/* gloki.app — the line diagram. One file, no build step.
   World: Beck-style transit diagram on white; brand blue is the Solve line.
   Tokens first; everything below reads them. */

@font-face {
  font-family: 'Hammersmith One';
  src: url('assets/fonts/HammersmithOne.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face { font-family: 'Cabin'; src: url('assets/fonts/Cabin-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cabin'; src: url('assets/fonts/Cabin-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Cabin'; src: url('assets/fonts/Cabin-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --paper: #ffffff;
  --wash: #eff6ff;          /* zone band */
  --wash-2: #e0ecff;
  --ink: #111827;           /* rules, ticks, nameplates */
  --ink-soft: #374151;      /* body text, 10.3:1 */
  --ink-muted: #4b5563;     /* captions, 7.6:1 */
  --solve: #3b82f6;         /* brand blue: strokes and fills only (3.7:1 is fine for a 6px line, not for text) */
  --solve-text: #1d4ed8;    /* 6.7:1 on white */
  --build: #0f766e;         /* 5.5:1 on white */
  --build-text: #0f766e;
  --contribute: #d97706;    /* 3.1:1 for the stroke */
  --contribute-text: #b45309; /* 5.0:1 on white, 4.6:1 on the wash */
  --status-good: #047857;
  --status-plan: #b45309;
  --status-later: #4b5563;
  --focus: #b45309;
  --display: 'Hammersmith One', 'Gill Sans', 'Trebuchet MS', sans-serif;
  --text: 'Cabin', 'Gill Sans', 'Segoe UI', sans-serif;
  --measure: 46ch;
  --line-w: 10;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--ink) var(--wash); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.55;
  caret-color: var(--solve-text);
  overflow-x: hidden;
}
::selection { background: var(--wash-2); color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1em; max-width: var(--measure); text-wrap: pretty; }
li, td, figcaption { text-wrap: pretty; }
a { color: var(--solve-text); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; color: var(--ink); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }
h1 { font-size: clamp(1.9rem, 1.1rem + 3.4vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 1rem + 2vw, 2.4rem); }
h3 { font-size: 1.25rem; }

.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: 0.6rem 1rem; z-index: 10; font-family: var(--display); }
.skip:focus { top: 1rem; }

/* Nameplate: the diagram's label grammar, used for every control label on the page. */
.plate {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.45em 0.7em 0.4em;
  border-radius: 2px;
}
.plate--solve { background: var(--solve-text); }
.plate--build { background: var(--build); }
.plate--contribute { background: var(--contribute-text); }

.wrap { width: min(100%, 74rem); padding-inline: 1rem; margin-inline: auto; }

/* Header: the map's title plate */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 3px solid var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.35rem; }
.brand img { width: 36px; height: 36px; }
.brand .short { display: none; }
.nav { display: flex; gap: 0.25rem 1.1rem; flex-wrap: wrap; font-family: var(--display); font-size: 0.95rem; }
.nav a { color: var(--ink); text-decoration: none; padding: 0.55rem 0.1rem; display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; }
.nav a::before { content: ''; width: 18px; height: 6px; border-radius: 3px; background: var(--ink); }
.nav .nav--solve::before { background: var(--solve); }
.nav .nav--build::before { background: var(--build); }
.nav .nav--contribute::before { background: repeating-linear-gradient(90deg, var(--contribute) 0 4px, transparent 4px 7px); }
.nav a:hover { text-decoration: underline; text-underline-offset: 0.3em; }
.nav .short { display: none; }

/* Hero: the diagram is the page's first viewport */
.hero { position: relative; padding-block: 1.25rem 2.5rem; }
.hero .wrap { display: grid; gap: 1rem; }
.kicker { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-family: var(--display); font-size: 1.2rem; color: var(--ink); }
.kicker img { width: 28px; height: 28px; border-radius: 7px; }
.kicker .plate { margin-left: 0.3rem; }
.hook { max-width: 22ch; }
.hook em { font-style: normal; color: var(--solve-text); }
.lede { font-size: 1.15rem; max-width: 46ch; color: var(--ink-soft); }
.lede strong { font-weight: 600; color: var(--ink); }
.diagram { position: relative; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagram--mobile { display: none; }
.diagram text { font-family: var(--display); fill: var(--ink); }
.diagram .label { font-size: 15px; }
.diagram .terminal { font-size: 18px; letter-spacing: 0.04em; text-transform: uppercase; fill: var(--paper); }
.diagram .small { font-family: var(--text); font-size: 13.5px; fill: var(--ink-muted); }
.line { fill: none; stroke-width: var(--line-w); stroke-linecap: round; stroke-linejoin: round; }
.line--solve { stroke: var(--solve); }
.line--build { stroke: var(--build); }
.line--contribute { stroke: var(--contribute); --dash: 0.03 0.022; stroke-dasharray: var(--dash); }
.diagram--mobile .line--contribute { --dash: 0.12 0.09; }
.line--trunk { stroke: var(--solve); }
.station { fill: var(--paper); stroke: var(--ink); stroke-width: 4; }
.station--lit { fill: var(--ink); }
.tick { stroke: var(--ink); stroke-width: 4; stroke-linecap: round; }
.plate-rect { fill: var(--ink); }
.plate-rect--solve { fill: var(--solve-text); }
.plate-rect--build { fill: var(--build); }
.plate-rect--contribute { fill: var(--contribute-text); }

/* Draw-on: the one authored moment. pathLength="1" on each path makes the dash maths trivial. */
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.draw.d2 { animation-delay: 0.15s; }
.draw.d3 { animation-delay: 0.3s; }
.draw.d4 { animation-delay: 0.9s; }
.line--contribute.draw { stroke-dasharray: 1; animation-name: draw-dashed; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes draw-dashed { to { stroke-dashoffset: 0; stroke-dasharray: var(--dash); } }
.arrive { opacity: 0; animation: arrive 0.6s ease-out 1.1s forwards; }
@keyframes arrive { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw, .line--contribute.draw { animation: none; stroke-dashoffset: 0; stroke-dasharray: none; }
  .line--contribute.draw { stroke-dasharray: var(--dash); }
  .arrive { animation: none; opacity: 1; }
}

/* The interchange: a wide pill where the three lines meet, holding the form. */
.interchange {
  position: relative;
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 28px;
  padding: 1rem 1.25rem 0.9rem;
  box-shadow: 0 10px 24px -14px rgba(17, 24, 39, 0.45);
}
.interchange h2 { font-size: 1.1rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 0.5rem; }
.interchange h2 span { display: inline-block; background: var(--ink); color: var(--paper); padding: 0.35em 0.6em 0.3em; border-radius: 2px; }
.form { display: grid; gap: 0.6rem; }
.field { display: grid; gap: 0.3rem; }
.field label { font-family: var(--display); font-size: 0.95rem; color: var(--ink); }
.field input[type='email'] {
  font: inherit; font-size: 1.05rem; color: var(--ink);
  height: 48px; padding: 0 0.9rem;
  border: 2px solid var(--ink); border-radius: 8px; background: var(--paper);
}
.field input[type='email']::placeholder { color: var(--ink-muted); opacity: 1; }
.doors { display: grid; gap: 0.35rem; }
.doors legend { font-family: var(--display); font-size: 0.95rem; color: var(--ink); padding: 0; margin-bottom: 0.3rem; }
.door { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
.door input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.door .swatch { width: 26px; height: 8px; border-radius: 4px; background: var(--solve); flex: none; }
.door .swatch--build { background: var(--build); }
.door .swatch--contribute { background: repeating-linear-gradient(90deg, var(--contribute) 0 6px, transparent 6px 10px); }
.door small { color: var(--ink-muted); font-size: 0.9rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.3rem;
  background: var(--ink); color: var(--paper);
  font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.02em;
  border: 0; border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: transform 160ms ease-out, background-color 160ms ease-out;
}
a.button:not(.button--ghost), .button:not(.button--ghost):hover { color: var(--paper); }
.button:hover { background: var(--solve-text); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button--ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.button--ghost:hover { background: var(--wash); color: var(--ink); }
.fine { font-size: 0.9rem; color: var(--ink-muted); margin: 0; }
.fine a { color: var(--ink-muted); }

/* The waitlist form runs on Brevo. Its script toggles the sib-/entry__ classes; the look stays the site's own. */
.doors { border: 0; margin: 0; padding: 0; min-width: 0; }
.form > .button { justify-self: start; }
.entry__field { display: grid; }
.form .entry__error { display: none; margin: 0.25rem 0 0; font-family: var(--text); font-size: 0.9rem; color: var(--contribute-text); }
.entry_errored input[type='email'] { border-color: var(--contribute-text); }
.sib-captcha { min-height: 65px; }
.input--hidden { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.sib-form-message-panel { display: none; margin: 0 0 0.6rem; padding: 0.75rem 0.9rem; border: 2px solid var(--ink); border-radius: 8px; background: var(--wash); color: var(--ink); }
.sib-form-message-panel--active { display: block; }
.sib-form-message-panel__text { margin: 0; }
#error-message { border-color: var(--contribute-text); background: var(--paper); }
.sib-form-block__button .progress-indicator__icon { flex: none; animation: spin 0.9s linear infinite; }
.sib-form-block__button .sib-hide-loader-icon { display: none; }
.sib-form-block__button-disabled { cursor: progress; opacity: 0.75; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sib-form-block__button .progress-indicator__icon { animation: none; } }

/* Section rhythm: more space above a heading than below it */
section { padding-block: 3.5rem 2.5rem; }
section > .wrap > h2 { margin-bottom: 0.75rem; }
.sub { font-size: 1.1rem; max-width: 46ch; margin-bottom: 2rem; }

/* Stations: the journey as one vertical line */
.route { list-style: none; margin: 0; padding: 0; position: relative; }
.route::before { content: ''; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 10px; border-radius: 5px; background: var(--solve); }
.stop { position: relative; padding: 0 0 2.2rem 3.4rem; display: grid; gap: 0.35rem; }
.stop:last-child { padding-bottom: 0.5rem; }
.stop::before { content: ''; position: absolute; left: 6px; top: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 4px solid var(--ink); transition: background-color 300ms ease-out; }
.stop.lit::before { background: var(--ink); }
.stop h3 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.stop .n { font-family: var(--display); font-size: 0.8rem; color: var(--paper); background: var(--ink); border-radius: 2px; padding: 0.3em 0.5em 0.25em; letter-spacing: 0.06em; }
.stop p { margin: 0; }
.stop--proof { display: grid; grid-template-columns: minmax(0, var(--measure)) 220px; gap: 0.35rem 2rem; align-items: start; }
.termrow { display: none; }
.stop--proof .text { grid-column: 1; }
.stop--proof figure { grid-column: 2; grid-row: 1 / span 3; margin: 0.4rem 0 0; }
.stop--proof img { border: 3px solid var(--ink); border-radius: 12px; width: 220px; }
.stop--proof figcaption { font-size: 0.85rem; color: var(--ink-muted); margin-top: 0.4rem; }
.stop .honest { color: var(--ink-muted); font-size: 0.95rem; }

/* Lines: the three ways in, each a terminal */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.term { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 0.25rem 1.2rem; align-items: start; padding: 1.25rem 0 1.5rem; border-top: 3px solid var(--ink); }
.term:first-child { border-top: 0; }
.term .bar { height: 100%; min-height: 3.2rem; width: 10px; border-radius: 5px; margin-left: 10px; background: var(--solve); position: relative; }
.term .bar::before { content: ''; position: absolute; top: -4px; left: -9px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 4px solid var(--ink); }
.term--build .bar { background: var(--build); }
.term--contribute .bar { background: repeating-linear-gradient(180deg, var(--contribute) 0 14px, transparent 14px 24px); }
.term h3 { font-size: 1.6rem; display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.term--solve h3 { color: var(--solve-text); }
.term--build h3 { color: var(--build-text); }
.term--contribute h3 { color: var(--contribute-text); }
.term p { margin: 0.35rem 0 0.9rem; }
.term .who { font-weight: 600; color: var(--ink); }

/* Status board */
.board { border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; max-width: 56rem; }
.board table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.board th, .board td { text-align: left; padding: 0.8rem 1rem; border-top: 2px solid var(--ink); vertical-align: top; }
.board thead th { border-top: 0; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 400; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.8rem; }
.board tbody tr:nth-child(even) { background: var(--wash); }
.board td:first-child { font-weight: 500; color: var(--ink); max-width: 30ch; }
.board .why { max-width: 40ch; }
.board .st { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--display); font-size: 0.95rem; white-space: nowrap; }
.board .st::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.st--test { color: var(--status-good); }
.st--plan { color: var(--status-plan); }
.st--plan::before { background: transparent !important; border: 2.5px dashed currentColor; width: 7px; height: 7px; }
.st--later { color: var(--status-later); }
.board .why { color: var(--ink-muted); font-size: 0.95rem; }

/* Who: the Global Democracy Initiative */
.who-grid { display: grid; gap: 1rem 3rem; grid-template-columns: minmax(0, 1fr); }
.motto { margin: 0.6rem 0 1.2rem; }
.papers { font-size: 0.98rem; color: var(--ink-muted); }
.values { list-style: none; padding: 0; margin: 0 0 1.2em; max-width: var(--measure); display: grid; gap: 0.6rem; }
.values li { padding-left: 1.4rem; position: relative; }
.values li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 10px; height: 10px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); }
.values strong { color: var(--ink); font-weight: 600; }

/* Imprint and privacy: plain documents on the same paper */
.doc { padding-block: 2.5rem 3.5rem; }
.doc h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.8rem); margin-bottom: 1.2rem; }
.doc h2 { font-size: 1.35rem; margin: 2rem 0 0.6rem; }
.doc address { font-style: normal; margin: 0 0 1em; }
.doc ul { max-width: var(--measure); padding-left: 1.2rem; }
.doc li { margin-bottom: 0.4em; }
.doc .updated { color: var(--ink-muted); font-size: 0.95rem; }
.foot { border-top: 3px solid var(--ink); padding-block: 1.5rem 2.5rem; font-size: 0.95rem; color: var(--ink-muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; align-items: center; }
.foot a { color: var(--ink-muted); }

@media (min-width: 760px) {
  .hero { padding-block: 2rem 3.5rem; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto; }
  .diagram--mobile, .termrow { display: none; }
  .diagram--desktop { display: block; }
  .stage { position: relative; aspect-ratio: 1200 / 600; grid-column: 1; grid-row: 3; }
  .stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  /* The interchange sits in the same grid cell as the diagram, at the convergence point: pure CSS, works with script off. */
  .hero .interchange { grid-column: 1; grid-row: 3; align-self: start; justify-self: start; position: relative; z-index: 1; margin-left: 50%; margin-top: 4.5%; width: 31.5%; max-width: 30rem; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .form .row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .form .row .button { justify-self: start; }
  .who-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 1099.98px) {
  .brand .long { display: none; }
  .brand .short { display: inline; }
}
@media (max-width: 759.98px) {
  .diagram--desktop { display: none; }
  .diagram--mobile { display: block; margin-bottom: -0.5rem; }
  .termrow { display: flex; gap: 0.4rem; justify-content: space-between; margin: 0.5rem 0 0; }
  .termrow .plate { font-size: 0.7rem; }
  .top { flex-wrap: wrap; padding-block: 0.7rem; }
  .nav { width: 100%; justify-content: space-between; gap: 0.2rem; }
  .nav .long { display: none; }
  .nav .short { display: inline; }
  .nav a { min-height: 44px; padding-block: 0.3rem; }
  .top { padding-block: 0.4rem 0; }
  .hero { padding-block: 0.9rem 2rem; }
  .hero .wrap { gap: 0.6rem; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.6rem; }
  .lede { font-size: 0.98rem; line-height: 1.45; }
  .termrow { margin: 0.2rem 0 0; }
  .diagram--mobile { margin-bottom: -0.6rem; }
  .interchange { border-radius: 22px; }
  .stop--proof { grid-template-columns: minmax(0, 1fr); }
  .stop--proof figure { grid-column: 1; grid-row: auto; }
  .stop--proof img { width: 200px; }
  .board th:nth-child(3), .board td:nth-child(3) { display: none; }
  .nav { gap: 0.1rem 0.8rem; font-size: 0.9rem; }
  .brand .plate { display: none; }
}
@media (max-width: 420px) {
  .nav { font-size: 0.82rem; }
  .nav a::before { width: 12px; }
}
