/* Alpha Downloader. Cool "glacier" palette; the brand blue → teal lives only in
   the file map (one colour per connection) and the logo. Archivo's width axis
   carries the personality: wide and heavy for headlines, normal for reading. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-var.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --fog: light-dark(#eef3f6, #0e1a24);
  --paper: light-dark(#ffffff, #132330);
  --ink: light-dark(#0f2231, #e6eef4);
  --muted: light-dark(#4a5d6e, #93a6b5);
  --line: light-dark(#d6dfe6, #22333f);
  --blue: #0a7cff;
  --link: light-dark(#0a6ad8, #5fb1ff);
  --amber: #f0a43a;
  --empty: light-dark(#dde6ec, #1a2b38);
  /* One colour per connection, blue to teal */
  --c1: #0a7cff;
  --c2: #0a98f0;
  --c3: #0bb3de;
  --c4: #0fc8c8;
  --c5: #12d6b8;
  --c6: #14e0b0;

  --wrap: 1160px;
  --gutter: clamp(20px, 4vw, 40px);

  font-family: "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--fog);
  accent-color: var(--blue);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
h1, h2 { margin: 0; font-weight: 750; letter-spacing: -0.015em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-stretch: 112%; line-height: 1.1; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in oklab, var(--blue) 30%, transparent); }

.skip { position: absolute; left: 12px; top: -60px; padding: 8px 14px; background: var(--paper); border-radius: 6px; z-index: 10; }
.skip:focus { top: 12px; }

/* Shared horizontal frame for every block */
.top, .hero, .map-wrap, .numbers, .app, .ways, .download, .bottom {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* Header */
.top { display: flex; align-items: center; gap: 24px; padding-block: 22px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 650; font-stretch: 110%; }
.top nav { margin-left: auto; display: flex; gap: 26px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.top nav a:hover { color: var(--ink); }

/* Buttons and quiet links */
.button {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 10px;
  transition: background-color 0.15s;
}
.button:hover { background: #0868d6; }
.button.small { padding: 8px 16px; font-size: 0.92rem; border-radius: 8px; }
.quiet { color: var(--ink); font-weight: 550; }

/* Hero: the headline is the image */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
  padding-block: clamp(48px, 9vw, 110px) 48px;
}
h1 {
  font-size: clamp(2.9rem, 7.4vw, 6.2rem);
  font-stretch: 125%;
  font-weight: 820;
  line-height: 0.92;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.lede { font-size: 1.12rem; color: var(--muted); max-width: 32em; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 26px; }
.meta { margin-top: 18px; font-size: 0.9rem; color: var(--muted); }

/* The file map */
.map {
  margin: 0;
  padding: clamp(20px, 3vw, 32px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 18px;
}
.map-head { display: flex; justify-content: space-between; gap: 16px; font-weight: 600; font-stretch: 105%; }
.map-head output { color: var(--muted); font-weight: 500; text-align: right; }
.strip {
  display: grid;
  grid-template-columns: repeat(32, 1fr);
  gap: 4px;
}
.strip i {
  aspect-ratio: 1 / 1.6;
  border-radius: 3px;
  background: var(--empty);
  position: relative;
  overflow: hidden;
}
/* A piece fills from the left as its connection reaches it */
.strip i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fill, transparent);
  transform-origin: left;
  transform: scaleX(var(--p, 0));
}
.strip i.cur { box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--ink) 35%, transparent); }
.strip i.c1 { --fill: var(--c1); }
.strip i.c2 { --fill: var(--c2); }
.strip i.c3 { --fill: var(--c3); }
.strip i.c4 { --fill: var(--c4); }
.strip i.c5 { --fill: var(--c5); }
.strip i.c6 { --fill: var(--c6); }
.strip i.stuck { --fill: var(--amber); }
.strip i.waiting { background: color-mix(in oklab, var(--amber) 38%, var(--empty)); }

.moments {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.moments li {
  padding-top: 14px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.93rem;
  transition: border-color 0.3s, color 0.3s;
}
.moments strong { display: block; color: var(--ink); font-weight: 650; margin-bottom: 4px; }
.moments li.on { border-top-color: var(--blue); color: var(--ink); }
.moments li[data-at="stuck"].on { border-top-color: var(--amber); }
.replay {
  justify-self: start;
  font: inherit;
  font-size: 0.9rem;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Numbers */
.numbers { padding-top: clamp(80px, 11vw, 140px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 32px 64px; }
.numbers-intro p { color: var(--muted); margin-top: 16px; max-width: 30em; }
.runs { display: grid; gap: 30px; }
.run-label { font-weight: 600; margin-bottom: 10px; }
.run-bars {
  display: grid;
  grid-template-columns: 3.4em 1fr 4.2em;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.92rem;
}
.who { color: var(--muted); }
.time { text-align: right; font-weight: 600; }
/* Every bar shares one scale (0 to 72 s), so lengths compare across rows */
.line { height: 8px; border-radius: 4px; background: var(--line); width: calc(var(--t) / 72 * 100%); }
.line.alpha { background: var(--blue); }
.numbers .aside { grid-column: 2; }
.aside { color: var(--muted); font-size: 0.95rem; max-width: 40em; }

/* App screenshot */
.app { padding-top: clamp(80px, 11vw, 140px); display: grid; gap: 28px; }
.app-copy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 64px; align-items: end; }
.app-copy p { color: var(--muted); max-width: 36em; }
.shot img {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -30px light-dark(rgba(15, 34, 49, 0.35), rgba(0, 0, 0, 0.7));
}

/* Browser and terminal */
.ways { padding-top: clamp(80px, 11vw, 140px); display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.ways h2 { font-size: clamp(1.4rem, 2.4vw, 1.8rem); margin-bottom: 14px; }
.ways p { color: var(--muted); }
.term {
  color-scheme: dark;
  margin: 20px 0 0;
  padding: 18px 20px;
  background: #0f2231;
  color: #cfe0ec;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 0.82rem;
  line-height: 1.7;
}

/* Narrow text blocks keep the shared left edge */
.open, .faq {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
  padding-top: clamp(80px, 11vw, 140px);
}
.open > *, .faq > * { max-width: 760px; }
.open p { color: var(--muted); margin: 16px 0 18px; }

/* Downloads */
.download { padding-top: clamp(80px, 11vw, 140px); }
.systems { margin: 28px 0 20px; border-top: 1px solid var(--line); }
.system {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 16px 64px;
  align-items: center;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.system dt { font-weight: 650; font-stretch: 108%; }
.system dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
/* Only this computer's download is the solid button; the rest stay quiet. */
.system .button.small { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.system .button.small:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.system.current .button.small { background: var(--blue); color: #fff; box-shadow: none; }
.system.current .button.small:hover { background: #0868d6; }
.system.current dt::after { content: "Your system"; margin-left: 12px; font-size: 0.8rem; font-weight: 500; color: var(--muted); }

/* FAQ */
.faq h2 { margin-bottom: 18px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; }
.faq details p { color: var(--muted); padding-bottom: 18px; max-width: 42em; }

/* Footer */
.bottom {
  margin-top: clamp(80px, 11vw, 140px);
  padding-block: 28px 44px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  color: var(--muted);
  font-size: 0.9rem;
}
.brand.small { font-size: 0.95rem; gap: 8px; }
.bottom nav { display: flex; gap: 22px; }
.bottom nav a { color: var(--muted); text-decoration: none; }
.bottom nav a:hover { color: var(--ink); }
.bottom p { margin-left: auto; }

/* Plain text pages (privacy policy) */
.doc { width: min(100% - 2 * var(--gutter), 760px); margin: 0 auto; padding-top: 48px; }
.doc h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 10px; }
.doc h2 { font-size: 1.3rem; font-stretch: 108%; margin: 38px 0 10px; }
.doc p, .doc li { color: var(--muted); }
.doc .updated { font-size: 0.9rem; }
.doc ul { padding-left: 20px; display: grid; gap: 8px; }
.doc + .bottom, .doc ~ .bottom { width: min(100% - 2 * var(--gutter), 760px); }

/* Smaller screens */
@media (width < 900px) {
  .hero, .numbers, .app-copy, .ways, .system { grid-template-columns: 1fr; }
  .hero { gap: 28px; }
  .numbers .aside { grid-column: auto; }
  .moments { grid-template-columns: 1fr 1fr; }
  .app-copy { gap: 16px; }
  .ways { gap: 56px; }
  .system { gap: 10px; }
}
@media (width < 560px) {
  :root { font-size: 16px; }
  .top nav a:not([href="#download"]) { display: none; }
  .strip { grid-template-columns: repeat(16, 1fr); }
  .moments { grid-template-columns: 1fr; gap: 14px; }
  .bottom p { margin-left: 0; }
}

@media (forced-colors: active) {
  .strip i::after { background: CanvasText; }
  .button { border: 1px solid ButtonText; }
}
