/* ============================================
   HOW IT GOT BIG — Design System
   ============================================ */

/* --- CUSTOM PROPERTIES --- */
:root {
  /* Core dark backgrounds */
  --ink: #08030F;
  --ink-90: rgba(8, 3, 15, 0.92);
  --ink-70: rgba(8, 3, 15, 0.70);
  --ink-mid: #0E0619;          /* slightly lighter dark plum panels */
  --ink-surface: #130920;      /* card/surface backgrounds */

  /* Paper (archive / light sections) */
  --paper: #F5F0E7;
  --paper-80: rgba(245, 240, 231, 0.80);

  /* Purple accent system */
  --signal: #B134FF;           /* primary electric neon purple */
  --signal-dim: rgba(177, 52, 255, 0.14);
  --signal-glow: rgba(177, 52, 255, 0.40);
  --signal-deep: #3D1460;      /* deep plum — used for surface tints */
  --signal-mid: #6B21C8;       /* mid-purple for gradients */
  --signal-pink: #FF3399;      /* pink-red accent — dates, labels */

  /* Grays */
  --gray: #7A7D85;
  --gray-light: #B8BBBD;
  --white: #FFFFFF;
  --white-10: rgba(255,255,255,0.10);
  --white-05: rgba(255,255,255,0.05);

  --font-display: 'Archivo Black', 'Arial Black', sans-serif;
  --font-heading: 'Archivo', 'Arial', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;

  --nav-h: 72px;
  --section-pad: clamp(80px, 12vw, 160px);

  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* --- RESET & BASE --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  /* Subtle purple vignette on the body itself */
  background-image: radial-gradient(ellipse at 50% 0%, rgba(109, 33, 200, 0.07) 0%, transparent 60%);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
ul, ol { list-style: none; }

/* --- TYPOGRAPHY SCALE --- */
.t-eyebrow {
  font-family: var(--font-body);
  font-size: clamp(10px, 1.1vw, 12px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
}
.t-eyebrow--signal { color: var(--signal); text-shadow: 0 0 12px var(--signal-glow); }

.t-section-label {
  font-family: var(--font-body);
  font-size: clamp(11px, 1.2vw, 13px);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--signal);
  text-shadow: 0 0 14px var(--signal-glow);
  display: flex;
  align-items: center;
  gap: 12px;
}
.t-section-label::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--signal);
  opacity: 0.6;
  box-shadow: 0 0 6px var(--signal-glow);
}

.t-display {
  font-family: var(--font-display);
  font-size: clamp(52px, 10vw, 160px);
  line-height: 0.92;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.t-display--paper { color: var(--paper); }
.t-display--ink { color: var(--ink); }

.t-h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.t-h2 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(28px, 4vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.t-h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.t-h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(16px, 1.8vw, 24px);
  line-height: 1.25;
}

.t-body {
  font-family: var(--font-body);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.7;
  color: var(--gray-light);
}

.t-body--paper { color: rgba(18,20,23,0.72); }

.t-meta {
  font-family: var(--font-body);
  font-size: clamp(10px, 1vw, 12px);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray);
}

.t-serif-pull {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 44px);
  font-style: italic;
  line-height: 1.3;
  color: var(--paper);
}

/* --- SECTION NUMBERS (decorative) --- */
.section-number-bg {
  font-family: var(--font-display);
  font-size: clamp(120px, 22vw, 320px);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--white-05);
  position: absolute;
  top: 0;
  right: -0.05em;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* --- LAYOUT UTILITIES --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 5vw, 80px);
  padding-right: clamp(20px, 5vw, 80px);
}

.container--narrow {
  max-width: 960px;
}

.section-pad {
  padding-top: var(--section-pad);
  padding-bottom: var(--section-pad);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 3vw, 48px);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(16px, 2.5vw, 40px);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: 1px solid currentColor;
  transition: all 0.3s var(--ease-out-quart);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out-quart);
  z-index: 0;
}
.btn > * { position: relative; z-index: 1; }
.btn:hover::before { transform: scaleX(1); }

.btn--primary {
  color: var(--white);
  border-color: var(--signal);
  box-shadow: 0 0 18px rgba(177,52,255,0.25), inset 0 0 18px rgba(177,52,255,0.04);
  transition: all 0.3s var(--ease-out-quart);
}
.btn--primary::before { background: var(--signal); }
.btn--primary:hover {
  color: var(--white);
  box-shadow: 0 0 32px rgba(177,52,255,0.5), inset 0 0 24px rgba(177,52,255,0.15);
}

.btn--outline {
  color: var(--white);
  border-color: rgba(255,255,255,0.3);
}
.btn--outline:hover { color: var(--ink); }

.btn--ink {
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ink:hover { color: var(--white); }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  text-shadow: 0 0 12px var(--signal-glow);
  position: relative;
  padding-bottom: 2px;
  transition: gap 0.3s var(--ease-out-quart);
}
.btn-text::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--signal);
  box-shadow: 0 0 6px var(--signal-glow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out-quart);
}
.btn-text:hover { gap: 14px; }
.btn-text:hover::after { transform: scaleX(1); }

/* --- ORIGIN MARK ICON --- */
.origin-mark {
  display: inline-block;
  position: relative;
  width: 1em;
  height: 1em;
}
.origin-mark svg {
  width: 100%;
  height: 100%;
}

/* --- LINES & DIVIDERS --- */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.08);
}
.divider--paper { background: rgba(18,20,23,0.12); }

.accent-line {
  width: 48px;
  height: 2px;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal-glow);
}

/* --- IMAGE PLACEHOLDER --- */
.img-placeholder {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--gray);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.img-placeholder--paper {
  background: rgba(18,20,23,0.04);
  border-color: rgba(18,20,23,0.10);
  color: rgba(18,20,23,0.40);
}
.img-placeholder__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* --- NAVIGATION --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease-out-quart), backdrop-filter 0.4s;
}
.nav.scrolled {
  background: rgba(8, 3, 15, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(177,52,255,0.12);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 clamp(20px, 5vw, 60px);
}
.nav__logo {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 1px;
}
.nav__logo-line1 {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-light);
}
.nav__logo-line2 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav__logo-big {
  color: var(--signal);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
}
.nav__link {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-light);
  transition: color 0.2s;
  position: relative;
}
.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--signal);
  transition: width 0.3s var(--ease-out-quart);
}
.nav__link:hover { color: var(--white); }
.nav__link:hover::after { width: 100%; }

.nav__cta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  border: 1px solid var(--signal);
  padding: 10px 22px;
  box-shadow: 0 0 16px rgba(177,52,255,0.25);
  transition: all 0.3s var(--ease-out-quart);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav__cta:hover {
  background: var(--signal);
  color: var(--white);
  box-shadow: 0 0 28px rgba(177,52,255,0.55);
}

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}
.nav__hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--white);
  transition: all 0.3s;
}

/* --- MOBILE NAV MENU --- */
.nav__mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--ink);
  z-index: 999;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out-quart);
}
.nav__mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}
.nav__mobile-link {
  font-family: var(--font-display);
  font-size: clamp(32px, 8vw, 56px);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--white);
  transition: color 0.2s;
}
.nav__mobile-link:hover { color: var(--signal); }

/* --- SCROLL ANIMATIONS --- */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.8s var(--ease-out-quart), transform 0.8s var(--ease-out-quart);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}
[data-reveal="fade"] {
  transform: none;
}
[data-reveal="left"] {
  transform: translateX(-32px);
}
[data-reveal="left"].revealed { transform: translateX(0); }
[data-reveal="right"] {
  transform: translateX(32px);
}
[data-reveal="right"].revealed { transform: translateX(0); }
[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }
[data-reveal-delay="5"] { transition-delay: 0.5s; }
[data-reveal-delay="6"] { transition-delay: 0.6s; }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .nav__links, .nav__cta { display: none; }
  .nav__hamburger { display: flex; }
  .nav__mobile-menu { display: flex; }
}

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

/* --- PREFERS REDUCED MOTION --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- GLOBAL POLISH ADDITIONS --- */

/* Subtle grain overlay on dark sections */
.hero::after,
.section-turning::after,
.section-closing::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 10;
  opacity: 0.6;
  mix-blend-mode: overlay;
}

/* Orange accent pulse for active state */
.nav__link.active {
  color: var(--signal);
}

/* Smooth image scale on story card hover */
.story-card__bg {
  overflow: hidden;
}

/* Better placeholder visual */
.img-placeholder {
  position: relative;
}
.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, transparent 60%);
  pointer-events: none;
}

/* Thin line separators */
.section-origins,
.section-turning,
.section-scale,
.section-stories,
.section-map {
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Smooth font rendering */
.t-display, .t-h1, .hero__headline, .origins__company-label,
.story-card__headline, .closing__headline, .page-hero__headline,
.footer__logo-line2 {
  -webkit-font-smoothing: antialiased;
}

/* Signal orange hover on all BTN-TEXT links */
.btn-text:hover {
  color: var(--signal);
}

/* Refined map container */
.map-svg-wrapper {
  border: 1px solid rgba(255,255,255,0.06);
  padding: clamp(20px, 3vw, 40px);
  background: rgba(255,255,255,0.01);
}

/* Tighten closing section */
.section-closing .closing__content {
  max-width: 800px;
  margin: 0 auto;
}

/* Better stats strip on mobile */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    border: 1px solid rgba(255,255,255,0.06);
  }
  .stat-item {
    border-right: 1px solid rgba(255,255,255,0.08);
  }
  .stat-item:nth-child(2n) { border-right: none; }
}

/* Refined footer mark alignment */
.footer__copyright {
  align-items: center;
}

/* Better story card minimum heights on mobile */
@media (max-width: 600px) {
  .story-card { min-height: 80vw; }
}
