/* Robo Orders Pizza: one stylesheet, system fonts only (no third-party requests). */

:root {
  --bg: #fbf7f0;
  --surface: #ffffff;
  --surface-2: #f3ece0;
  --text: #2a2420;
  --muted: #6b6159;
  --border: #e6dccd;
  --accent: #c8452c;        /* tomato */
  --accent-ink: #ffffff;
  --accent-soft: #f7ddd5;
  --green: #3f7a4f;         /* basil */
  --green-soft: #dcebdf;
  --robo: #8fa3b8;
  --robo-dark: #5d7187;
  --screen: #24303d;
  --eye: #9be7ff;
  --box: #e7c48f;
  --box-lid: #d4a965;
  --radius: 14px;
  --wrap: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b1815;
    --surface: #24201c;
    --surface-2: #2d2823;
    --text: #f1ebe3;
    --muted: #b3a89c;
    --border: #3a332c;
    --accent: #ff7a5c;
    --accent-ink: #1b1815;
    --accent-soft: #4a2a22;
    --green: #7fc493;
    --green-soft: #22382a;
    --robo: #7d90a5;
    --robo-dark: #a9bbcd;
    --screen: #0f151c;
    --box: #c9a370;
    --box-lid: #a98450;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1b1815; --surface: #24201c; --surface-2: #2d2823; --text: #f1ebe3;
  --muted: #b3a89c; --border: #3a332c; --accent: #ff7a5c; --accent-ink: #1b1815;
  --accent-soft: #4a2a22; --green: #7fc493; --green-soft: #22382a; --robo: #7d90a5;
  --robo-dark: #a9bbcd; --screen: #0f151c; --box: #c9a370; --box-lid: #a98450;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; z-index: 10; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
nav { display: flex; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--text); }
.brand span { white-space: nowrap; }
@media (max-width: 480px) { nav { gap: 12px; } nav a { font-size: .85rem; } .brand { gap: 8px; } .brand span { font-size: .9rem; } }

/* Hero */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 40px; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { max-width: 220px; margin: 0 auto; order: -1; }
  .hero { padding-top: 32px; } }
.eyebrow { color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin-bottom: 12px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 999px; font-weight: 600; text-decoration: none; border: 2px solid var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { color: var(--accent); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.hero-art { margin: 0; }
.hero-art svg { width: 100%; height: auto; }

/* Illustration parts */
.shadow { fill: var(--border); }
.stroke { stroke: var(--robo-dark); stroke-width: 5; stroke-linecap: round; }
.body { fill: var(--robo); }
.limb { fill: var(--robo-dark); }
.screen { fill: var(--screen); }
.eye { fill: var(--eye); }
.smile { fill: none; stroke: var(--eye); stroke-width: 3; stroke-linecap: round; }
.accent { fill: var(--accent); }
.badge { fill: var(--surface); stroke: var(--green); stroke-width: 2; }
.badge-line { stroke: var(--green); stroke-width: 2; stroke-linecap: round; }
.box { fill: var(--box); }
.box-lid { fill: var(--box-lid); }
.topping { fill: var(--box); }

/* Sections */
section { padding: 40px 0; }
.section-title { margin-bottom: 20px; }

.idea-grid, .card-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .idea-grid, .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .idea-grid, .card-grid { grid-template-columns: 1fr; } }
.idea-grid li, .card-grid li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.idea-grid strong { display: block; font-size: 1.1rem; margin: 8px 0 4px; }
.idea-grid p, .card-grid p { color: var(--muted); margin: 0; font-size: .95rem; }
.idea-tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); background: var(--green-soft); padding: 3px 10px; border-radius: 999px; }

.story p { font-size: 1.08rem; }

.chapter-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.chapter { display: grid; grid-template-columns: 52px 1fr auto; gap: 18px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chapter h3 { margin-bottom: 2px; }
.chapter p { margin: 0 0 4px; color: var(--muted); font-size: .97rem; }
.chapter .service { color: var(--accent); font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.chapter .see { color: var(--green); font-size: .88rem; margin-top: 6px; }
.num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.status { font-size: .78rem; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
@media (max-width: 600px) {
  .chapter { grid-template-columns: 40px 1fr; }
  .num { width: 36px; height: 36px; font-size: 1rem; }
  .status { grid-column: 2; justify-self: start; }
}

.card-grid h3 { color: var(--text); }

.about { padding-bottom: 64px; }
.about p { color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; color: var(--muted); font-size: .9rem; }
.site-footer p { margin: 0; }

/* Chapter layers: plain line for everyone, "under the hood" for builders. */
.chapter .plain { color: var(--text); font-size: 1rem; margin-bottom: 8px; }
.chapter .under { font-size: .93rem; line-height: 1.55; border-left: 3px solid var(--green-soft); padding-left: 12px; margin: 8px 0; }
.under-label { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--green); margin-bottom: 2px; }
.chapter code { font: .86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
.chapter .src { font-size: .8rem; }
.chapter .src a { color: var(--muted); }
.chapter .src a:hover { color: var(--accent); }

/* ---------- Chapter pages ---------- */
.chapter-hero { padding: 56px 0 24px; }
.chapter-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.toc a { font-size: .88rem; text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px; }
.toc a:hover { border-color: var(--accent); color: var(--accent); }

.block { padding: 40px 0; }
.block.alt { background: var(--surface-2); }
.block h2 { margin-bottom: 16px; }
.block h3 { margin-top: 8px; }

.level { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.level p:last-child, .level ol:last-child { margin-bottom: 0; }
.level-tag { display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.steps { padding-left: 1.2em; margin: 0; }
.steps li { margin-bottom: 8px; }

code { font: .86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; white-space: nowrap; }
.block.alt code { background: var(--surface); }

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; min-width: 9em; }

.example { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 18px 20px; }
.example ul { padding-left: 1.2em; margin: 0 0 10px; }
.example li { margin-bottom: 6px; }
.note { color: var(--muted); font-size: .92rem; margin: 0; }

.replay-title { font-size: 1rem; margin: 22px 0 8px; }
.replay { background: #1f1b18; color: #f1ebe3; border-radius: 12px; padding: 14px 16px; overflow-x: auto; font: .82rem/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }
.replay code, .block.alt .replay code { background: none; padding: 0; font: inherit; color: inherit; overflow-wrap: normal; white-space: pre; }
.replay .prompt { color: #7fc493; user-select: none; }
.replay .comment { color: #b3a89c; }
.caption { color: var(--muted); font-size: .88rem; margin-top: 8px; }
.checks { padding-left: 1.2em; }
.checks li { margin-bottom: 6px; }

.sources-title { font-size: 1.1rem; }
.sources { padding-left: 1.2em; font-size: .9rem; color: var(--muted); }
.sources li { margin-bottom: 4px; }
.sources a { color: var(--muted); }

.chapter-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 8px; padding-bottom: 48px; font-size: .95rem; }
.muted { color: var(--muted); }

/* Chapter list: a chapter that is live */
.chapter h3 a { color: inherit; text-decoration: none; }
.chapter h3 a:hover { color: var(--accent); }
.status.live { background: var(--green-soft); color: var(--green); font-weight: 600; text-decoration: none; }
.card-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .card-grid.three { grid-template-columns: 1fr; } }
.chapter .aws-name { font-size: .82rem; color: var(--muted); margin-top: 6px; }
