/* The site of OneHundredX. The design file is designs/onehundredx/DESIGN.md. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

/* The color of each line, and the edge of each card, as classes: the CSP
   refuses a style attribute. */
.c-code { --c: var(--code); }
.c-markets { --c: var(--markets); }
.edge-depot { --edge: linear-gradient(var(--code), var(--markets)); }
.edge-code { --edge: var(--code); }
.edge-markets { --edge: var(--markets); }
.edge-gate { --edge: var(--gate); }

  /* Every color is a token of designs/onehundredx/DESIGN.md; hairlines and
     glows are color-mix() tints of those tokens. */
  :root {
    color-scheme: dark;
    --night: #0A1222;     /* neutral */
    --surface: #111B30;   /* surface */
    --bone: #ECE5D8;      /* primary */
    --muted: #9AA3B5;     /* secondary */
    --code: #5B8CFF;      /* line-code */
    --markets: #2ED3A3;   /* line-markets */
    --gate: #FFB547;      /* gate */
    --future: #3A4660;    /* line-future */
    --hair: color-mix(in srgb, var(--bone) 12%, transparent);
    --edge-line: color-mix(in srgb, var(--bone) 22%, transparent);
    --grid: color-mix(in srgb, var(--bone) 7%, transparent);
    --bar-bg: color-mix(in srgb, var(--night) 80%, transparent);
    --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
    --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    /* The three gaps: inside an item, between items, between sections. */
    --gap-s: 8px;
    --gap-m: 24px;
    --gap-l: 80px;
    /* One fluid column for all text. Only the desktop map runs wider. */
    --gutter: clamp(16px, 5vw, 48px);
    --col: min(640px, 100% - 2 * var(--gutter));
    --map: min(1120px, 100% - 2 * var(--gutter));
    /* the height of the sticky bar, and the cell of the margin grid. */
    --bar: 56px;
    --cell: 64px;
  }

  *, *::before, *::after { box-sizing: border-box; }
  html { background: var(--night); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  @media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
  body {
    position: relative;
    isolation: isolate;
    margin: 0;
    color: var(--bone);
    font: 400 16px/1.6 var(--sans);
    background:
      radial-gradient(ellipse 70% 40% at 50% 38%, color-mix(in srgb, var(--code) 7%, transparent), transparent 70%),
      var(--night);
  }
  ::selection { background: var(--code); color: var(--night); }
  a:focus-visible, button:focus-visible { outline: 2px solid var(--bone); outline-offset: 4px; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .col { width: var(--col); margin-inline: auto; }

  /* Header: the name and the links on one line at every width. A bar that
     stays at the top, see-through night blue over a soft blur, with a hairline
     under it. The hairline sits inside --bar, so a jump link lands right
     under the bar. */
  .top {
    position: sticky; top: 0; z-index: 10; height: var(--bar);
    background: var(--bar-bg); border-bottom: 1px solid var(--hair);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  }
  .top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-s); height: 100%; }
  #products, #how, #founder, #contact { scroll-margin-top: var(--bar); }
  .brand { display: inline-flex; flex: none; align-items: center; gap: var(--gap-s); color: var(--bone); text-decoration: none; }
  .wordmark { font: 400 26px/1 var(--serif); letter-spacing: -0.01em; white-space: nowrap; }
  .nav { display: flex; margin: 0 calc(-1 * var(--gap-s)) 0 0; padding: 0; list-style: none; }
  .nav a {
    display: block; padding: var(--gap-s); white-space: nowrap;
    font: 500 14px/1.2 var(--sans); color: var(--muted); text-decoration: none; transition: color 0.2s;
  }
  .nav a:hover { color: var(--bone); }
  @media (max-width: 639px) { .nav .wide { display: none; } }
  @media (max-width: 399px) { .wordmark { font-size: 22px; } }
  @media (max-width: 359px) { .nav .mid { display: none; } }

  /* Hero: one column, the subline in two tones. */
  .hero { padding-top: var(--gap-l); }
  .hero h1 { margin: 0 0 var(--gap-m); font: 400 clamp(44px, 7vw + 16px, 84px)/1 var(--serif); letter-spacing: -0.02em; text-wrap: balance; }
  .hero .sub { margin: 0; font: 400 19px/1.55 var(--sans); color: var(--muted); }
  .hero .first { color: var(--bone); }

  /* The map */
  .products { padding-top: var(--gap-l); }
  .map { width: var(--map); margin-inline: auto; }
  .map-svg { display: block; width: 100%; height: auto; }
  .routes { display: none; }

  .map-svg .track, .map-svg .glow { fill: none; stroke: var(--c); stroke-linecap: round; stroke-linejoin: round; }
  .map-svg .track { stroke-width: 6; }
  .map-svg .glow { stroke-width: 14; opacity: 0.55; }
  .map-svg .future { fill: none; stroke: var(--future); stroke-width: 4; stroke-dasharray: 14 12; stroke-linecap: round; }
  .map-svg .line-name { font: 400 28px var(--serif); fill: var(--c); }
  .map-svg .hit { fill: transparent; }

  .station, .gate { cursor: pointer; outline: none; }
  .station .ring { fill: none; stroke: none; }
  .station:focus-visible .ring { stroke: var(--bone); stroke-width: 2; }
  .station .dot { fill: var(--night); stroke: var(--c); stroke-width: 4.5; transform-box: fill-box; transform-origin: center; transition: transform 0.25s var(--ease), fill 0.25s; }
  .station:hover .dot, .station.selected .dot { transform: scale(1.22); }
  .station.selected .dot { fill: var(--c); }
  .station .bloom { fill: var(--c); opacity: 0; transition: opacity 0.3s; }
  .station.selected .bloom { opacity: 0.6; }
  .station .name { font: 600 16px var(--sans); fill: var(--bone); }
  .station .what { font: 400 13px var(--mono); letter-spacing: 0.01em; fill: var(--muted); }
  .depot .body { fill: var(--surface); stroke: var(--bone); stroke-width: 1.5; transition: fill 0.25s, stroke-width 0.2s; }
  .depot:hover .body { stroke-width: 2.5; }
  .depot text { font: 400 28px var(--serif); fill: var(--bone); transition: fill 0.25s; }
  .depot.selected .body { fill: var(--bone); }
  .depot.selected text { fill: var(--night); }
  .venue rect { fill: var(--surface); stroke: var(--edge-line); stroke-width: 1; }
  .venue text { font: 400 13px var(--mono); letter-spacing: 0.01em; fill: var(--bone); }

  .gate .bar { stroke: var(--muted); stroke-width: 4; stroke-linecap: round; transition: stroke 0.3s, stroke-width 0.2s; }
  .gate .bar-glow { stroke: var(--gate); stroke-width: 10; stroke-linecap: round; opacity: 0; transition: opacity 0.4s; }
  .gate.lit .bar, .gate:hover .bar, .gate.selected .bar { stroke: var(--gate); }
  .gate:hover .bar, .gate.selected .bar { stroke-width: 6; }
  .gate.lit .bar-glow { opacity: 0.8; }
  .gate.selected .bar-glow { opacity: 1; }
  .gate:focus-visible .hit { stroke: var(--bone); stroke-width: 2; }

  .map-svg .run { pointer-events: none; transition: opacity 0.3s; }
  .map-svg .run .head { fill: var(--bone); }
  .map-svg .run .halo { fill: var(--c); opacity: 0.9; }
  .map-svg .run .trail { fill: var(--c); }

  /* Below 1024px the map turns into vertical route strips in the text column,
     so no map label drops under 12px. */
  .r-head { padding-bottom: var(--gap-m); }
  .r-depot {
    min-height: 56px; padding: 0 28px; cursor: pointer;
    font: 400 28px/1 var(--serif); color: var(--bone);
    background: var(--surface); border: 1.5px solid var(--bone); border-radius: 9999px;
    transition: background-color 0.25s, color 0.25s;
  }
  .r-depot.selected { background: var(--bone); color: var(--night); }
  .route { position: relative; margin-bottom: var(--gap-m); }
  .route-name { margin: 0 0 var(--gap-s); font: 400 28px/1 var(--serif); color: var(--c); text-shadow: 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }
  .stops { position: relative; margin: 0; padding: var(--gap-s) 0; list-style: none; }
  .stops::before {
    content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 6px; border-radius: 3px;
    background: var(--c); transform-origin: top;
    box-shadow: 0 0 16px color-mix(in srgb, var(--c) 60%, transparent), 0 0 4px var(--c);
  }
  .r-station, .r-gate {
    position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    width: 100%; margin: 0; padding: var(--gap-s) var(--gap-s) var(--gap-s) 48px; cursor: pointer;
    font: inherit; color: inherit; text-align: left; background: none; border: 0; border-radius: 3px;
  }
  .r-station:focus-visible, .r-gate:focus-visible { outline-offset: 0; }
  .r-station { min-height: 64px; }
  .r-gate { min-height: 44px; }
  .r-dot {
    position: absolute; left: 5px; top: 50%; width: 22px; height: 22px; margin-top: -11px;
    background: var(--night); border: 4.5px solid var(--c); border-radius: 50%;
    transition: background-color 0.25s, box-shadow 0.25s, transform 0.25s var(--ease);
  }
  .r-station.selected .r-dot { background: var(--c); box-shadow: 0 0 16px var(--c); transform: scale(1.15); }
  .r-name { font: 600 16px/1.4 var(--sans); color: var(--bone); }
  .r-what, .r-gname { font: 400 12px/1.4 var(--mono); letter-spacing: 0.01em; color: var(--muted); }
  .r-venues { display: flex; flex-wrap: wrap; gap: var(--gap-s); margin-top: var(--gap-s); }
  .tag {
    padding: 3px 8px; font: 400 12px/1.3 var(--mono); letter-spacing: 0.01em; color: var(--bone);
    background: var(--surface); border: 1px solid var(--edge-line); border-radius: 9999px;
  }
  .r-bar {
    position: absolute; left: 3px; top: 50%; width: 26px; height: 4px; margin-top: -2px; border-radius: 2px;
    background: var(--muted); transition: background-color 0.3s, box-shadow 0.3s;
  }
  .r-gate.lit .r-bar, .r-gate.selected .r-bar { background: var(--gate); box-shadow: 0 0 12px var(--gate); }
  .r-gate.selected .r-gname { color: var(--gate); }
  .route-future { margin-bottom: 0; }
  .route-future .route-name { color: var(--muted); text-shadow: none; }
  .route-future .dash {
    width: 4px; height: 72px; margin-left: 14px; border-radius: 2px;
    background: repeating-linear-gradient(to bottom, var(--future) 0 14px, transparent 14px 26px);
  }
  .card-slot { list-style: none; padding: var(--gap-s) 0 var(--gap-m) 48px; }
  div.card-slot { padding: 0 0 var(--gap-m); }
  .stops .run { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; transition: opacity 0.3s; }
  .stops .run span { position: absolute; left: 0; top: 0; border-radius: 50%; }
  .stops .run .head { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; background: var(--bone); box-shadow: 0 0 10px 3px var(--c); }
  .stops .run .trail { background: var(--c); }

  @media (max-width: 1023px) {
    .map-svg { display: none; }
    .routes { display: block; }
  }

  /* The card: the one raised panel, right under the map. */
  #card-home .card { margin-top: var(--gap-m); }
  .card { position: relative; padding: var(--gap-m); background: var(--surface); border: 1px solid var(--hair); border-radius: 6px; }
  html:not(.js) .card article + article { margin-top: var(--gap-m); padding-top: var(--gap-m); border-top: 1px solid var(--hair); }
  .js .card article::before, .js .card article::after {
    content: ""; position: absolute; left: -2px; top: var(--gap-m); bottom: var(--gap-m); width: 3px; border-radius: 3px; background: var(--edge);
  }
  .js .card article::after { filter: blur(8px); }
  .card-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap-s) 12px; margin: 0 0 var(--gap-s); }
  .chip { display: inline-block; padding: 4px 12px; font: 500 14px/1.2 var(--sans); color: var(--night); border-radius: 9999px; }
  .chip-code { background: var(--code); }
  .chip-markets { background: var(--markets); }
  .chip-gate { background: var(--gate); }
  .card .meta { font: 400 12px/1.3 var(--mono); letter-spacing: 0.01em; color: var(--muted); }
  .card h3 { margin: 0 0 var(--gap-s); font: 400 38px/1.05 var(--serif); letter-spacing: -0.01em; text-wrap: balance; }
  .card .lead { margin: 0 0 var(--gap-s); font: 400 19px/1.55 var(--sans); color: var(--muted); }
  .card .story { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 16px; margin: 0 0 var(--gap-s); font: 400 14px/1.5 var(--sans); }
  .card .story dt { color: var(--muted); }
  .card .story dd { margin: 0; }
  .card .text { margin: 0; max-width: 34em; }
  @media (max-width: 599px) {
    .card h3 { font-size: 30px; line-height: 1.2; letter-spacing: 0; }
  }

  /* The rules: rows on hairlines. The first sentence is soft, the gate is bone.
     Half a group gap above and below each row puts one group gap between rows. */
  .how { padding-top: var(--gap-l); }
  .rules { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hair); }
  .rules li {
    display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 16px;
    padding: calc(var(--gap-m) / 2) var(--gap-s); color: var(--muted); border-top: 1px solid var(--hair); border-radius: 3px;
    transition: background-color 0.3s, color 0.3s;
  }
  .rules b { font-weight: 500; color: var(--bone); }
  .rules .g { justify-self: center; width: 4px; height: 26px; border-radius: 2px; background: var(--muted); transition: background-color 0.3s, box-shadow 0.3s; }
  .rules li.on { color: var(--bone); background: var(--surface); }
  .rules li.on .g { background: var(--gate); box-shadow: 0 0 12px var(--gate); }

  /* The close: the founder line, then the contact, as two sentences. */
  .founder { padding-top: var(--gap-l); }
  .founder .line { margin: 0 0 var(--gap-s); font: 400 30px/1.2 var(--serif); text-wrap: pretty; }
  .founder p { margin: 0; }
  .out { color: var(--bone); text-decoration: underline 1px var(--muted); text-underline-offset: 0.3em; transition: color 0.2s, text-decoration-color 0.2s; }
  .out:hover { color: var(--code); text-decoration-color: var(--code); }
  /* A link inside a sentence keeps its ring off the word before it. */
  .out:focus-visible { outline-offset: 2px; }
  .contact { padding-block: var(--gap-m) var(--gap-l); }
  .contact p { margin: 0; font: 400 19px/1.55 var(--sans); color: var(--muted); }
  .contact .mail { font: 400 17px/1.55 var(--mono); overflow-wrap: anywhere; }

  /* The one orchestrated moment: Code lights up, then Markets, then the dashed line. */
  @media (prefers-reduced-motion: no-preference) {
    .map-svg .draw { stroke-dasharray: 1 1; stroke-dashoffset: 1; animation: draw 1.2s linear var(--d) forwards; }
    .map-svg .reveal { animation: appear 0.5s ease-out var(--d) both; }
    .map-svg .line-future { animation: appear 0.8s ease-out 2.4s both; }
    .route .stops::before { animation: grow 1s cubic-bezier(0.4, 0, 0.2, 1) var(--d) both; }
    .route-future .dash { animation: appear 0.6s ease-out 2s both; }
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes appear { from { opacity: 0; } to { opacity: 1; } }
  @keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    .gate .bar { stroke: var(--gate); }
    .gate .bar-glow { opacity: 0.8; }
    .r-gate .r-bar { background: var(--gate); box-shadow: 0 0 12px var(--gate); }
  }

  .brand .logo { display: block; width: 54px; height: 26px; flex: none; }

  /* the sheet and the margin grid, from the farhour site. From 1024px,
     where the map is the full SVG, the whole page lies on a sheet in the
     surface color, lifted off the night with a soft shadow, and a faint grid
     fills the side margins and fades out over 3 cells before the sheet. The
     sheet is as wide as the map, in whole grid cells, so the vertical grid
     lines meet both of its edges. Pure CSS: it shows without the script. */
  @media (min-width: 1024px) {
    /* From 1024px, min(640px, 100% - 2 * gutter) is always 640px. The grid
       math needs the column and the sheet as plain lengths. The map keeps
       32px of sheet on each side. */
    :root { --col: 640px; --sheet: 960px; --map: calc(var(--sheet) - 64px); }
    body::before, body::after {
      content: ""; position: absolute; top: 0; bottom: 0; z-index: -1; pointer-events: none;
    }
    body::before {
      left: 0; right: 0;
      background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
      background-size: var(--cell) var(--cell);
      background-position: calc(50% + var(--cell) / 2 - var(--sheet) / 2) 0;
      -webkit-mask-image: linear-gradient(90deg,
        #000 calc(50% - var(--sheet) / 2 - var(--cell) * 3),
        transparent calc(50% - var(--sheet) / 2),
        transparent calc(50% + var(--sheet) / 2),
        #000 calc(50% + var(--sheet) / 2 + var(--cell) * 3));
      mask-image: linear-gradient(90deg,
        #000 calc(50% - var(--sheet) / 2 - var(--cell) * 3),
        transparent calc(50% - var(--sheet) / 2),
        transparent calc(50% + var(--sheet) / 2),
        #000 calc(50% + var(--sheet) / 2 + var(--cell) * 3));
    }
    /* The soft blue glow behind the map moves from the night onto the sheet. */
    body::after {
      left: 50%; width: var(--sheet); transform: translateX(-50%);
      background:
        radial-gradient(ellipse 70% 40% at 50% 38%, color-mix(in srgb, var(--code) 7%, transparent), transparent 70%),
        var(--surface);
      box-shadow: 0 0 140px 48px rgb(0 0 0 / 60%);
    }
  }
  /* The sheet grows by one cell at a time up to 18 cells (1152px), and keeps
     at least 16px of night on each side. */
  @media (min-width: 1088px) { :root { --sheet: 1024px; } }
  @media (min-width: 1152px) { :root { --sheet: 1088px; } }
  @media (min-width: 1216px) { :root { --sheet: 1152px; } }

  /* the dots. A canvas above the sheet's shadow, so a label near the
     sheet keeps its contrast. It draws only in the margins and the bar sits
     above it, so it never covers text. */
  .dots { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
