/*
  TalkToWalk, project page styles
  Contents: 1 fonts, 2 tokens, 3 base, 4 layout and shared controls, 5 header,
  6 hero, 7 route map, 8 idea, 9 approach, 10 roadmap, 11 literature,
  12 previous work, 13 cite, 14 footer, 15 utilities, 16 print
*/

/* 1. Fonts: self-hosted, SIL Open Font License 1.1 (see OFL.txt) */
@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("overpass-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Overpass";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("overpass-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Overpass Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("overpass-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Overpass Mono";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("overpass-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Tokens. Dark "blueprint" theme by default, light "whiteprint" theme on request and in print. */
:root {
  color-scheme: dark;

  --ink: #0b1426;                        /* page background */
  --ink-glass: rgb(11 20 38 / 0.88);     /* sticky header */
  --panel: #0f1b31;                      /* raised surfaces */
  --panel-glass: rgb(15 27 49 / 0.84);   /* route card over the grid */
  --panel-2: #14243f;                    /* corridor floor, bars */
  --rule: #22344f;                       /* hairlines */
  --rule-strong: #364c70;                /* walls, outlines */
  --text: #e6edf8;
  --muted: #a0b0ca;
  --plan: #7ab4ff;                       /* route, links, primary actions */
  --plan-hover: #a3caff;
  --plan-ring: rgb(122 180 255 / 0.14);
  --plan-ink: #07101e;                   /* text on --plan */
  --signal: #ffb547;                     /* junctions and the current command */
  --signal-soft: rgb(255 181 71 / 0.16);
  --done: #63d6ab;
  --nod: #a26bff;                        /* accent of the previous project */
  --nod-soft: rgb(162 107 255 / 0.15);
  --grid: rgb(122 180 255 / 0.07);
  --shadow: 0 28px 60px -28px rgb(0 0 0 / 0.65);

  --font: "Overpass", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Overpass Mono", ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --text-xs: 0.8rem;
  --text-code: 0.85rem;
  --text-sm: 0.875rem;
  --text-ui: 0.95rem;
  --text-base: 1.0625rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.2rem, 1.1rem + 0.5vw, 1.45rem);
  --text-2xl: clamp(1.6rem, 1.3rem + 1.2vw, 2.15rem);
  --text-3xl: clamp(1.75rem, 1.3rem + 1.8vw, 2.6rem);
  --text-stat: clamp(1.75rem, 1.3rem + 1.6vw, 2.6rem);
  --text-display: clamp(3rem, 1.5rem + 6vw, 5.75rem);

  --fw-regular: 400;
  --fw-medium: 600;
  --fw-bold: 720;
  --fw-heavy: 800;
  --fw-display: 850;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: clamp(3rem, 2.4rem + 3vw, 4.5rem);
  --space-9: clamp(3.5rem, 2.4rem + 4.5vw, 6.25rem);

  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-control: 10px;
  --radius-m: 14px;
  --radius-l: 22px;
  --radius-pill: 999px;

  --container: 74rem;
  --gutter: clamp(1rem, 0.5rem + 2.4vw, 2rem);
  --header-h: 4rem;
  --target: 2.75rem;                     /* minimum touch target, 44 px */

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur: 180ms;
}

@media (prefers-color-scheme: light), print {
  :root {
    color-scheme: light;
    --ink: #f4f7fb;
    --ink-glass: rgb(244 247 251 / 0.88);
    --panel: #ffffff;
    --panel-glass: rgb(255 255 255 / 0.86);
    --panel-2: #eaf0f8;
    --rule: #d6dfec;
    --rule-strong: #a9b9d1;
    --text: #0d1a2e;
    --muted: #4a5a75;
    --plan: #1f5bd0;
    --plan-hover: #184aae;
    --plan-ring: rgb(31 91 208 / 0.14);
    --plan-ink: #ffffff;
    --signal: #b45309;
    --signal-soft: rgb(214 128 0 / 0.14);
    --done: #0f7a55;
    --nod: #7c3aed;
    --nod-soft: rgb(124 58 237 / 0.1);
    --grid: rgb(31 91 208 / 0.07);
    --shadow: 0 28px 60px -32px rgb(15 35 70 / 0.35);
  }
}

/* 3. Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
dl,
dd,
figure,
pre {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  line-height: 1.12;
  text-wrap: balance;
}

p,
li,
dd {
  text-wrap: pretty;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--plan);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

code,
pre {
  font-family: var(--font-mono);
}

::selection {
  background: var(--signal-soft);
  color: var(--text);
}

/* 4. Layout and shared controls */
.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.section {
  padding-block: var(--space-9);
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  gap: var(--space-4);
  max-width: 46rem;
  margin-bottom: var(--space-7);
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.025em;
}

.section-intro {
  color: var(--muted);
  font-size: var(--text-md);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--gutter);
  z-index: 100;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-s);
  background: var(--plan);
  color: var(--plan-ink);
  font-weight: var(--fw-bold);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  padding: 0.65rem 1.15rem 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-size: var(--text-ui);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.button svg {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
}

.button-primary {
  background: var(--plan);
  color: var(--plan-ink);
}

.button-primary:hover {
  background: var(--plan-hover);
}

.button-secondary {
  border-color: var(--rule-strong);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--plan);
  background: var(--panel-2);
}

.text-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  font-weight: var(--fw-medium);
}

.pill-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: 0 var(--space-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.pill-button:hover {
  border-color: var(--plan);
  background: var(--panel-2);
}

/* 5. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target);
  margin-right: auto;
  color: var(--text);
  font-size: var(--text-md);
  font-weight: var(--fw-heavy);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}

.bm-bg {
  fill: var(--panel-2);
}

.bm-route {
  fill: none;
  stroke: var(--plan);
  stroke-width: 3.4;
  stroke-linecap: round;
}

.bm-dot {
  fill: var(--signal);
}

.site-nav {
  min-width: 0;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  list-style: none;
}

.nav-list a {
  display: inline-block;
  padding-block: 0.6rem;
  color: var(--muted);
  font-size: var(--text-ui);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.lang-link,
.icon-link {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  min-width: var(--target);
  min-height: var(--target);
  padding: 0 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
  text-decoration: none;
}

.lang-link {
  border-color: var(--rule-strong);
}

.lang-link:hover,
.icon-link:hover {
  background: var(--panel-2);
}

.icon-link svg {
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  fill: currentColor;
}

@media (max-width: 899.98px) {
  /* With JavaScript the section links collapse into a disclosure menu. */
  .js .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-width: var(--target);
    min-height: var(--target);
    padding: 0 0.85rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--text-ui);
    font-weight: var(--fw-medium);
    cursor: pointer;
  }

  .nav-toggle svg {
    flex: none;
    width: 1.1rem;
    height: 1.1rem;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    fill: none;
  }

  .nav-toggle .icon-close,
  .nav-toggle[aria-expanded="true"] .icon-open {
    display: none;
  }

  .nav-toggle[aria-expanded="true"] .icon-close {
    display: block;
  }

  .js:not(.nav-static) .nav-list {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-2) var(--gutter) var(--space-5);
    border-bottom: 1px solid var(--rule);
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .js:not(.nav-static) .nav-toggle[aria-expanded="true"] + .nav-list {
    display: flex;
  }

  .js:not(.nav-static) .nav-list a {
    display: block;
    padding-block: 0.8rem;
    border-bottom: 1px solid var(--rule);
    color: var(--text);
    font-size: var(--text-base);
  }

  /* Without JavaScript (or if the menu script fails) the links sit on one scrollable row. */
  html:not(.js) .site-header,
  .nav-static .site-header {
    position: static;
  }

  html:not(.js) .header-inner,
  .nav-static .header-inner {
    flex-wrap: wrap;
    row-gap: 0;
  }

  html:not(.js) .site-nav,
  .nav-static .site-nav {
    order: 3;
    flex-basis: 100%;
  }

  html:not(.js) .nav-list,
  .nav-static .nav-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    /* room for the 3 px focus ring + 3 px offset inside the scroll area */
    margin-inline: -6px;
    padding: 6px 6px var(--space-2);
  }

  html:not(.js) .nav-list a,
  .nav-static .nav-list a {
    white-space: nowrap;
  }
}

@media (max-width: 399.98px) {
  .header-inner {
    gap: var(--space-2);
  }

  .brand {
    gap: 0.45rem;
    font-size: var(--text-base);
  }

  .js .nav-toggle {
    padding: 0;
  }

  /* Icon-only toggle on very narrow screens; "Menu" stays its accessible name. */
  .nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
}

/* 6. Hero */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 6rem) var(--space-8);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(85% 75% at 72% 38%, #000 20%, transparent 78%);
  mask-image: radial-gradient(85% 75% at 72% 38%, #000 20%, transparent 78%);
}

.hero-grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas:
      "copy card"
      "facts card";
    column-gap: clamp(2.5rem, 1rem + 4vw, 4.5rem);
    row-gap: var(--space-7);
  }

  .hero-copy {
    grid-area: copy;
    align-self: end;
  }

  .route-card {
    grid-area: card;
    align-self: center;
  }

  .facts {
    grid-area: facts;
    align-self: start;
  }
}

.hero-title {
  font-size: var(--text-display);
  font-weight: var(--fw-display);
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.hero-subtitle {
  margin-top: var(--space-4);
  font-size: var(--text-xl);
  font-weight: var(--fw-medium);
  line-height: 1.3;
}

.hero-lede {
  max-width: 38rem;
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--text-md);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--text-sm);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.8rem 0.25rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-weight: var(--fw-medium);
}

.status-dot {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--rule);
}

.facts > div {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  color: var(--muted);
  font-size: var(--text-sm);
}

.facts dd {
  margin-top: 0.1rem;
  font-weight: var(--fw-medium);
  line-height: 1.35;
}

/* 7. Route map: the one animated element on the page */
.route-card {
  padding: clamp(1rem, 0.6rem + 1.6vw, 1.6rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  background: var(--panel-glass);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

/* Tablets: map and route text side by side, so the card does not fill the screen. */
@media (min-width: 600px) and (max-width: 959.98px) {
  .route-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    column-gap: var(--space-5);
    align-items: center;
  }

  .route-card .route-text {
    margin-top: 0;
  }
}

.route-map {
  width: 100%;
  height: auto;
}

.map-floor {
  fill: var(--panel-2);
}

.map-hatch {
  stroke: var(--rule);
  stroke-width: 1.4;
}

.map-rooms {
  fill: url(#rooms-hatch);
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.map-walls {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-plan {
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.5;
  stroke-dasharray: 1.5 6;
  stroke-linecap: round;
  opacity: 0.6;
}

.map-trail {
  fill: none;
  stroke: var(--plan);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* With JavaScript the trail starts empty and is drawn as the robot walks (pathLength="1000").
   If the script fails, main.js reveals the whole trail or the page drops the .js class. */
.js .map-trail {
  stroke-dasharray: 1000 1000;
  stroke-dashoffset: 1000;
}

/* SVG user units: the map scales with its card, so the label size is set per layout. */
.map-label {
  fill: var(--muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: var(--fw-medium);
}

@media (min-width: 600px) {
  .map-label {
    font-size: 14px;
  }
}

@media (min-width: 960px) {
  .map-label {
    font-size: 12px;
  }
}

.junction {
  fill: var(--panel);
  stroke: var(--signal);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  transition: fill 250ms var(--ease);
}

.junction.is-passed {
  fill: var(--signal);
}

.junction.is-hit {
  animation: junction-hit 650ms var(--ease);
}

@keyframes junction-hit {
  40% {
    transform: scale(1.45);
  }
}

.start-mark {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.5;
}

.robot-lidar-stop {
  stop-color: var(--signal);
}

.robot-body {
  fill: var(--signal);
  stroke: var(--panel);
  stroke-width: 2;
}

.robot-heading {
  fill: var(--plan-ink);
}

.route-text {
  margin-top: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-ui);
  line-height: 1.8;
}

.route-step {
  margin-inline: -0.15em;
  padding: 0.1em 0.15em;
  border-radius: var(--radius-xs);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-color 250ms var(--ease), color 250ms var(--ease), box-shadow 250ms var(--ease);
}

.is-animating .route-step {
  color: var(--muted);
}

.is-animating .route-step.is-done {
  color: var(--text);
}

.is-animating .route-step.is-active {
  background: var(--signal-soft);
  box-shadow: inset 0 -2px 0 var(--signal);
  color: var(--text);
}

.route-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}

.route-note {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* The sentence about the highlight only applies while the animation is running or paused mid-lap. */
.route-note-live {
  display: none;
}

.is-animating .route-note-live {
  display: inline;
}

.route-toggle svg {
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  fill: currentColor;
}

.route-toggle .icon-play,
.route-toggle[data-state="paused"] .icon-pause {
  display: none;
}

.route-toggle[data-state="paused"] .icon-play {
  display: block;
}

/* 8. Idea: inputs, model, output */
.flow {
  display: grid;
  gap: var(--space-3);
}

.flow-inputs {
  display: grid;
  gap: var(--space-3);
}

@media (min-width: 600px) and (max-width: 899.98px) {
  .flow-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.flow-node {
  padding: var(--space-5);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
}

.flow-model {
  border-color: var(--plan);
  box-shadow: 0 0 0 4px var(--plan-ring);
}

.flow-role {
  color: var(--muted);
  font-size: var(--text-sm);
}

.flow-name {
  margin-top: 0.15rem;
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  line-height: 1.3;
}

.flow-text {
  margin-top: 0.4rem;
  color: var(--muted);
}

.flow-arrow {
  justify-self: center;
  width: 2.5rem;
  height: 1rem;
  color: var(--muted);
  transform: rotate(90deg);
}

.flow-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-feedback {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-top: var(--space-3);
  padding: var(--space-5);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-m);
}

.flow-feedback svg {
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flow-feedback p + p {
  margin-top: 0.3rem;
  color: var(--muted);
}

@media (min-width: 900px) {
  .flow {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-4);
  }

  .flow-arrow {
    transform: none;
  }

  .flow-feedback {
    grid-column: 1 / -1;
  }
}

/* 9. Approach */
.approach-grid {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 1000px) {
  .approach-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: start;
  }

  .side {
    position: sticky;
    top: calc(var(--header-h) + var(--space-5));
  }
}

.steps {
  display: grid;
  list-style: none;
  counter-reset: step;
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}

.step {
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-content: start;
  column-gap: var(--space-3);
  padding-block: var(--space-5);
  border-top: 1px solid var(--rule);
  counter-increment: step;
}

.step::before {
  content: counter(step);
  display: grid;
  place-items: center;
  grid-row: span 2;
  width: 1.9rem;
  height: 1.9rem;
  border: 1.5px solid var(--plan);
  border-radius: 50%;
  color: var(--plan);
  font-family: var(--font-mono);
  font-size: var(--text-code);
  font-weight: var(--fw-medium);
}

.step-title {
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
}

.step-text {
  margin-top: 0.35rem;
  color: var(--muted);
}

.panel {
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
}

.panel-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
}

.panel-text {
  margin-top: var(--space-3);
  color: var(--muted);
}

.rules {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  list-style: none;
  counter-reset: rule;
}

.rules li {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  counter-increment: rule;
}

.rules li::before {
  content: counter(rule) ".";
  color: var(--signal);
  font-weight: var(--fw-bold);
}

.junction-types {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
  list-style: none;
}

.junction-type {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-s);
  background: var(--panel-2);
  font-size: var(--text-sm);
  line-height: 1.35;
  text-align: center;
}

.junction-type svg {
  width: 4rem;
  height: 4rem;
}

.junction-type small {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
}

.jt-corridor {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jt-path {
  fill: none;
  stroke: var(--plan);
  stroke-width: 2.5;
  stroke-dasharray: 3 4;
  stroke-linecap: round;
}

.jt-node {
  fill: var(--panel-2);
  stroke: var(--signal);
  stroke-width: 2.5;
}

.training {
  margin-top: var(--space-6);
}

.training-list {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-5);
  list-style: none;
}

@media (min-width: 640px) {
  .training-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .training-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: var(--space-6);
  }
}

.training-list li {
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule-strong);
}

.training-name {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: var(--text-base);
  font-weight: var(--fw-bold);
}

.training-name::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 2px;
  background: var(--signal);
}

.training-text {
  margin-top: 0.35rem;
  color: var(--muted);
}

/* 10. Roadmap */
@media (min-width: 1000px) {
  .split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: var(--space-7);
    align-items: start;
  }

  .split .section-head {
    position: sticky;
    top: calc(var(--header-h) + var(--space-6));
    margin-bottom: 0;
  }
}

.roadmap {
  display: grid;
  gap: var(--space-5);
  max-width: 48rem;
  list-style: none;
}

.milestone {
  position: relative;
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: var(--space-4);
}

.milestone:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.85rem;
  bottom: calc(-1 * var(--space-5) + 0.3rem);
  left: calc(0.75rem - 1px);
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--rule-strong) 0 4px, transparent 4px 9px);
}

.milestone-done:not(:last-child)::after {
  background: var(--done);
}

.milestone-marker {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
  border: 2px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--ink);
}

.milestone-done .milestone-marker {
  border-color: var(--done);
  background: var(--done);
}

.milestone-done .milestone-marker::after {
  content: "";
  position: absolute;
  top: 0.22rem;
  left: 0.42rem;
  width: 0.35rem;
  height: 0.65rem;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.milestone-next .milestone-marker {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.milestone-next .milestone-marker::after {
  content: "";
  position: absolute;
  inset: 0.3rem;
  border-radius: 50%;
  background: var(--signal);
}

.milestone-status {
  display: inline-block;
  padding: 0.05rem 0.55rem 0;
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
}

.milestone-done .milestone-status {
  color: var(--done);
}

.milestone-next .milestone-status {
  color: var(--signal);
}

.milestone-title {
  margin-top: var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
}

.milestone-text {
  margin-top: var(--space-1);
  color: var(--muted);
}

/* 11. Literature */
.refs {
  border-top: 1px solid var(--rule);
  list-style: none;
  counter-reset: ref;
}

.ref {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  gap: var(--space-3);
  padding-block: var(--space-6);
  border-bottom: 1px solid var(--rule);
  counter-increment: ref;
}

.ref::before {
  content: "[" counter(ref) "]";
  grid-row: span 2;
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: var(--fw-medium);
}

.ref-meta {
  color: var(--muted);
  font-size: var(--text-sm);
}

.ref-title {
  margin-top: 0.3rem;
  font-size: var(--text-md);
  font-weight: var(--fw-bold);
  line-height: 1.35;
}

.ref-source {
  margin-top: 0.3rem;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-code);
}

.ref-why {
  color: var(--muted);
}

@media (min-width: 900px) {
  .ref {
    grid-template-columns: 3.25rem minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: var(--space-6);
  }

  .ref::before {
    grid-row: auto;
  }
}

/* 12. Previous work */
.previous {
  position: relative;
  display: grid;
  gap: var(--space-7);
  padding: clamp(1.5rem, 0.9rem + 2.6vw, 3rem);
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-l);
  background:
    radial-gradient(110% 130% at 100% 0%, var(--nod-soft), transparent 55%),
    var(--panel);
}

@media (min-width: 900px) {
  .previous {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
  }
}

.previous-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.previous-snake {
  flex: none;
  width: 4.5rem;
  height: auto;
}

.snake-body {
  fill: var(--plan);
}

.snake-head {
  fill: var(--nod);
}

.snake-food {
  fill: var(--done);
}

.previous-label {
  color: var(--muted);
  font-size: var(--text-sm);
}

.previous-title {
  margin-top: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: var(--fw-heavy);
  letter-spacing: -0.03em;
}

.previous-text {
  max-width: 36rem;
  margin-top: var(--space-4);
  color: var(--muted);
}

.previous-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-6);
}

.previous-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5) var(--space-4);
  list-style: none;
}

.previous-stats li {
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule-strong);
  color: var(--muted);
  font-size: var(--text-sm);
}

.stat-value {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text);
  font-size: var(--text-stat);
  font-weight: var(--fw-heavy);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* 13. Cite */
.cite-box {
  max-width: 54rem;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius-m);
  background: var(--panel);
}

.cite-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 3.5rem;
  padding: 0.4rem 0.5rem 0.4rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--panel-2);
}

.cite-format {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-code);
}

.cite-code {
  padding: var(--space-5) 1.1rem;
  overflow-x: auto;
  font-size: var(--text-code);
  line-height: 1.75;
  tab-size: 2;
}

/* The box clips its children, so the focus ring is drawn inside the code area. */
.cite-code:focus-visible {
  outline-offset: -3px;
}

.copy-status {
  padding: 0 1.1rem 0.8rem;
  color: var(--done);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
}

.copy-status:empty {
  padding: 0;
}

/* 14. Footer */
.site-footer {
  padding-block: var(--space-8) var(--space-6);
  border-top: 1px solid var(--rule);
  background: var(--panel);
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 800px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
}

.footer-brand {
  font-size: var(--text-lg);
  font-weight: var(--fw-heavy);
  letter-spacing: -0.02em;
}

.footer-about {
  max-width: 26rem;
  margin-top: var(--space-2);
  color: var(--muted);
}

.footer-people {
  display: grid;
  gap: var(--space-3);
}

.footer-people dt {
  color: var(--muted);
  font-size: var(--text-sm);
}

.footer-people dd {
  font-weight: var(--fw-medium);
}

.footer-links {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  list-style: none;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
}

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--text-sm);
}

/* 15. Utilities and motion preferences */
[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 16. Print (uses the light tokens, see section 2) */
@media print {
  .site-header,
  .skip-link,
  .route-toggle,
  .copy-button,
  .hero::before {
    display: none;
  }

  .button-primary {
    border-color: currentColor;
    background: none;
    color: var(--text);
  }

  .section {
    padding-block: 1.5rem;
  }

  .route-card,
  .previous {
    box-shadow: none;
  }
}
