/* Hark Road Trip — one stylesheet. Cream ground, asphalt ink, highway green, and the seasons. */
:root {
  --ground: #fbf6ee;
  --card: #ffffff;
  --ink: #1f2a2e;
  --ink-2: #4f5a5e;
  --ink-3: #6b5a44;
  --line: #e3d8c6;
  --track: #e7dfd1;
  --green: #1d6b4f;
  --green-dark: #134a36;
  --green-soft: #dcefe4;
  --green-text: #165a41;
  --sign-sub: #d4ece0;
  --dash: #8fb3a0;
  --asphalt: #353a40;
  --stripe: #f2c14e;
  --fall: #f6e2c6;
  --fall-ink: #6b4a2b;
  --nov: #f2d9cf;
  --nov-ink: #7a2f27;
  --cranberry: #a8322d;
  --dec: #dce8f1;
  --dec-ink: #2f4f6b;
  --car: #d9692b;
  --warn-soft: #f6e4c4;
  --warn: #8a5200;
  --gold: #b8892b;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --sans: 'Overpass', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.5 var(--sans); overflow-x: hidden; }
a { color: var(--green); }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; margin: 0; letter-spacing: -0.02em; }
.page { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 22px; }
.shield { width: 30px; height: 32px; }
.shield path { fill: var(--green); stroke: #fff; stroke-width: 1.5; }
.shield text { font: 800 13px var(--sans); fill: #fff; }
nav { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 600; }
nav a { color: var(--ink-2); text-decoration: none; }
nav a:hover { color: var(--ink); }
.nav-button { background: var(--ink); color: var(--ground); border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; font-size: 14px; font-weight: 700; }

/* Hero */
.hero { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; padding: 40px 0 16px; }
.hero-copy { flex: 1 1 460px; min-width: 0; }
.eyebrow { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--fall-ink); }
h1 { margin-top: 12px; font-size: clamp(50px, 8vw, 88px); line-height: .95; letter-spacing: -0.025em; }
.lede { margin: 18px 0 0; color: var(--ink-2); font-size: 19px; }
.users-chip { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; background: var(--ink); color: var(--ground); text-decoration: none; border-radius: 999px; padding: 10px 16px; font-size: 15px; }
.users-chip strong { font-family: var(--display); font-size: 17px; }
.users-chip .up { color: #9fd9b8; font-weight: 700; }
.users-chip .muted { color: #c9c1b3; }
.users-chip[hidden] { display: none; }

.trip-card { flex: 1 1 420px; min-width: 0; background: var(--card); border: 2px solid var(--ink); border-radius: 20px; padding: 26px 26px 20px; box-shadow: 0 8px 0 var(--ink); }
.trip-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.big { display: flex; align-items: baseline; gap: 10px; }
.big strong { font-family: var(--display); font-weight: 800; font-size: 96px; line-height: .85; color: var(--green); }
.big span { font-weight: 700; color: var(--ink-2); font-size: 18px; line-height: 1.3; }
.pill { font-size: 14px; font-weight: 800; background: var(--track); color: var(--ink-2); border-radius: 999px; padding: 6px 14px; }
.pill.on-pace, .pill.ahead, .pill.kept { background: var(--green-soft); color: var(--green-text); }
.pill.behind, .pill.short { background: var(--warn-soft); color: var(--warn); }
.segments { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 5px; margin-top: 22px; }
.segments i { height: 14px; border-radius: 3px; background: var(--track); }
.segments i.on { background: var(--green); animation: fill .4s ease both; animation-delay: calc(var(--i) * 80ms + 200ms); }
@keyframes fill { from { transform: scaleY(.3); opacity: 0 } to { transform: none; opacity: 1 } }
.trip-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.verdict { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

/* Sections */
section + section { margin-top: 56px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(30px, 4vw, 40px); }
.section-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 560px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; }
.lg-reached { width: 14px; height: 14px; border-radius: 3px; background: var(--green); }
.lg-sign { width: 14px; height: 14px; border-radius: 3px; border: 2px solid var(--green); background: #fffaf2; }
.lg-dot { width: 14px; height: 14px; border-radius: 50%; border: 3px solid var(--green); background: #fff; }
.show-sm { display: none; }

/* Route map */
.route-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 18px; }
.route { border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; min-width: 0; }
.route svg { display: block; width: 100%; height: auto; }
.z-fall { fill: var(--fall); } .z-nov { fill: var(--nov); } .z-dec { fill: var(--dec); }
.zone { font: 800 15px var(--sans); letter-spacing: 2px; }
.zone.fall, .end-label.fall { fill: var(--fall-ink); } .zone.nov { fill: var(--nov-ink); } .zone.dec, .end-label.dec { fill: var(--dec-ink); }
.leaves ellipse { fill: var(--car); } .leaves .l2 { fill: #c2452d; } .leaves .l3 { fill: #e0a33a; }
.snow circle { fill: #fff; }
.lights polyline { fill: none; stroke: var(--dec-ink); stroke-width: 1.5; }
.lights .b1 { fill: var(--cranberry); } .lights .b2 { fill: var(--green); } .lights .b3 { fill: var(--stripe); }
.lights circle { animation: twinkle 2.4s ease-in-out infinite; }
.lights .b2 { animation-delay: .8s; } .lights .b3 { animation-delay: 1.6s; }
@keyframes twinkle { 50% { opacity: .35 } }
.tg-sign line { stroke: var(--fall-ink); stroke-width: 3; }
.tg-sign rect { fill: var(--cranberry); }
.tg-sign text { font: 800 12px var(--sans); letter-spacing: 1px; fill: #fff; text-anchor: middle; }
.road { fill: none; stroke: var(--asphalt); stroke-width: 34; stroke-linecap: round; stroke-linejoin: round; }
.road-line { fill: none; stroke: var(--stripe); stroke-width: 3; stroke-dasharray: 14 12; }
.pace-sign line { stroke: var(--ink-3); stroke-width: 2.5; }
.pace-sign rect { fill: #fffaf2; stroke: var(--green); stroke-width: 2; }
.pace-sign text { font: 800 14px var(--sans); fill: var(--green); text-anchor: middle; }
.pace-sign.reached rect { fill: var(--green); }
.pace-sign.reached text { fill: #fff; }
.ship-dot { fill: #fff; stroke: var(--green); stroke-width: 4; }
.car { transform: translate(var(--x), var(--y)); animation: drive 1.6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes drive { from { transform: translate(40px, 140px); } }
.car .body, .car .cabin { fill: var(--car); }
.car .window { fill: var(--dec); }
.car .wheel { fill: var(--ink); }
.car-label { font: 800 13px var(--sans); fill: var(--ink); text-anchor: middle; }
.end-label { font: 700 11px var(--sans); text-anchor: middle; }

/* Exits */
.outline-button { background: none; border: 2px solid var(--ink); border-radius: 999px; padding: 8px 16px; min-height: 44px; font-size: 14px; font-weight: 700; }
.outline-button:disabled { opacity: .5; }
.exits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.exit { display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: 12px; font-size: 14px; }
.exit-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.exit.shipped { background: var(--green); color: #fff; border: 0; padding: 4px; transition: transform .15s; }
.exit.shipped:hover { transform: translateY(-2px); }
.exit-inner { display: flex; flex-direction: column; gap: 4px; height: 100%; border: 2px solid #fff; border-radius: 9px; padding: 14px 16px; }
.exit.shipped .exit-tag { background: #fff; color: var(--green); border-radius: 4px; padding: 2px 8px; }
.exit-title { font-size: 21px; font-weight: 800; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
.exit-summary { color: var(--sign-sub); }
.exit.bonus { background: var(--gold); }
.exit.bonus .exit-tag { color: var(--gold); }
.exit.late { background: var(--ink-2); }
.exit.late .exit-tag { color: var(--ink-2); }
.exit.next { border: 2px dashed var(--dash); background: #fffaf2; padding: 16px 18px; }
.exit.next .exit-meta { color: var(--green); }
.exit.next .exit-tag { border: 2px solid var(--green); border-radius: 4px; padding: 0 7px; }
.exit.next .exit-title { font-size: 18px; font-weight: 700; }
.exit.later { border: 2px dashed #d8ccb8; padding: 16px 18px; color: var(--ink-3); }
.exit-due { font-weight: 600; }
.more { display: none; margin: 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--ink-3); padding: 6px 0; grid-column: 1 / -1; }
.empty { grid-column: 1 / -1; text-align: center; padding: 40px 20px; border: 2px dashed var(--line); border-radius: 14px; }
.empty h3 { font-size: 24px; }
.empty p { color: var(--ink-2); margin: 8px auto 0; max-width: 420px; }

/* Dialogs */
dialog { border: 2px solid var(--ink); border-radius: 20px; padding: 44px 20px 20px; max-width: min(520px, calc(100vw - 32px)); width: 100%; background: var(--ground); color: var(--ink); box-shadow: 0 8px 0 var(--ink); }
dialog::backdrop { background: rgba(31, 42, 46, .5); }
.dialog-close { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 28px; line-height: 1; width: 44px; height: 44px; }
.big-sign .exit-title { font-size: 26px; }
.big-sign .exit-summary { font-size: 16px; }
.exit-links { display: flex; gap: 16px; margin-top: 10px; }
.sign-link { color: #fff; font-weight: 700; font-size: 14px; }
.dialog-cat { margin: 12px 4px 0; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
#agent-dialog h2 { font-size: 26px; }
#agent-dialog p { color: var(--ink-2); margin: 4px 0 12px; }
#agent-prompt { width: 100%; height: 220px; font: 13px/1.5 ui-monospace, monospace; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--card); color: var(--ink); resize: vertical; }
.agent-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; font-size: 14px; }
.copy-button { background: var(--green); color: #fff; border: 0; border-radius: 999px; padding: 10px 16px; min-height: 44px; font-weight: 700; }

footer { margin-top: 56px; padding: 20px 0 40px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
:focus-visible { outline: 3px solid var(--car); outline-offset: 2px; }

@media (max-width: 680px) {
  .page { padding: 0 16px; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .wordmark { font-size: 19px; }
  .hero { padding-top: 20px; gap: 24px; }
  .lede { font-size: 16px; }
  .trip-card { padding: 20px 18px 16px; box-shadow: 0 6px 0 var(--ink); }
  .big strong { font-size: 64px; }
  .big span { font-size: 15px; }
  .route { width: 1000px; }
  .exits { grid-template-columns: 1fr; gap: 12px; }
  .exit.later { display: none; }
  .more { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
