@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f5f2e6;
  --card: #fffdf2;
  --ink: #163631;
  --muted: #4d625a;
  --forest: #103b3b;
  --amber: #ffcf77;
  --rule: #adbaab;
  --rust: #91452a;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  scroll-padding-top: 1.2rem;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.6 system-ui, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p, ol, dl, dd, pre { margin: 0; }
h1, h2, h3, h4, .button, .return, summary { font-family: var(--display); }
h1, h2, h3, h4 { letter-spacing: -.045em; text-wrap: balance; }
h1 { font-size: clamp(4.1rem, 9vw, 7.7rem); line-height: .88; max-width: 7ch; font-weight: 800; }
h2 { font-size: clamp(2rem, 4.4vw, 3.25rem); line-height: 1.04; }
h3 { font-size: 1.45rem; line-height: 1.16; }
a { color: #24574d; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #a84e21; outline-offset: 4px; }
button:disabled { cursor: default; }
code, pre { font: .9em/1.55 var(--mono); }
pre code { font: inherit; }
.wrap { margin-inline: auto; width: min(68rem, calc(100% - 3rem)); }
.skip { position: absolute; top: .5rem; left: .7rem; background: var(--card); padding: .7rem; z-index: 4; }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.top, footer, .top nav, .actions { display: flex; align-items: center; }
.top, footer { justify-content: space-between; gap: .8rem; min-height: 4rem; border-bottom: 2px solid var(--ink); }
.top nav { gap: 1.1rem; }
.top a, .return { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 700; font-size: .92rem; text-decoration: none; }
.top a:hover, .return:hover { text-decoration: underline; }
.hero, .lesson-section { display: grid; grid-template-columns: minmax(0, .83fr) minmax(0, 1.17fr); gap: clamp(2rem, 6vw, 5.5rem); align-items: start; }
.hero { padding-block: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow, .trace-step { font: 700 .76rem/1.5 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.hero-copy > .eyebrow { color: var(--rust); margin-bottom: 1.1rem; }
.intro { margin: 1.25rem 0 1.4rem; font-size: clamp(1.05rem, 1.8vw, 1.27rem); line-height: 1.5; max-width: 31ch; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 1rem; padding: .58rem 1rem; border: 1.5px solid var(--ink); border-radius: 4px; font-size: .97rem; font-weight: 750; line-height: 1.3; text-decoration: none; }
.bright { background: var(--amber); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.bright:hover:enabled, a.bright:hover { background: #ffe09a; }
.dark { color: #fdf9e9; background: var(--forest); }
.dark:hover:enabled, a.dark:hover { background: #22524c; }
.button:disabled { color: var(--muted); border-color: var(--rule); background: var(--paper); box-shadow: none; }
.ticket { min-width: 0; background: var(--card); border: 1.5px solid var(--forest); border-radius: 7px 7px 2px 2px; box-shadow: 4px 4px 0 #c4c6b2; }
.ticket-head { padding: 1rem 1.3rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .8rem; align-items: center; border-radius: 5px 5px 0 0; background: var(--forest); color: #fff9e6; }
.ticket-head .eyebrow { color: #f3c878; grid-column: 1; font-size: .72rem; }
.ticket-head label { font: 700 1.4rem/1.2 var(--display); grid-column: 1; }
.ticket-head select { grid-column: 2; grid-row: 1/3; }
select { min-height: 44px; max-width: 100%; padding: .32rem .45rem; color: var(--ink); background: var(--card); border: 1px solid var(--ink); border-radius: 4px; }
.ticket-head select:focus-visible { outline-color: var(--amber); }
.routes { padding: .1rem 1.25rem; }
.route { padding: .8rem 0; }
.route + .route { border-top: 1px dashed var(--rule); }
.route h3 { display: flex; align-items: center; gap: .5rem; font-size: 1.13rem; }
.route h3::before { content: ""; width: 1.6rem; height: .3rem; border-radius: 1rem; background: var(--route); }
.route[data-line="Canal"] { --route: #296e70; }
.route[data-line="Hill"] { --route: #a44b33; }
.trip { display: grid; grid-template-columns: 2.3rem minmax(0, 1fr); align-items: baseline; gap: .5rem; margin-top: .55rem; }
.trip-no { font: 700 .81rem/1.4 var(--mono); color: var(--muted); }
.stops { display: flex; padding: 0; list-style: none; }
.stop { position: relative; flex: 1 1 0; min-width: 0; padding: .25rem .2rem 0 .75rem; border-top: 1px solid var(--route); }
.stop::before { content: ""; position: absolute; width: .38rem; height: .38rem; left: .05rem; top: -.25rem; border: 1px solid var(--route); border-radius: 50%; background: var(--card); }
.stop[aria-current]::before { background: var(--route); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--route); }
.stop strong, .stop time { display: block; }
.stop strong { line-height: 1.35; font-size: .93rem; overflow-wrap: anywhere; }
.stop time, .empty { color: var(--muted); font-size: .79rem; }
.stop time { font-family: var(--mono); }
.empty { font-style: italic; }
.ticket-foot { display: flex; flex-wrap: wrap; gap: .25rem .8rem; justify-content: space-between; padding: .6rem 1.25rem; background: #f0ebd8; border-top: 1px dashed var(--rule); color: var(--muted); font-size: .77rem; }
.lesson-section, .notes { border-top: 2px solid var(--ink); padding-block: clamp(2.1rem, 4.5vw, 3.5rem); }
.section-copy > p { max-width: 43ch; margin-top: .85rem; }
.section-copy > a { display: inline-block; margin-top: .85rem; }
.section-copy > .button { display: inline-flex; }
.surface, .trace-platform { min-width: 0; border: 1px solid var(--rule); background: var(--card); border-radius: 5px; padding: clamp(1rem, 2.6vw, 1.55rem); }
.surface label, .panel-heading label { display: block; font: 700 1.15rem/1.35 var(--display); }
.snippet { margin: .7rem 0; padding: .75rem .9rem; border-left: 3px solid #88a18c; background: #e7ede0; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.hint, .kit-hint { color: var(--muted); font-size: .86rem; }
#prediction { display: block; width: 100%; min-height: 46px; margin: .33rem 0 .75rem; padding: .54rem .7rem; color: var(--ink); background: #fffef8; border: 1px solid #728276; border-radius: 3px; font-size: 1rem; }
.feedback:empty { display: none; }
.feedback { margin-top: .9rem; padding: .6rem .8rem; background: #f6e9cf; border-left: 3px solid var(--rust); }
.feedback.good { background: #e0ecd8; border-left-color: #34634c; }
.surface .text-button { color: var(--rust); }
.trace-platform { border: 1px solid var(--forest); border-top-width: 4px; }
.panel-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; }
.trace-step { color: var(--rust); margin: 1rem 0 .2rem; }
#trace-detail { margin-top: .5rem; }
.readout { margin-top: .65rem; padding: .7rem .8rem; background: var(--forest); color: #fff8e5; border-radius: 3px; }
.readout p { color: #f7d48b; font: .75rem/1.45 var(--mono); margin-bottom: .25rem; }
.readout pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .84rem; }
.actions { gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }
.text-button { min-height: 44px; border: 0; background: transparent; color: var(--forest); padding: .2rem; font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: .2em; }
.text-button:disabled { color: var(--muted); text-decoration: none; }
.kit-detail > p, .kit-detail details p { margin: .65rem 0; }
.kit-detail details { margin-top: 1rem; border-top: 1px solid var(--rule); }
summary { padding: .7rem 0; min-height: 44px; font-weight: 700; }
.notes h2 { font-size: 1.55rem; }
.notes p { margin-top: .65rem; font-size: .9rem; color: var(--muted); max-width: 77ch; }
footer { border-bottom: none; border-top: 2px solid var(--ink); color: var(--muted); font-size: .85rem; }
@media (max-width: 780px) {
  .hero, .lesson-section { gap: 1.5rem; }
  .hero { grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr); }
  .ticket-head { grid-template-columns: minmax(0, 1fr); }
  .ticket-head select { grid-column: 1; grid-row: auto; width: fit-content; margin-top: .35rem; }
}
@media (max-width: 630px) {
  .wrap { width: calc(100% - 2rem); }
  .hero, .lesson-section { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 1.75rem 0 2rem; }
  h1 { max-width: none; font-size: clamp(3.35rem, 12vw, 4.9rem); line-height: .98; }
  .hero-copy > .eyebrow { margin-bottom: .5rem; }
  .intro { margin: .6rem 0 .8rem; max-width: 39ch; }
  .ticket-head { padding: .75rem .85rem; }
  .routes { padding: .05rem .85rem; }
  .ticket-foot { padding: .45rem .85rem; }
  .ticket-foot span { display: none; }
  .lesson-section, .notes { padding: 1.75rem 0; }
  .top nav { gap: .65rem; }
  .top a, .return { font-size: .84rem; }
  .section-copy > p { margin-top: .6rem; }
  .snippet { font-size: .8rem; }
  footer { flex-wrap: wrap; }
}
@media (min-width: 375px) and (max-width: 630px) {
  .ticket-head { grid-template-columns: minmax(0, 1fr) auto; }
  .ticket-head select { grid-column: 2; grid-row: 1/3; margin: 0; }
}
