/* fitzroyalabs.com — "The control sheet". Ivory paper, ink, one copper. The films are the only dark objects. */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Chivo Mono";
  src: url("/assets/fonts/chivo-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --paper: oklch(0.945 0.012 85);
  --paper-deep: oklch(0.912 0.015 84);
  --ink: oklch(0.2 0.012 60);
  --ink-soft: oklch(0.4 0.014 60);
  --rule: oklch(0.2 0.012 60 / 0.18);
  --rule-strong: oklch(0.2 0.012 60 / 0.7);
  --copper: oklch(0.5 0.125 50);
  --copper-light: oklch(0.74 0.125 58);
  --screen: oklch(0.17 0.008 60);
  --screen-text: oklch(0.86 0.012 85);

  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  --gutter: clamp(20px, 4.2vw, 64px);
  --margin-col: clamp(0px, 9vw, 150px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  font-weight: 420;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
::selection { background: var(--ink); color: var(--paper); }

.wrap { padding-inline: var(--gutter); max-width: 1480px; margin-inline: auto; }
.mono { font-family: "Chivo Mono", ui-monospace, monospace; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }

.skip { position: absolute; left: var(--gutter); top: -60px; z-index: 10; background: var(--ink); color: var(--paper); padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 8px; }

/* Top bar */
.bar { border-bottom: 1px solid var(--rule-strong); }
.bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-xs) var(--space-lg); min-height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; min-height: 44px; align-items: center; text-decoration: none; font-weight: 720; font-stretch: 108%; letter-spacing: 0.12em; font-size: 1.05rem; }
.brand-star { color: var(--copper); font-size: 1.25em; line-height: 0; transform: translateY(0.1em); }
.brand small { font-weight: 420; font-stretch: 100%; letter-spacing: 0.01em; font-size: 0.8rem; color: var(--ink-soft); }
.bar nav { display: flex; flex-wrap: wrap; gap: 2px var(--space-lg); }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-size: 0.95rem; font-weight: 520; }
.bar nav a:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* Lead */
.lead { padding-block: clamp(48px, 9vw, 128px) clamp(40px, 6vw, 88px); }
.lead-grid { display: grid; gap: var(--space-2xl) var(--gutter); }
.kicker { color: var(--ink-soft); margin-bottom: var(--space-lg); }
.lead h1 {
  font-size: clamp(3rem, 10.4vw, 9.75rem);
  font-weight: 820;
  font-stretch: 66%;
  line-height: 0.86;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  max-width: 13ch;
}
.lead h1 em { font-style: normal; color: var(--copper); }
.lede { max-width: 46ch; font-size: clamp(1.1rem, 1.5vw, 1.35rem); line-height: 1.5; }
.lede + .lede { margin-top: var(--space-md); color: var(--ink-soft); font-size: 1.0625rem; }

.index { border-top: 1px solid var(--rule-strong); margin-top: clamp(36px, 5.5vw, 72px); }
.index li { border-bottom: 1px solid var(--rule); }
.index a { display: grid; grid-template-columns: 3.2rem 1fr auto; align-items: baseline; gap: var(--space-md); padding-block: var(--space-md); text-decoration: none; }
.index .no { color: var(--ink-soft); }
.index .name { font-size: clamp(1.5rem, 2.6vw, 2.25rem); font-weight: 760; font-stretch: 72%; text-transform: uppercase; line-height: 1; }
.index .role { display: block; margin-top: 6px; font-size: 0.95rem; color: var(--ink-soft); font-weight: 420; font-stretch: 100%; text-transform: none; }
.index .go { color: var(--ink-soft); transition: transform 0.4s var(--ease-out), color 0.2s; }
.index a:hover .go { transform: translateY(4px); color: var(--copper); }

/* Sheets */
.sheet { border-top: 1px solid var(--rule-strong); padding-block: clamp(40px, 6vw, 88px) clamp(56px, 8vw, 120px); }
.sheet-head { display: grid; gap: var(--space-xs) var(--gutter); align-items: end; margin-bottom: clamp(28px, 4vw, 56px); }
.sheet-no { color: var(--ink-soft); }
.sheet h2 { font-size: clamp(3.25rem, 11vw, 10rem); font-weight: 840; font-stretch: 64%; line-height: 0.82; letter-spacing: -0.012em; text-transform: uppercase; }
.sheet .role { font-size: clamp(1.15rem, 1.8vw, 1.5rem); font-weight: 560; line-height: 1.25; max-width: 24ch; }
.hook { font-size: clamp(1.35rem, 2.5vw, 2.1rem); font-weight: 520; font-stretch: 88%; line-height: 1.22; max-width: 30ch; letter-spacing: -0.005em; }
.explain { margin-top: var(--space-lg); max-width: 58ch; color: var(--ink-soft); }
.intro { display: grid; gap: var(--space-lg) var(--gutter); margin-bottom: clamp(32px, 5vw, 64px); }

/* A product film with its chapters */
.demo { display: grid; gap: var(--space-lg) var(--gutter); align-items: start; }
.screen { background: var(--screen); color: var(--screen-text); border: 1px solid var(--ink); }
.screen video, .screen img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: var(--screen); }
.screen figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--space-lg); padding: 10px 14px; border-top: 1px solid oklch(0.86 0.012 85 / 0.2); }
.sound { display: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; background: none; border: 0; padding: 0; min-height: 44px; margin-block: -12px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.js .sound { display: inline-flex; align-items: center; }
.sound:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }
.steps-title { color: var(--ink-soft); padding-bottom: var(--space-sm); border-bottom: 1px solid var(--rule-strong); }
.steps li { border-bottom: 1px solid var(--rule); }
.steps a { display: grid; grid-template-columns: 3.4rem 1fr; gap: var(--space-sm); align-items: baseline; padding-block: 14px; text-decoration: none; min-height: 48px; }
.steps .at { color: var(--ink-soft); font-size: 0.78rem; }
.steps .what { font-weight: 520; line-height: 1.35; }
.steps .what small { display: block; margin-top: 3px; font-size: 0.92rem; font-weight: 420; color: var(--ink-soft); }
.steps a:hover { background: var(--paper-deep); }
.steps a[aria-current="step"] .at, .steps a[aria-current="step"] .what { color: var(--copper); }
.steps a[aria-current="step"] .what small { color: var(--ink-soft); }

/* Facts under each film */
.facts { display: grid; gap: 0 var(--gutter); margin-top: clamp(32px, 5vw, 64px); border-top: 1px solid var(--rule-strong); }
.facts div { padding-block: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-soft); margin-bottom: 6px; }
.facts dd { font-weight: 520; line-height: 1.35; max-width: 34ch; }

/* How they fit */
.join { border-top: 1px solid var(--rule-strong); background: var(--paper-deep); padding-block: clamp(48px, 7vw, 104px); }
.join h2, .contact h2 { font-size: clamp(2.25rem, 6vw, 5rem); font-weight: 820; font-stretch: 66%; line-height: 0.9; text-transform: uppercase; max-width: 16ch; }
.join-grid { display: grid; gap: var(--space-2xl) var(--gutter); margin-top: clamp(28px, 4vw, 56px); }
.join-grid p { max-width: 52ch; }
.join-grid p + p { margin-top: var(--space-md); color: var(--ink-soft); }
.pair { border-top: 1px solid var(--rule-strong); }
.pair div { display: grid; grid-template-columns: 7.5rem 1fr; gap: var(--space-md); padding-block: var(--space-md); border-bottom: 1px solid var(--rule); align-items: baseline; }
.pair dt { color: var(--ink-soft); }
.pair dd { font-weight: 520; line-height: 1.35; }

/* Contact and footer */
.contact { border-top: 1px solid var(--rule-strong); padding-block: clamp(56px, 8vw, 120px); }
.contact-grid { display: grid; gap: var(--space-xl) var(--gutter); align-items: end; }
.contact p { max-width: 46ch; margin-top: var(--space-lg); }
.mail { display: inline-block; font-size: clamp(1.35rem, 3.4vw, 2.75rem); font-weight: 640; font-stretch: 80%; text-underline-offset: 0.18em; text-decoration-thickness: 2px; text-decoration-color: var(--copper); overflow-wrap: anywhere; }
.mail:hover { color: var(--copper); }
.foot { border-top: 1px solid var(--rule-strong); padding-block: var(--space-lg) var(--space-2xl); color: var(--ink-soft); font-size: 0.92rem; }
.foot-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs) var(--space-xl); }
.foot a { text-underline-offset: 4px; }
.foot a:hover { color: var(--ink); }

/* Document pages (privacy, not found) */
.doc { padding-block: clamp(48px, 8vw, 112px); }
.doc h1 { font-size: clamp(2.5rem, 7vw, 5.5rem); font-weight: 820; font-stretch: 66%; line-height: 0.9; text-transform: uppercase; margin-bottom: var(--space-xl); }
.doc h2 { font-size: 1.25rem; font-weight: 700; margin-top: var(--space-xl); margin-bottom: var(--space-xs); }
.doc p { max-width: 62ch; }
.doc p + p { margin-top: var(--space-sm); }

/* One orchestrated entrance; content is never hidden without the script that reveals it. */
@media (prefers-reduced-motion: no-preference) {
  .js .rise { opacity: 0; transform: translateY(18px); }
  .js .rise.in { opacity: 1; transform: none; transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: calc(var(--i, 0) * 90ms); }
  /* boot.js sets .static when the motion module has not arrived in time. */
  .js.static .rise { opacity: 1; transform: none; }
}

@media (min-width: 900px) {
  .lead-grid { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); align-items: end; }
  .sheet-head { grid-template-columns: var(--margin-col) minmax(0, 1fr) minmax(220px, 0.5fr); }
  .intro { grid-template-columns: var(--margin-col) minmax(0, 1.2fr) minmax(0, 1fr); }
  .intro > :first-child { grid-column: 2; }
  .demo { grid-template-columns: minmax(0, 2.15fr) minmax(260px, 1fr); }
  .sheet.flip .demo { grid-template-columns: minmax(260px, 1fr) minmax(0, 2.15fr); }
  .sheet.flip .demo .screen { order: 2; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts div { border-bottom: 0; }
  .join-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr) auto; }
}
@media (min-width: 560px) and (max-width: 899px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
  .bar nav, .screen video { display: none; }
  body { background: #fff; }
}
