/* ---------- Dark theme + Manrope (clean) ---------- */
:root{
  /* Brand accent — the single source of truth. Everything accent-coloured
     derives from this (including --hero-accent below). */
  --tayen-accent: #00B0F0;

  --bg: #000000;
  --ink: #f2f5f7;
  --muted: #a1a7b3;
  --line: #1f2430;
  --card: #0c0f14;
  --btn: #ffffff;
  --btn-ink: #000000;
  --link: #cfd6ff;
  --link-hover: #e4e8ff;

  --font-sans: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Frontier Silicon hero palette */
  --hero-bg: #0B0F1A;       /* deep ink */
  --hero-accent: var(--tayen-accent);   /* accent / kicker / primary CTA */
  --hero-title: #F1F5F9;
  --hero-sub: #94A3B8;
  --hero-hairline: #1E293B; /* borders */

  /* Vertical rhythm — one shared scale instead of per-section margins.
     --space-section: 80px @390, ~122px @1024, ~155px @1440, capped 160px. */
  --space-section: clamp(80px, 8vw + 40px, 160px);
  --space-block: clamp(16px, 2vw, 24px);  /* heading→body, small intra-section gaps */
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }

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

.wrap { max-width: 1100px; margin: 0 auto; padding: 16px 24px; }

.nav { display: flex; gap: 18px; align-items: center; }
.logo { display:flex; gap:10px; align-items:center; text-decoration:none; }
.logo-text { font-weight: 700; color: var(--ink); }

.primary-nav { margin-left: auto; display: flex; gap: 16px; }

.main { padding: 28px 0; }

.grid { display:grid; gap:18px; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); }
.card { background: var(--card); border:1px solid var(--line); border-radius:12px; padding:16px; }

.btn { display:inline-block; padding:10px 14px; border-radius:10px; background: var(--btn); color: var(--btn-ink); font-weight:600; }
.btn:hover { opacity: .9; text-decoration: none; }

/* --- Typography helpers --- */
.kicker { text-transform: uppercase; letter-spacing:.08em; color: var(--muted); font-size:12px; font-weight: 500; }
.h1 { font-size: 44px; line-height:1.1; margin:10px 0 12px; font-weight: 400; letter-spacing: -0.005em; } /* normal (not bold) */
.sub { font-size: 18px; color: var(--muted); max-width: 800px; font-weight: 400; }

/* People grid */
.person .name { font-weight: 600; color: var(--ink); }
.person .title, .person .role { color: var(--muted); font-size: 14px; }

/* Bigger, crisp avatars on dark */
img.headshot {
  width: 160px;            /* visible size */
  height: 160px;
  object-fit: cover;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: #111;
  display: block;
}

/* Rich text from Wagtail */
.richtext p, .richtext li { color: var(--ink); }
.richtext h2, .richtext h3 { color: var(--ink); }

/* Breathing room between list items (the editor can't add blank lines) */
.richtext ol, .richtext ul { padding-left: 1.4em; }
.richtext li { margin-bottom: 0.4em; line-height: 1.6; }
.richtext li:last-child { margin-bottom: 0; }

/* Brand text-colour palette (applied from the rich-text editor) */
.text-accent { color: var(--tayen-accent); }
.text-muted  { color: var(--muted); }

/* Relative font sizes (applied from the rich-text editor). em-based so they
   scale relative to the surrounding text. */
.text-small  { font-size: 0.85em; }
.text-large  { font-size: 1.25em; }
.text-xlarge { font-size: 1.6em; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--tayen-accent); outline-offset: 2px; }

/* --- Site footer: centered symmetric stack --- */
.site-footer {
  background: var(--bg);
  border-top: 1px solid #1f1f1f;   /* hairline, barely visible on black */
  color: var(--hero-sub);
  font-size: 14px;
}
.footer-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
  padding-top: 64px;
  padding-bottom: 48px;
}
.footer-logo { display: inline-flex; text-decoration: none; }
.footer-logo img { width: 140px; height: auto; display: block; }
.footer-wordmark { font-weight: 700; font-size: 20px; color: var(--hero-title); }
.footer-blurb {
  margin: 0;
  max-width: 30em;
  text-wrap: balance;
  font-size: 14px;
  line-height: 1.6;
  color: var(--hero-sub);
}
.footer-social {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}
.footer-social a { color: var(--hero-sub); }
.footer-social a:hover { color: var(--hero-accent); text-decoration: none; }
.footer-legal { margin: 0; font-size: 12px; color: #9a9a9a; }
.footer-legal a { color: #9a9a9a; margin-left: 14px; }

/* --- Hero sizing ---
   A min-height band that grows with its content instead of a fixed
   aspect-ratio. The old aspect-ratio + absolutely-centered inner clipped the
   (taller) text hero on mobile; this lets it expand so nothing is cut off. */
.hero {
  margin-bottom: var(--space-section);  /* same rhythm as section-to-section */
  position: relative;
  overflow: hidden;
  isolation: isolate;         /* keep overlays contained */
  display: flex;
  flex-direction: column;
  justify-content: center;    /* vertical centering within the band */
  min-height: clamp(360px, 52vh, 600px);
}

/* Keep content padded; in normal flow so the hero grows to fit. The .wrap
   class on this element would otherwise center + cap it (margin:0 auto /
   max-width); cancel that so the copy stays left-aligned to the page gutter
   (the outer main .wrap already caps the width). */
.hero-inner {
  position: relative;
  margin: 0;
  max-width: none;
  width: 100%;
  display: grid; align-content: center;
  padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 4vw, 40px);
  z-index: 2;
}
/* In the hero grid, items stretch full-width by default — keep the CTA button
   sized to its content and left-aligned instead of spanning the page. */
.hero-inner .btn { justify-self: start; }

/* Background image as real <img> for Safari */
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--pos-x, 50%) var(--pos-y, 50%); /* tweakable */
  display: block;
  transform: scale(1.02);
  filter: contrast(108%) saturate(106%);
}
/* Two-column hero: text on the left, animated/vector panel on the right. */
.hero-inner.has-media {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-content: center;
  align-items: center;
  column-gap: clamp(28px, 5vw, 72px);
}
.hero-copy { display: grid; align-content: center; }
.hero-media {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: min(42vh, 420px);  /* caps the hero band at ~70vh; object-fit:contain keeps the SVG whole */
  display: grid;
  place-items: center;
}
/* No panel background or border (blends into the page); contain so the whole
   SVG is scaled to fit and stays fully visible. */
.hero-media-svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero-media-svg svg { width: 100%; height: 100%; display: block; }

/* Reduced motion: freeze the morph on its chip frame. Only reachable because
   the SVG is inlined; classes are the morph's own (b*=brain, c*=chip,
   h*=humanoid, all as class="s xN"). */
@media (prefers-reduced-motion: reduce) {
  .hero-media-svg svg * { animation: none !important; }
  .hero-media-svg svg [class*=" b"],
  .hero-media-svg svg [class*=" h"] { display: none; }
  .hero-media-svg svg [class*=" c"] { stroke-dashoffset: 0 !important; }
}

@media (max-width: 860px) {
  /* Stack: text above, the media panel below. Tighter rhythm so the hero
     lands near 70vh on phones and the proof strip stays reachable. */
  .hero { min-height: 48vh; }   /* the desktop 52vh clamp is what held 390 at 73vh */
  .hero-inner { padding: 20px 0 8px; }
  .hero-inner.has-media { grid-template-columns: 1fr; row-gap: 12px; }
  .hero-media { aspect-ratio: 16 / 9; max-height: min(20vh, 170px); }
  .hero-lockup { margin-top: 8px; }
  /* Separation should be visible, not literal: 24px is enough on narrow. */
  section.hero .sub { margin-top: 24px; }
}

/* Dark overlay keeps text readable */
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.55),
    rgba(0,0,0,.35) 45%,
    rgba(0,0,0,.65)
  );
  z-index: 1; pointer-events: none;
}

/* --- spacing utilities --- */
.mt-xxl { margin-top: var(--space-section) !important; }
.mb-xxl { margin-bottom: var(--space-section) !important; }

/* Body copy: 17px mobile -> 18px desktop, under the headings not beside them */
.intro {
  font-size: clamp(17px, 1vw + 13px, 18px);
  line-height: 1.6;
  max-width: 900px;                      /* keeps lines readable */
}
.intro p { margin: 0 0 0.9em; }
/* No trailing margin inside a section box — keeps the visual gap between
   sections exactly one --space-section (was 155+16px after text sections). */
.intro p:last-child { margin-bottom: 0; }

/* --- Proof strip: bare facts under the hero --- */
/* The strip sits inside the hero's --space-section gap rather than adding to
   it: the hero's own margin is zeroed and the strip's margins + 28px padding
   rebuild the same total distance to the first section. */
section.hero:has(+ .proof-strip) { margin-bottom: 0; }
.proof-strip {
  /* Half the section gap each side, minus the padding AND roughly half the
     strip's own line box, so hero -> first section totals ~one section gap. */
  margin: max(10px, calc(var(--space-section) / 2 - 46px)) 0;
  padding: 28px 0;
}
.proof-strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));  /* 150 leaves a 5+1 orphan at 1024 */
  gap: 14px 24px;
  font-size: 13px;
  letter-spacing: 0.05em;
  line-height: 1.4;
}
.proof-strip strong { color: var(--hero-accent); font-weight: 600; }
/* Labels break as whole units (never mid-phrase orphans like "budget"/"it") */
.proof-strip span { color: #9a9a9a; white-space: nowrap; }
@media (max-width: 760px) {
  .proof-strip ul { grid-template-columns: repeat(2, 1fr); }
}
/* End-of-page variant (above the footer): the top margin collapses with the
   last section's --space-section bottom margin, so the gap stays single. */
.proof-strip--end { margin: var(--space-section) 0 0; }

/* In-section variant (e.g. under the Founding Team heading): compact margins
   instead of the hero-budget ones. Its longer labels need to wrap freely
   (the nowrap above is tuned to the short compute-gap labels). */
.proof-strip--inline { margin: 4px 0 16px; padding: 12px 0; }
.proof-strip--inline span { white-space: normal; }

/* --- Home content sections: one shared 12-column grid, one left edge ---
   All prose (headings + paragraphs) sits in columns 1-7; a section's figure
   stacks directly below its own text in columns 1-9, a --space-block away,
   so it reads as part of the section rather than floating beside it. The
   admin figure-side choice is deliberately ignored. */
.section-full,
.section-split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(16px, 1.5vw, 24px);
}
.section-full { max-width: none; }
.section-full > * { grid-column: 1 / 8; }

.section-split { row-gap: var(--space-block); }
.section-split .intro { grid-column: 1 / 8; max-width: none; }
/* Full-bleed-to-container figures: narrow prose against wide charts is the
   deliberate contrast; same left edge, more room for dense diagrams. */
.section-split .section-figure { grid-column: 1 / -1; }

/* Section headings (the bold accent lead paragraph of each section):
   clearly above body size, tight to the text they introduce. */
.section-full > p:first-child,
.section-split .intro > p:first-child {
  font-size: clamp(21px, 1vw + 17px, 26px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-block);
}

.section-figure { margin: 0; }
.section-figure img { width: 100%; height: auto; display: block; }
.section-figure svg { width: 100%; height: auto; display: block; }
@media (max-width: 760px) {
  /* Single column; figure stays below its text, as on desktop */
  .section-full > *,
  .section-split .section-figure,
  .section-split .intro { grid-column: 1 / -1; }
}

/* --- Tech brief pages (TechBriefPage) --- */
/* Narrative pages: readable column width, left-aligned to match index pages. */
.tech-brief { max-width: 820px; }

.tb-hero { margin-bottom: clamp(28px, 5vw, 56px); }
.tb-kicker {
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-size: 12px; font-weight: 500;
  margin: 0 0 10px;
}
.tb-hero h1 {
  font-size: clamp(32px, 5vw, 44px); line-height: 1.1;
  margin: 0 0 12px; font-weight: 400; letter-spacing: -0.005em;
}
.tb-subtitle {
  font-size: clamp(16px, 2.1vw, 20px); line-height: 1.4;
  color: var(--muted); max-width: 700px; margin: 0;
}
.tb-hero-img { margin: clamp(24px, 4vw, 40px) 0 0; }
.tb-hero-img img {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--line);
}

/* Body flow: headings, rich text and figures */
.tb-body { font-size: clamp(16px, 2.1vw, 18px); line-height: 1.7; }
.tb-body h2 {
  font-size: clamp(22px, 3vw, 28px); line-height: 1.2;
  font-weight: 600; letter-spacing: -0.005em;
  margin: clamp(36px, 5vw, 56px) 0 12px;
}
.tb-body .richtext { margin: 0 0 1.2em; }
.tb-body .richtext p { margin: 0 0 0.9em; }

.tb-figure { margin: clamp(28px, 4vw, 44px) 0; }
.tb-figure img {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card);
}
.tb-figure figcaption {
  color: var(--muted); font-size: 14px; line-height: 1.5;
  margin-top: 10px; text-align: center;
}

/* --- Section headers (index pages) --- */
.section-head { margin: 0 0 clamp(24px, 4vw, 40px); }
.section-head h1 {
  font-size: clamp(32px, 5vw, 44px); line-height: 1.1;
  margin: 0 0 12px; font-weight: 400; letter-spacing: -0.005em;
}

/* --- Grouped sections (Technology hub) --- */
/* Lay the groups out as side-by-side columns; collapse to one on narrow. */
.tech-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 4vw, 48px);
  align-items: start;
}
.tech-group { margin: 0; }
.tech-group-title {
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; letter-spacing: -0.005em;
  margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
/* Within a column, stack the cards vertically. */
.tech-groups .card-grid { grid-template-columns: 1fr; }
/* Item titles lighter than the section heading for clearer hierarchy. */
.tech-groups .card-title { font-weight: 400; }

/* --- Card grid (research / news indexes) --- */
.card-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card-link {
  display: flex; flex-direction: column; padding: 0; overflow: hidden;
  text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.card-link:hover {
  text-decoration: none; border-color: #33405c; transform: translateY(-2px);
}
.card-thumb {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  display: block; border-bottom: 1px solid var(--line);
}
.card-text { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.card-title { font-size: 18px; font-weight: 600; line-height: 1.25; margin: 0; }
.card-desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.card-meta { color: var(--muted); font-size: 12px; margin: 0; }

/* --- Careers --- */
.job-list { margin-top: clamp(32px, 5vw, 56px); }
.job-list h2 { font-size: clamp(20px, 3vw, 26px); margin: 0 0 16px; font-weight: 600; }
.job-list-items { list-style: none; margin: 0; padding: 0; }
.job-row { border-top: 1px solid var(--line); }
.job-row:last-child { border-bottom: 1px solid var(--line); }
.job-row a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  padding: 16px 4px; text-decoration: none; color: var(--ink);
}
.job-row a:hover { text-decoration: none; color: var(--link-hover); }
.job-title { font-weight: 600; font-size: 17px; }
.job-meta { color: var(--muted); font-size: 14px; }
.apply-cta { margin: clamp(28px, 4vw, 44px) 0 0; }

/* --- Related research (technology pillar) --- */
.related-research {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}
.related-research h2 {
  font-size: clamp(20px, 3vw, 26px); margin: 0 0 20px; font-weight: 600;
}

/* --- Primary navigation --- */
.primary-nav .nav-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 1.5rem;
}
.primary-nav .nav-item { position: relative; }
.primary-nav .nav-item > a {
  display: inline-block; padding: 6px 0;
  color: var(--ink); text-decoration: none;
  font-size: 15px; font-weight: 500; white-space: nowrap;
}
.primary-nav .nav-item > a:hover { color: var(--link-hover); }

.primary-nav .dropdown {
  display: none;
  position: absolute; left: 0; top: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 0; margin: 0; list-style: none; min-width: 200px; z-index: 20;
}
.primary-nav .dropdown li { padding: 0; }
.primary-nav .dropdown a {
  display: block; padding: 8px 14px;
  color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.primary-nav .dropdown a:hover { background: rgba(255,255,255,.05); color: var(--link-hover); }
.primary-nav .nav-item.has-children:hover > .dropdown { display: block; }

/* Mobile: wrap the nav instead of overflowing */
@media (max-width: 640px) {
  .nav { flex-wrap: wrap; }
  .primary-nav { width: 100%; margin-left: 0; }
  .primary-nav .nav-list { flex-wrap: wrap; gap: 0.6rem 1.25rem; }
}

/* --- Frontier Silicon hero (home) ----------------------------------------- */
/* No hero background: it inherits the page background; the bg image still
   renders on top if one is set on the page. */

/* Reading order: kicker -> title -> subtitle. Kicker + subtitle carry meaning,
   the serif title is the brand anchor. */
section.hero .kicker {
  text-transform: none;            /* sentence case, not uppercase */
  letter-spacing: 0;
  color: var(--hero-accent);
  font-weight: 500;
  font-size: clamp(0.875rem, 0.3vw + 0.8rem, 1rem);
  /* Sit on one line where there's room; only the narrow viewport wraps it,
     and then at the container edge rather than mid-phrase. */
  max-width: 100%;
}

/* Title lockup: h1 + subtitle read as one unit. The wrapper owns the
   responsive size; the h1 is 1em of it and the subtitle a % of it (set
   inline from the admin scale field, ~40-45%). */
.hero-lockup {
  font-size: clamp(2.25rem, 3.4vw + 1rem, 3.25rem); /* ~36 -> 52px */
  letter-spacing: -0.02em;
  color: var(--hero-title);
  margin: 12px 0 0;
}
section.hero .h1 {
  font-weight: 400;
  font-size: 1em;
  line-height: 1.05;
  color: inherit;
  margin: 0;
}
section.hero .h1-line2 {
  display: block;
  font-size: 45%;            /* default; the admin scale overrides inline */
  line-height: 1.2;
  margin: 0.14em 0 0;        /* tight: same thought as the h1 */
}

/* Standalone statement: clearly separated from the lockup, body-ish size. */
section.hero .sub {
  font-size: clamp(1rem, 0.6vw + 0.7rem, 1.1875rem); /* ~16 -> 19px */
  line-height: 1.5;
  color: var(--hero-sub);
  max-width: 490px;                /* wraps to 2-3 lines */
  margin: clamp(32px, 3vw, 40px) 0 0;
}

/* CTA row: primary solid accent, secondary outline only. */
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-cta .btn { padding: 11px 18px; }

.btn--primary {
  background: var(--hero-accent);
  color: var(--hero-bg);           /* dark text on accent */
}
.btn--primary:hover { opacity: .92; }

.btn--secondary {
  background: transparent;
  color: var(--hero-title);
  border: 1px solid var(--hero-hairline);
  font-weight: 500;
}
.btn--secondary:hover {
  background: transparent;
  border-color: var(--hero-accent);
  color: var(--hero-title);
}

