/* Tinderbox Works public site. One stylesheet, light only (DESIGN.md: public pages are always light).
   Tokens copied from the front matter of DESIGN.md; names match tokens.json (--surface-1, --radius-md, ...). */

:root {
  color-scheme: light;

  /* Brand anchors and Signal Blue */
  --primary: #202124;
  --primary-hover: #3c3d41;
  --on-primary: #ffffff;
  --accent-blue: #245dcc;
  --link: #245dcc;
  --focus: #245dcc;
  --focus-on-stage: #7ba6f5;
  --selection: #e9effa;
  --selection-strong: #dce6f8;

  /* Surfaces */
  --canvas: #ffffff;
  --surface-1: #f5f5f3;
  --surface-2: #eaeae6;
  --surface-3: #dfdfd9;
  --surface-raised: #ffffff;
  --surface-sunken: #f5f5f3;
  --stage: #18191b;
  --on-stage: #ffffff;
  --on-stage-muted: #b9bcc1;
  --scrim: #2021247a;

  /* Lines */
  --hairline: #d3d5d8;
  --hairline-soft: #e5e6e8;
  --hairline-strong: #82868c;

  /* Ink */
  --ink: #202124;
  --ink-muted: #5c6066;
  --ink-disabled: #a6a9ae;
  --inverse-canvas: #202124;
  --inverse-ink: #ffffff;
  --inverse-ink-muted: #b9bcc1;

  /* Signals (dots, glyphs and chip tints only, always with a word) */
  --success: #16803c;
  --success-tint: #e3f1e6;
  --warning: #8f6300;
  --warning-tint: #fbefcf;
  --danger: #c5221f;
  --danger-tint: #fbd8dd;

  /* Report kinds */
  --kind-bug: #b35214;
  --kind-bug-tint: #ffe1c4;
  --kind-crash: #c5221f;
  --kind-crash-tint: #fbd8dd;
  --kind-feature: #6b4cc9;
  --kind-feature-tint: #e3dcfa;
  --kind-feedback: #a3337f;
  --kind-feedback-tint: #f5d5ed;

  /* Brand gradient family */
  --gradient-magenta: #f5d5ed;
  --gradient-violet: #e3dcfa;
  --gradient-orange: #ffe1c4;
  --gradient-coral: #fbd8dd;
  --gradient-glow: #ffffffb8;

  /* Project accent: Tinderbox Works' own rust (header frame line, link underlines, the mark) */
  --project-accent: #a3472a;
  --on-project-accent: #ffffff;

  /* Side nav (used by the product mock in the hero) */
  --rail: #202124;
  --rail-current: #3c3d41;
  --on-rail: #ffffff;
  --on-rail-muted: #a7abb1;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 15px;
  --radius-xl: 20px;
  --radius-xxl: 30px;
  --radius-pill: 100px;

  /* Marketing spacing (5px rhythm) */
  --space-hair: 1px;
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 15px;
  --space-lg: 20px;
  --space-xl: 30px;
  --space-xxl: 40px;
  --space-section: 96px;

  /* Elevation and motion */
  --shadow-1: 0 0 0 1px #2021240f, 0 1px 2px #2021240f;
  --shadow-2: 0 0 0 0.5px #2021241a, 0 10px 30px #20212414;
  --shadow-3: 0 0 0 0.5px #2021241f, 0 24px 64px #2021242e;
  --shadow-halo: 0 0 0 1px #245dcc26;
  --duration-fast: 140ms;
  --duration-base: 200ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);

  /* Type */
  --font: "Inter", "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  /* Layout */
  --wrap: 1199px;
  --gutter: 32px;
  --header-h: 72px;
}

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

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

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  font-feature-settings: "cv01", "cv05", "cv09", "cv11", "ss03";
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg, video { display: block; max-width: 100%; }
img, video { height: auto; }

h1, h2, h3, h4, p, ul, ol, figure, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { font-weight: 500; text-wrap: balance; }
p { text-wrap: pretty; }

a { color: inherit; }

/* Body links (public-link): ink text, accent underline */
.prose a,
a.text-link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--project-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover, a.text-link:hover { text-decoration-thickness: 3px; }

/* Focus: 2px solid Signal Blue, 2px offset, never removed */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

::selection { background: var(--selection-strong); }

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: max(var(--gutter), env(safe-area-inset-left, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ---------- Type scale (marketing) ---------- */

.display-xl {
  font-size: clamp(44px, 6.4vw, 85px);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-feature-settings: "cv01", "cv05", "cv09", "cv11", "ss03", "ss02";
}
.display-lg {
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-feature-settings: "cv01", "cv05", "cv09", "cv11", "ss03", "ss02";
}
.display-md {
  font-size: clamp(26px, 3vw, 32px);
  line-height: 1.13;
  letter-spacing: -0.031em;
  font-weight: 500;
}
.headline {
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 600;
}
.subhead {
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--ink-muted);
  font-weight: 400;
}
.lead {
  font-size: 18px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--ink-muted);
}
.muted { color: var(--ink-muted); }
.caption { font-size: 13px; font-weight: 500; color: var(--ink-muted); letter-spacing: -0.01em; }
.eyebrow {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--project-accent);
}
.eyebrow-quiet {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---------- Buttons and chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.97); }
.btn svg { width: 16px; height: 16px; flex: none; }

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

.btn-secondary { background: var(--surface-2); color: var(--ink); }
.btn-secondary:hover { background: var(--surface-3); }

.btn-lg { min-height: 52px; padding: 0 28px; font-size: 17px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }

.btn[disabled], .btn[aria-disabled="true"] { cursor: default; color: var(--ink-muted); background: var(--surface-1); transform: none; }

@media (prefers-reduced-motion: reduce) {
  .btn, .btn:active { transition: none; transform: none; }
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip-version { background: var(--surface-2); font-weight: 600; }

/* New / Changed / Fixed counts: tint + dot + word, text stays ink */
.counts { display: flex; flex-wrap: wrap; gap: 8px; }
.count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.count::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.count b { font-weight: 600; }
.count-new { background: var(--success-tint); }
.count-new::before { background: var(--success); }
.count-changed { background: var(--selection); }
.count-changed::before { background: var(--accent-blue); }
.count-fixed { background: var(--danger-tint); }
.count-fixed::before { background: var(--danger); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--canvas);
  border-top: 2px solid var(--project-accent); /* the 2px frame line */
  border-bottom: 1px solid var(--hairline-soft);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav actions";
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.035em;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}
.brand-mark { width: 36px; height: 36px; flex: none; }

.site-nav { grid-area: nav; justify-self: center; }
.site-nav ul { display: flex; gap: 8px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a:hover { background: var(--surface-1); }
.site-nav a[aria-current="page"] { font-weight: 650; }

.header-actions { grid-area: actions; display: flex; gap: 10px; }
.header-actions .btn { min-height: 44px; }

/* ---------- Sections ---------- */

.section { padding-block: var(--space-section); }
.section-head { display: grid; gap: 14px; max-width: 760px; margin-bottom: 48px; }
.section-head .display-lg { margin-top: 2px; }

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

.hero { padding-block: 56px 48px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 44px;
  align-items: center;
}
.hero-copy { display: grid; gap: 22px; align-content: start; }
.hero-title {
  font-size: clamp(44px, 5.3vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 500;
  font-feature-settings: "cv01", "cv05", "cv09", "cv11", "ss03", "ss02";
}
.hero-title span { display: block; }
.hero-sub { max-width: 40ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero-note { font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* The product picture: coral spotlight (public pages) behind a mock of the Plan screen */
.hero-visual {
  position: relative;
  border-radius: var(--radius-xxl);
  padding: clamp(14px, 2.4vw, 28px);
  background:
    radial-gradient(80% 90% at 0% 0%, var(--gradient-glow), transparent 70%),
    linear-gradient(135deg, var(--gradient-coral), var(--gradient-violet) 60%, var(--gradient-magenta));
}

.app-mock {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-3);
  border-top: 2px solid var(--project-accent);
}
.app-mock-bar {
  display: flex;
  gap: 6px;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  background: var(--rail);
}
.app-mock-bar i { width: 9px; height: 9px; border-radius: 50%; background: #5f6268; }
.app-mock-bar i:nth-child(1) { background: #ed6a5e; }
.app-mock-bar i:nth-child(2) { background: #f4bf4f; }
.app-mock-bar i:nth-child(3) { background: #61c554; }

.app-mock-body { display: grid; grid-template-columns: 118px minmax(0, 1fr); }
.app-mock-rail {
  background: var(--rail);
  color: var(--on-rail-muted);
  padding: 10px 8px;
  display: grid;
  align-content: start;
  gap: 2px;
  font-size: 11px;
  font-weight: 500;
}
.app-mock-rail .mock-brand {
  display: flex; align-items: center; gap: 7px;
  color: var(--on-rail); font-weight: 600; font-size: 11px;
  padding: 2px 6px 12px;
}
.app-mock-rail .mock-brand svg { width: 18px; height: 18px; }
.app-mock-rail span:not(.mock-brand, .mock-spacer) { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; }
.app-mock-rail span:not(.mock-brand, .mock-spacer)::before {
  content: ""; width: 9px; height: 9px; border: 1.5px solid currentColor; border-radius: 3px; flex: none; opacity: .8;
}
.app-mock-rail .is-current { background: var(--rail-current); color: var(--on-rail); }
.app-mock-rail .mock-spacer { min-height: 36px; }

.app-mock-main { min-width: 0; background: var(--surface-raised); }
.app-mock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline-soft);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
}
.app-mock-head b { font-size: 12px; font-weight: 600; margin-right: 4px; }
.app-mock-head .tab { padding: 2px 8px; border-radius: var(--radius-pill); color: var(--ink-muted); }
.app-mock-head .tab.on { background: var(--surface-1); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hairline-soft); }
.app-mock-head .goal { margin-left: auto; color: var(--ink-muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; }
.app-mock-main svg { width: 100%; height: auto; }

/* ---------- Plan trees (inline SVG) ---------- */

.tree text { font-family: var(--font); fill: var(--ink); letter-spacing: -0.01em; }
.tree .t-phase { font-size: 13px; font-weight: 600; }
.tree .t-phase-meta { font-size: 11px; fill: var(--ink-muted); font-variant-numeric: tabular-nums; }
.tree .t-name { font-size: 12.5px; font-weight: 600; }
.tree .t-meta { font-size: 11px; fill: var(--ink-muted); }
.tree .t-tag { font-size: 10.5px; font-weight: 600; fill: var(--on-primary); letter-spacing: 0; }
.tree .t-gate { font-size: 11px; font-weight: 600; }
.tree .halo { paint-order: stroke; stroke: var(--canvas); stroke-width: 4px; stroke-linejoin: round; }
.tree .halo-1 { paint-order: stroke; stroke: var(--surface-1); stroke-width: 4px; stroke-linejoin: round; }
.tree .band { fill: var(--surface-1); }
.tree .rule { stroke: var(--hairline-soft); stroke-width: 1; }
.tree .edge { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.tree .edge-next { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.tree .edge-todo { fill: none; stroke: var(--hairline-strong); stroke-width: 1.4; stroke-dasharray: 4 4; }

/* mini tree inside the hero mock */
.tree-mini text { font-family: var(--font); fill: var(--ink); letter-spacing: -0.01em; }
.tree-mini .m-col { font-size: 9px; font-weight: 600; }
.tree-mini .m-col-meta { font-size: 7.5px; fill: var(--ink-muted); }
.tree-mini .m-name { font-size: 8.5px; font-weight: 600; }
.tree-mini .m-meta { font-size: 7px; fill: var(--ink-muted); }
.tree-mini .m-card-k { font-size: 6.5px; font-weight: 600; fill: var(--ink-muted); letter-spacing: .06em; }
.tree-mini .m-card-t { font-size: 9.5px; font-weight: 600; }
.tree-mini .m-card-b { font-size: 7px; fill: var(--ink-muted); }
.tree-mini .m-btn { font-size: 7px; font-weight: 600; fill: var(--on-primary); }

.plan-figure {
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-xl);
  background: var(--canvas);
  overflow: hidden;
}
.plan-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.plan-scroll:focus-visible { outline-offset: -2px; }
.plan-scroll svg { min-width: 900px; width: 100%; height: auto; }
.plan-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline-soft);
  font-size: 13px;
  color: var(--ink-muted);
}
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend svg { width: 16px; height: 16px; }
.scroll-hint { display: none; }

.phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
  counter-reset: phase;
}
.phases li {
  counter-increment: phase;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--surface-1);
  display: grid;
  gap: 6px;
  align-content: start;
}
.phases h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; display: flex; gap: 10px; align-items: baseline; }
.phases h3::before {
  content: counter(phase);
  font-size: 12px; font-weight: 600; color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.phases p { font-size: 14px; color: var(--ink-muted); line-height: 1.45; }

/* ---------- Feature cards ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.feature {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px 18px;
  padding: 26px 28px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.feature svg { width: 32px; height: 32px; grid-row: span 2; margin-top: 2px; color: var(--ink); }
.feature h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.feature p { color: var(--ink-muted); font-size: 15px; line-height: 1.45; }

/* ---------- AI native spotlight ---------- */

.spotlight {
  border-radius: var(--radius-xxl);
  padding: clamp(28px, 4.4vw, 56px);
  background:
    radial-gradient(80% 90% at 0% 0%, var(--gradient-glow), transparent 70%),
    linear-gradient(135deg, var(--gradient-violet), var(--gradient-magenta));
}
.ai-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}
.ai-copy { display: grid; gap: 18px; align-content: start; }
.ai-copy .lead { color: var(--ink-muted); max-width: 46ch; }
.ai-points { display: grid; gap: 14px; margin-top: 8px; }
.ai-points li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.ai-points svg { width: 20px; height: 20px; margin-top: 1px; }
.ai-points b { display: block; font-weight: 600; letter-spacing: -0.015em; }
.ai-points span { color: var(--ink-muted); font-size: 15px; }

.terminal {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stage);
  color: var(--on-stage);
  box-shadow: var(--shadow-3);
  min-width: 0;
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #232427;
  color: var(--on-stage-muted);
  font-size: 13px;
  font-weight: 500;
}
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; }
.terminal-bar i:nth-child(1) { background: #ed6a5e; }
.terminal-bar i:nth-child(2) { background: #f4bf4f; }
.terminal-bar i:nth-child(3) { background: #61c554; margin-right: 10px; }
.terminal pre {
  margin: 0;
  padding: 20px 20px 24px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.terminal .prompt { color: var(--on-stage); font-weight: 500; }
.terminal .dim { color: var(--on-stage-muted); }
.terminal .ok { color: #5cc07b; }
.terminal .wait { color: #e2ab45; }
.terminal .cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--on-stage);
}
@media (prefers-reduced-motion: no-preference) {
  .terminal .cursor { animation: blink 1.1s steps(1) infinite; }
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Pricing and trial ---------- */

.offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
.offer {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(24px, 3.4vw, 40px);
  border-radius: var(--radius-xxl);
  border: 1px solid var(--hairline-soft);
  background: var(--surface-raised);
}
.offer-trial { background: var(--surface-1); border-color: transparent; }
.offer .price { font-size: clamp(40px, 5vw, 62px); line-height: 1; letter-spacing: -0.05em; font-weight: 500; }
.offer .price small { font-size: 18px; letter-spacing: -0.01em; color: var(--ink-muted); font-weight: 400; margin-left: 6px; }
.checks { display: grid; gap: 10px; margin-top: 4px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; }
.checks svg { width: 18px; height: 18px; margin-top: 2px; color: var(--success); }
.trial-terms {
  display: inline-flex;
  align-self: start;
  justify-self: start;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--canvas);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.offer .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

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

.site-footer {
  margin-top: var(--space-section);
  border-top: 1px solid var(--hairline-soft);
  padding-block: 40px 48px;
  font-size: 14px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px 32px;
}
.footer-inner .brand { font-size: 17px; }
.footer-inner .brand-mark { width: 28px; height: 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.footer-links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px;
  color: var(--ink); text-decoration: none; font-weight: 500;
  border-radius: var(--radius-sm);
}
.footer-links a:hover { text-decoration: underline; text-decoration-color: var(--project-accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.copyright { color: var(--ink-muted); }

/* ---------- Devlog index ---------- */

.devlog-page { padding-top: 48px; }
.devlog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
}
.devlog-head .intro { display: grid; gap: 12px; }
.devlog-follow { display: grid; gap: 8px; justify-items: end; }
.follow-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 10px; justify-content: flex-end; }
.follow-row .subscribe { width: 340px; }

.subscribe {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 4px 4px 4px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-pill);
  background: var(--canvas);
  width: min(100%, 340px);
}
.subscribe:focus-within { box-shadow: var(--shadow-halo); border-color: var(--hairline-strong); }
.subscribe input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.subscribe input::placeholder { color: var(--ink-muted); opacity: 1; }
.subscribe input:focus-visible { outline: none; }
.subscribe:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.subscribe .btn { min-height: 40px; }
.subscribe-note { font-size: 13px; color: var(--ink-muted); min-height: 1em; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.filter {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--surface-1);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.filter:hover { background: var(--surface-2); }
.filter[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

.release-list {
  position: relative;
  display: grid;
  gap: 20px;
  margin-top: 28px;
  padding-left: 52px;
}
.release-list:has(.release-card)::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: var(--hairline-soft);
}
.release-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 22px 24px 24px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
  transition: box-shadow var(--duration-base) var(--ease-standard);
}
.release-card:hover { box-shadow: var(--shadow-2); }
.release-card::before {
  content: "";
  position: absolute;
  left: -48px;
  top: 26px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-3);
  box-shadow: 0 0 0 4px var(--canvas);
}
.release-card:first-child::before { background: var(--project-accent); }
.release-card[hidden] { display: none; }

.release-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--ink-muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.release-card .counts { margin-left: auto; }
.release-card-title { font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 600; }
.release-card-title a { text-decoration: none; color: var(--ink); }
.release-card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-xl); }
.release-card-title a:focus-visible { outline: none; }
.release-card-title a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.release-card-summary { color: var(--ink-muted); font-size: 17px; line-height: 1.4; }

.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.thumbs li {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--stage);
}
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumb-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: #18191bd9;
  color: var(--on-stage);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.devlog-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  margin-top: 28px;
  padding: clamp(28px, 4vw, 48px);
  border-radius: var(--radius-xl);
  background: var(--surface-1);
}
.release-list:has(.release-card) ~ .devlog-empty { display: none; }
.release-list:not(:has(.release-card)) { margin-top: 0; padding: 0; }
.devlog-empty p { color: var(--ink-muted); max-width: 52ch; }
.filter-empty { margin-top: 20px; color: var(--ink-muted); }

/* ---------- Release page ---------- */

.release-page { padding-top: 32px; }
.release-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
  max-width: 1120px;
  margin-inline: auto;
}
.release-main { display: grid; gap: 18px; min-width: 0; }
.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.release-h1 {
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
}
.release-main > .lead { font-size: clamp(18px, 1.8vw, 21px); margin-top: -4px; }

.stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--stage);
}
.stage video, .stage img { width: 100%; height: 100%; object-fit: contain; }
.stage :focus-visible { outline-color: var(--focus-on-stage); }

.media-figure { display: grid; gap: 10px; margin-top: 10px; }
.media-figure figcaption { font-size: 14px; color: var(--ink-muted); }

.release-section { display: grid; gap: 22px; padding-top: 40px; }
.release-section > h2 {
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
.item { display: grid; gap: 8px; align-content: start; min-width: 0; }
.item h3 { font-size: 18px; line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; }
.item p { color: var(--ink-muted); }
.item .stage { margin-top: 6px; }
.item-list { display: grid; gap: 14px; }
.item-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; }
.item-list li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-strong); margin-top: 8px; }
.item-list b { font-weight: 600; }
.item-list span { color: var(--ink-muted); }

.loop-toggle {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #18191bd9;
  color: var(--on-stage);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.loop-toggle::before { content: ""; position: absolute; inset: -6px; } /* 44px hit area */
.loop-toggle:focus-visible { outline: 2px solid var(--focus-on-stage); outline-offset: 2px; }

.release-aside {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: grid;
  gap: 16px;
}
.aside-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}
.aside-card h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.aside-card p { font-size: 14px; color: var(--ink-muted); }
.toc ul { display: grid; gap: 2px; }
.toc a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  color: var(--link);
  text-decoration: none;
  font-weight: 500;
}
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.toc a span { color: var(--ink-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.aside-card .subscribe { width: 100%; padding-left: 14px; }
.aside-card .subscribe .btn { padding: 0 14px; }
.aside-card .rss-link { font-size: 14px; }

/* ---------- 404 ---------- */

.notfound { padding-block: 96px 40px; display: grid; gap: 18px; justify-items: start; }
.notfound .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* ---------- Responsive: the brand breakpoints 1199 / 810 / 809px ---------- */

@media (max-width: 1199px) {
  :root { --gutter: 28px; --space-section: 80px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-sub { max-width: 52ch; }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-layout { grid-template-columns: minmax(0, 1fr) 232px; gap: 40px; }
}

/* Tablet: 810px up to 1199px keeps the two-column aside; phone starts at 809px */
@media (max-width: 809px) {
  :root { --gutter: 16px; --space-section: 64px; --header-h: 104px; }
  body { font-size: 16px; line-height: 1.5; }

  .site-header { position: static; }
  [id] { scroll-margin-top: 16px; }
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand trial"
      "nav signin";
    gap: 6px 12px;
    padding-block: 10px 8px;
    min-height: 0;
  }
  .brand { font-size: 18px; gap: 10px; }
  .brand-mark { width: 32px; height: 32px; }
  .site-nav { justify-self: start; margin-left: -10px; }
  .site-nav ul { gap: 0; flex-wrap: wrap; }
  .site-nav a { padding: 0 10px; font-size: 15px; }
  .header-actions { display: contents; }
  .header-actions .btn-primary { grid-area: trial; }
  .header-actions .btn-secondary { grid-area: signin; }
  .header-actions .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }

  .hero { padding-block: 32px 24px; }
  .hero-copy { gap: 18px; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .app-mock-body { grid-template-columns: minmax(0, 1fr); }
  .app-mock-rail { display: none; }
  .app-mock-head .goal { display: none; }

  .section-head { margin-bottom: 32px; }
  .features { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .feature { padding: 20px; gap: 4px 14px; grid-template-columns: 32px minmax(0, 1fr); }
  .feature svg { width: 28px; height: 28px; }
  .phases { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .scroll-hint { display: inline; }
  .terminal pre { font-size: 13px; padding: 16px; }
  .offer-grid { grid-template-columns: minmax(0, 1fr); }
  .offer .actions .btn { flex: 1 1 auto; }

  .devlog-page { padding-top: 32px; }
  .devlog-follow { justify-items: stretch; width: 100%; }
  .follow-row { justify-content: stretch; flex-wrap: nowrap; }
  .follow-row .subscribe { flex: 1; width: auto; }
  .release-list { padding-left: 0; }
  .release-list:has(.release-card)::before, .release-card::before { display: none; }
  .release-card { padding: 18px 16px 18px; }
  .release-card .counts { margin-left: 0; width: 100%; }
  .thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .thumbs li:nth-child(3) { display: none; }

  .release-page { padding-top: 16px; }
  .release-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .release-aside { position: static; }
  .items { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .stage, .thumbs li { border-radius: var(--radius-md); }
}

@media (max-width: 380px) {
  .brand { font-size: 16px; gap: 8px; }
  .brand-mark { width: 28px; height: 28px; }
  .header-actions .btn { padding: 0 12px; }
  .site-nav a { padding: 0 8px; font-size: 14px; }
  .follow-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .release-card { transition: none; }
}

@media print {
  .site-header, .site-footer, .release-aside, .skip-link { display: none; }
}

/* ---------- Small helpers ---------- */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.features-section { padding-top: 24px; }
.tree-mini .halo-1 { paint-order: stroke; stroke: var(--surface-1); stroke-width: 3px; stroke-linejoin: round; }
