/* Maestro's project page: the app's own colours and type, nothing loaded from elsewhere. */
:root {
  color-scheme: light;
  --bg: #faf9f7;
  --panel: #ffffff;
  --subtle: #f2f1ed;
  --line: #e4e2dc;
  --line-soft: #ecebe6;
  --text: #1f1e1c;
  --soft: #3a3936;
  --muted: #6b6a66;
  --faint: #8f8e89;
  --accent: #c6613f;
  --accent-bg: #fbefe9;
  --accent-line: #e9b9a5;
  --green: #2f7a4f;
  --green-bg: #eaf5ee;
  --amber: #9a6214;
  --amber-bg: #fbf3e6;
  --red: #b3412f;
  --red-bg: #fbecea;
  --blue: #2f5f9e;
  --blue-bg: #eaf1fb;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Ubuntu Mono', Menlo, monospace;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #181818;
    --panel: #202020;
    --subtle: #262626;
    --line: #333333;
    --line-soft: #2a2a2a;
    --text: #ececec;
    --soft: #d4d4d2;
    --muted: #a3a3a0;
    --faint: #7d7d7a;
    --accent: #d97757;
    --accent-bg: #2a1f1a;
    --accent-line: #6a4535;
    --green: #8fcca8;
    --green-bg: #18261e;
    --amber: #e0a43a;
    --amber-bg: #2a2016;
    --red: #f0a3a0;
    --red-bg: #2c1a19;
    --blue: #9cbcf0;
    --blue-bg: #18202c;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--subtle); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }

/* The bar on top: the mark, the sections, the code. */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.bar-in { max-width: 1120px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; }
.mark { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font: 700 12.5px var(--mono); }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; white-space: nowrap; }
.nav a:hover { background: var(--subtle); color: var(--text); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
section { padding: 84px 0 0; }
.eyebrow { font: 600 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
h2 { font-size: clamp(28px, 4vw, 38px); max-width: 760px; }
.lead { margin-top: 14px; max-width: 720px; font-size: 18px; color: var(--muted); }
h3 { font-size: 19px; }

/* Hero */
.hero { padding: 88px 0 24px; }
.hero h1 { font-size: clamp(38px, 6.4vw, 66px); max-width: 900px; letter-spacing: -.035em; }
.hero h1 span { color: var(--muted); }
.hero .lead { font-size: 20px; max-width: 760px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.fact { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--soft); font-size: 14px; }
.fact b { color: var(--green); font-weight: 600; }
.agents { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; color: var(--muted); font-size: 14px; align-items: center; }
.agent { padding: 5px 11px; border-radius: 8px; background: var(--subtle); color: var(--soft); font-size: 13.5px; }

/* Diagrams: boxes and the lines between them, drawn with HTML so they read at any width. */
.diagram { margin-top: 34px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.flow { display: grid; grid-template-columns: 1fr auto 1.4fr auto 1fr; align-items: center; gap: 14px; }
.node { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.node h4 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.node p, .node li { font-size: 14px; color: var(--muted); }
.node ul { margin: 6px 0 0; padding-left: 18px; }
.node.is-core { border-color: var(--accent-line); background: var(--accent-bg); }
.node.is-core h4 { color: var(--accent); }
.arrow { color: var(--faint); font: 600 13px var(--mono); text-align: center; white-space: nowrap; }
.arrow::after { content: '⟶'; display: block; font-size: 22px; line-height: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--faint); }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--red); }
.dot.accent { background: var(--accent); }
.dot.blue { background: var(--blue); }
.caption { margin-top: 16px; font-size: 14px; color: var(--faint); }

/* The three doors */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.door { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); display: grid; gap: 10px; align-content: start; }
.door .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 15px var(--mono); }
.door:nth-child(1) .num { background: var(--blue-bg); color: var(--blue); }
.door:nth-child(2) .num { background: var(--amber-bg); color: var(--amber); }
.door:nth-child(3) .num { background: var(--green-bg); color: var(--green); }
.door p { color: var(--muted); font-size: 15px; }
.door a { font-size: 14.5px; font-weight: 600; text-decoration: none; }

/* Rings beside the three doors: the layers around the computer */
.safety { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 28px; align-items: center; margin-top: 34px; }
.safety .doors { grid-template-columns: 1fr; margin-top: 0; gap: 12px; }
.safety .door { padding: 20px 22px; grid-template-columns: 34px 1fr; column-gap: 14px; }
.safety .door > :not(.num) { grid-column: 2; }
.safety .door .num { grid-row: 1 / span 3; }
.rings { position: relative; width: 100%; aspect-ratio: 1; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px dashed var(--line); display: flex; justify-content: center; }
.ring span { margin-top: 10px; font: 600 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--bg); height: fit-content; }
.ring.r1 { border-color: var(--blue); }
.ring.r1 span { color: var(--blue); }
.ring.r2 { inset: 13%; border-color: var(--amber); }
.ring.r2 span { color: var(--amber); }
.ring.r3 { inset: 26%; border-color: var(--green); }
.ring.r3 span { color: var(--green); }
.ring.core { inset: 39%; border: 0; background: var(--accent-bg); align-items: center; text-align: center; }
.ring.core b { display: block; color: var(--accent); font-size: 15px; }
.ring.core small { color: var(--muted); font-size: 12px; }

/* The map: four zones, left to right */
.map { margin-top: 34px; display: grid; grid-template-columns: 1fr 40px 1.1fr 40px 1.9fr 40px 1.2fr; align-items: stretch; }
.zone { display: grid; gap: 10px; align-content: start; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.zone.is-home { border-color: var(--accent-line); }
.zone-title { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.zone-title small { text-transform: none; letter-spacing: 0; font-weight: 400; }
.zone.is-home .zone-title { color: var(--accent); }
.pieces { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.piece { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 13.5px; }
.piece b { font-weight: 600; }
.piece span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.piece.is-off { border-style: dashed; }
.piece.is-core { background: var(--accent-bg); border-color: var(--accent-line); }
.piece.is-core b { color: var(--accent); }
.link { display: grid; place-items: center; position: relative; }
.link::before { content: ''; position: absolute; left: 4px; right: 4px; top: 50%; border-top: 1.5px dashed var(--faint); }
.link span { position: relative; writing-mode: vertical-rl; transform: rotate(180deg); font: 11px var(--mono); color: var(--faint); background: var(--bg); padding: 6px 0; }

/* Cards and lists */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 30px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); display: grid; gap: 10px; align-content: start; }
.card p, .card li { color: var(--muted); font-size: 15px; }
.card ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.card .tag { justify-self: start; font: 600 11.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: var(--amber); }
.tag.red { background: var(--red-bg); color: var(--red); }
.tag.blue { background: var(--blue-bg); color: var(--blue); }
.tag.accent { background: var(--accent-bg); color: var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--soft); }

/* Tabs (the three ways to reach it) */
.tabs { margin-top: 30px; }
.tablist { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--subtle); }
.tablist button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 14.5px; padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.tablist button[aria-selected="true"] { background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tabpanel { margin-top: 16px; }
.tabpanel[hidden] { display: none; }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.hop { padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 14px; color: var(--soft); }
.hop.is-you { border-color: var(--blue); }
.hop.is-core { border-color: var(--accent-line); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.hop-arrow { color: var(--faint); font: 13px var(--mono); }
.hop-arrow::before { content: '⟶ '; }

/* The journey (a credential, step by step) */
.journey { margin-top: 30px; display: grid; grid-template-columns: 280px 1fr; gap: 22px; }
.steps { display: grid; gap: 6px; align-content: start; }
.steps button { display: flex; gap: 12px; align-items: flex-start; text-align: left; border: 1px solid transparent; border-radius: 12px; background: none; color: var(--muted); font: inherit; font-size: 14.5px; padding: 10px 12px; cursor: pointer; }
.steps button b { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--subtle); font: 700 12px var(--mono); color: var(--muted); }
.steps button[aria-selected="true"] { border-color: var(--line); background: var(--panel); color: var(--text); }
.steps button[aria-selected="true"] b { background: var(--accent); color: #fff; }
.stage { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); padding: 24px; min-height: 380px; display: grid; gap: 16px; align-content: start; }
.stage[hidden] { display: none; }
.stage h3 { font-size: 20px; }
.stage > p { color: var(--muted); }
.stage-nav { display: flex; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Mock pieces of the app, drawn small */
.mock { border: 1px solid var(--line); border-radius: 16px; background: var(--bg); padding: 16px; display: grid; gap: 10px; font-size: 14px; }
.bubble { padding: 10px 14px; border-radius: 14px; background: var(--subtle); color: var(--soft); max-width: 92%; }
.bubble.agent { justify-self: start; }
.bubble.you { justify-self: end; background: var(--accent-bg); color: var(--text); }
.tool { font: 13px var(--mono); color: var(--muted); padding: 8px 12px; border-radius: 10px; border: 1px dashed var(--line); }
.cardmock { border: 1px solid var(--accent-line); border-radius: 14px; background: var(--panel); padding: 14px; display: grid; gap: 8px; }
.cardmock .t { font-weight: 600; }
.cardmock .s { color: var(--muted); font-size: 13.5px; }
.cardmock .row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--soft); background: var(--bg); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.secret { font-family: var(--mono); letter-spacing: .2em; color: var(--faint); }

/* Checklist */
.checklist { margin-top: 30px; display: grid; gap: 10px; counter-reset: step; }
.check { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.check::before { counter-increment: step; content: counter(step); width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font: 700 15px var(--mono); }
.check h3 { font-size: 17px; }
.check p { margin-top: 4px; color: var(--muted); font-size: 15px; }
.where { margin-top: 8px; font: 12.5px var(--mono); color: var(--faint); }

/* Limits and rules */
.limits { margin-top: 30px; display: grid; gap: 10px; }
.limit { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.limit .ic { color: var(--amber); font-weight: 700; }
.limit p { color: var(--muted); font-size: 15px; }
.limit b { color: var(--text); font-weight: 600; }
.rules { margin-top: 30px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.rule { padding: 18px 20px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 var(--radius) var(--radius) 0; }
.rule b { display: block; margin-bottom: 4px; }
.rule p { color: var(--muted); font-size: 15px; }

table { width: 100%; border-collapse: collapse; margin-top: 26px; font-size: 14.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--faint); font-weight: 500; font-size: 13px; }
td { color: var(--soft); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-top: 26px; }
.table-wrap table { margin: 0; }

footer { margin-top: 110px; padding: 34px 0 60px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }

@media (max-width: 1000px) {
  .map { grid-template-columns: 1fr; gap: 0; }
  .link { height: 44px; }
  .link::before { left: 50%; right: auto; top: 4px; bottom: 4px; border-top: 0; border-left: 1.5px dashed var(--faint); }
  .link span { writing-mode: horizontal-tb; transform: none; padding: 0 8px; }
}
@media (max-width: 900px) {
  .safety { grid-template-columns: 1fr; }
  .rings { max-width: 340px; margin: 0 auto; }
  .flow { grid-template-columns: 1fr; }
  .arrow::after { content: '↓'; }
  .doors, .grid3 { grid-template-columns: 1fr; }
  .grid2, .rules { grid-template-columns: 1fr; }
  .journey { grid-template-columns: 1fr; }
  .steps { grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 640px) {
  .nav { display: none; }
  section { padding-top: 64px; }
  .hero { padding-top: 56px; }
  .diagram, .door, .stage { padding: 18px; }
  .pieces { grid-template-columns: 1fr; }
  .ring span { font-size: 10px; }
}
