/* ---------- Self-hosted fonts (variable, latin subset; no external requests) ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/spacegrotesk-latin.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  --bg: #05070d;
  --bg-alt: #080b14;
  --panel: #0e1320;
  --panel-2: #121829;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #eaf0ff;
  --muted: #97a3bd;
  --dim: #7c88a3; /* one shade above the 4.5:1 AA floor on --bg */
  --accent: #00e0b8;
  --accent-2: #0a84ff;
  --accent-3: #7b61ff;
  --maxw: 1120px;
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, .brand, .stat-num, .mailto {
  font-family: "Space Grotesk", "Inter", sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

/* Film grain / vignette overlay */
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(0, 224, 184, 0.10), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, rgba(123, 97, 255, 0.08), transparent 60%);
}

section, header, footer { position: relative; z-index: 1; }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 56px);
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 20px; font-weight: 700; display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { color: var(--accent); font-size: 14px; }
/* Brand lockup: the Glenrch wordmark with the registered entity (Glen Research LLC) beneath it in the nav,
   inline after it in the footer. The entity line stays visible at every breakpoint. */
.brand-lockup { flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1.1; }
.brand-word { display: inline-flex; align-items: center; gap: 9px; }
.brand-entity {
  font-family: "Inter", system-ui, -apple-system, sans-serif; font-weight: 500; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: clamp(14px, 3vw, 34px); }
.nav-links a { color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-cta {
  color: var(--text); border: 1px solid var(--line);
  padding: 8px 18px; border-radius: 999px;
  background: rgba(255,255,255,0.03);
}
.nav-links .nav-cta:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100svh; display: flex; align-items: flex-start;
  padding: clamp(150px, 20vh, 240px) clamp(20px, 5vw, 56px) 90px;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0,224,184,0.16), rgba(10,132,255,0.08) 40%, transparent 70%);
  filter: blur(20px); z-index: 0;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; width: 100%; position: relative; }
.eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 22px;
  padding: 7px 14px; border: 1px solid rgba(0,224,184,0.25); border-radius: 999px;
  background: rgba(0,224,184,0.05);
}
.hero-title {
  font-size: clamp(40px, 7vw, 82px); line-height: 1.02; font-weight: 700;
  margin-bottom: 26px;
}
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  font-size: clamp(17px, 2vw, 21px); color: var(--muted); max-width: 640px; margin-bottom: 38px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 64px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 16px;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #04121a; box-shadow: 0 10px 40px -12px rgba(0,224,184,0.6);
}
.btn-primary:hover { box-shadow: 0 16px 48px -10px rgba(0,224,184,0.75); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,0.02); }
.btn-ghost:hover { border-color: var(--accent); }

/* minmax(0, max-content): the columns shrink (and labels wrap) when the three stats would otherwise
   overflow the hero between the 640px breakpoint and full width; identical to max-content when they fit. */
.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, max-content));
  gap: clamp(24px, 5vw, 64px); align-items: start;
}
.stat { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-num { font-size: clamp(30px, 4vw, 46px); font-weight: 700; line-height: 1.05; white-space: nowrap; }
.stat-label { color: var(--dim); font-size: 14px; letter-spacing: 0.02em; }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(72px, 12vw, 130px) clamp(20px, 5vw, 56px);
}
.section-alt {
  max-width: none;
  background: linear-gradient(180deg, var(--bg-alt), var(--bg));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section-head { max-width: 760px; margin-bottom: 56px; }
/* alt sections centre every child at --maxw; widen the head to that box so it stays left-aligned with the cards */
.section-alt > .section-head { max-width: var(--maxw); }
.section-head > * { max-width: 760px; }
.tag {
  display: inline-block; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 18px;
}
.section-head h2, .contact h2 { font-size: clamp(28px, 4.4vw, 48px); line-height: 1.1; font-weight: 700; }
.section-lead { margin-top: 20px; font-size: clamp(16px, 2vw, 19px); color: var(--muted); }

.prose p { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 760px; margin-bottom: 22px; }

/* ---------- Product section: business pillars, figures, stage timeline ---------- */
.pillar, .product-figure, .stage {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.product-pillars { margin-top: 0; margin-bottom: 48px; } /* left/right stay auto: alt sections centre children */
.product-figure { margin-bottom: 48px; padding: 18px; }
.product-figure img { display: block; width: 100%; height: auto; border-radius: 10px; }
.product-figure figcaption { margin-top: 12px; color: var(--muted); font-size: 15px; }
.diagram-scroll { overflow-x: auto; }
.diagram-scroll svg { display: block; width: 100%; min-width: 760px; height: auto; } /* scrolls, not shrinks, on phones */
.dg-box { fill: var(--panel); stroke: var(--line-2); stroke-width: 1.5; }
.dg-loop {
  fill: color-mix(in srgb, var(--accent) 8%, transparent); stroke: var(--accent); stroke-width: 1.5;
  stroke-dasharray: 6 5;
}
.dg-title { fill: var(--text); }
.dg-note { fill: var(--muted); }
.dg-flow { fill: none; stroke: var(--accent); stroke-width: 2; }
.dg-arrow { fill: var(--accent); }
.stage { margin-top: 48px; padding: 26px 28px; }
.stage h3 { font-size: 19px; margin-bottom: 14px; }
.stage ol { list-style: none; }
.stage li {
  position: relative; padding: 0 0 12px 26px; border-left: 2px solid var(--line); margin-left: 6px;
  color: var(--muted); font-size: 16px;
}
.stage li:last-child { padding-bottom: 0; }
.stage li::before {
  content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
}
.stage li.next::before { background: var(--bg); border: 2px solid var(--accent); }
.stage li span { display: inline-block; min-width: 92px; color: var(--text); font-weight: 600; }
.stage p { margin-top: 16px; color: var(--muted); font-size: 15px; }

.pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 46px; }
.pillar { padding: 26px; }
.pillar h3 { font-size: 19px; margin-bottom: 8px; color: var(--text); }
.pillar p { color: var(--muted); font-size: 15px; }

/* ---------- Product / Platform / Research / Risk cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, 1fr); } /* 2x2 grid for 4-item sections (Product, Risk & Controls) */
.card {
  padding: 30px 28px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  transition: transform .25s ease, border-color .25s ease, box-shadow .3s ease;
}
.card:hover {
  transform: translateY(-4px); border-color: rgba(0,224,184,0.4);
  box-shadow: 0 24px 60px -30px rgba(0,224,184,0.5);
}
.card-ico {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; margin-bottom: 20px;
  background: rgba(0,224,184,0.08); border: 1px solid rgba(0,224,184,0.2); color: var(--accent);
}
.card h3 { font-size: 19px; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 15px; }

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.member {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 32px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  transition: border-color .25s ease, transform .25s ease;
}
.member:hover { border-color: rgba(10,132,255,0.4); transform: translateY(-3px); }
.avatar {
  flex: none; width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center; font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 26px; color: #05070d;
  background: linear-gradient(135deg, var(--a), var(--b));
}
.member-body h3 { font-size: 22px; }
.role { color: var(--accent); font-size: 14px; font-weight: 600; margin-bottom: 12px; letter-spacing: 0.02em; }
.bio { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.linkedin {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600;
  color: var(--text); padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px;
  transition: border-color .2s, background .2s;
}
.linkedin:hover { border-color: var(--accent-2); background: rgba(10,132,255,0.08); }
.in {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px;
  background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; font-style: normal;
}

/* ---------- Contact ---------- */
.contact { text-align: center; }
.contact-inner { max-width: 720px; margin: 0 auto; }
.contact .tag { display: block; }
.mailto {
  display: inline-block; margin-top: 30px; font-size: clamp(24px, 4.5vw, 44px); font-weight: 700;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  border-bottom: 1px solid rgba(0,224,184,0.3); padding-bottom: 4px;
  transition: opacity .2s;
}
.mailto:hover { opacity: 0.85; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 40px clamp(20px, 5vw, 56px); }
.section-alt + .footer { border-top: 0; } /* the alt section above already draws the divider */
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; display: flex; flex-direction: column;
  align-items: flex-start; gap: 14px;
}
.footer p { color: var(--dim); font-size: 14px; }
.footer-legal p + p { margin-top: 4px; }
.footer-legal a { color: var(--muted); border-bottom: 1px solid rgba(255,255,255,0.14); transition: color .2s, border-color .2s; }
.footer-legal a:hover { color: var(--text); border-color: var(--accent); }

/* ---------- Reveal animation (only when JS is active, so content never stays hidden) ----------
   The active class is ".revealed" — keep it distinct from every style class in this file.
   In particular NOT ".in", which is the LinkedIn badge style on the team cards. */
.js .reveal { transition: opacity .7s ease, transform .7s ease; }
.js .reveal:not(.revealed) { opacity: 0; transform: translateY(22px); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .pillars, .cards { grid-template-columns: repeat(2, 1fr); }
  .pillar:last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd trailing pillar spans both columns instead of sitting orphaned */
  .team { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links a:not(.nav-cta) { display: none; } /* keep only the Contact pill; the brand lockup (with its entity line) stays */
  .pillars, .cards { grid-template-columns: 1fr; }
  .member { flex-direction: column; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .stat-num { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .reveal:not(.revealed) { opacity: 1; transform: none; }
  .js .reveal { transition: none; }
  html { scroll-behavior: auto; }
}
