/* ---------- Dark theme + Manrope (clean) ---------- */
:root{
  --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: #00B0F0;   /* accent / kicker / primary CTA — matches logo */
  --hero-title: #F1F5F9;
  --hero-sub: #94A3B8;
  --hero-hairline: #1E293B; /* borders */
}

* { 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: #00B0F0; }
.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 #7aa2ff; outline-offset: 2px; }

/* --- Site footer (multi-column, admin-editable) --- */
.site-footer {
  background: var(--hero-bg);            /* deep ink #0B0F1A */
  border-top: 1px solid var(--hero-hairline);
  color: var(--hero-sub);               /* muted #94A3B8 */
  font-size: 14px;
}
/* Top band: left brand zone, right link columns. */
.footer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 72px);
  padding-top: clamp(40px, 6vw, 64px);
  padding-bottom: clamp(32px, 5vw, 48px);
  align-items: start;
}

/* Left zone */
.footer-brand { display: grid; gap: 14px; align-content: start; }
.footer-logo { display: inline-flex; align-items: center; text-decoration: none; }
.footer-logo img { display: block; }
.footer-wordmark { font-weight: 700; font-size: 20px; color: var(--hero-title); }
.footer-blurb { margin: 0; font-size: 13px; line-height: 1.5; color: var(--hero-sub); max-width: 30ch; }
.footer-contact { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.footer-contact a { color: var(--hero-sub); font-size: 14px; }
.footer-contact a:hover { color: var(--hero-accent); text-decoration: none; }

/* Right zone: link columns */
.footer-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(24px, 4vw, 48px);
}
.footer-col-heading {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--hero-title);
}
.footer-col-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col-links a { color: var(--hero-sub); font-size: 14px; }
.footer-col-links a:hover { color: var(--hero-accent); text-decoration: none; }

/* Bottom bar: thin muted legal line */
.footer-bottom { border-top: 1px solid var(--hero-hairline); }
.footer-bottom-inner {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  align-items: center; justify-content: space-between;
  padding-top: 16px; padding-bottom: 16px;
  font-size: 12px; color: var(--hero-sub);
}
.footer-legal-links { display: flex; gap: 18px; }
.footer-legal-links a { color: var(--hero-sub); }
.footer-legal-links a:hover { color: var(--hero-accent); text-decoration: none; }

@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* --- 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 {
  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(40px, 8vw, 96px) 0  clamp(28px, 6vw, 64px);
  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;
  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; }

@media (max-width: 860px) {
  /* Stack: text above, the media panel below. */
  .hero-inner.has-media { grid-template-columns: 1fr; row-gap: clamp(24px, 5vw, 40px); }
  .hero-media { aspect-ratio: 16 / 9; }
}

/* 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: clamp(56px, 8vw, 128px) !important; }
.mb-xxl { margin-bottom: clamp(56px, 8vw, 128px) !important; }

/* Bigger intro text (fluid from mobile → desktop) */
.intro {
  font-size: clamp(16px, 2.1vw, 20px);  /* tweak numbers to taste */
  line-height: 1.7;
  max-width: 900px;                      /* keeps lines readable */
}
.intro p { margin: 0 0 0.9em; }

/* --- 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%;
}

section.hero .h1 {
  font-weight: 400;
  font-size: clamp(2.25rem, 3.4vw + 1rem, 3.25rem); /* ~36 -> 52px */
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--hero-title);
  margin: 12px 0 14px;
}

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 */
}

/* 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);
}

