/* Main Street Guide page styles. The same design system as Agent Customs (site/styles.css):
   three colors in a 60-30-10 split, Geist with one Instrument Serif
   italic word per heading, glass only where something sits behind it, ease-out motion under
   300 ms, feedback on press, and hover effects on fine pointers only. The navy palette marks
   it as a different site. No third-party code. */

@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Variable.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/InstrumentSerif-Italic.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---- Palette (60-30-10): navy ground, paper, coral ------------------------------------ */
:root { --c1: #0a1430; --c2: #eef0f2; --c3: #ff6f59; --on-c3: #0a1430; --c3-ink: #bf3a26; }

:root {
  color-scheme: dark;
  --ok: #8fd1a6;
  --caution: #e9c46a;
  --warn: #f0a35e;
  --bad: #f2665a;
  --info: color-mix(in oklab, var(--c2) 62%, var(--c1));
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-enter: cubic-bezier(0.22, 1, 0.36, 1);
  --gut: 80px;
  --padt: 120px;
  --padb: 72px;
  --tint: var(--c2);
  --ink: var(--c2);
  --ink-2: color-mix(in oklab, var(--c2) 84%, var(--c1));
  --muted: color-mix(in oklab, var(--c2) 68%, var(--c1));
  --faint: color-mix(in oklab, var(--c2) 56%, var(--c1));
  --line: color-mix(in oklab, var(--c2) 10%, transparent);
  --line-2: color-mix(in oklab, var(--c2) 18%, transparent);
  --well: color-mix(in oklab, var(--c1) 70%, #000);
  --surface: color-mix(in oklab, var(--c2) 4%, var(--c1));
  --accent: var(--c3);
  color: var(--ink);
}

/* ---- Base ------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { background: var(--c1); scrollbar-color: color-mix(in oklab, var(--c2) 24%, transparent) transparent; }
body { margin: 0; color: var(--ink); background: var(--c1); font: 400 16px/1.625 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
h1, h2, h3 { margin: 0; color: var(--ink); font-weight: 500; text-wrap: balance; }
h1 em, h2 em, .close-line em { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; color: var(--accent); }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); }
code, pre { font-family: var(--mono); }
code { font-size: .9em; overflow-wrap: anywhere; }
::selection { background: var(--c3); color: var(--on-c3); }
input, textarea { caret-color: var(--c3); }
:focus-visible { outline: 2px solid var(--c3); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 12px; z-index: 50; background: var(--c2); color: var(--c1); padding: 10px 14px; border-radius: 10px; }
.skip:focus { left: 16px; }
.grain { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
svg use { pointer-events: none; }

/* ---- Layout: one wrap, one section per screen ------------------------------------------ */
.wrap { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; position: relative; z-index: 1; }
main > section, footer.closing { position: relative; isolation: isolate; min-height: 100svh; padding: var(--padt) 0 var(--padb); }
/* The assistant is a tool, not a screen: its section is as tall as the window in it. */
#assistant { min-height: 0; }
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head h2, .change h2 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -.03em; }
.section-sub { margin-top: 18px; max-width: 52ch; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; color: var(--muted); }
.section-sub code { color: var(--ink-2); }

/* ---- Glass: the menu bar and the street card --------------------------------------------- */
.glass { position: relative; isolation: isolate;
  background: linear-gradient(180deg, color-mix(in oklab, var(--tint) 9%, transparent), color-mix(in oklab, var(--tint) 3%, transparent));
  -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--c2) 10%, transparent) inset, 0 24px 60px -24px rgba(0, 0, 0, .7); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; z-index: 2;
  background: linear-gradient(150deg, color-mix(in oklab, var(--tint) 42%, transparent), color-mix(in oklab, var(--tint) 6%, transparent) 30%, color-mix(in oklab, var(--tint) 3%, transparent) 65%, color-mix(in oklab, var(--tint) 18%, transparent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }

/* ---- Controls ---------------------------------------------------------------------------- */
button, .button { font: 500 15px/1 var(--sans); letter-spacing: -.005em; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink); background: transparent;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
button:disabled { opacity: .45; cursor: not-allowed; }
button svg, .button svg, .text-link svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 150ms var(--ease-out); }
.primary { color: var(--on-c3); background: var(--c3); }
.ghost { border-color: var(--line-2); }
.small { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.98); }
@media (hover: hover) and (pointer: fine) {
  .primary:hover:not(:disabled) { background: color-mix(in oklab, var(--c3) 86%, var(--c2)); transform: translateY(-1px); }
  .ghost:hover:not(:disabled) { background: color-mix(in oklab, var(--tint) 7%, transparent); border-color: color-mix(in oklab, var(--tint) 32%, transparent); transform: translateY(-1px); }
  .button:hover svg, button:hover svg, .text-link:hover svg { transform: translateX(3px); }
}
.text-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 500; text-decoration: none; }
.draw { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; padding-bottom: 4px; transition: background-size 150ms var(--ease-out), color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .draw:hover { background-size: 100% 1px; color: var(--ink); } }
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 0 0 8px; }

/* ---- Navigation -------------------------------------------------------------------------- */
.topbar { position: fixed; z-index: 30; top: 14px; left: 0; right: 0; pointer-events: none; }
.nav { pointer-events: auto; width: min(100% - 2 * var(--gut) + 24px, 1304px); margin-inline: auto; display: flex; align-items: center; gap: 14px; padding: 7px 7px 7px 18px; border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in oklab, var(--c1) 80%, transparent), color-mix(in oklab, var(--c1) 66%, transparent)); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: -.01em; flex: none; }
.brand-mark { width: 24px; height: 24px; fill: none; stroke: var(--c3); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.practice-tag { flex: none; font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; color: var(--c3); border: 1px solid color-mix(in oklab, var(--c3) 50%, transparent); background: color-mix(in oklab, var(--c3) 8%, transparent); }
.nav-links { display: flex; gap: 24px; margin-left: auto; margin-right: 8px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; padding: 4px 0; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 150ms var(--ease-out), color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background-size: 100% 1px; } }
.nav-cta { border-radius: 999px; }

/* ---- Screen 1: the street ----------------------------------------------------------------- */
.hero { display: flex; align-items: flex-start; padding-bottom: 64px; }
.hero-ground { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(50% 60% at 82% 42%, color-mix(in oklab, var(--c3) 24%, transparent), transparent 70%),
    radial-gradient(40% 50% at 12% 4%, color-mix(in oklab, var(--c2) 8%, transparent), transparent 70%),
    var(--c1); }
.hero-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 24px; align-items: start; min-height: calc(100svh - var(--padt) - 64px); }
.hero-text { grid-column: 1 / span 5; display: grid; gap: 26px; }
.practice-note { display: inline-flex; align-items: center; gap: 10px; justify-self: start; font-size: 14px; color: var(--ink-2); padding: 8px 14px 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: color-mix(in oklab, var(--c2) 4%, transparent); }
.practice-note svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--c3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero h1 { font-size: clamp(38px, 5vw, 72px); line-height: 1.02; letter-spacing: -.035em; color: var(--c2); }
.lead { font-size: clamp(18px, 1.4vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-facts { grid-column: 1 / -1; grid-row: 2; align-self: end; list-style: none; margin: 48px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: 14px; color: var(--muted); }
.hero-facts li { display: flex; gap: 10px; align-items: center; }
.hero-facts svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--c3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The street card: three shops, each with the stamp the guard gives it. */
.street { grid-column: 7 / span 6; min-width: 0; }
.street-card { overflow: hidden; border-radius: 22px; }
.street-bar { display: flex; align-items: center; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); position: relative; z-index: 3; }
.street-bar h2 { font-size: 15px; font-weight: 500; letter-spacing: -.01em; }
.street-note { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.bar-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shops { list-style: none; margin: 0; padding: 0; position: relative; z-index: 3; }
.shop { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 18px; align-items: start; padding: 18px; border-bottom: 1px solid var(--line); }
.shop h3 { font-size: 19px; letter-spacing: -.02em; }
.sells { margin-top: 2px; font-size: 14.5px; color: var(--ink-2); }
.outcome { margin-top: 8px; font-size: 14px; color: var(--muted); max-width: 46ch; }
.shop-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 8px; font-size: 14px; }
.shop-actions .draw { color: var(--ink-2); }
.street-foot { padding: 12px 18px 14px; font-size: 12.5px; color: var(--muted); position: relative; z-index: 3; }
.stamp-mini { --tone: var(--ok); align-self: center; justify-self: end; max-width: 122px; padding: 8px 10px; text-align: center; color: var(--tone); border: 3px double var(--tone); border-radius: 9px;
  font: 700 11.5px/1.15 var(--mono); letter-spacing: .1em; text-transform: uppercase; rotate: -6deg; background: color-mix(in oklab, var(--tone) 7%, transparent); }
.tone-ok { --tone: var(--ok); } .tone-warn { --tone: var(--warn); } .tone-bad { --tone: var(--bad); }

/* Hero entrance, once: words rise from masks, then the lead, then the card settles. */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .1em 0; margin: 0 -.06em -.1em 0; }
.w > span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .rise .w > span { animation: rise-word 700ms var(--ease-enter) both; }
  .rise .w:nth-of-type(2) > span { animation-delay: 30ms; } .rise .w:nth-of-type(3) > span { animation-delay: 60ms; }
  .rise .w:nth-of-type(4) > span { animation-delay: 90ms; }
  .rise em .w:nth-of-type(1) > span { animation-delay: 140ms; } .rise em .w:nth-of-type(2) > span { animation-delay: 180ms; }
  .fade-up { animation: fade-up 520ms var(--ease-enter) both; animation-delay: var(--d, 0ms); }
  .settle { animation: settle 900ms var(--ease-enter) both; animation-delay: 120ms; }
}
@keyframes rise-word { from { transform: translateY(105%); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes settle { from { transform: scale(.98); } }

/* ---- Screen 2: what this site added ------------------------------------------------------- */
.change { display: flex; align-items: center; }
.change-wrap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: center; }
.change-text { grid-column: 1 / span 5; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 16px; color: var(--ink-2); }
.steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 14px; align-items: baseline; }
.steps strong { color: var(--ink); font-weight: 500; }
.step-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12.5px; font-weight: 600; background: var(--c3); color: var(--on-c3); translate: 0 -1px; }
.change-after { margin: 22px 0 6px; color: var(--muted); font-size: 15px; max-width: 46ch; }
.code-stack { grid-column: 7 / span 6; display: grid; gap: 14px; min-width: 0; }
.code-card { overflow: hidden; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.code-head { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 8px 10px 8px 18px; font: 400 12.5px/1 var(--mono); color: var(--muted); border-bottom: 1px solid var(--line); }
.code-card pre { margin: 0; padding: 22px 24px; overflow-x: auto; font-size: 14px; line-height: 1.85; color: var(--ink-2); }
.code-card .k { color: var(--c3); } .code-card .s { color: var(--c2); } .code-card .f { color: var(--c2); font-weight: 500; }
.tree .dir { color: var(--c2); font-weight: 500; }
.tree .hl { color: var(--c3); }
.tree .note { color: var(--muted); font-family: var(--sans); font-size: 13px; }
/* The two added lines: a plus in the margin and a green wash, as in a code review. */
.diff .add, .diff .ctx { display: block; margin: 0 -24px; padding: 0 24px 0 44px; position: relative; }
.diff .add { background: color-mix(in oklab, var(--ok) 11%, transparent); color: var(--ink); }
.diff .add::before { content: "+"; position: absolute; left: 22px; color: var(--ok); font-weight: 600; }
.diff .ctx { color: var(--muted); }
.diff .ctx .k, .diff .ctx .s, .diff .ctx .f { color: inherit; font-weight: 400; }

/* ---- Screen 3: the assistant --------------------------------------------------------------- */
.assistant-window { padding: 18px 18px 20px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .8); }
.try-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 0 4px; }
.try-label { font-size: 13px; color: var(--muted); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 34px; font-size: 13px; padding: 0 12px; border-radius: 999px; border-color: var(--line-2); color: var(--ink-2); gap: 8px; }
@media (hover: hover) and (pointer: fine) { .chips button:hover { color: var(--ink); border-color: color-mix(in oklab, var(--c2) 40%, transparent); } }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--info)); flex: none; display: inline-block; }
.assistant-note { margin: 14px 4px 0; font-size: 14px; color: var(--muted); }
#assistant-status { display: inline-block; font-size: 13.5px; color: var(--ink-2); padding: 10px 14px; border-radius: 12px; border: 1px solid color-mix(in oklab, var(--c3) 45%, transparent); background: color-mix(in oklab, var(--c3) 8%, transparent); margin: 12px 4px 0; }
#agent-app { padding: 0 4px; }
.key-steps { list-style: none; margin: 16px 4px 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.key-steps li { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.key-steps strong { color: var(--ink); font-weight: 500; }

/* ---- The close and the footer ---------------------------------------------------------------- */
footer.closing { display: flex; align-items: stretch; padding-bottom: 32px; min-height: 80svh; }
footer.closing > .wrap { display: grid; grid-template-rows: 1fr auto; gap: 64px; }
.close { align-self: center; display: grid; gap: 24px; justify-items: start; max-width: 900px; }
.close-line { font-size: clamp(40px, 6vw, 88px); font-weight: 500; line-height: 1; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.close-fact { color: var(--muted); font-size: clamp(17px, 1.4vw, 20px); max-width: 46ch; }
.footer-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px 24px; align-items: center; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.footer-links a { color: var(--ink-2); }
.maker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; font-size: 14px; color: var(--muted); }
.maker strong { font-weight: 500; color: var(--ink); }
.legal { font-size: 13px; color: var(--muted); max-width: 90ch; }

/* ---- Reduced motion: nothing travels ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  button:active:not(:disabled), .button:active { transform: none; filter: brightness(.92); }
}

/* ---- Tablet and phone ------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  :root { --gut: 48px; }
  .hero-text, .street, .change-text, .code-stack { grid-column: 1 / -1; }
  .hero-text { margin-bottom: 40px; }
  .hero-facts { display: none; }
  .hero-wrap { min-height: 0; }
  .street { max-width: 640px; }
  .change-text { margin-bottom: 40px; }
  .key-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) { .nav-links { display: none; } .nav { justify-content: space-between; } }
@media (max-width: 640px) {
  :root { --gut: 16px; --padt: 96px; --padb: 48px; }
  .topbar { top: 10px; }
  .nav { padding-left: 14px; gap: 8px; }
  .practice-tag { display: none; }
  .shop { grid-template-columns: minmax(0, 1fr); }
  .stamp-mini { justify-self: start; rotate: -3deg; }
  .assistant-window { padding: 12px 8px 14px; border-radius: 22px; }
  .code-card pre { padding: 18px 16px; font-size: 13px; }
  .diff .add, .diff .ctx { margin: 0 -16px; padding: 0 16px 0 34px; }
  .diff .add::before { left: 16px; }
}
