/* Tokenova Learn: the hub, the quick-help pages and the 404 page.
   site/build_site.py copies this file to /assets/site.css. Colours come only from tokens.css.
   Each course is a metro line on the same transit map as the courses themselves. */

/* ---------------------------------------------------------------- shared shell */
/* Same sizing as trytokenova.com, so the two sites feel like one: type grows gently with the screen
   (16 px on a phone, never above 19 px), in one centred column of up to 80rem. Nothing is zoomed. */
html { font-size: clamp(100%, 0.9rem + 0.15vw, 118.75%); }
.wrap { max-width: calc(80rem + 80px); margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); }
.skip { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm);
        background: var(--signal); color: var(--signal-ink); font: 800 var(--fs-sm)/1 var(--font-display); text-decoration: none; }
.skip:focus { top: 8px; }

header.top { border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-4); padding-block: var(--sp-4); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); color: var(--ink); text-decoration: none;
         font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; }
.brand span b { color: var(--signal); font-weight: 800; }
.top-nav { margin-left: auto; }
.top-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-5); }
.top-nav a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); font-size: var(--fs-sm); text-decoration: none; }
.top-nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
/* The dark/light button needs a script, so it only shows when scripts run (the "js" class is set in the page head). */
.theme-btn { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; flex: none;
             border: 1px solid var(--rule-strong); border-radius: var(--r-pill); background: transparent; color: var(--ink); cursor: pointer; }
.js .theme-btn { display: inline-flex; }
.theme-btn:hover { background: var(--panel-2); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn svg + svg { display: none; }
[data-theme="light"] .theme-btn svg:first-child { display: none; }
[data-theme="light"] .theme-btn svg + svg { display: block; }
@media (max-width: 640px) {
  .top-nav { order: 3; width: 100%; margin-left: 0; }
  .theme-btn { margin-left: auto; }
}

.eyebrow { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); margin: 0 0 var(--sp-3); }
.btn { align-self: flex-start; display: inline-flex; gap: 8px; align-items: center; background: var(--accent);
       color: var(--accent-ink); text-decoration: none; font-weight: 700; padding: 10px 18px; border-radius: var(--r-md); }
.btn:hover { filter: brightness(1.08); }

footer.bottom { position: relative; background: var(--panel-2); color: var(--ink-2); font-size: var(--fs-sm); }
footer.bottom::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--brand-gradient); }
.foot-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--sp-6) var(--sp-5); padding-block: var(--sp-7) var(--sp-6); }
.foot-brand { display: grid; gap: var(--sp-3); justify-items: start; align-content: start; }
.foot-brand p { margin: 0; max-width: 36ch; }
footer.bottom .foot-brand .brand { color: var(--ink); font-size: var(--fs-xl); }
.foot-tag, .foot-label { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.12em; text-transform: uppercase; }
.foot-tag { color: var(--signal); }
.foot-label { color: var(--muted); margin: 0 0 var(--sp-2); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
footer.bottom a { color: var(--ink-2); text-decoration: none; overflow-wrap: anywhere; }
footer.bottom a:not(.brand) { display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }
footer.bottom a:hover { color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 2px; }
footer.bottom .foot-brand p a { display: inline; color: var(--ink); font-weight: 700; }
.foot-more { color: var(--muted); }
.foot-base { color: var(--muted); padding-bottom: var(--sp-5); }
.foot-base p { margin: 0; border-top: 1px solid var(--rule); padding-top: var(--sp-4); }
@media (max-width: 860px) {
  .foot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) { .foot-grid { grid-template-columns: minmax(0, 1fr); gap: var(--sp-5); padding-block: var(--sp-6) var(--sp-5); } }

/* Mint is only 1.6:1 on the light ground, so mint labels switch to the purple text colour there. */
[data-theme="light"] .brand span b, [data-theme="light"] .eyebrow, [data-theme="light"] .foot-tag,
[data-theme="light"] .route .q { color: var(--accent-text); }

/* ---------------------------------------------------------------- hub */
.hero { padding-block: var(--sp-7) var(--sp-6); }
.hero h1 { font-size: clamp(2rem, 5vw, var(--fs-4xl)); font-weight: 900; margin: 0 0 var(--sp-4); max-width: 18ch; }
.hero h1 em { font-style: normal; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--ink-2); font-size: var(--fs-lg); max-width: 60ch; margin: 0; }
.map { display: flex; align-items: center; gap: 10px; margin-top: var(--sp-6); color: var(--muted); font-size: var(--fs-sm); flex-wrap: wrap; }
.map i { display: inline-block; width: 36px; height: 4px; border-radius: 2px; background: var(--c); }
.band { padding-block: var(--sp-5) var(--sp-7); }
.band h2 { font-size: var(--fs-xl); margin: 0 0 var(--sp-5); scroll-margin-top: var(--sp-4); }
.band > .wrap > p { color: var(--ink-2); max-width: 68ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: var(--sp-5); }  /* auto-fit: few courses still fill the row */
.course { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md); padding: var(--sp-5);
          display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.course .line { position: relative; height: 6px; border-radius: 3px; background: var(--line); margin: 6px 0 var(--sp-2); }
.course .stop { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%);
                border-radius: 50%; background: var(--panel); border: 4px solid var(--line); }
.course.is-soon .line { background: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 22px); }
.course h3 { font-size: var(--fs-2xl); margin: 0; }
.course h3 a { color: var(--ink); text-decoration: none; }
.course h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.meta, .tools { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.meta li { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; }
.meta li + li::before { content: "·"; margin-right: 14px; color: var(--muted); }
.blurb { color: var(--ink-2); margin: 0; }
.tools li { font-size: var(--fs-xs); border: 1px solid var(--rule-strong); border-radius: var(--r-pill); padding: 2px 10px; color: var(--ink-2); }
.course .actions { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
.course .actions a:not(.btn) { display: inline-flex; align-items: center; min-height: 24px; }
.soon { margin: auto 0 0; color: var(--muted); font-weight: 700; }
.next { border-style: dashed; background: transparent; justify-content: center; }
.next p { margin: 0; color: var(--ink-2); }

/* Quick help: small stations on a side line */
.help-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: var(--sp-4); }
.help-card { position: relative; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r-md);
             padding: var(--sp-4) var(--sp-4) var(--sp-4) var(--sp-7); min-width: 0; }
.help-card::before { content: ""; position: absolute; left: 22px; top: 0; bottom: 0; width: 4px; background: var(--l-feature); }
.help-card::after { content: ""; position: absolute; left: 16px; top: 20px; width: 16px; height: 16px; border-radius: 50%;
                    background: var(--panel); border: 4px solid var(--l-feature); }
.help-card h3 { font-size: var(--fs-lg); margin: 0 0 var(--sp-1); }
.help-card h3 a { color: var(--ink); text-decoration: none; }
.help-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }  /* the whole card is the link */
.help-card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.help-card p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.note { margin: var(--sp-5) 0 0; padding: var(--sp-3) var(--sp-4); border-left: 4px solid var(--l-main); background: var(--panel-2);
        border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--ink-2); }
.faq-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--sp-5); }
.faq-list h3 { font-size: var(--fs-lg); margin: 0 0 var(--sp-2); }
.faq-list p { margin: 0; color: var(--ink-2); }
.agency-card { display: grid; gap: var(--sp-3); justify-items: start; background: var(--accent-soft); border: 1px solid var(--rule-strong);
               border-radius: var(--r-md); padding: var(--sp-6) var(--sp-5); }
.agency-card h2 { margin: 0; }
.agency-card p { margin: 0; color: var(--ink-2); font-size: var(--fs-lg); max-width: 60ch; }

/* ---------------------------------------------------------------- 404 */
.lost { max-width: 640px; margin: 0 auto; padding: var(--sp-8) max(16px, 4vw); }
.lost .eyebrow { margin-top: var(--sp-5); }
.lost h1 { font-size: var(--fs-3xl); font-weight: 900; margin: 0 0 var(--sp-4); }
.lost p { color: var(--ink-2); font-size: var(--fs-lg); }
.lost .btn { font-size: var(--fs-md); }

/* ---------------------------------------------------------------- quick-help pages */
.doc { padding-block: var(--sp-5) var(--sp-8); }
.crumbs ol { list-style: none; margin: 0 0 var(--sp-5); padding: 0; display: flex; flex-wrap: wrap; gap: 2px var(--sp-2);
             font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 24px; }
.crumbs li + li::before { content: "›"; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 24px; color: var(--ink-2); }
.doc-head h1 { font-size: clamp(1.9rem, 4.5vw, var(--fs-3xl)); font-weight: 900; margin: 0 0 var(--sp-3); }
.lead { color: var(--ink-2); font-size: var(--fs-lg); max-width: 68ch; margin: 0 0 var(--sp-3); }
.doc-head .btn { margin-top: var(--sp-2); }
.doc h2 { font-size: var(--fs-xl); margin: var(--sp-7) 0 var(--sp-3); scroll-margin-top: var(--sp-4); }
.doc h3 { font-size: var(--fs-lg); margin: var(--sp-5) 0 var(--sp-2); }
.doc section, .doc article, .doc [id] { scroll-margin-top: var(--sp-4); }
.doc p, .doc ul, .doc ol, .doc dl { max-width: 76ch; }
.entry li + li, .day ul:not(.meta) li + li, .doc dd li + li, .toc li + li { margin-top: var(--sp-1); }
.sign { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin: var(--sp-4) 0 var(--sp-1); }
.from { color: var(--muted); font-size: var(--fs-sm); }
.ui { font-weight: 700; }
.print-only { display: none; }
var { font-style: italic; }

/* wide tables scroll inside their own box, never the page */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r-md); margin-block: var(--sp-3) var(--sp-4); }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: var(--fs-sm); }
.table-wrap th { text-align: left; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.08em;
                 text-transform: uppercase; color: var(--ink-2); background: var(--panel-2); }
.table-wrap th, .table-wrap td { padding: var(--sp-2) var(--sp-3); vertical-align: top; }
.table-wrap td { border-top: 1px solid var(--rule); }
.cheats table { min-width: 880px; table-layout: fixed; }
.cheats col.c-task { width: 23%; } .cheats col.c-cmd { width: 27%; } .cheats col.c-vs { width: 20%; }
.cheats col.c-gd { width: 20%; } .cheats col.c-day { width: 10%; }
.cheats td:last-child { white-space: nowrap; }

/* commands and files: the terminal is dark in both themes */
.doc pre { margin: var(--sp-2) 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border-radius: var(--r-md); background: var(--term-bg);
           color: var(--term-fg); font-size: var(--fs-sm); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.doc pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.doc pre.file { white-space: pre; overflow-wrap: normal; overflow-x: auto; }
.callout { margin-block: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-left: 4px solid var(--info); background: var(--panel-2);
           border-radius: 0 var(--r-md) var(--r-md) 0; max-width: 76ch; }
.callout > :last-child { margin-bottom: 0; }
.callout-head { margin: 0 0 var(--sp-1); font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.callout-warn { border-left-color: var(--warn); }
.callout-office { border-left-color: var(--l-main); }
.callout p { margin: 0 0 var(--sp-2); }

/* each entry is a station: a rule above, the name, then the details */
.entry { border-top: 1px solid var(--rule); margin-top: var(--sp-6); }
.entry > h2 { margin-top: var(--sp-5); }
.entry h2.msg { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.toc { margin: var(--sp-4) 0; padding: 0 0 0 var(--sp-5); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree > li { position: relative; padding: var(--sp-2) 0 var(--sp-2) var(--sp-6); border-left: 4px solid var(--l-main); margin-left: 8px; }
.tree > li::before { content: ""; position: absolute; left: -10px; top: 14px; width: 16px; height: 16px; border-radius: 50%;
                     background: var(--paper); border: 4px solid var(--l-main); box-sizing: border-box; }
.tree ul { margin-top: var(--sp-2); padding-left: var(--sp-4); border-left: 2px solid var(--rule-strong); }
.tree ul li { padding-block: 2px; }
.tree .arrow { color: var(--muted); }
.route { list-style: none; margin: 0 0 var(--sp-2); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--rule-strong); border-radius: var(--r-md); }
.route .q { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--signal); }
.letters { list-style: none; margin: var(--sp-4) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.letters a { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding-inline: var(--sp-2); border: 1px solid var(--rule-strong);
             border-radius: var(--r-sm); font-family: var(--font-mono); font-weight: 600; text-decoration: none; color: var(--ink); }
.letters a:hover { background: var(--panel-2); }
.doc dt { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg); margin-top: var(--sp-4); }
.doc dd { margin: 0; color: var(--ink-2); }
.doc dd p { margin: var(--sp-1) 0; }
.file-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); }
.file-head h2 { margin-bottom: 0; font-family: var(--font-mono); font-size: var(--fs-lg); overflow-wrap: anywhere; }
.copy { min-height: 32px; padding: 4px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: transparent;
        color: var(--ink); font: 700 var(--fs-sm)/1 var(--font-body); cursor: pointer; }
.copy:hover { background: var(--panel-2); }
.day { background: var(--panel); border: 1px solid var(--rule); border-left: 6px solid var(--l-main); border-radius: var(--r-md);
       padding: var(--sp-4) var(--sp-5); margin-top: var(--sp-4); }
.day.is-bonus { border-left-color: var(--l-feature); }
.day h3 { margin-top: 0; font-size: var(--fs-xl); }
.day h3 a { color: var(--ink); }
.day .meta { margin-bottom: var(--sp-2); }
.day p { margin: var(--sp-2) 0; color: var(--ink-2); }
.siblings { margin-top: var(--sp-8); padding-top: var(--sp-2); border-top: 1px solid var(--rule); }
.siblings ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); max-width: none; }
.siblings a { display: inline-flex; align-items: center; min-height: 24px; }

/* ---------------------------------------------------------------- print: light paper, no site chrome */
@media print {
  :root, :root[data-theme="light"] {
    color-scheme: light;
    --paper: Canvas; --panel: Canvas; --panel-2: Canvas; --ink: CanvasText; --ink-2: CanvasText; --muted: CanvasText;
    --rule: GrayText; --rule-strong: GrayText; --accent-text: CanvasText; --signal: CanvasText; --info: GrayText; --warn: GrayText;
    --term-bg: Canvas; --term-fg: CanvasText; --l-main: GrayText; --l-feature: GrayText;
  }
  .print-only { display: block; }
  header.top, footer.bottom, .skip, .crumbs, .siblings, .doc-head .btn, .copy, .letters, .no-print { display: none !important; }
  body { font-size: 10pt; }
  .wrap { max-width: none; padding: 0; }
  .doc { padding: 0; }
  .doc a { color: inherit; text-decoration: none; }
  .doc h2, .doc h3 { break-after: avoid; }
  .doc pre { border: 1px solid GrayText; white-space: pre-wrap; overflow-wrap: anywhere; }
  .doc pre.file { white-space: pre-wrap; overflow: visible; }
  .entry, .day, .callout, .route, .doc tr, .doc dl > div { break-inside: avoid; }
  .table-wrap { overflow: visible; border: 0; }
  .table-wrap table, .cheats table { min-width: 0; }
  .table-wrap th, .table-wrap td { border: 1px solid GrayText; padding: 3px 6px; }
  .cheats table { font-size: 8pt; }
  .cheats thead { display: table-header-group; }
  .cheats code { border: 0; padding: 0; }
}
