/* ========== Renyi landing ========== */
/* Black + silver. IBM Plex Sans + Plex Mono (self-hosted). Pure mono accent. */

/* ---- Self-hosted IBM Plex (drops external Google Fonts dep) ---- */
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('vendor/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('vendor/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal; font-weight: 500; font-display: swap;
  src: url('vendor/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  --bg:        #000000;
  --bg-2:      #0a0a0a;
  --bg-3:      #111111;
  --fg:        #ffffff;
  --fg-2:      #c8ccd1;          /* "silver" — secondary fg */
  --fg-muted:  #8a8f97;
  --fg-faint:  #4a4e54;
  --accent:    #ffffff;          /* mono accent */
  --accent-soft: rgba(255,255,255,0.08);
  --line:      #1a1a1a;
  --line-2:    #2a2a2a;
  --max:       1180px;
  --gutter:    clamp(20px, 5vw, 56px);
  --r:         2px;              /* sharp corners — defense-tech feel */

  --font-display: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Sticky topbar is ~64px tall; offset scroll target so headings aren't hidden under it */
  scroll-padding-top: 80px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--fg-faint); transition: border-color 0.15s ease; }
a:hover { border-bottom-color: var(--fg); }
.no-underline, .nav a, .brand, .btn { border-bottom: 0 !important; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -40px; left: 8px;
  background: var(--fg); color: var(--bg);
  padding: 6px 10px;
  z-index: 100;
  font-family: var(--font-mono); font-size: 12px;
}
.skip-link:focus { top: 8px; }

/* ---------- Mono utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 400;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--gutter);
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--fg); font-weight: 500; letter-spacing: 0;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--fg);
  font-family: var(--font-mono);
  font-weight: 500; font-size: 14px;
  color: var(--fg);
}
.brand-text {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav { display: flex; align-items: center; gap: 8px; }
.nav a {
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* WCAG 2.2 / Google: ≥48px touch target — pad vertically */
  padding: 14px 12px;
  display: inline-flex; align-items: center;
  min-height: 44px;
}
.nav a:hover { color: var(--fg); }
.nav .nav-cta {
  color: var(--bg);
  background: var(--fg);
  padding: 14px 18px;
}
.nav .nav-cta:hover { background: var(--fg-2); color: var(--bg); }

@media (max-width: 700px) {
  .nav a:not(.nav-cta) { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: clamp(96px, 14vw, 180px) var(--gutter) clamp(72px, 12vw, 144px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  /* Subtle dot grid — also serves as the loading state under Three.js scene */
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: 28px 28px;
}
/* Three.js renders into this. Scroll-tied transforms applied by inline script. */
.hero-canvas {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease-out;
  will-change: opacity, transform;
}
/* Static SVG ghost — visible until Three.js mounts a canvas inside .hero-canvas */
.hero-canvas-ghost {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: 0.18;
  transition: opacity 0.5s ease;
}
.hero-canvas:has(canvas) .hero-canvas-ghost { opacity: 0; }
.hero-canvas-ghost svg { width: 320px; height: 320px; max-width: 60%; }
/* Mobile: dim the canvas more so text is fully readable */
@media (max-width: 720px) {
  .hero-canvas { opacity: 0.45; }
  .hero-canvas-ghost svg { width: 220px; height: 220px; }
}
/* Decorative scanlines layer (very subtle) */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, transparent 60%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
  z-index: 1;
}
/* Lat/long-feeling cross at center — purely decorative */
.hero::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 100%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.04) 30%, rgba(255,255,255,0.04) 70%, transparent);
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max);
  margin: 0 auto;
}
/* Cap the heading column so the Three.js globe (right-shifted on wide screens) breathes. */
.hero-content > h1,
.hero-content > .cta-row { max-width: 760px; }

.hero h1 {
  margin: 24px 0 28px;
  font-family: var(--font-display);
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
}
.h1-faint {
  display: block;
  color: var(--fg-muted);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.005em;
  margin-top: 16px;
  max-width: 28ch;
}

.lead {
  max-width: 56ch;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--fg-2);
  margin: 0 0 36px;
}

.cta-row {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px;          /* ≥48px touch target with this padding + 12px font + line-height */
  min-height: 48px;
  font-family: var(--font-mono);
  font-size: 12px; font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--fg); color: var(--bg); border-bottom: 1px solid var(--fg); }
.btn-primary { background: var(--fg); color: var(--bg); }
.btn-primary:hover { background: var(--fg-2); color: var(--bg); }
.btn .arrow { font-family: var(--font-mono); font-size: 14px; }

/* Coordinate ticker in hero corner — replaces the formula */
.hero-meta {
  position: absolute;
  bottom: 24px; right: var(--gutter);
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  text-align: right;
  pointer-events: none;
  user-select: none;
}
.hero-meta div + div { margin-top: 4px; }
@media (max-width: 720px) { .hero-meta { display: none; } }

/* ---------- Sections ---------- */
.band {
  padding: clamp(64px, 11vw, 120px) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.band-inner { max-width: var(--max); margin: 0 auto; }

.section-label {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 12px;
  /* Sticky: pin the section label to the top while scrolling within its section */
  position: sticky;
  top: 80px;
  z-index: 2;
  background: var(--bg);
  padding: 8px 0;
  /* Compensate so it doesn't visually shift when becoming sticky */
  margin-top: -8px;
}
.section-label::before {
  content: ""; display: inline-block;
  width: 24px; height: 1px; background: var(--fg-muted);
}
@media (prefers-reduced-motion: reduce) {
  .section-label { position: static; padding: 0; margin-top: 0; }
}

.section-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  max-width: 22ch;
}
.section-sub {
  margin: 0 0 56px;
  max-width: 60ch;
  color: var(--fg-2);
  font-size: 17px;
}

/* ---------- Capabilities — full-bleed sectional ---------- */
.cap {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 32px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
  transition: background 0.25s ease, padding-left 0.25s ease;
}
.cap:first-of-type { border-top: 1px solid var(--line-2); }
.cap:last-of-type { border-bottom: 1px solid var(--line-2); }
.cap:hover {
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  padding-left: 12px;
}
.cap:hover .cap-num { color: var(--fg-2); }
.cap-num { transition: color 0.25s ease; }
.cap-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-faint);
  letter-spacing: 0.12em;
}
.cap h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.cap p {
  margin: 0 0 16px;
  color: var(--fg-2);
  font-size: 16px;
  max-width: 60ch;
}
.cap-spec {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px 14px;
}
.cap-spec li {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  text-transform: uppercase;
}
.cap-spec li::before { content: "—"; margin-right: 6px; color: var(--fg-faint); }
@media (max-width: 720px) {
  .cap { grid-template-columns: 1fr; gap: 12px; }
}

/* ---------- Approach (4 paragraphs) ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px 64px;
}
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; gap: 36px; } }
.app-item h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.app-item p {
  margin: 0;
  color: var(--fg-2);
  font-size: 16px;
  max-width: 50ch;
}

/* ---------- Pedigree — bare wordmarks ---------- */
.pedigree {
  text-align: center;
  padding: clamp(80px, 12vw, 120px) var(--gutter);
  border-bottom: 1px solid var(--line);
}
.pedigree .mono { display: block; margin-bottom: 18px; color: var(--fg-faint); }
.pedigree-claim {
  margin: 0 auto 56px;
  max-width: 36ch;
  font-family: var(--font-display);
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 400;
  color: var(--fg-2);
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.wordmarks {
  display: flex;
  flex-wrap: wrap;
  align-items: center; justify-content: center;
  gap: clamp(28px, 5vw, 64px);
  font-family: var(--font-display);
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.wordmark { white-space: nowrap; }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1000px) { .team-grid { grid-template-columns: 1fr; } }

.founder {
  padding: 28px 28px 32px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.founder-marker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  border: 1px solid var(--line-2);
  padding: 3px 10px;
  margin-bottom: 14px;
}

.founder-head { margin-bottom: 18px; }
.founder h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.bio-role {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.founder-prose {
  margin: 0 0 28px;
  color: var(--fg-2);
  font-size: 16px;
  max-width: 64ch;
}

.bio-track-label {
  margin: 0 0 14px !important;
  color: var(--fg-faint) !important;
  text-transform: uppercase;
}

/* ---------- Track tiles (per-founder project cards) ---------- */
/* Track grid auto-adapts: works at full-width (founders stacked) AND
   half-width (founders side-by-side). minmax 180px keeps tiles readable. */
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
@media (max-width: 480px) { .track-grid { grid-template-columns: 1fr; } }

.track-tile {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-family: inherit;
  color: inherit;
}
.track-tile:hover {
  border-color: var(--line-2);
  background: var(--bg-3);
}
.track-tile:hover .track-icon { color: var(--fg-2); }
.track-tile:hover .track-chevron { color: var(--fg-2); }
.track-tile[aria-expanded="true"] {
  border-color: var(--fg-muted);
  background: var(--bg-3);
}
.track-tile[aria-expanded="true"] .track-icon { color: var(--fg); }

/* Vertical card layout: top row = icon (left) + chevron (right), then titles below.
   This eliminates the empty horizontal gap that came from icon-titles-chevron in one row. */
.track-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "icon . chev"
    "title title title";
  row-gap: 16px;
  padding: 14px 16px;
}
.track-icon {
  grid-area: icon;
  width: 18px;
  height: 18px;
  color: var(--fg-muted);
  transition: color 0.2s ease;
}
.track-icon svg { display: block; width: 100%; height: 100%; }

.track-chevron {
  grid-area: chev;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--fg-faint);
  line-height: 1;
  transition: transform 0.25s ease, color 0.2s ease;
  transform-origin: center;
}
.track-tile[aria-expanded="true"] .track-chevron {
  transform: rotate(45deg);
  color: var(--fg);
}

.track-titles { grid-area: title; min-width: 0; }
.track-employer {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
  /* Truncate long employer names with ellipsis on narrow cards */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.track-role {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* When expanded, allow the title to wrap so full text shows */
.track-tile[aria-expanded="true"] .track-employer,
.track-tile[aria-expanded="true"] .track-role {
  white-space: normal;
}

.track-detail {
  max-height: 0;
  overflow: hidden;
  font-size: 13.5px;
  color: var(--fg-2);
  line-height: 1.5;
  padding: 0 16px;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.track-tile[aria-expanded="true"] .track-detail {
  max-height: 320px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.contact-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .contact-grid,
  .contact-grid-2 { grid-template-columns: 1fr; }
}
.contact-card {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 28px 28px 32px;
  color: var(--fg);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
  border-bottom-color: var(--line) !important;
}
.contact-card:hover { background: var(--bg-2); }
.contact-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 18px;
}
.contact-value {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.contact-card .arrow {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--fg-muted);
  align-self: flex-end;  /* push arrow to bottom-right of card */
}

/* ---------- Footer ---------- */
.footer {
  /* Use safe-area-inset-bottom so the footer isn't obscured by Safari's URL bar
     or the iOS home indicator. max() falls back to 56px on devices w/o safe areas. */
  padding: 32px var(--gutter) max(56px, calc(env(safe-area-inset-bottom, 0px) + 32px));
  background: var(--bg);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.footer-pron {
  font-family: var(--font-display);
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-faint);
  margin-left: 8px;
}
.footer-meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.footer-meta .sep { margin: 0 10px; opacity: 0.5; }
.footer-meta a { color: var(--fg-muted); border-bottom-color: transparent; }
.footer-meta a:hover { color: var(--fg); }

/* ---------- Reveal-on-scroll ---------- */
/* Sections fade in + slight lift as they enter the viewport. */
/* JS toggles .is-visible via IntersectionObserver. */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger child elements within a revealed parent — nice for the wordmark row */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0.05s; }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.15s; }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.25s; }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.35s; }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.45s; }

/* ---------- Scroll progress (thin bar at top) ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--fg);
  transform-origin: left;
  transform: scaleX(0);
  z-index: 100;
  pointer-events: none;
  /* No transition — the JS updates it on every scroll frame */
}

/* ---------- Disciplines bar (single-stat substitute in hero) ---------- */
.disciplines {
  display: flex; align-items: center; justify-content: flex-start;
  gap: 14px;
  margin: 36px 0 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.disciplines .rule {
  flex: 0 0 36px;
  height: 1px;
  background: var(--fg-faint);
}
.disciplines .domains {
  display: flex; gap: 14px;
}
.disciplines .domains span { color: var(--fg); }
.disciplines .sep {
  color: var(--fg-faint);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
  .scroll-progress { display: none; }
}
