/* =========================================================================
   3 SIGMA RESEARCH
   Design system — dark, quantitative, institutional.
   ========================================================================= */

/* ----- Tokens ----------------------------------------------------------- */
:root {
  /* Surfaces */
  --bg:          #07090f;
  --bg-grad:     #0a0e18;
  --surface:     #0e1320;
  --surface-2:   #131a2a;
  --surface-3:   #182135;
  --line:        rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --text:        #eaedf5;
  --text-dim:    #9aa3bb;
  --text-faint:  #5d6680;

  /* Accents */
  --gold:        #c8a96a;
  --gold-bright: #e2c483;
  --gold-soft:   rgba(200, 169, 106, 0.12);
  --gold-line:   rgba(200, 169, 106, 0.32);
  --cyan:        #6bd6ec;
  --cyan-soft:   rgba(107, 214, 236, 0.12);

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Metrics */
  --maxw:    1200px;
  --gutter:  clamp(20px, 5vw, 64px);
  --radius:  16px;
  --radius-sm: 10px;
  --ease:    cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "calt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }

/* Ambient background gradient + faint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 700px at 78% -8%, rgba(200, 169, 106, 0.10), transparent 60%),
    radial-gradient(900px 600px at 8% 8%, rgba(107, 214, 236, 0.06), transparent 55%),
    linear-gradient(180deg, var(--bg-grad), var(--bg) 55%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
          mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
}

/* ----- Layout ----------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 11vw, 150px); position: relative; }
.section--tight { padding-block: clamp(54px, 8vw, 96px); }
.divider { height: 1px; background: var(--line); border: 0; }

/* ----- Typography ------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.08; letter-spacing: -0.015em; }
.h-display { font-size: clamp(2.6rem, 6.4vw, 5rem); }
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.9rem, 3.8vw, 3rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
p { color: var(--text-dim); }
.lead { font-size: clamp(1.1rem, 1.7vw, 1.35rem); line-height: 1.6; color: #c3cadd; }
strong { color: var(--text); font-weight: 600; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold-line);
}
.eyebrow--center::after {
  content: "";
  width: 26px; height: 1px;
  background: var(--gold-line);
}

.section-head { max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .eyebrow { margin-bottom: 22px; }
.section-head p { margin-top: 20px; }

.text-accent { color: var(--gold); }
.serif-accent { font-family: var(--font-display); font-style: italic; }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.95em 1.6em;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.35s var(--ease), background 0.35s var(--ease),
              border-color 0.35s var(--ease), color 0.35s var(--ease);
}
.btn .arr { transition: transform 0.35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn--primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1a1305;
  font-weight: 600;
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -12px rgba(200, 169, 106, 0.6); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--gold-line); color: var(--gold-bright); background: var(--gold-soft); }

/* ----- Header ----------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(8, 10, 16, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--line);
}
.nav {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1;
}
.brand__name b { font-weight: 600; }
.brand__name span { display: block; font-family: var(--font-mono); font-size: 0.56rem; letter-spacing: 0.42em; color: var(--text-faint); text-transform: uppercase; margin-top: 5px; }

.nav__links { display: flex; align-items: center; gap: 4px; }
.nav__links a {
  position: relative;
  padding: 8px 16px;
  font-size: 0.93rem;
  color: var(--text-dim);
  border-radius: 8px;
  transition: color 0.25s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 2px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after,
.nav__links a[aria-current="page"]::after { transform: scaleX(1); }
.nav__links a[aria-current="page"] { color: var(--text); }

.nav__cta { display: flex; align-items: center; gap: 14px; }
.nav__toggle { display: none; }

/* Mobile nav */
.nav__burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: transparent;
  position: relative;
}
.nav__burger span,
.nav__burger span::before,
.nav__burger span::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 18px; height: 1.5px;
  background: var(--text);
  transform: translate(-50%, -50%);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.nav__burger span::before { transform: translate(-50%, -7px); }
.nav__burger span::after  { transform: translate(-50%, 5px); }

/* ----- Hero ------------------------------------------------------------- */
.hero { position: relative; padding-top: 150px; padding-bottom: clamp(80px, 12vw, 140px); overflow: hidden; }
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 18%, #000 82%, transparent);
}
.hero__inner { position: relative; z-index: 1; max-width: 880px; }
.hero h1 { margin-top: 30px; }
.hero .lead { margin-top: 30px; max-width: 600px; }
.hero__actions { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 16px; }

.hero__sigma {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
}

/* ----- Stat band -------------------------------------------------------- */
.stat-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stat {
  background: var(--surface);
  padding: clamp(26px, 3vw, 40px) clamp(22px, 2.5vw, 34px);
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 3.4vw, 3rem);
  line-height: 1;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.stat__num .unit { font-size: 0.5em; color: var(--gold); font-style: italic; }
.stat__label {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ----- Cards / pillars -------------------------------------------------- */
.grid { display: grid; gap: 24px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 3vw, 38px);
  transition: transform 0.5s var(--ease), border-color 0.5s var(--ease);
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card__index {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--gold);
}
.card h3 { margin-top: 20px; }
.card p { margin-top: 14px; font-size: 0.97rem; }

.icon-badge {
  width: 50px; height: 50px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-bright);
  margin-bottom: 22px;
}
.icon-badge svg { width: 24px; height: 24px; }

/* ----- Split feature ---------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(36px, 6vw, 84px);
  align-items: center;
}
.split--reverse .split__media { order: -1; }
.feature-list { margin-top: 30px; display: grid; gap: 18px; }
.feature-list li { display: flex; gap: 16px; align-items: flex-start; }
.feature-list .tick {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--gold-bright);
  margin-top: 2px;
}
.feature-list .tick svg { width: 14px; height: 14px; }
.feature-list b { color: var(--text); }
.feature-list p { margin-top: 3px; font-size: 0.95rem; }

/* Framed media panel */
.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(120% 120% at 80% 0%, var(--surface-2), var(--surface));
  padding: 30px;
  overflow: hidden;
}
.panel__corner {
  position: absolute; width: 18px; height: 18px;
  border-color: var(--gold-line); border-style: solid; border-width: 0;
}
.panel__corner.tl { top: 14px; left: 14px; border-top-width: 1px; border-left-width: 1px; }
.panel__corner.tr { top: 14px; right: 14px; border-top-width: 1px; border-right-width: 1px; }
.panel__corner.bl { bottom: 14px; left: 14px; border-bottom-width: 1px; border-left-width: 1px; }
.panel__corner.br { bottom: 14px; right: 14px; border-bottom-width: 1px; border-right-width: 1px; }

/* ----- Approach / process list ----------------------------------------- */
.steps { display: grid; gap: 0; border-top: 1px solid var(--line); }
.step {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: clamp(16px, 3vw, 48px);
  padding: clamp(28px, 4vw, 44px) 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.step__no { font-family: var(--font-mono); color: var(--gold); font-size: 0.95rem; padding-top: 6px; }
.step h3 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.step p { margin-top: 14px; max-width: 60ch; }

/* ----- Team ------------------------------------------------------------- */
.team-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.member { }
.member__photo {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--surface-3), var(--surface));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s var(--ease);
}
.member:hover .member__photo { border-color: var(--gold-line); }
.member__mono {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 4.6rem);
  color: var(--text-faint);
  letter-spacing: 0.04em;
  transition: color 0.4s var(--ease);
}
.member:hover .member__mono { color: var(--gold); }
.member__name { margin-top: 20px; font-family: var(--font-display); font-size: 1.25rem; color: var(--text); }
.member__role { margin-top: 6px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.member__bio { margin-top: 12px; font-size: 0.93rem; }

/* ----- Insights --------------------------------------------------------- */
.insight {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  padding: clamp(24px, 3vw, 34px) 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 0.4s var(--ease);
}
.insight:first-child { border-top: 1px solid var(--line); }
.insight:hover { padding-left: 12px; }
.insight__meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.insight__meta .tag { color: var(--gold); display: block; margin-bottom: 6px; }
.insight__title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.2vw, 1.75rem); color: var(--text); transition: color 0.3s; }
.insight:hover .insight__title { color: var(--gold-bright); }
.insight__title + p { margin-top: 8px; font-size: 0.95rem; }
.insight__arrow {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: all 0.35s var(--ease);
  flex: none;
}
.insight:hover .insight__arrow { background: var(--gold); color: #1a1305; border-color: var(--gold); transform: rotate(-45deg); }

/* ----- CTA -------------------------------------------------------------- */
.cta {
  position: relative;
  border: 1px solid var(--gold-line);
  border-radius: clamp(18px, 3vw, 28px);
  background:
    radial-gradient(140% 160% at 50% 0%, rgba(200, 169, 106, 0.10), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: clamp(48px, 7vw, 92px) clamp(28px, 5vw, 80px);
  text-align: center;
  overflow: hidden;
}
.cta h2 { max-width: 16ch; margin-inline: auto; }
.cta p { max-width: 52ch; margin: 22px auto 0; }
.cta .hero__actions { justify-content: center; }

/* ----- Forms ------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; }
.field--full { grid-column: 1 / -1; }
.field label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-dim); }
.field input, .field select, .field textarea {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.97rem;
  transition: border-color 0.3s var(--ease), background 0.3s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold-line);
  background: var(--surface-2);
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--text-faint); margin-top: 6px; }

/* ----- Contact info ----------------------------------------------------- */
.contact-row { display: flex; align-items: flex-start; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.contact-row:first-child { border-top: 1px solid var(--line); }
.contact-row .ic { color: var(--gold); margin-top: 3px; flex: none; }
.contact-row b { display: block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); font-weight: 400; margin-bottom: 5px; }
.contact-row span { color: var(--text); }

/* ----- Footer ----------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4)); margin-top: 40px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-block: clamp(54px, 7vw, 80px); }
.footer-brand p { margin-top: 20px; font-size: 0.93rem; max-width: 34ch; }
.footer-col h4 { font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 18px; }
.footer-col a { display: block; padding: 6px 0; color: var(--text-dim); font-size: 0.94rem; transition: color 0.25s; }
.footer-col a:hover { color: var(--gold-bright); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-block: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom small, .footer-disclaimer { color: var(--text-faint); font-size: 0.8rem; line-height: 1.7; }
.footer-disclaimer { padding-bottom: 36px; max-width: 90ch; }
.footer-legal { display: flex; gap: 22px; }
.footer-legal a { color: var(--text-faint); font-size: 0.8rem; transition: color 0.25s; }
.footer-legal a:hover { color: var(--gold); }

/* ----- Page hero (interior pages) -------------------------------------- */
.page-hero { padding-top: 168px; padding-bottom: clamp(40px, 6vw, 72px); position: relative; }
.page-hero .eyebrow { margin-bottom: 22px; }
.page-hero h1 { max-width: 16ch; }
.page-hero p { margin-top: 24px; max-width: 56ch; }
.breadcrumb { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 26px; }
.breadcrumb a { color: var(--text-faint); }
.breadcrumb a:hover { color: var(--gold); }

/* ----- Scroll reveal ---------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }

/* ----- Misc ------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 7px 14px;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.muted { color: var(--text-faint); }

/* Distribution mini-viz used on interior pages */
.dist-figure { width: 100%; height: 280px; }

/* ----- Responsive ------------------------------------------------------- */
@media (max-width: 980px) {
  .grid--3, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
  .stat-band { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .insight { grid-template-columns: 1fr auto; }
  .insight__meta { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav__links, .nav__cta .btn { display: none; }
  .nav__burger { display: block; }
  .grid--3, .grid--2, .team-grid, .form-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 1fr; gap: 6px; }
  .step__no { padding-top: 0; }

  /* Mobile menu panel */
  .nav__links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 78px; left: 0; right: 0;
    background: rgba(9, 12, 19, 0.97);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 14px var(--gutter) 22px;
  }
  .nav__links.open a { padding: 15px 4px; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav__links.open a::after { display: none; }
  .nav.open .nav__cta .btn { display: inline-flex; }
}
@media (max-width: 480px) {
  .stat-band { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-legal { flex-wrap: wrap; gap: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
