/*
 * Fractal site. Tokens are Daylight's, taken from the app
 * (Fractal-rust/app/src/design/tokens.css) so the site and the app read as
 * one thing. Marketing-scale type is the only addition.
 *
 * Fonts are self-hosted: a product whose pitch is "nothing leaves your Mac"
 * should not load its typeface from Google.
 */

@font-face {
  font-family: "Figtree";
  src: url("fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("fonts/dm-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("fonts/dm-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-sunk: #f0f1ee;
  --surface-hover: #f2f3f0;
  --ink: #1b1f1d;
  --ink-2: #4c5451;
  --ink-3: #838c88;
  --ink-inverse: #ffffff;
  --line: #e3e5e2;
  --line-strong: #cfd3cf;
  --accent: #17766b;
  --accent-hover: #0e564e;
  --accent-wash: #dcedea;
  --accent-ink: #0e564e;
  --warn: #8a6115;
  --acct-1: #17766b;
  --acct-2: #274a7d;
  --acct-3: #7d4a86;
  --bar: var(--surface-sunk);

  --font-sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-hero: clamp(36px, 6vw, 60px);
  --text-h2: clamp(26px, 3.6vw, 36px);
  --text-h3: 18px;
  --text-lead: clamp(17px, 2vw, 20px);
  --text-body: 16px;
  --text-small: 14px;
  --text-micro: 12px;

  --radius-chip: 999px;
  --radius-control: 10px;
  --radius-card: 14px;
  --radius-inset: 8px;

  --shadow-card: 0 1px 3px rgba(27, 31, 29, 0.07);
  --shadow-raise: 0 24px 60px rgba(27, 31, 29, 0.16);

  --page: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a;
    --surface: #1b1f22;
    --surface-sunk: #23282c;
    --surface-hover: #262c30;
    --ink: #eaeeef;
    --ink-2: #aeb7b8;
    --ink-3: #7b858a;
    --ink-inverse: #14171a;
    --line: #2a3033;
    --line-strong: #3a4145;
    --accent: #5cc0b2;
    --accent-hover: #7ad3c6;
    --accent-wash: #1d3b38;
    --accent-ink: #8fdcd0;
    --warn: #d9ab52;
    --acct-1: #5cc0b2;
    --acct-2: #7fa8de;
    --acct-3: #c89ad0;
    --bar: #2d3438;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-raise: 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

/* --- base ------------------------------------------------------------ */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }

code, .mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
code {
  font-size: 0.9em;
  background: var(--surface-sunk);
  padding: 1px 6px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- header ---------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand img { width: 30px; height: 30px; }
.brand:hover { color: var(--ink); }
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav a:not(.btn) {
  color: var(--ink-2);
  text-decoration: none;
  font-size: var(--text-small);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-control);
}
.nav a:not(.btn):hover { color: var(--ink); background: var(--surface-hover); }
.nav a[aria-current="page"]:not(.btn) { color: var(--ink); }
@media (max-width: 640px) {
  .nav .hide-sm { display: none; }
}

/* --- buttons --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-control);
  border: 1px solid transparent;
  font: inherit;
  font-size: var(--text-small);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms var(--ease-out), border-color 120ms var(--ease-out);
}
.btn-primary { background: var(--accent); color: var(--ink-inverse); }
.btn-primary:hover { background: var(--accent-hover); color: var(--ink-inverse); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--ink); }
.btn-lg { min-height: 48px; padding: 0 24px; font-size: var(--text-body); }
.btn svg { width: 18px; height: 18px; flex: none; }

/* --- hero ------------------------------------------------------------ */

.hero { padding: clamp(56px, 9vw, 104px) 0 0; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: var(--text-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 5px 12px;
  border-radius: var(--radius-chip);
  margin-bottom: 20px;
}
.hero h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 14em;
  margin: 0 auto;
  text-wrap: balance;
}
.hero .lead {
  font-size: var(--text-lead);
  color: var(--ink-2);
  max-width: 36em;
  margin: 20px auto 0;
  text-wrap: pretty;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.hero-note {
  margin-top: 14px;
  font-size: var(--text-micro);
  color: var(--ink-3);
}

/* --- the illustration: a drawn Fractal window ------------------------ */

.shot {
  margin: clamp(48px, 7vw, 72px) auto 0;
  max-width: 1000px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raise);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  user-select: none;
}
.shot-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 46px;
  padding: 0 14px;
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
}
.lights { display: flex; gap: 7px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-strong); }
.scope {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-chip);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.marks { display: flex; }
.mark {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  color: var(--ink-inverse);
  font-size: 9.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.mark + .mark { margin-left: -5px; }
.m1 { background: var(--acct-1); }
.m2 { background: var(--acct-2); }
.m3 { background: var(--acct-3); }
.shot-search {
  margin-left: auto;
  width: min(220px, 30%);
  height: 28px;
  border-radius: var(--radius-control);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  display: flex;
  align-items: center;
  padding: 0 10px;
  gap: 6px;
}
.shot-search svg { width: 14px; height: 14px; }

.shot-body {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.stack { padding: 14px; border-right: 1px solid var(--line); }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  margin-bottom: 8px;
  background: var(--surface);
}
.step .axis { color: var(--ink-3); width: 64px; flex: none; }
.step .val { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step .n, .row .n, .files .when { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-3); }

.live {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  overflow: hidden;
}
.chips {
  display: flex;
  gap: 6px;
  padding: 10px;
  background: var(--surface-sunk);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.chip {
  padding: 4px 10px;
  border-radius: var(--radius-chip);
  color: var(--ink-2);
  white-space: nowrap;
  border: 1px solid transparent;
}
.chip.on { background: var(--surface); color: var(--ink); border-color: var(--line-strong); font-weight: 600; }
.chip.dead { color: var(--ink-3); opacity: 0.55; }
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
}
.row::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: var(--share);
  background: var(--bar);
  border-radius: 6px;
  z-index: 0;
}
.row > * { position: relative; }
.row .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.hot::before { background: var(--accent-wash); }
.row.hot .label { color: var(--accent-ink); font-weight: 600; }
.row svg, .files svg { width: 16px; height: 16px; color: var(--ink-3); flex: none; }

.files { padding: 14px; }
.files-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px 10px;
  color: var(--ink-3);
}
.files-head b { color: var(--ink); font-weight: 600; }
.file {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 6px;
  border-bottom: 1px solid var(--line);
}
.file:last-child { border-bottom: 0; }
.file .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

@media (max-width: 760px) {
  .shot-body { grid-template-columns: 1fr; }
  .stack { border-right: 0; border-bottom: 1px solid var(--line); }
  .files .file:nth-child(n + 6) { display: none; }
  .shot-search { display: none; }
}

/* --- sections -------------------------------------------------------- */

section { padding: clamp(64px, 10vw, 112px) 0 0; }
.section-head { max-width: 40em; margin-bottom: 40px; }
.section-head h2 { font-size: var(--text-h2); font-weight: 700; text-wrap: balance; }
.section-head p { color: var(--ink-2); font-size: 18px; margin-top: 14px; text-wrap: pretty; }
.kicker {
  display: block;
  font-size: var(--text-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-ink);
  margin-bottom: 12px;
}

/* pivot walkthrough: three numbered moves */
.moves {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  counter-reset: move;
}
.move {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.move::before {
  counter-increment: move;
  content: counter(move);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 16px;
}
.move h3 { font-size: var(--text-h3); font-weight: 650; }
.move p { color: var(--ink-2); margin-top: 8px; }
.move .crumb {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface-sunk);
  border-radius: var(--radius-inset);
  padding: 8px 10px;
  overflow-wrap: anywhere;
}
.move .crumb b { color: var(--accent-ink); font-weight: 500; }
@media (max-width: 820px) {
  .moves { grid-template-columns: 1fr; }
}

/* feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.feature { background: var(--surface); padding: 28px; }
.feature .ic {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-control);
  background: var(--accent-wash);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: var(--text-h3); font-weight: 650; }
.feature p { color: var(--ink-2); margin-top: 8px; font-size: 15px; }
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 580px) {
  .features { grid-template-columns: 1fr; }
}

/* privacy */
.privacy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
}
.privacy .section-head { margin-bottom: 0; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.checks li:last-child { border-bottom: 0; }
.checks svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 3px; }
.checks b { display: block; font-weight: 600; }
.checks span { color: var(--ink-2); font-size: 15px; }
@media (max-width: 820px) {
  .privacy { grid-template-columns: 1fr; }
}

/* closing call to action */
.closer {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(40px, 7vw, 72px) var(--gutter);
}
.closer img { width: 72px; height: 72px; margin: 0 auto 20px; }
.closer h2 { font-size: var(--text-h2); font-weight: 700; }
.closer p { color: var(--ink-2); margin: 12px auto 28px; max-width: 30em; }

/* --- footer ---------------------------------------------------------- */

.site-foot {
  margin-top: clamp(64px, 10vw, 112px);
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--ink-3);
  font-size: var(--text-small);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
.site-foot nav { margin-left: auto; display: flex; gap: 20px; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }

/* --- downloads page -------------------------------------------------- */

.page-head { padding: clamp(48px, 8vw, 80px) 0 0; }
.page-head h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -0.03em; }
.page-head p { color: var(--ink-2); font-size: var(--text-lead); margin-top: 12px; max-width: 34em; }

.latest {
  margin-top: 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 4vw, 36px);
}
.latest-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.latest-top img { width: 56px; height: 56px; }
.latest-top h2 { font-size: 24px; font-weight: 700; }
.latest-top .meta { color: var(--ink-3); font-size: var(--text-small); }
.badge {
  font-size: var(--text-micro);
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 3px 10px;
  border-radius: var(--radius-chip);
}
.notes { margin: 20px 0 0; padding-left: 20px; color: var(--ink-2); }
.notes li + li { margin-top: 4px; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}
.dl {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-control);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 120ms var(--ease-out), background 120ms var(--ease-out);
}
.dl:hover { border-color: var(--accent); background: var(--surface-hover); color: var(--ink); }
.dl.primary { background: var(--accent); border-color: var(--accent); color: var(--ink-inverse); }
.dl.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--ink-inverse); }
.dl svg { width: 22px; height: 22px; flex: none; }
.dl .what { flex: 1; min-width: 0; }
.dl b { display: block; font-size: var(--text-body); }
.dl small { display: block; font-size: var(--text-micro); opacity: 0.8; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl .size { font-family: var(--font-mono); font-size: var(--text-micro); opacity: 0.8; }
@media (max-width: 640px) {
  .dl-grid { grid-template-columns: 1fr; }
}

.which {
  margin-top: 16px;
  font-size: var(--text-small);
  color: var(--ink-2);
}

.sums { margin-top: 18px; font-size: var(--text-micro); color: var(--ink-3); }
.sums summary { cursor: pointer; width: fit-content; }
.sums dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; margin: 10px 0 0; }
.sums dt { color: var(--ink-2); }
.sums dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }

.guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.guide .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
}
.guide h3 { font-size: var(--text-h3); font-weight: 650; margin-bottom: 12px; }
.guide ol, .guide ul { margin: 0; padding-left: 20px; color: var(--ink-2); }
.guide li + li { margin-top: 6px; }
.guide .card p { color: var(--ink-2); }
.guide .card p + p, .guide .card p + ol, .guide .card p + ul, .guide .card ol + p, .guide .card ul + p { margin-top: 10px; }
.guide .wide { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .guide { grid-template-columns: 1fr; }
}

.older { width: 100%; border-collapse: collapse; font-size: var(--text-small); }
.older th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-3);
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--line-strong);
}
.older td { padding: 14px 12px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.older td:first-child { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.older .date { font-family: var(--font-mono); color: var(--ink-3); white-space: nowrap; }
.older .links { white-space: nowrap; }
.older .links a + a { margin-left: 14px; }
.older .summary { color: var(--ink-2); }
@media (max-width: 640px) {
  .older .summary, .older th:nth-child(3) { display: none; }
}

.empty, .error {
  margin-top: 36px;
  padding: 24px;
  border-radius: var(--radius-card);
  border: 1px dashed var(--line-strong);
  color: var(--ink-2);
}
