/* CyberRoute one-page site.
   Layout idea: full-height screens that snap one at a time. Each screen opens with an
   app-style bar (title left, screen number right) over a hairline, and lists are rows
   separated by hairlines. No scripts, no external files. */

:root {
  --paper: #FFFFFF;
  --ink: #111111;
  --graphite: #666666;
  --hairline: #E5E5E5;
  /* The device's own interface font: San Francisco on Apple, Segoe UI on Windows, the system font on Android. */
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --font-body: var(--font-display);
  --gutter: clamp(1.25rem, 5.5vw, 3rem);
  --col-gap: clamp(2.5rem, 5vw, 5rem);
  --measure: 36rem;
  --radius: 8px;
  --total: "17";            /* number of screens on a phone; the desktop value is set below */
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-snap-type: y mandatory;
  /* No smooth scrolling: links from the other language land on their screen at once instead of
     sliding past every screen above it. */
}

/* iPhone and iPad: follow the text size chosen in the system settings.
   (Android Chrome does the same through the text-scale tag in the page head.) */
@supports (font: -apple-system-body) and (-webkit-touch-callout: none) {
  html { font: -apple-system-body; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  counter-reset: screen;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
b { font-weight: 600; }
i, em { font-style: normal; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Screens (phone first: every pane is one screen) ---------- */

.pane {
  position: relative;
  min-height: 100vh;
  min-height: 100lvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  counter-increment: screen;
}

.pane__in {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: 0 var(--gutter) 1.25rem;
}

/* ---------- Bar: title left; screen number and language switch right ---------- */

.bar {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.125rem 0 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.bar__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.bar__sub {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.bar__status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.3;
}

.bar__status span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--graphite);
}

.idx {
  flex: none;
  margin-left: auto;
  color: var(--graphite);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.idx::before { content: counter(screen, decimal-leading-zero) " / " var(--total); }

/* Language switch: opens the same screen in the other language. */
.lang {
  position: relative;
  flex: none;
  font-size: 0.8125rem;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}

/* A bigger tap area than the word itself, without moving anything. */
.lang::after {
  content: "";
  position: absolute;
  inset: -0.75rem -0.625rem;
}

.lang:hover { text-decoration-thickness: 2px; }

/* ---------- Content area ---------- */

.fill {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  gap: clamp(0.875rem, 2.4svh, 1.5rem);
  padding-block: 1.25rem;
  padding-block: clamp(1rem, 3svh, 2rem);
}

.lead {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 1.15rem + 1.15vw, 2rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -0.022em;
  max-width: 22em;
  text-wrap: balance;
}

.text {
  max-width: var(--measure);
  text-wrap: pretty;
}

.stress {
  max-width: var(--measure);
  font-size: 1.125em;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.note {
  max-width: var(--measure);
  font-size: 0.9375rem;
  color: var(--graphite);
}

.muted { color: var(--graphite); }

/* ---------- Hero ---------- */

.fill--hero { container-type: inline-size; }

.name {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 13vw, 4.25rem);
  font-size: clamp(2.75rem, 17.5cqi, 5.25rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.name__for {
  display: block;
  margin-top: 0.85rem;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--graphite);
}

/* The route line: start, waypoints, destination. Used once in the hero and in the before/now strips. */
.route {
  display: flex;
  align-items: center;
  width: 100%;
}

.route > i { display: block; flex: none; }
.route > .seg { flex: 1 1 auto; height: 0; border-top: 2px solid var(--ink); }
.route > .seg--todo { border-top: 2px dashed var(--graphite); }
.route > .start { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink); }
.route > .end { width: 0.5rem; height: 0.5rem; background: var(--ink); }
.route > .wp {
  position: relative;
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.route > .wp em {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 0.3rem;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--graphite);
}

.route--hero { max-width: 26rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--hairline);
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 0.125rem;
  padding: 0.75rem 0.75rem 0.75rem 0;
}

.stat + .stat {
  padding-left: 0.75rem;
  border-left: 1px solid var(--hairline);
}

.stat dd {
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat dt {
  font-size: 0.8125rem;
  line-height: 1.3;
  color: var(--graphite);
}

.cue {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
  color: var(--graphite);
  text-decoration: none;
}

.cue::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
}

/* ---------- Demo video ---------- */

.media {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.media__frame {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  text-align: center;
}

.media__frame p { display: grid; gap: 0.125rem; }
.media__frame p span { font-size: 0.875rem; color: var(--graphite); }

.media__frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--ink);
}

.media figcaption {
  max-width: var(--measure);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* ---------- Route figures ---------- */

.fig {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.fig svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 26rem;
  max-height: min(54svh, 26rem);
}

.g-grid { fill: none; stroke: var(--hairline); stroke-width: 1; }
.g-built { fill: none; stroke: var(--graphite); stroke-width: 3; stroke-dasharray: 7 6; stroke-linejoin: round; }
.g-jam { fill: none; stroke: var(--graphite); stroke-width: 9; }
.g-route { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.g-node { fill: var(--ink); }
.g-wp { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; }
.g-label { fill: var(--graphite); font-size: 11.5px; }
.g-num { fill: var(--ink); font-size: 10.5px; font-weight: 700; text-anchor: middle; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.5rem;
  font-size: 0.875rem;
  color: var(--graphite);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.key { display: inline-block; flex: none; width: 1.75rem; height: 0; border-top: 3px solid var(--ink); }
.key--built { border-top: 3px dashed var(--graphite); }
.key--wp { width: 0.8125rem; height: 0.8125rem; border: 2.5px solid var(--ink); border-radius: 50%; }

/* ---------- Numbered steps ---------- */

.steps {
  counter-reset: step;
  border-top: 1px solid var(--hairline);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

.steps li::before {
  content: counter(step);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Before / now strips ---------- */

.strips { border-top: 1px solid var(--hairline); }

.strip {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: start;
  column-gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--hairline);
}

.strip__k {
  font-size: 0.8125rem;
  line-height: 0.75rem;
  font-weight: 600;
}

.strip--before { padding-bottom: 1.75rem; }

/* ---------- Rows with a state underneath ---------- */

.rows { border-top: 1px solid var(--hairline); }

.row {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--hairline);
}

.row__main { text-wrap: pretty; }

.row__meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--graphite);
}

.row__meta b { color: var(--ink); }

.st {
  display: inline-block;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}

.st--on { background: var(--ink); }
.st--later { border-color: var(--graphite); border-style: dotted; }

/* ---------- Facts and plain lists ---------- */

.facts { display: grid; gap: 0.75rem; }
.facts dt { font-size: 0.8125rem; color: var(--graphite); }
.facts dd { max-width: var(--measure); font-size: 0.9375rem; text-wrap: pretty; }

.group__k {
  padding-bottom: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--graphite);
}

.list { border-top: 1px solid var(--hairline); }

.list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.list li span { color: var(--graphite); }

/* ---------- Tap-to-open rows ---------- */

.acc-list { border-top: 1px solid var(--hairline); }
.acc { border-bottom: 1px solid var(--hairline); }

.acc > summary {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 0.15rem;
  padding: 0.8rem 2.25rem 0.8rem 0;
  list-style: none;
  cursor: pointer;
}

.acc > summary::-webkit-details-marker { display: none; }

.acc__t { font-weight: 600; letter-spacing: -0.005em; }

.acc__s {
  font-size: 0.9375rem;
  color: var(--graphite);
  text-wrap: pretty;
}

.acc__i {
  position: absolute;
  top: 1rem;
  right: 0.125rem;
  width: 1rem;
  height: 1rem;
}

/* The plus is drawn with borders so both strokes keep the same thickness on every screen. */
.acc__i::before,
.acc__i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease;
}

.acc__i::before { width: 0.875rem; height: 0; border-top: 1.5px solid var(--ink); }
.acc__i::after { width: 0; height: 0.875rem; border-left: 1.5px solid var(--ink); }
.acc[open] .acc__i::after { transform: translate(-50%, -50%) scaleY(0); }

.acc__body {
  display: grid;
  gap: 0.2rem;
  padding: 0 2.25rem 0.95rem 0;
}

.acc__k { font-size: 0.8125rem; color: var(--graphite); }
.acc__v { max-width: var(--measure); font-size: 0.9375rem; text-wrap: pretty; }

@media (hover: hover) {
  .acc > summary:hover .acc__t { text-decoration: underline; text-underline-offset: 0.2em; }
}

/* ---------- What's next ---------- */

.next {
  counter-reset: nx;
  border-top: 1px solid var(--hairline);
}

.next li {
  counter-increment: nx;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--hairline);
}

.next li::before {
  content: counter(nx);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.next p { max-width: var(--measure); text-wrap: pretty; }

/* ---------- Contact ---------- */

.contact { display: grid; gap: 1.25rem; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.btn:focus-visible { outline-offset: 4px; border-radius: var(--radius); }

.fine {
  max-width: var(--measure);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--graphite);
  text-wrap: pretty;
}

.toplink {
  align-self: flex-start;
  font-size: 0.8125rem;
  color: var(--graphite);
  text-underline-offset: 0.2em;
}

/* ---------- Not-found page ---------- */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  max-width: 40rem;
  margin-inline: auto;
  padding: var(--gutter);
}

.lost a { text-underline-offset: 0.2em; }

/* ---------- Short phone screens: tighter spacing so one screen still holds its content ---------- */

@media (max-height: 40rem) and (max-width: 59.9375rem) {
  .pane__in { padding-bottom: 0.75rem; }
  .bar { padding: 0.875rem 0 0.625rem; }
  .fill { gap: 0.75rem; padding-block: 0.75rem; }
  .row { padding: 0.5rem 0; }
  .list li { padding: 0.35rem 0; }
  .steps li, .next li { padding: 0.55rem 0; }
  .acc > summary { padding-block: 0.6rem; }
  .acc__i { top: 0.8rem; }
  .cue { padding: 0.25rem 0; }
}

/* ---------- Desktop: one screen holds two columns ---------- */

@media (min-width: 60rem) {
  :root { --total: "10"; }

  body { font-size: 1.0625rem; }

  .screen {
    counter-increment: screen;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    min-height: 100vh;
    min-height: 100lvh;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-rows: auto auto 1fr;
    column-gap: var(--col-gap);
    width: 100%;
    max-width: 76rem;
    margin-inline: auto;
    padding: 0 var(--gutter) 1.5rem;
  }

  /* One hairline under the bar, across both columns. */
  .screen::before {
    content: "";
    grid-column: 1 / -1;
    grid-row: 2;
    border-top: 1px solid var(--hairline);
  }

  .pane,
  .pane__in { display: contents; }

  .pane { counter-increment: none; }

  .bar {
    grid-row: 1;
    grid-column: 1 / -1;
    align-self: baseline;
    padding: 1.75rem 0 1rem;
    border-bottom: 0;
  }

  .fill {
    grid-row: 3;
    grid-column: 1 / -1;
    align-self: center;
    gap: clamp(1rem, 2.6svh, 1.75rem);
    padding-block: clamp(1.5rem, 4svh, 3rem);
  }

  /* Two panes side by side. */
  .screen--split > .pane:first-child .bar,
  .screen--split > .pane:first-child .fill { grid-column: 1; }

  .screen--split > .pane:last-child .bar,
  .screen--split > .pane:last-child .fill { grid-column: 2; }

  .screen--split > .pane:first-child .idx,
  .screen--split > .pane:first-child .lang { display: none; }

  /* Two panes stacked into one screen: the intro sits right above the list. */
  .screen--stack { grid-template-rows: auto auto 1fr auto auto 1fr; }
  .screen--stack > .pane:last-child .bar { display: none; }
  .screen--stack > .pane:first-child .fill { grid-row: 4; padding-bottom: 0; }
  .screen--stack > .pane:last-child .fill { grid-row: 5; padding-top: clamp(1rem, 2.6svh, 1.75rem); }
  .screen--stack .lead { font-size: 1.375rem; line-height: 1.3; max-width: 34em; }

  .cue { display: none; }

  /* The figures are drawn larger here, so their labels are set smaller to end up about text size. */
  .g-label { font-size: 9.5px; }

  /* Rows that line up with the two columns: name left, detail right. */
  .acc > summary,
  .next li {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--col-gap);
  }

  .acc > summary { padding: 1.1rem 0; }
  .acc__s { padding-right: 2.25rem; }
  .acc__i { top: 1.35rem; }

  .acc__body {
    margin-left: calc((100% - var(--col-gap)) * 5 / 12 + var(--col-gap));
    padding-bottom: 1.25rem;
  }

  .next li { padding: 1.1rem 0; }
  .next li::before { content: counter(nx) "  " attr(data-k); white-space: pre; }
  .next b { display: none; }
  .next p::first-letter { text-transform: uppercase; }

  .contact {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--col-gap);
    align-items: center;
  }
}

/* ---------- Korean page ---------- */

html:lang(ko) {
  /* Same system fonts, with each system's Korean font named so Hangul never falls back to something odd. */
  --font-display: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", system-ui, Roboto, "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
  word-break: keep-all;          /* lines wrap between words, never inside a Korean word */
  overflow-wrap: break-word;
}

html:lang(ko) body { line-height: 1.6; }
html:lang(ko) .bar__title { line-height: 1.3; }
html:lang(ko) .lead { line-height: 1.32; }
html:lang(ko) .stress { line-height: 1.5; }

/* Very short windows and phones held sideways: let the page scroll freely. */
@media (max-height: 30rem) {
  html { scroll-snap-type: y proximity; }
}

@media (prefers-reduced-motion: reduce) {
  .acc__i::before,
  .acc__i::after { transition: none; }
}

@media print {
  html { scroll-snap-type: none; }
  .pane, .pane__in, .screen { min-height: 0; }
  .cue, .toplink, .idx, .lang { display: none; }
  .pane { break-inside: avoid; }
}
