/* ═══════════════════════════════════════════════════════════════
   PATC — Design System v3 · Refined token set + corridor theme
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  color-scheme: dark;

  /* ── Surface palette ──────────────────────────────────────────── */
  --bg-base:       #0A0F1A;
  --bg-base-rgb:   10, 15, 26;
  --bg-elevated:   #121826;
  --bg-overlay:    #1A2233;

  /* ── Text palette ─────────────────────────────────────────────── */
  --text-primary:   #E8ECF4;
  --text-secondary: #9BA4B5;
  --text-muted:     #5C6678;

  /* ── Accent ───────────────────────────────────────────────────── */
  --accent:        #3DBFB0;
  --accent-rgb:    61, 191, 176;
  --accent-hover:  #2EADA0;
  --accent-faint:  rgba(61, 191, 176, 0.08);

  /* ── Signal semantics (traffic-domain only) ───────────────────── */
  --signal-green:     #34D399;
  --signal-green-rgb: 52, 211, 153;
  --signal-amber:     #F59E0B;
  --signal-amber-rgb: 245, 158, 11;
  --signal-red:       #F87171;
  --signal-red-rgb:   248, 113, 113;

  /* ── Borders ──────────────────────────────────────────────────── */
  --border-subtle: #1F2937;
  --border-strong: #374151;

  /* ── Shapes ───────────────────────────────────────────────────── */
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* ── Type scale: 64 / 40 / 28 / 20 / 16 / 14 / 12 ──────────── */
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  /* Subtle dot grid — visible on all pages */
  background-image: radial-gradient(circle, rgba(61, 191, 176, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
img { max-width: 100%; }

/* ── Scroll-reveal primitives — 3-D spring entrance ──────────── */
/* Spring easing: cubic-bezier(0.34, 1.56, 0.64, 1) overshoots ~8% then settles */
.reveal {
  opacity: 0;
  transform: perspective(900px) translateY(44px) rotateX(6deg);
  transition: opacity 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--reveal-delay, 0s);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.reveal.visible {
  opacity: 1;
  transform: perspective(900px) translateY(0) rotateX(0deg);
}
.reveal-delay-1 { --reveal-delay: 60ms; }
.reveal-delay-2 { --reveal-delay: 120ms; }
.reveal-delay-3 { --reveal-delay: 180ms; }
.reveal-delay-4 { --reveal-delay: 240ms; }
.reveal-delay-5 { --reveal-delay: 300ms; }

.reveal-left {
  opacity: 0;
  transform: perspective(900px) translateX(-52px) rotateY(-5deg);
  transition: opacity 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.reveal-left.visible {
  opacity: 1;
  transform: perspective(900px) translateX(0) rotateY(0deg);
}

.reveal-right {
  opacity: 0;
  transform: perspective(900px) translateX(52px) rotateY(5deg);
  transition: opacity 0.75s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.75s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.reveal-right.visible {
  opacity: 1;
  transform: perspective(900px) translateX(0) rotateY(0deg);
}

.reveal-scale {
  opacity: 0;
  transform: perspective(900px) scale(0.88) translateY(22px);
  transition: opacity 0.80s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.80s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-style: preserve-3d;
  will-change: transform, opacity;
}
.reveal-scale.visible {
  opacity: 1;
  transform: perspective(900px) scale(1) translateY(0);
}

/* ── Scroll progress bar ──────────────────────────────────────── */
.scroll-progress {
  background: var(--accent);
  height: 2px;
  left: 0;
  position: fixed;
  top: 0;
  transform-origin: left;
  transform: scaleX(0);
  width: 100%;
  z-index: 200;
  pointer-events: none;
}

/* ── Sticky header ────────────────────────────────────────────── */
.site-header {
  align-items: center;
  background: rgba(var(--bg-base-rgb), 0.78);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 48px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.35s ease, border-color 0.35s ease;
}
.site-header.scrolled {
  background: rgba(var(--bg-base-rgb), 0.94);
  border-bottom-color: var(--border-strong);
}

/* Brand */
.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
  transition: transform 0.25s ease;
}
.brand:hover { transform: scale(1.02); }
.brand img { height: 28px; width: 28px; }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }
.brand small { color: var(--text-secondary); font-size: 11px; }

/* Nav */
nav { display: flex; gap: 4px; }
nav a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  padding: 7px 14px;
  position: relative;
  transition: color 0.2s ease;
}
nav a:hover,
nav a.active {
  color: var(--accent);
}
nav a::after {
  background: var(--accent);
  border-radius: 1px;
  bottom: 0;
  content: '';
  height: 2px;
  left: 50%;
  opacity: 0;
  position: absolute;
  transform: translateX(-50%) scaleX(0);
  transition: opacity 0.2s ease, transform 0.25s ease;
  width: 20px;
}
nav a:hover::after,
nav a.active::after {
  opacity: 1;
  transform: translateX(-50%) scaleX(1);
}

/* ── Main ─────────────────────────────────────────────────────── */
main { overflow: hidden; position: relative; }

/* ── Eyebrow ──────────────────────────────────────────────────── */
.eyebrow {
  align-items: center;
  color: var(--accent);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: 0.12em;
  margin: 0 0 16px;
  text-transform: uppercase;
}
.eyebrow::before {
  background: var(--accent);
  border-radius: 3px;
  content: '';
  display: inline-block;
  height: 2px;
  width: 20px;
}

/* ── Headings (type scale: 64 / 40 / 28 / 20) ────────────────── */
h1, h2, h3, p { margin-top: 0; }
h1 {
  color: var(--text-primary);
  font-size: clamp(42px, 5.2vw, 72px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin-bottom: 20px;
}
h2 {
  color: var(--text-primary);
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  margin-bottom: 12px;
}
h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── Hero ──────────────────────────────────────────────────────── */
.hero {
  margin: 0 auto;
  max-width: 1200px;
  padding: 80px 48px 64px;
  position: relative;
}
.page-hero {
  max-width: 960px;
  padding-bottom: 40px;
}
.hero-copy {
  max-width: 640px;
}
.hero-lede {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 560px;
}

/* Hero actions */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ── Buttons ──────────────────────────────────────────────────── */
.primary-action,
.secondary-action,
.profile-link {
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  gap: 6px;
  padding: 12px 22px;
  transition: all 0.25s cubic-bezier(.22,1,.36,1);
}
.primary-action {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg-base);
}
.primary-action:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.25);
}
.secondary-action,
.profile-link {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.secondary-action:hover,
.profile-link:hover {
  background: var(--accent-faint);
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-1px);
}

/* ── Credibility strip ────────────────────────────────────────── */
.cred-strip {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 500;
  gap: 6px 18px;
  margin-top: 40px;
  padding-top: 20px;
}
.cred-strip span {
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12px;
}

/* ── Section container ────────────────────────────────────────── */
.section {
  margin: 0 auto;
  max-width: 1200px;
  padding: 52px 48px;
  position: relative;
}
.section-inner { max-width: 720px; }
.split-section {
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
}
.section-head { max-width: 720px; }
.section-lede {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 640px;
}

/* ── Card grids ───────────────────────────────────────────────── */
.process-grid,
.benefit-grid,
.page-links,
.team-grid {
  display: grid;
  gap: 16px;
}
.process-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; }
.benefit-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; }
.page-links   { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }
.team-grid    { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }

.process-grid article,
.benefit-grid article,
.page-links a,
.team-grid article {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.process-grid article:hover,
.benefit-grid article:hover,
.page-links a:hover,
.team-grid article:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-3px);
}

/* Step number */
.process-grid article span {
  color: var(--accent);
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Body copy in cards */
.process-grid p,
.benefit-grid p,
.page-links strong,
.team-grid p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}
.benefit-grid strong,
.page-links span {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}
.page-links span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Profile URL */
.profile-url {
  color: var(--text-muted);
  display: block;
  font-size: 12px;
  margin-top: 8px;
}

/* ── Safety panel ─────────────────────────────────────────────── */
.safety-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1fr);
  padding: 48px;
}
.safety-grid { display: grid; gap: 12px; }
.safety-grid p {
  background: rgba(var(--signal-green-rgb), 0.04);
  border: 1px solid rgba(var(--signal-green-rgb), 0.12);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
  padding: 16px;
  transition: border-color 0.25s ease;
}
.safety-grid p:hover {
  border-color: rgba(var(--signal-green-rgb), 0.25);
}
.safety-grid strong { color: var(--signal-green); }

/* ── Section divider ──────────────────────────────────────────── */
.section-divider {
  background: linear-gradient(90deg, transparent, rgba(61, 191, 176, 0.2), transparent);
  border: none;
  height: 1px;
  margin: 0;
  width: 100%;
}

/* ── Impact stat cards ────────────────────────────────────────── */
.impact-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 28px;
}
.impact-grid article {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.impact-grid article:hover {
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-3px);
}
.impact-grid strong {
  color: var(--text-primary);
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 10px;
}
.impact-grid span {
  color: var(--text-secondary);
  display: block;
  font-size: 13px;
  line-height: 1.5;
}
.impact-grid a {
  color: var(--accent);
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
  transition: color 0.2s ease;
}
.impact-grid a:hover { color: var(--accent-hover); }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  gap: 16px;
  padding: 24px 48px;
}
footer span { color: var(--text-primary); font-weight: 800; }
footer p { margin: 0 auto 0 0; }
footer a {
  color: var(--accent);
  font-weight: 600;
  transition: color 0.2s ease;
}
footer a:hover { color: var(--accent-hover); }

/* Team footer (enhanced) */
.team-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 0;
}
.footer-inner {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 0 auto;
  max-width: 1200px;
  padding: 28px 48px;
}
.footer-brand {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.footer-inner > p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 0 auto 0 0;
}
.footer-team {
  display: flex;
  gap: 28px;
}
.footer-person {
  display: flex;
  align-items: center;
  gap: 10px;
}
.footer-person strong {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.footer-name-link {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s ease;
}
.footer-name-link:hover {
  color: var(--accent);
}
.footer-links {
  display: flex;
  gap: 6px;
}
.footer-links a {
  background: var(--accent-faint);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  transition: all 0.2s ease;
}
.footer-links a:hover {
  background: rgba(var(--accent-rgb), 0.15);
  border-color: rgba(var(--accent-rgb), 0.3);
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-header { padding: 10px 20px; }
  .hero, .section { padding-left: 20px; padding-right: 20px; }
  .hero { gap: 32px; grid-template-columns: 1fr; }
  .split-section, .safety-panel { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  footer { padding: 20px; }
  .footer-inner { padding: 20px; }
  .footer-team { flex-direction: column; gap: 12px; }
  .footer-person { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (max-width: 640px) {
  .process-grid, .benefit-grid, .page-links, .impact-grid, .team-grid {
    grid-template-columns: 1fr;
  }
  h1 { font-size: 32px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
}
