:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --border: #e2e2e2;
  --accent: #2563eb;
  --code-bg: #f5f5f5;
  --nav-bg: #fafafa;
}

* {
  box-sizing: border-box;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Top navigation, present on every page */
.site-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
}
.site-nav .nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
}
.site-nav .brand {
  font-weight: 700;
  margin-right: 0.5rem;
  color: var(--fg);
}
.site-nav a {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}
.site-nav a:hover {
  color: var(--accent);
  text-decoration: none;
}
.site-nav a.active {
  color: var(--fg);
  font-weight: 600;
  border-bottom: 2px solid var(--accent);
}

main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}
h1 + p.lead {
  color: var(--muted);
  font-size: 1.1rem;
  margin-top: 0;
}
h2 {
  margin-top: 2.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
h3 {
  margin-top: 1.75rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}
pre code {
  background: none;
  padding: 0;
  font-size: 0.88rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
td code {
  white-space: nowrap;
}

.next-steps {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.example-list {
  list-style: none;
  padding: 0;
}
.example-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}
.example-list a {
  font-weight: 600;
  font-size: 1.05rem;
}
.example-list p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.note {
  background: #fff8e6;
  border: 1px solid #f0d999;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

/* Shared demo/example page chrome */
.demo-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
  margin: 1.5rem 0;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0.75rem 0;
}
.controls label {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.9rem;
}
button {
  font: inherit;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
}
input[type="file"] {
  font-size: 0.85rem;
}
#output img {
  max-width: 100%;
  border: 1px solid var(--border);
  /* No border-radius here deliberately — several pages (playground,
     circle-crop, basic-crop) show the export to prove its actual pixel
     shape (rectangle/circle/rounded-rectangle); a decorative CSS radius on
     the <img> itself would misrepresent a plain rectangle as rounded. */
}
