/* Thumbforge landing page. Used only by overrides/home.html; the docs pages keep the theme CSS.
   Spacing scale: 4 8 12 16 24 40 64 96 128 (px). One accent colour; the second hue family
   appears only inside the thumbnail mock-ups. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("inter-bold-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #ede8e0;
  --ink: #17140f;
  --ink-2: #4a443b;
  --line: #d9d2c6;
  --line-strong: #857b6c;
  --accent: #c2410c;
  --on-accent: #ffffff;
  --grid: rgb(23 20 15 / 0.07);
  --shadow: 0 1px 2px rgb(23 20 15 / 0.06), 0 18px 40px -20px rgb(23 20 15 / 0.35);

  /* The terminal panel stays dark in both schemes. */
  --term-bg: #17140f;
  --term-bar: #221e18;
  --term-line: #342e26;
  --term-ink: #f1ece3;
  --term-dim: #a59c8d;
  --term-accent: #ff8a52;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 40px;
  --s7: 64px;
  --s8: 96px;
  --s9: 128px;

  --radius: 12px;
  --max: 1180px;
  --gutter: clamp(var(--s4), 4vw, var(--s6));
  --section: clamp(var(--s7), 6.67vw, var(--s8));

  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e0b;
    --surface: #181511;
    --surface-2: #221e18;
    --ink: #f2eee7;
    --ink-2: #b9b0a2;
    --line: #342e26;
    --line-strong: #7a7062;
    --accent: #ff8a52;
    --on-accent: #17140f;
    --grid: rgb(242 238 231 / 0.05);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 18px 40px -20px rgb(0 0 0 / 0.7);
  }
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.35rem + 4.6vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.875rem, 1.3rem + 2.3vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
  max-width: 68ch;
}

a {
  color: inherit;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: var(--s4);
  top: var(--s3);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s4);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transform: translateY(-200%);
}

.skip:focus-visible {
  transform: none;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s5);
  padding-block: var(--s3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand svg {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--ink);
}

.brand .spark {
  fill: var(--accent);
}

.nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: 44px;
  padding: 0 var(--s3);
  color: var(--ink-2);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 8px;
}

.nav a:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav svg {
  width: 16px;
  height: 16px;
}

/* Below 720 px: brand on one line, the three most important links on a wrapping row. */
@media (max-width: 719.98px) {
  .site-header__inner {
    justify-content: flex-start;
  }

  .nav {
    width: 100%;
    margin-inline: calc(-1 * var(--s3));
  }

  .nav .nav__wide {
    display: none;
  }
}

/* ---------- Shared pieces ---------- */

.eyebrow,
.label {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.label {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.label b {
  color: var(--accent);
  font-weight: 600;
}

.label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.section {
  padding-block: var(--section);
  border-top: 1px solid var(--line);
}

.section__head {
  display: grid;
  gap: var(--s4);
  margin-bottom: clamp(var(--s6), 5vw, var(--s7));
}

.section__head p {
  color: var(--ink-2);
  font-size: 1.0625rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 48px;
  padding: 0 var(--s5);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn:hover {
  background: var(--surface-2);
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip--now {
  background: var(--ink);
  color: var(--bg);
}

.chip--now::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.chip--soon {
  border: 1px dashed var(--line-strong);
  color: var(--ink-2);
}

.cmd {
  display: block;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.8125rem;
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* A flag and its value (or a placeholder) never break apart: lines wrap only between them. */
.nb {
  white-space: nowrap;
}

/* Thumbnail mock-ups: fixed artwork, identical in both schemes. */
.thumb {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.tb-t {
  font-family: var(--font-display);
  font-weight: 700;
}

.chk-a {
  fill: var(--surface);
}

.chk-b {
  fill: var(--surface-2);
}

.frame {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

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

.hero {
  position: relative;
  overflow: clip;
  padding-block: clamp(var(--s6), 7vw, var(--s8)) clamp(var(--s7), 9vw, var(--s9));
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 40%, #000 30%, transparent 75%);
}

.hero__grid {
  display: grid;
  gap: clamp(var(--s6), 6vw, var(--s7));
  align-items: center;
}

.hero__copy {
  display: grid;
  gap: var(--s5);
  justify-items: start;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s1) var(--s3);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--ink-2);
  max-width: 46ch;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

.hero__note {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 52ch;
}

/* Links inside running text: inline (no taller line box), with vertical padding that
   gives a 44 px hit area without pushing the lines apart. */
.hero__note a {
  padding-block: 14px;
  color: var(--ink);
  text-underline-offset: 3px;
}

.stack {
  position: relative;
  margin: 0;
  padding-bottom: var(--s4);
}

.stack__hero {
  transform: rotate(-1.25deg);
}

.tag {
  position: absolute;
  top: calc(-1 * var(--s3));
  right: var(--s5);
  z-index: 2;
  padding: var(--s1) var(--s3);
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* The row sits below the hero card and overlaps only the hero's outer margin band (below the
   safe-margin box), so it never covers the hero's title, badge or safe area. A percentage
   margin scales with the stack width, as the hero card's height does. */
.stack__row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(var(--s2), 2vw, var(--s4));
  margin: -1.25% clamp(var(--s2), 3vw, var(--s6)) 0;
  padding: 0;
  list-style: none;
  position: relative;
  z-index: 1;
}

.stack__row .frame {
  padding: 3px;
}

.stack__row li:nth-child(1) .frame {
  transform: rotate(2deg) translateY(6px);
}

.stack__row li:nth-child(2) .frame {
  transform: rotate(-1.5deg) translateY(-4px);
}

.stack__row li:nth-child(3) .frame {
  transform: rotate(2.5deg) translateY(10px);
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  }
}

/* ---------- How it works ---------- */

.steps {
  display: grid;
  gap: var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.step {
  display: grid;
  align-content: start;
  gap: var(--s3);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--accent);
}

.step p {
  color: var(--ink-2);
}

.step .chip {
  justify-self: start;
}

.step__cmds {
  display: grid;
  gap: var(--s2);
  margin-top: var(--s2);
}

@media (min-width: 840px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- The split ---------- */

.equation {
  --op: 24px;
  container-type: inline-size;
  display: grid;
  gap: var(--s3);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.equation figure {
  display: grid;
  gap: var(--s3);
  margin: 0;
}

.equation figcaption {
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.4;
}

.equation figcaption strong {
  display: block;
  color: var(--ink);
  font-size: 0.9375rem;
}

.op {
  justify-self: center;
  width: var(--op);
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-2);
}

.equation .is-final .frame {
  border-color: var(--accent);
  border-width: 2px;
}

.split-note {
  margin-top: var(--s6);
  color: var(--ink-2);
  font-size: 1.0625rem;
}

.split-note strong {
  color: var(--ink);
}

/* Signs sit level with the middle of the tile frames: tile width from the container width,
   frame height = (tile - 10px border and padding) * 9 / 16 + 10px, minus half the 32 px glyph. */

/* 2 x 2: "background + title" over "+ badge = final". */
@media (min-width: 560px) and (max-width: 899.98px) {
  .equation {
    --tile: calc((100cqi - 2 * var(--op) - 3 * var(--s3)) / 2);
    grid-template-columns: var(--op) 1fr var(--op) 1fr;
    grid-template-areas:
      ". a p1 b"
      "p2 c eq d";
    align-items: start;
    row-gap: var(--s5);
  }

  .equation > :nth-child(1) {
    grid-area: a;
  }

  .equation > :nth-child(2) {
    grid-area: p1;
  }

  .equation > :nth-child(3) {
    grid-area: b;
  }

  .equation > :nth-child(4) {
    grid-area: p2;
  }

  .equation > :nth-child(5) {
    grid-area: c;
  }

  .equation > :nth-child(6) {
    grid-area: eq;
  }

  .equation > :nth-child(7) {
    grid-area: d;
  }
}

@media (min-width: 900px) {
  .equation {
    --tile: calc((100cqi - 3 * var(--op) - 6 * var(--s3)) / 4.25);
    grid-template-columns: 1fr var(--op) 1fr var(--op) 1fr var(--op) 1.25fr;
    align-items: start;
  }
}

@media (min-width: 560px) {
  .op {
    margin-top: calc(((var(--tile) - 10px) * 9 / 16 + 10px) / 2 - 16px);
  }
}

/* ---------- Terminal ---------- */

.term-grid {
  display: grid;
  gap: var(--s6);
  align-items: start;
}

.term {
  min-width: 0;
  border: 1px solid var(--term-line);
  border-radius: var(--radius);
  background: var(--term-bg);
  color: var(--term-ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.term__bar {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-line);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--term-dim);
}

.term__bar::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--term-line);
  box-shadow:
    16px 0 0 var(--term-line),
    32px 0 0 var(--term-line);
  margin-right: 40px;
}

.term pre {
  margin: 0;
  padding: var(--s5);
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--term-ink);
  tab-size: 2;
}

.term pre:focus-visible {
  outline: 3px solid var(--term-accent);
  outline-offset: -3px;
  border-radius: 0 0 var(--radius) var(--radius);
}

.t-p,
.t-c {
  color: var(--term-dim);
}

.t-f {
  color: var(--term-accent);
}

.t-a {
  color: var(--term-dim);
  font-style: italic;
}

.t-soon {
  color: var(--term-dim);
}

.t-soon .t-f {
  color: var(--term-dim);
}

.t-mark {
  color: var(--term-accent);
}

.facts {
  display: grid;
  gap: var(--s5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: var(--s3);
  color: var(--ink-2);
}

.facts strong {
  display: block;
  color: var(--ink);
}

.facts svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
  margin-top: 2px;
}

@media (min-width: 900px) {
  .term-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  }
}

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

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--s4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: grid;
  align-content: start;
  gap: var(--s3);
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card p {
  color: var(--ink-2);
}

.card code {
  color: var(--ink);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 4px;
}

.card .chip {
  justify-self: start;
}

.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--s2);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--accent);
}

.icon svg {
  width: 24px;
  height: 24px;
}

/* ---------- Status ---------- */

.status {
  display: grid;
  gap: var(--s4);
}

.status__col {
  padding: var(--s5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.status__col--soon {
  background: transparent;
  border-style: dashed;
  border-color: var(--line-strong);
}

.status__col h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.status ul {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.status li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--s3);
}

.status li svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.status__col--now li svg {
  color: var(--accent);
}

.status__col--soon li {
  color: var(--ink-2);
}

.status__more {
  margin-top: var(--s5);
}

@media (min-width: 760px) {
  .status {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- Who it is for ---------- */

.who {
  display: grid;
  gap: var(--s5);
}

.who__lead {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  max-width: 30ch;
}

.who__not {
  display: flex;
  gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.who p {
  color: var(--ink-2);
}

.who .who__lead {
  color: var(--ink);
}

.who > div {
  display: grid;
  gap: var(--s5);
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
}

@media (min-width: 900px) {
  .who {
    grid-template-columns: 1fr 1fr;
    align-items: baseline;
    column-gap: var(--s7);
  }
}

/* ---------- Install ---------- */

.install {
  display: grid;
  gap: var(--s5);
  max-width: 760px;
}

.install pre {
  margin: 0;
  padding: var(--s5);
  border: 1px solid var(--term-line);
  border-radius: var(--radius);
  background: var(--term-bg);
  color: var(--term-ink);
  font-size: 0.9375rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.install code {
  user-select: all;
  -webkit-user-select: all;
  font-size: inherit;
}

.install__note {
  color: var(--ink-2);
}

.install__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--s6) var(--s7);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.site-footer__inner {
  display: grid;
  gap: var(--s5);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--s1);
  margin: 0 calc(-1 * var(--s3));
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--s3);
  color: var(--ink);
  text-underline-offset: 3px;
}

/* The licence link sits in running text: inline, with padding for a 44 px hit area. */
.site-footer p a {
  display: inline;
  min-height: 0;
  padding: 14px 0;
}

.site-footer__meta {
  display: grid;
  gap: var(--s2);
  line-height: 1.5;
}

@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .site-footer ul {
    justify-content: flex-end;
  }
}

/* ---------- Motion: opt-in only ---------- */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .btn,
  .nav a {
    transition:
      background-color 160ms ease,
      color 160ms ease,
      border-color 160ms ease;
  }

  .stack .frame {
    transition: transform 240ms cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  .stack__hero:hover .frame {
    transform: translateY(-6px);
  }

  .stack__row li:nth-child(1) .frame:hover {
    transform: rotate(0deg) translateY(-4px);
  }

  .stack__row li:nth-child(2) .frame:hover {
    transform: rotate(0deg) translateY(-8px);
  }

  .stack__row li:nth-child(3) .frame:hover {
    transform: rotate(0deg) translateY(0);
  }
}

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