/* novarun.org — a sheet set.
   Three sheets bound left to right the way a drawing set is: a cover with
   the sheet index, then one sheet per product. The drawing chrome — the
   frame, the annotation lettering, the title block, the sheet number — is
   the only thing the three share. Everything inside a sheet belongs to
   that product's own brand: Novarun's Paper/Ink/Spark and Sora, then
   RouteStudy's black and Geist, then Drainage Study's True Blue,
   Helvetica and Plex Mono. Nothing is flattened to a house style, because
   a sheet set is exactly the thing that carries several authors' drawings
   without redrawing any of them. */

/* ============================ tokens ============================ */

:root {
  /* Novarun v1 brand — OKLCH from the guidelines, sRGB here. */
  --nv-paper: #FEF7F2;      /* oklch(0.98 0.01 60) */
  --nv-ink: #1A1512;        /* oklch(0.2 0.01 50)  */
  --nv-ink-soft: #655B56;
  --nv-ink-faint: #968D89;
  --nv-spark: #BD413F;      /* oklch(0.55 0.16 25) */
  --nv-spark-tint: #FACAC5;
  --nv-edge: #EBE3DD;

  /* RouteStudy brand — from the app's globals.css. */
  --rs-black: #0e0e10;
  --rs-white: #f5f5f6;
  --rs-green: #4cc98a;
  --rs-yellow: #d7ba4b;
  --rs-red: #c15b4a;
  --rs-n400: #a3a3a3;
  --rs-n500: #737373;
  --rs-n800: #262626;

  /* Drainage Study brand — from its v1.0 guidelines. */
  --ds-blue: #3D63F5;
  --ds-ink: #101B2E;
  --ds-paper: #F6F8FB;
  --ds-slate: #48597A;
  --ds-rule: #DCE2EB;
  --ds-mono-label: #5F6E8A;
  --ds-fill: #DDE4FD;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Station positions on the cover's alignment. Every tick, label, node
     and leader hangs off these two, so a station moves in one place. */
  --sta-1: 30%;
  --sta-2: 74%;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--nv-paper);
  color: var(--nv-ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ========================= the sheet set ========================= */

.set {
  display: flex;
  height: 100dvh;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.set::-webkit-scrollbar { display: none; }

.sheet {
  flex: 0 0 100%;
  width: 100%;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  padding: clamp(12px, 1.6vw, 24px);
}

/* The paper itself: a bordered field that grows if a sheet needs more
   room than the viewport, exactly as a drawing sheet would. */
.paper {
  min-height: calc(100dvh - 2 * clamp(12px, 1.6vw, 24px));
  border: 1px solid var(--frame);
  border-radius: 3px;
  padding: clamp(22px, 3vw, 46px) clamp(26px, 3.6vw, 52px);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Per-sheet themes. Each sets the frame colour, the ground, the ink and
   the typeface for everything inside it. */

.sheet--cover {
  --frame: var(--nv-edge);
  --ground: var(--nv-paper);
  --ink: var(--nv-ink);
  --ink-soft: var(--nv-ink-soft);
  --ink-faint: var(--nv-ink-faint);
  --accent: var(--nv-spark);
  background-color: var(--nv-paper);
  background-image:
    linear-gradient(rgba(26, 21, 18, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 21, 18, 0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--nv-ink);
}

.sheet--routestudy {
  --frame: var(--rs-n800);
  --ground: var(--rs-black);
  --ink: var(--rs-white);
  --ink-soft: var(--rs-n400);
  --ink-faint: var(--rs-n500);
  --accent: var(--rs-green);
  background-color: var(--rs-black);
  background-image:
    linear-gradient(rgba(245, 245, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 245, 246, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  color: var(--rs-white);
  font-family: "Geist", "Inter", Helvetica, Arial, sans-serif;
}

.sheet--drainage {
  --frame: var(--ds-rule);
  --ground: var(--ds-paper);
  --ink: var(--ds-ink);
  --ink-soft: var(--ds-slate);
  --ink-faint: var(--ds-mono-label);
  --accent: var(--ds-blue);
  background-color: var(--ds-paper);
  background-image: radial-gradient(rgba(61, 99, 245, 0.13) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ds-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ====================== shared drawing chrome ====================== */

/* The small tracked lettering a sheet is annotated in. On the Drainage
   Study sheet its own brand says annotation is mono, so it swaps. */
.annot {
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 0.145em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.sheet--drainage .annot {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
}

.titleblock {
  margin: clamp(16px, 2.6vh, 34px) 0 0 auto;
  border: 1px solid var(--frame);
  border-radius: 8px;
  background: var(--ground);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, auto));
  overflow: hidden;
}

.field { padding: 8px 17px; border-right: 1px solid var(--frame); }
.field:last-child { border-right: 0; }
.field dd { margin-top: 3px; font-size: 13px; font-weight: 500; white-space: nowrap; }

.rights {
  margin-top: 12px;
  text-align: right;
  font-size: 12px;
  color: var(--ink-faint);
}

/* ============================ cover ============================ */

.masthead { display: flex; align-items: flex-end; gap: 11px; }
.masthead img { width: auto; height: 31px; display: block; }

.wordmark {
  font-family: "Sora", "Inter", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: 25px;
  letter-spacing: -0.018em;
  line-height: 1;
  padding-bottom: 1px;
}

.statement { padding-top: clamp(40px, 7vh, 86px); }

.sheet--cover h1 {
  font-family: "Sora", "Inter", Helvetica, Arial, sans-serif;
  font-weight: 600;
  font-size: clamp(1.95rem, 4.5vw, 2.95rem);
  line-height: 1.14;
  letter-spacing: -0.03em;
  max-width: 19ch;
  text-wrap: balance;
}

.statement p {
  margin-top: 20px;
  max-width: 54ch;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-wrap: pretty;
}

/* the alignment, and the index hung off it */

.alignment { position: relative; margin-top: clamp(46px, 7vh, 92px); }

.rule { position: relative; height: 1px; }

.seg { position: absolute; top: 0; height: 1px; transform-origin: left center; }

.seg-built {
  left: 0;
  right: calc(100% - var(--sta-1));
  background: var(--ink);
  transform: scaleX(0);
}

.seg-future {
  left: var(--sta-1);
  right: 0;
  background: repeating-linear-gradient(to right, #CFC5BE 0 7px, transparent 7px 15px);
  transform: scaleX(0);
}

.tick { position: absolute; left: 0; top: -7px; width: 1px; height: 15px; background: var(--ink); }

.node {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  transform: scale(0);
}

.node-1 { left: var(--sta-1); background: var(--nv-spark); }
.node-2 { left: var(--sta-2); background: var(--nv-paper); border: 2px solid var(--nv-spark); }

.sta { position: absolute; top: -30px; transform: translateX(-50%); opacity: 0; }
.sta-start { left: 0; transform: none; }
.sta-1 { left: var(--sta-1); }
.sta-2 { left: var(--sta-2); }

.leader {
  position: absolute;
  top: 1px;
  width: 1px;
  height: 34px;
  background: #CFC5BE;
  transform-origin: top center;
  transform: scaleY(0);
}

.leader-1 { left: var(--sta-1); }
.leader-2 { left: var(--sta-2); }

/* A cover sheet's index is a table of what follows — here each row is
   the way to that sheet. */
.index { margin-top: 34px; border-top: 1px solid var(--frame); }

.index-row {
  display: grid;
  grid-template-columns: 176px 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  width: 100%;
  padding: 16px 4px;
  border-bottom: 1px solid var(--frame);
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0;
  transition: background 200ms var(--ease), padding 200ms var(--ease);
}

.index-row:hover, .index-row:focus-visible { background: rgba(189, 65, 63, 0.045); }
.index-row:focus-visible { outline: 2px solid var(--nv-spark); outline-offset: -2px; }

.chip { width: 100%; height: auto; display: block; border-radius: 7px; }

.index-row h2 {
  font-family: "Sora", "Inter", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.index-row p { margin-top: 3px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.index-no { text-align: right; }
.index-no .sheetno { font-size: 13px; font-weight: 500; margin-top: 3px; }
.index-status { color: var(--nv-spark); }

/* The keyword heading each product sheet leads with. Set in the drawing
   chrome's annotation lettering so it reads as a sheet label, not as a
   second headline competing with the hero line under it. */
.eyebrow {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  line-height: 1.55;
  margin-bottom: 10px;
}

/* ========================== RouteStudy ========================== */

.sheet--routestudy .lockup { height: 36px; width: auto; display: block; align-self: flex-start; }

.rs-hero { padding-top: clamp(8px, 1.6vh, 20px); }

.sheet--routestudy .hero-line {
  font-size: clamp(1.65rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.022em;
  max-width: 20ch;
  text-wrap: balance;
}

.rs-sub {
  margin-top: 12px;
  max-width: 52ch;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

/* the corridor drawing */
.rs-draw { margin-top: clamp(12px, 2.2vh, 24px); width: 100%; height: auto; overflow: visible; }
.rs-draw .route {
  fill: none;
  stroke: url(#rsgrad);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.rs-draw .xing { stroke: var(--rs-n500); stroke-width: 1.5; }
.rs-draw .endpt { stroke-width: 3.5; fill: var(--rs-black); }

/* The one annotation that is a sentence rather than a label, so it is
   the one that may wrap. */
.rs-caption { margin-top: 10px; white-space: normal; }

.rs-grid {
  margin-top: clamp(10px, 1.7vh, 18px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.rs-card {
  border: 1px solid var(--rs-n800);
  border-radius: 11px;
  padding: 14px 14px 15px;
  opacity: 0;
}

.rs-card h3 { font-size: 14px; font-weight: 600; }
.rs-card p { margin-top: 5px; font-size: 12.75px; line-height: 1.45; color: var(--ink-soft); }

.rs-meta { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: baseline; }
.rs-meta p { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); max-width: 86ch; }

.rs-price { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 10px 26px; }
.rs-price div { font-size: 13px; color: var(--ink-soft); }
.rs-price b { color: var(--ink); font-weight: 600; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: clamp(14px, 2.2vh, 24px);
  align-self: flex-start;
  padding: 12px 20px;
  border-radius: 9px;
  background: var(--rs-white);
  color: var(--rs-black);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

.cta:hover, .cta:focus-visible { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.cta:focus-visible { outline: 2px solid var(--rs-green); outline-offset: 3px; }
.cta span { font-weight: 400; opacity: 0.6; }

/* ======================== Drainage Study ======================== */

.sheet--drainage .lockup { height: 34px; width: auto; display: block; align-self: flex-start; border-radius: 7px; }

.ds-body {
  padding-top: clamp(8px, 1.6vh, 22px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}

.sheet--drainage .hero-line {
  font-size: clamp(1.9rem, 4.4vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.026em;
  max-width: 14ch;
}

.ds-sub { margin-top: 13px; max-width: 46ch; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }

.ds-list { margin-top: 18px; border-top: 1px solid var(--ds-rule); }
.ds-list div { padding: 9px 0; border-bottom: 1px solid var(--ds-rule); display: flex; gap: 14px; align-items: baseline; opacity: 0; }
.ds-list b { font-weight: 500; font-size: 14.5px; min-width: 10.5rem; }
.ds-list span { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

/* the catchment: the mark doubles as the product's drawing surface, so
   what is drawn here is a delineated area, never the logo itself */
.ds-figure { position: relative; }
.ds-draw { width: 100%; height: auto; display: block; overflow: visible; }
.ds-draw .catch-fill { fill: var(--ds-fill); opacity: 0; }
.ds-draw .catch-line {
  fill: none;
  stroke: var(--ds-blue);
  stroke-width: 7;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.ds-draw .poi { fill: var(--ds-blue); }
.ds-draw .poi-ring { fill: none; stroke: var(--ds-blue); stroke-width: 2.5; opacity: 0.45; }

.ds-readout { margin-top: 14px; opacity: 0; }
.ds-readout .num {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}
.ds-readout .unit {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--ink-faint);
  margin-top: 8px;
  display: block;
}
.ds-readout .says { margin-top: 12px; font-size: 15px; line-height: 1.55; max-width: 34ch; }

.ds-status {
  margin-top: clamp(18px, 3vh, 30px);
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px dashed var(--ds-blue);
  border-radius: 9px;
  color: var(--ds-blue);
}

.ds-status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ds-blue); }

/* ========================== navigation ========================== */

.nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--nav-edge, #EBE3DD);
  border-radius: 999px;
  background: var(--nav-bg, rgba(254, 247, 242, 0.86));
  backdrop-filter: blur(7px);
  color: var(--nav-ink, #1A1512);
  cursor: pointer;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), background 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease);
}

.nav:hover { transform: translateY(-50%) scale(1.04); }
.nav:focus-visible { outline: 2px solid var(--nav-accent, #BD413F); outline-offset: 3px; }
.nav[hidden] { display: none; }
.nav-next { right: 6px; }
.nav-prev { left: 6px; }
.nav svg { display: block; }
/* The tab stays a tab. A labelled pill is wide enough to sit on the
   content at every width, and the sheet index plus the title block
   already say which sheet is which. */
.nav .label { display: none; }

/* the nav re-skins itself to whatever sheet is under it */
body[data-sheet="routestudy"] { --nav-edge: #262626; --nav-bg: rgba(14, 14, 16, 0.82); --nav-ink: #f5f5f6; --nav-accent: #4cc98a; }
body[data-sheet="drainage"] { --nav-edge: #DCE2EB; --nav-bg: rgba(246, 248, 251, 0.86); --nav-ink: #101B2E; --nav-accent: #3D63F5; }

.hint {
  position: fixed;
  left: 50%;
  bottom: clamp(30px, 4.5vh, 50px);
  transform: translateX(-50%);
  z-index: 20;
  font-size: 10.5px;
  letter-spacing: 0.145em;
  text-transform: uppercase;
  color: var(--nav-ink, #1A1512);
  opacity: 0.42;
  transition: opacity 400ms var(--ease), color 300ms var(--ease);
  pointer-events: none;
}

.hint[data-gone="1"] { opacity: 0; }

/* ====================== the drawn-in sequence ======================
   Each sheet draws itself once, when it first fills the screen. */

.is-live .seg-built { animation: draw 520ms var(--ease) both; }
.is-live .seg-future { animation: draw 520ms var(--ease) 430ms both; }
.is-live .node-1 { animation: pop 280ms var(--ease) 380ms both; }
.is-live .node-2 { animation: pop 280ms var(--ease) 700ms both; }
.is-live .sta-start, .is-live .sta-1 { animation: fade 340ms ease 420ms both; }
.is-live .sta-2 { animation: fade 340ms ease 740ms both; }
.is-live .leader-1 { animation: drop 260ms var(--ease) 540ms both; }
.is-live .leader-2 { animation: drop 260ms var(--ease) 800ms both; }
.is-live .index-row { animation: rise 420ms var(--ease) both; }
.is-live .index-row:nth-child(1) { animation-delay: 620ms; }
.is-live .index-row:nth-child(2) { animation-delay: 720ms; }
.is-live .index-row:nth-child(3) { animation-delay: 820ms; }

.is-live .route { animation: trace 1500ms var(--ease) 180ms both; }
.is-live .rs-card { animation: rise 420ms var(--ease) both; }
.is-live .rs-card:nth-child(1) { animation-delay: 700ms; }
.is-live .rs-card:nth-child(2) { animation-delay: 790ms; }
.is-live .rs-card:nth-child(3) { animation-delay: 880ms; }
.is-live .rs-card:nth-child(4) { animation-delay: 970ms; }
.is-live .rs-card:nth-child(5) { animation-delay: 1060ms; }

.is-live .catch-line { animation: trace 1400ms var(--ease) 200ms both; }
.is-live .catch-fill { animation: fade 600ms ease 1450ms both; }
.is-live .ds-readout { animation: rise 460ms var(--ease) 1700ms both; }
.is-live .ds-list div { animation: rise 400ms var(--ease) both; }
.is-live .ds-list div:nth-child(1) { animation-delay: 620ms; }
.is-live .ds-list div:nth-child(2) { animation-delay: 700ms; }
.is-live .ds-list div:nth-child(3) { animation-delay: 780ms; }
.is-live .ds-list div:nth-child(4) { animation-delay: 860ms; }
.is-live .ds-list div:nth-child(5) { animation-delay: 940ms; }

@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .set { scroll-behavior: auto; }
  .seg, .node, .sta, .leader, .index-row, .rs-card, .ds-list div, .ds-readout { animation: none !important; transform: none; opacity: 1; }
  .route, .catch-line { animation: none !important; stroke-dashoffset: 0; }
  .catch-fill { animation: none !important; opacity: 1; }
  .cta:hover, .nav:hover { transform: none; }
  .nav:hover { transform: translateY(-50%); }
}

/* ========================= narrow screens ========================= */

@media (max-width: 860px) {
  .rs-grid { grid-template-columns: repeat(2, 1fr); }
  .rs-grid > :last-child:nth-child(odd) { grid-column: span 2; }
  .ds-body { grid-template-columns: 1fr; gap: 26px; }
  .titleblock { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field:nth-child(2) { border-right: 0; }
  .field:nth-child(1), .field:nth-child(2) { border-bottom: 1px solid var(--frame); }
}

@media (max-width: 620px) {
  .paper { padding: 20px 18px; }
  :root { --sta-1: 46%; --sta-2: 78%; }
  .sta-2, .leader-2 { display: none; }
  .rs-grid { grid-template-columns: 1fr; gap: 10px; }
  .rs-card p { font-size: 12.5px; }
  .index-row { grid-template-columns: 132px 1fr; gap: 14px; }
  .index-no { grid-column: 2; text-align: left; }
  .titleblock { grid-template-columns: 1fr; }
  .field { border-right: 0; border-bottom: 1px solid var(--frame); }
  .field:last-child { border-bottom: 0; }
  .rights { text-align: left; }
}

/* On a phone the tabs would sit on the text, and swiping is the gesture
   anyway — drop them to the foot of the sheet. */
@media (max-width: 620px) {
  .nav { top: auto; bottom: 12px; transform: none; padding: 10px; }
  .nav:hover { transform: none; }
  .nav-next { right: 12px; }
  .nav-prev { left: 12px; }
  .hint { bottom: 22px; }
}
