/* Page layout and the site's look: dark "flash" bands with ember beams, and "lab notes" sections in between.
   Colors, type and base components come from brand/. */

html { scroll-padding-top: 88px; }
html, body { margin: 0; background: var(--surface); color: var(--text); font-family: var(--font-sans); }
::selection { background: var(--ember); color: var(--ink); }
/* Full-bleed hover fills and beams never cause sideways scroll. */
main { overflow-x: clip; }

.wrap { max-width: 1152px; margin: 0 auto; }
.section { padding: var(--space-12) var(--space-6); }
.section--raised { background: var(--surface-raised); }
/* Ember punctuation at the end of big headlines. */
.dot { color: var(--ember); }


/* Nav: dark and sticky. It shares the 1152 px container so the logo and headline start on one edge. */
.fl-nav { position: sticky; top: 0; z-index: 20; padding: 0 max(var(--space-6), calc((100% - 1152px) / 2)); }
.fl-nav__logo:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }
.fl-nav__cta { min-height: 40px; padding: 10px 18px; }

/* Flash: a dark band with three ember beams bursting from one point, 28° apart like the mark's beams. */
.flash { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-8); box-sizing: border-box; min-height: min(calc(100svh - 64px), 880px); padding: var(--space-12) var(--space-6); background: var(--surface); color: var(--text); }
.flash--page { min-height: 0; padding-bottom: var(--space-8); }
.flash__inner { position: relative; z-index: 1; width: 100%; max-width: 1152px; margin: 0 auto; }
.flash__inner { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.flash__mark { display: block; width: 72px; height: 72px; }
.flash__title { margin: 0; max-width: 11ch; font-size: clamp(52px, 9vw, 128px); line-height: 0.9; font-weight: 800; font-stretch: 125%; letter-spacing: -0.035em; text-wrap: balance; }
.flash--page .flash__title { max-width: 13ch; font-size: clamp(48px, 7vw, 96px); }
.flash__lead { margin: 0; max-width: 540px; font-size: 20px; line-height: 30px; color: var(--muted); }
.flash__email { font-size: clamp(28px, 4vw, 48px); line-height: 1.1; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; color: var(--text); text-decoration: underline; text-decoration-color: var(--ember); text-decoration-thickness: 3px; text-underline-offset: 8px; overflow-wrap: anywhere; }
.flash__email:hover { text-decoration-thickness: 6px; }
.flash__email:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 4px; }
.flash__actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-1); }
/* Beams start a fixed distance into the 1152 px text column, so wide screens never slide them under the headline. */
/* An SVG with left and right set still sizes itself as a square, so the width is set explicitly to reach the right edge. */
.flash { --rays-x: calc(max(var(--space-6), (100% - 1152px) / 2) + min(58vw, 780px)); }
.flash__rays { position: absolute; left: var(--rays-x); bottom: 0; width: calc(100% - var(--rays-x)); height: 100%; }
/* Shorter bands put the beams closer to the headline, so they start further in. */
.flash--page { --rays-x: calc(max(var(--space-6), (100% - 1152px) / 2) + min(64vw, 860px)); }
.flash__beam { fill: var(--ember); }
.flash__point { fill: var(--paper); }
/* Per-page variants: Spotlight's found square, Research hairlines, 404 ghost beams, Contact signal arcs. */
.flash__cut { fill: var(--surface); }
.flash__line { fill: none; stroke: var(--muted); stroke-opacity: 0.4; stroke-width: 2; }
.flash__ghost { fill: none; stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 2; stroke-dasharray: 10 12; }
.flash__ring { fill: none; stroke: var(--ember); stroke-width: 56; }

/* The beams burst out from their shared point once on load. */
@keyframes beam-in { from { transform: scale(0.15); opacity: 0; } }
@keyframes point-in { from { opacity: 0; } }
@keyframes sweep { from { transform: rotate(14deg); opacity: 0; } 30% { opacity: 1; } }
@keyframes bar-in { from { transform: translateX(-120px); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes rise { from { transform: translateY(500px); } }
@keyframes ring-in { from { transform: scale(0.8); opacity: 0; } }
@keyframes flicker { 0%, 25%, 55%, 100% { opacity: 1; } 15%, 40% { opacity: 0.15; } }
@media (prefers-reduced-motion: no-preference) {
  .flash__beam { transform-box: view-box; transform-origin: 60px 940px; animation: beam-in 560ms cubic-bezier(.2,.8,.2,1) 80ms both; }
  .flash__beam:nth-child(2) { animation-delay: 160ms; }
  .flash__beam:nth-child(3) { animation-delay: 240ms; }
  .flash__point { animation: point-in 120ms ease-out both; }
  /* Variants keep the staggered delays above and swap only the motion. */
  .flash__rays--spotlight .flash__beam { animation-name: sweep; animation-duration: 900ms; }
  .flash__rays--shortlist .flash__beam { animation-name: bar-in; animation-duration: 520ms; }
  .flash__rays--research .flash__line { stroke-dasharray: 1; animation: draw 800ms cubic-bezier(.2,.8,.2,1) both; }
  .flash__rays--research .flash__beam { animation-delay: 520ms; }
  .flash__rays--about .flash__beam, .flash__rays--about .flash__beam:nth-child(n) { animation-name: rise; animation-duration: 640ms; animation-delay: 80ms; }
  .flash__ring { transform-box: view-box; transform-origin: 60px 940px; animation: ring-in 480ms cubic-bezier(.2,.8,.2,1) both; }
  .flash__ring:nth-child(2) { animation-delay: 120ms; }
  .flash__ring:nth-child(3) { animation-delay: 240ms; }
  .flash__ring:nth-child(4) { animation-delay: 360ms; }
  .flash__rays--404 .flash__beam { animation: none; }
  .flash__rays--404 .flash__point { animation: flicker 1s ease-out 300ms both; }
}

/* Section head: title and lead on one 2 px rule. */
.sec-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; margin-bottom: var(--space-6); padding-top: var(--space-2); border-top: var(--border-top) solid var(--text); }
.sec-head__title { margin: 0; font-size: clamp(36px, 5vw, 64px); line-height: 1; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; text-wrap: balance; }
.sec-head__lead { margin: 0; max-width: 440px; padding-top: 4px; font-size: 18px; line-height: 28px; color: var(--muted); }
.sec-foot { margin: var(--space-4) 0 0; }

/* Index: big rows. Linked rows flood with ember on hover, and the arrow tilts up to the beam angle. */
.index { list-style: none; margin: 0; padding: 0; border-bottom: var(--border-rule) solid var(--rule); }
.index__row { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 32px; gap: var(--space-4); align-items: baseline; padding: var(--space-4) 0; border-top: var(--border-rule) solid var(--rule); color: var(--text); text-decoration: none; }
.index--static .index__row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.index__name { font-size: clamp(30px, 4.5vw, 60px); line-height: 1; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; }
.index--notes .index__name { font-size: clamp(24px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.02em; }
.index__desc { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); font-size: 17px; line-height: 26px; color: var(--muted); }
.index__arrow { align-self: center; width: 32px; height: 32px; stroke: currentColor; transition: transform 240ms cubic-bezier(.2,.8,.2,1); }
a.index__row::before { content: ""; position: absolute; z-index: -1; inset: 0 calc(-1 * var(--space-3)); background: var(--ember); transform: scaleX(0); transform-origin: left; transition: transform 280ms cubic-bezier(.2,.8,.2,1); }
a.index__row:hover::before, a.index__row:focus-visible::before { transform: scaleX(1); }
/* Ink on ember is 5.7:1; muted text would fail, so everything turns Ink. */
a.index__row:hover, a.index__row:focus-visible, a.index__row:hover .index__desc, a.index__row:focus-visible .index__desc { color: var(--ink); }
a.index__row:hover .index__arrow, a.index__row:focus-visible .index__arrow { transform: translateX(6px) rotate(-28deg); }
a.index__row:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 4px; }

/* Plates: products shown like figures in a paper, whole plate clickable. */
.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.plate { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-4); background: var(--surface-raised); box-shadow: inset 0 0 0 var(--border-rule) var(--rule); color: var(--text); text-decoration: none; transition: box-shadow 180ms; }
.plate:hover { box-shadow: inset 0 0 0 var(--border-focus) var(--text); }
.plate:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }
.plate__top { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; margin-bottom: var(--space-4); }
.plate__mark { display: block; width: 96px; height: 96px; transition: transform 240ms cubic-bezier(.2,.8,.2,1); }
.plate:hover .plate__mark { transform: translateY(-4px); }
.plate__name { font-size: clamp(32px, 4vw, 48px); line-height: 1; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; }
.plate__body { flex-grow: 1; max-width: 44ch; font-size: 17px; line-height: 26px; color: var(--muted); }
.plate:hover .arrow-link svg { transform: translateX(4px); }

/* Statement: one big idea on an ember band. */
.statement { padding: var(--space-16) var(--space-6); background: var(--ember); color: var(--ink); }
.statement__title { margin: 0; max-width: 12ch; font-size: clamp(52px, 9vw, 136px); line-height: 0.9; font-weight: 800; font-stretch: 125%; letter-spacing: -0.035em; text-wrap: balance; }
.statement__body { margin: var(--space-4) 0 0; max-width: 560px; font-size: 20px; line-height: 30px; }

/* Loop: steps with tall condensed numerals. */
.loop { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.loop--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.loop li { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-2); border-top: var(--border-rule) solid var(--rule); }
.loop__n { margin-bottom: var(--space-2); font-size: clamp(72px, 9vw, 120px); line-height: 0.85; font-weight: 800; font-stretch: 62.5%; letter-spacing: -0.02em; color: var(--ember-action); font-variant-numeric: tabular-nums; }
.loop__title { margin: 0; font-size: 24px; line-height: 28px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.015em; }
.loop__body { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted); }

/* Notebook: an empty lab page, hatched at the beam angle. */
.notebook { padding: var(--space-6); background: repeating-linear-gradient(-28deg, transparent 0 14px, var(--rule) 14px 15px); box-shadow: inset 0 0 0 var(--border-rule) var(--rule); }
.notebook__page { display: flex; flex-direction: column; gap: var(--space-2); max-width: 520px; padding: var(--space-4); background: var(--surface-raised); box-shadow: inset 0 0 0 var(--border-rule) var(--rule); }
.notebook__title { margin: 0; font-size: 28px; line-height: 32px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; }
.notebook__page p:last-child { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted); }

/* Team: people as plates with an ember monogram. */
.team { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.person { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-4); background: var(--surface-raised); box-shadow: inset 0 0 0 var(--border-rule) var(--rule); }
.person__mono { display: grid; place-items: center; width: 88px; height: 88px; margin-bottom: var(--space-3); background: var(--ember); color: var(--ink); font-size: 32px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; }
.person__mono--line { background: transparent; box-shadow: inset 0 0 0 var(--border-focus) var(--text); color: var(--text); }
.person__role { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--muted); }
.person__name { margin: 0; font-size: 28px; line-height: 32px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.02em; }
.person__body { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted); }

/* Waitlist form */
.waitlist { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1); }
.waitlist[hidden] { display: none; }
.waitlist__row { display: flex; gap: var(--space-1); align-items: flex-end; }
.waitlist__row .fl-field { flex: 1; }
/* Button matches the logo: ember fill with an Ink label (5.7:1). The system's darker hover fails with Ink, so hover adds an Ink edge. */
.waitlist .fl-btn--ember:not([disabled]) { background: var(--ember); color: var(--ink); }
.waitlist .fl-btn--ember:not([disabled]):hover, .waitlist .fl-btn--ember:not([disabled]):active { box-shadow: inset 0 0 0 var(--border-focus) var(--ink); }
.waitlist__fine { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.waitlist .fl-field__input { border-color: var(--text); }
.waitlist__details summary { list-style: none; width: fit-content; display: inline-flex; align-items: center; gap: var(--space-half); font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); cursor: pointer; }
.waitlist__details summary::-webkit-details-marker { display: none; }
.waitlist__details summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.waitlist__details summary:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }
.waitlist__details summary svg { width: 20px; height: 20px; stroke: currentColor; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.waitlist__details[open] summary svg { transform: rotate(90deg); }
.waitlist__more { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-2); }
.waitlist__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
#waitlist-status { width: 100%; max-width: 560px; }

/* Text link with an arrow that steps right on hover */
.arrow-link { display: inline-flex; align-items: center; gap: var(--space-half); width: fit-content; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); text-decoration: none; }
.arrow-link svg { width: 20px; height: 20px; stroke: currentColor; transition: transform 180ms cubic-bezier(.2,.8,.2,1); }
.arrow-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.arrow-link:hover svg { transform: translateX(4px); }
.arrow-link:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }

/* Footer: legal links in the base row, then the name as a giant solid signature. */
.fl-footer__legal { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.fl-footer__base a { font-size: inherit; line-height: inherit; color: inherit; }
/* Line height 1.2 leaves room for the g's descender, which overflow: hidden would otherwise cut. */
.footer-sign { max-width: 1152px; margin: var(--space-6) auto 0; overflow: hidden; white-space: nowrap; font-size: min(17.5vw, 236px); line-height: 1.2; font-weight: 800; font-stretch: 125%; letter-spacing: -0.04em; color: var(--paper); user-select: none; }

/* Legal pages: one readable column; tables scroll inside .fl-table-wrap on phones. */
.legal__date { margin: 0; }
.legal__nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); border-bottom: var(--border-rule) solid var(--rule); }
.legal__nav a { padding: 12px 0; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--muted); text-decoration: none; }
.legal__nav a:hover, .legal__nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.legal__nav a:focus-visible { outline: var(--border-focus) solid var(--focus); outline-offset: 2px; }
.legal__body > :not(.fl-table-wrap) { max-width: 720px; }
.legal__body h2 { margin: var(--space-6) 0 0; font-size: 24px; line-height: 28px; font-weight: 800; font-stretch: 125%; letter-spacing: -0.015em; }
.legal__body p, .legal__body li { font-size: 16px; line-height: 26px; }
.legal__body p { margin: var(--space-2) 0 0; }
.legal__body ul, .legal__body ol { display: flex; flex-direction: column; gap: var(--space-1); margin: var(--space-2) 0 0; padding-left: var(--space-3); }
.legal__body .fl-table-wrap { margin-top: var(--space-3); }
.legal__body .fl-table td { vertical-align: top; }

/* The name: dark sign-off on the About page */
.name { background: var(--surface); color: var(--text); }
.name__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: var(--space-8); align-items: center; }
.name__mark { display: block; width: 100%; max-width: 280px; height: auto; }
.name__word { margin: 0; font-size: clamp(64px, 11vw, 144px); line-height: 0.9; font-weight: 800; font-stretch: 125%; letter-spacing: -0.03em; }
.name__def { margin: var(--space-3) 0 0; font-size: 24px; line-height: 32px; }
.name__def span { color: var(--muted); }
.name__body { margin: var(--space-2) 0 0; max-width: 480px; font-size: 16px; line-height: 24px; color: var(--muted); }

@media (max-width: 960px) {
  /* Tablets and phones: beams become a strip under the content instead of sitting beside it. */
  .flash, .flash--page { min-height: 0; padding-bottom: 0; }
  .flash__rays, .flash--page .flash__rays { position: relative; left: auto; right: auto; flex: none; width: calc(100% + 2 * var(--space-6)); height: 260px; margin: 0 calc(-1 * var(--space-6)); }
  .flash--page .flash__rays { height: 160px; }
  .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Index rows stack (name over description) below 960 px; four columns squeeze long names into the description.
     The 96 px number column lines names up with the section title above. */
  .index__row { grid-template-columns: minmax(0, 1fr) 28px; gap: var(--space-1) var(--space-4); padding: var(--space-3) 0; }
  .index--static .index__row { grid-template-columns: minmax(0, 1fr); }
  .index__desc { grid-column: 1; }
  .index__arrow { grid-row: 1; grid-column: 2; width: 28px; height: 28px; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: var(--space-3); }
  /* Phones: nav scrolls away; links get their own row under the logo; Contact stands in for the button. */
  .fl-nav { position: static; padding: var(--space-2) var(--space-2) 0; row-gap: 0; }
  .fl-nav__links { flex-basis: 100%; gap: var(--space-2); }
  .fl-nav__cta { display: none; }
  .flash, .flash--page { gap: var(--space-6); padding: var(--space-8) var(--space-2) 0; }
  .flash__rays, .flash--page .flash__rays { width: calc(100% + 2 * var(--space-2)); height: 220px; margin: 0 calc(-1 * var(--space-2)); }
  .flash--page .flash__rays { height: 140px; }
  .section { padding: var(--space-8) var(--space-2); }
  .statement { padding: var(--space-12) var(--space-2); }
  /* 52 px is too wide for "Benchmarks" on a 375 px phone; 11vw keeps the longest word on screen. */
  .statement__title { font-size: 11vw; }
  .sec-head { grid-template-columns: 1fr; gap: var(--space-2); }
  .index__row { column-gap: var(--space-2); }
  /* 30 px "partnerships" runs into the arrow below 375 px. */
  .index__name { font-size: min(30px, 7.5vw); }
  a.index__row::before { inset: 0 calc(-1 * var(--space-2)); }
  .plates, .team, .loop, .loop--3 { grid-template-columns: 1fr; }
  .plate, .person { padding: var(--space-3); }
  .notebook { padding: var(--space-2); }
  .fl-footer { padding: var(--space-8) var(--space-2) var(--space-4); }
  .waitlist__row { flex-direction: column; align-items: stretch; }
  .waitlist__more { grid-template-columns: 1fr; }
  .name__grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .name__mark { max-width: 120px; }
}
