@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("assets/fonts/familjen-grotesk.woff2") format("woff2");
}

:root {
  /* Jit's own tokens: Tidewater accent and the graph's lane colours. */
  --canvas: #f2f4f4;
  --raised: #ffffff;
  --sunken: #e4e9e9;
  --ink: #132024;
  --ink-2: #4b5b5f;
  --rule: #cfd7d8;
  --accent: #21707a;
  --on-accent: #ffffff;
  --lane-0: #5d6fb5;
  --lane-1: #2f8f84;
  --lane-2: #b0528a;
  --shot-shadow: 0 30px 60px -28px rgb(19 32 36 / .35), 0 0 0 1px rgb(19 32 36 / .08);

  --gutter: 104px;
  --lane-x: 28px;
  --lane-gap: 30px;
  --display: "Familjen Grotesk", ui-rounded, system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #111719;
    --raised: #1a2225;
    --sunken: #0b1012;
    --ink: #e9efef;
    --ink-2: #9fb0b3;
    --rule: #2a3538;
    --accent: #67b5ba;
    --on-accent: #0e1a1c;
    --lane-0: #8e9bd6;
    --lane-1: #6fc2b5;
    --lane-2: #d79bc0;
    --shot-shadow: 0 30px 70px -30px rgb(0 0 0 / .8), 0 0 0 1px rgb(255 255 255 / .07);
  }
}

@media (max-width: 720px) {
  :root { --gutter: 46px; --lane-x: 13px; --lane-gap: 12px; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

code { font: .92em var(--mono); }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  padding: .5rem .9rem; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); text-decoration: none;
}
.skip:focus { top: 1rem; }

/* ---------- Top bar ---------- */

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 1240px; margin: 0 auto; padding: .85rem 24px;
  background: color-mix(in srgb, var(--canvas) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink); text-decoration: none;
}
.brand img { display: block; }
.top nav { display: flex; align-items: center; gap: clamp(.9rem, 2.5vw, 1.8rem); font-size: .95rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); }
.top nav .nav-download {
  padding: .4rem .85rem; border-radius: 999px;
  color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule);
}
.top nav .nav-download:hover { box-shadow: inset 0 0 0 1px var(--accent); }
@media (max-width: 560px) {
  .top nav a:not(.nav-download) { display: none; }
}

/* ---------- The history: a lane gutter with commits beside it ---------- */

.history {
  position: relative;
  max-width: 1240px; margin: 0 auto;
  padding: 0 24px 0 calc(var(--gutter) + 24px);
}
.lanes {
  position: absolute; left: 24px; top: 0;
  width: var(--gutter); height: 100%;
  overflow: visible; pointer-events: none;
}
.lanes path { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.lanes .link { stroke-width: 1; opacity: .4; }
.lanes .node circle { fill: var(--canvas); stroke-width: 2.5; }
.lanes .node .dot { stroke: none; }
.lanes .node {
  transform-box: fill-box; transform-origin: center;
  transition: transform .5s var(--ease), opacity .3s linear;
}
.js .lanes .node:not(.is-reached) { transform: scale(.2); opacity: 0; }
.lanes .l0 { stroke: var(--lane-0); } .lanes .node .f0 { fill: var(--lane-0); }
.lanes .l1 { stroke: var(--lane-1); } .lanes .node .f1 { fill: var(--lane-1); }
.lanes .l2 { stroke: var(--lane-2); } .lanes .node .f2 { fill: var(--lane-2); }

.commit { padding: clamp(4rem, 9vw, 7.5rem) 0 0; }
.commit:last-of-type { padding-bottom: clamp(4rem, 9vw, 7rem); }

/* Content appears once the lane has reached its commit. */
.js .commit > *, .js .feature-text > * { transition: opacity .7s linear; }
.js .commit:not(.is-reached) > *:not(.feature-text):not(.shot),
.js .commit:not(.is-reached) .feature-text > * { opacity: 0; }
.js .commit:not(.is-reached) .shot { clip-path: inset(0 100% 0 0); }
.shot { clip-path: inset(0 -5% -12% -5%); transition: clip-path 1.1s var(--ease); }

/* ---------- Type ---------- */

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.022em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.75rem); line-height: 1; max-width: 15ch; letter-spacing: -.035em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); line-height: 1.08; }
h3 { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
.lede { margin-top: 1.5rem; max-width: 52ch; font-size: clamp(1.1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--ink-2); }
.intro { margin-top: 1.1rem; max-width: 60ch; color: var(--ink-2); }
.fine { font-size: .9rem; color: var(--ink-2); }

/* A ref label, drawn the way Jit draws them beside the graph. */
.ref {
  display: inline-block; margin-bottom: .9rem;
  padding: .15rem .6rem; border-radius: 6px;
  font-size: .85rem; font-weight: 600;
  color: var(--lane-1);
  background: color-mix(in srgb, var(--lane-1) 16%, transparent);
}
.ref.tag { color: var(--lane-0); background: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lane-0) 60%, transparent); }

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; margin-top: 2rem; }
.button {
  display: inline-flex; align-items: center; gap: .6rem;
  padding: .8rem 1.35rem; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; text-decoration: none;
  transition: transform .2s var(--ease), background-color .2s linear;
}
.button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.button:active { transform: scale(.98); }
.button svg { flex: none; }
.button.quiet { background: none; color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule); }
.button.quiet:hover { background: none; box-shadow: inset 0 0 0 1px var(--ink-2); }

/* ---------- Logotype: "jit" with its dots drawn as commits on a lane ---------- */

.logotype { display: block; height: clamp(4.5rem, 9vw, 7rem); width: auto; margin: 0 0 clamp(1.8rem, 4vw, 2.8rem) -0.4rem; overflow: visible; }
.logotype path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 1; }
.lg-lane { stroke: var(--accent); stroke-width: 2.5; }
.lg-ink path { stroke: var(--ink); stroke-width: 7; }
.lg-c1 { fill: var(--accent); }
.lg-c2 { fill: var(--canvas); stroke: var(--accent); stroke-width: 3; }
.logotype circle { transform-box: fill-box; transform-origin: center; }

/* The first commit lands, the lane runs through the second into the t, then the letters hang from it. */
.logotype.play .lg-c1 { animation: lg-pop .5s var(--ease) .15s backwards; }
.logotype.play .lg-lane { animation: lg-draw .7s cubic-bezier(.5, 0, .2, 1) .4s backwards; }
.logotype.play .lg-c2 { animation: lg-pop .45s var(--ease) .68s backwards; }
.logotype.play .lg-j { animation: lg-draw .55s var(--ease) .55s backwards; }
.logotype.play .lg-i { animation: lg-draw .45s var(--ease) .9s backwards; }
.logotype.play .lg-t { animation: lg-draw .6s var(--ease) 1.05s backwards; }
.logotype.play .lg-bar { animation: lg-draw .4s var(--ease) 1.4s backwards; }
@keyframes lg-draw { from { stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } }
@keyframes lg-pop { from { transform: scale(0); } 60% { transform: scale(1.18); } }

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

.hero { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.hero [data-release-meta] { flex-basis: 100%; }
.star-badge { gap: .4rem; padding: .55rem .9rem; font-size: .9rem; }

.compare { margin: clamp(3rem, 6vw, 4.5rem) 0 0; }
.compare-stage {
  position: relative;
  filter: drop-shadow(0 34px 44px rgb(0 0 0 / .28));
  touch-action: pan-y;
}
.compare img { display: block; width: 100%; height: auto; }
.compare .shot-light { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--split)); }
.compare-handle {
  position: absolute; top: 2%; bottom: 2%; left: var(--split);
  width: 2px; margin-left: -1px; background: var(--accent);
}
.compare-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 14px; height: 44px; margin: -22px 0 0 -7px; border-radius: 7px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--canvas);
}
.compare-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; touch-action: pan-y;
}
@media (max-width: 720px) {
  .compare-handle::after { width: 10px; height: 32px; margin: -16px 0 0 -5px; border-radius: 5px; box-shadow: 0 0 0 2px var(--canvas); }
}
.compare-stage:has(.compare-range:focus-visible) .compare-handle::after { box-shadow: 0 0 0 3px var(--canvas), 0 0 0 5px var(--accent); }
figcaption { margin-top: 1rem; font-size: .9rem; color: var(--ink-2); }

/* ---------- Footprint ledger ---------- */

.ledger { margin: 2.4rem 0 1.4rem; max-width: 760px; border-top: 1px solid var(--rule); }
.ledger div {
  display: grid; grid-template-columns: minmax(8.5rem, 11rem) 1fr; align-items: baseline; gap: 1.5rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
}
.ledger dt { font: 600 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ledger dd { margin: 0; color: var(--ink-2); }
@media (max-width: 520px) {
  .ledger div { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---------- Features ---------- */

.feature-text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.feature-text .ref { grid-column: 1 / -1; justify-self: start; }
.feature-text p { color: var(--ink-2); max-width: 52ch; padding-top: .35rem; }
.feature .shot { margin: clamp(2rem, 4vw, 3rem) 0 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 1.1% / 1.7%; box-shadow: var(--shot-shadow); }
@media (max-width: 900px) {
  .feature-text { grid-template-columns: 1fr; }
  .feature-text p { margin-top: .8rem; }
}

.rest {
  margin: 2.2rem 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--rule);
}
.rest div { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.rest dt { font-weight: 600; }
.rest dd { margin: .2rem 0 0; color: var(--ink-2); font-size: 1rem; }
@media (max-width: 720px) {
  .rest { grid-template-columns: 1fr; }
}

/* ---------- Download ---------- */

.first-launch {
  margin-top: 3rem; max-width: 720px;
  padding: 1.5rem 1.6rem; border-radius: 14px;
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--rule);
}
.first-launch p { margin-top: .6rem; color: var(--ink-2); font-size: 1rem; }
.command {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1rem; padding: .55rem .55rem .55rem .9rem; border-radius: 9px;
  background: var(--sunken);
}
.command code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: .88rem; }
.command button {
  flex: none; min-width: 4.6rem; padding: .35rem .7rem; border: 0; border-radius: 6px;
  background: var(--raised); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule);
  font: 600 .85rem var(--text); cursor: pointer;
}
.command button:hover { box-shadow: inset 0 0 0 1px var(--ink-2); }

/* ---------- Footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  max-width: 1240px; margin: 0 auto; padding: 2rem 24px 3rem calc(var(--gutter) + 24px);
  font-size: .9rem; color: var(--ink-2);
}
.foot a { color: inherit; margin-left: 1.2rem; }
.foot p:last-child a:first-child { margin-left: 0; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
