:root{
  /* ---- Light theme (default) ---- */
  --grad: #FAFAFA;
  --panel: rgba(255,255,255,0.68);
  --panel-border: rgba(255,255,255,0.9);
  --ink: #1c3d33;
  --ink-soft: #3a5c50;
  --pine-deep: #0f261e;
  --nav-bg: rgba(8,9,10,0.82);
  --nav-border: rgba(255,255,255,0.08);
  --nav-ink: #eafaf1;
  --nav-ink-soft: rgba(234,250,241,0.72);
  --dropdown-bg: rgba(255,255,255,0.92);
  --dropdown-hover: rgba(22,53,43,0.08);
  --control-border: rgba(22,53,43,0.25);
  --control-bg: rgba(255,255,255,0.5);
  --placeholder-bg: rgba(255,255,255,0.4);
  --placeholder-border: rgba(22,53,43,0.35);
  --btn-bg: #0f261e;
  --btn-ink: #eafaf1;

  /* ---- Fixed brand surfaces (unaffected by theme) ---- */
  --footer-bg: #0f261e;
  --footer-ink: #eafaf1;
  --footer-ink-soft: rgba(234,250,241,0.78);
  --footer-line: rgba(234,250,241,0.2);

  --radius: 22px;
  --maxw: 1180px;
}

[data-theme="dark"]{
  --grad: #16161D;
  --panel: rgba(255,255,255,0.055);
  --panel-border: rgba(92,160,255,0.18);
  --ink: #E7EDF5;
  --ink-soft: rgba(231,237,245,0.68);
  --pine-deep: #5CA0FF;
  --nav-bg: rgba(6,7,10,0.85);
  --nav-border: rgba(92,160,255,0.2);
  --nav-ink: #E7EDF5;
  --nav-ink-soft: rgba(231,237,245,0.68);
  --dropdown-bg: rgba(14,18,26,0.95);
  --dropdown-hover: rgba(92,160,255,0.12);
  --control-border: rgba(92,160,255,0.32);
  --control-bg: rgba(255,255,255,0.05);
  --placeholder-bg: rgba(255,255,255,0.04);
  --placeholder-border: rgba(92,160,255,0.32);
  --btn-bg: #5CA0FF;
  --btn-ink: #0b1626;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body{
  margin:0;
  font-family:'Manrope', sans-serif;
  color: var(--ink);
  background: var(--grad);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}

h1,h2,h3, .display{
  font-family:'Fraunces', serif;
  font-weight: 500;
  line-height: 1.08;
  margin: 0;
  color: var(--pine-deep);
}

p { line-height: 1.65; margin: 0; }

a { color: inherit; }

img{ max-width: 100%; display:block; }

.wrap{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
nav{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  transition: background .3s ease, border-color .3s ease;
}
.nav-inner{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 32px;
  display:flex;
  align-items:center;
  gap: 56px;
}
.logo{
  font-family:'Fraunces', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--nav-ink);
  letter-spacing: -0.01em;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-links{
  display:flex;
  align-items:center;
  gap: 26px;
  list-style:none;
  margin: 0 40px 0 auto;
  padding:0;
  font-size: 0.95rem;
  font-weight: 500;
}
.nav-links a{
  text-decoration:none;
  color: var(--nav-ink-soft);
  transition: color .2s ease;
}
.nav-links a:hover{ color: var(--nav-ink); }
.nav-links li{ position: relative; }

.nav-drop{
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dropdown-bg);
  backdrop-filter: blur(18px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 10px;
  min-width: 200px;
  list-style:none;
  box-shadow: 0 20px 40px rgba(20,60,45,0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav-links li:hover .nav-drop,
.nav-links li:focus-within .nav-drop{
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-drop li{ position: static; }
.nav-drop a{
  display:block;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  white-space: nowrap;
  color: var(--ink-soft);
}
.nav-drop a:hover{ background: var(--dropdown-hover); }

.nav-right{
  display:flex;
  align-items:center;
  gap: 18px;
  flex-shrink: 0;
}
.nav-search{
  position: relative;
  display:flex;
  align-items:center;
}
.search-toggle, .theme-toggle{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  color: var(--nav-ink);
  flex-shrink: 0;
  padding: 0;
}
.search-toggle svg, .theme-toggle svg{ width: 17px; height: 17px; }
.theme-toggle .icon-moon{ display:none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display:block; }
.search-box{
  position: absolute;
  top: 50%;
  left: calc(100% + 8px);
  transform: translateY(-50%);
  width: 0;
  overflow: hidden;
  opacity: 0;
  border: 1.5px solid var(--control-border);
  border-radius: 100px;
  background: var(--dropdown-bg);
  backdrop-filter: blur(10px);
  transition: width .25s ease, opacity .2s ease, padding .25s ease;
  padding: 0;
}
.search-box.open{
  width: 190px;
  opacity: 1;
  padding: 0 6px;
}
.search-box input{
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  padding: 9px 8px;
  font-family:'Manrope', sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
}

/* ---------- Language switcher ---------- */
.lang-switcher{ position: relative; }
.lang-toggle{
  width: auto;
  min-width: 46px;
  height: 38px;
  padding: 0 12px;
  border-radius: 100px;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: var(--nav-ink);
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  font-family:'Manrope', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.lang-menu{
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--dropdown-bg);
  backdrop-filter: blur(18px);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 8px;
  min-width: 120px;
  list-style:none;
  margin: 0;
  box-shadow: 0 20px 40px rgba(20,60,45,0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 60;
}
.lang-menu.open{
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-option{
  display:flex;
  align-items:center;
  justify-content: space-between;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family:'Manrope', sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-align: left;
}
.lang-option:hover{ background: var(--dropdown-hover); }
.lang-option.is-active{ color: var(--pine-deep); font-weight: 700; }

.nav-safe-ai{
  color: var(--pine-deep);
  text-decoration:none;
  font-size: 0.95rem;
  font-weight: 800;
  white-space: nowrap;
}
.nav-safe-ai:hover{ text-decoration: underline; }
.nav-safe-ai.is-current{
  text-decoration: underline;
  text-underline-offset: 4px;
}
.menu-toggle{
  display:none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: var(--nav-ink);
  align-items:center; justify-content:center;
  cursor:pointer;
  flex-shrink: 0;
  padding: 0;
}
.menu-toggle svg{ width: 19px; height: 19px; }

/* Mobile nav drawer (opened by the three-dot button) */
.mobile-nav{
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(300px, 82vw);
  background: var(--footer-bg);
  color: var(--footer-ink);
  z-index: 100;
  padding: 90px 28px 28px;
  transform: translateX(100%);
  transition: transform .28s ease;
  overflow-y: auto;
}
.mobile-nav.open{ transform: translateX(0); }
.mobile-nav ul{
  list-style:none;
  margin:0; padding:0;
  display:flex;
  flex-direction: column;
  gap: 4px;
}
.mobile-nav li{ border-bottom: 1px solid rgba(234,250,241,0.12); }
.mobile-nav a{
  display:block;
  padding: 16px 4px;
  text-decoration:none;
  color: var(--footer-ink);
  font-family:'Fraunces', serif;
  font-size: 1.15rem;
}
.mobile-nav-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.mobile-nav-backdrop.open{ opacity: 1; visibility: visible; }

/* ---------- Panel (glass) ---------- */
.panel{
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 60px rgba(20, 60, 45, 0.08);
  transition: background .3s ease, border-color .3s ease;
}

section{ padding: 120px 0; }
section:first-of-type{ padding-top: 90px; }

.eyebrow-note{
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 14px;
}

/* ---------- Hero ---------- */
.hero{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items:center;
  padding-top: 30px;
}
.hero-copy{ padding: 52px 48px; }
.hero h1{
  font-size: clamp(2.3rem, 4vw, 3.4rem);
  letter-spacing: -0.01em;
}
.hero p.lede{
  margin-top: 22px;
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-actions{
  margin-top: 34px;
  display:flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn{
  display:inline-block;
  padding: 14px 26px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration:none;
  transition: transform .2s ease, box-shadow .2s ease, background .3s ease, color .3s ease;
}
.btn-solid{ background: var(--btn-bg); color: var(--btn-ink); }
.btn-outline{
  background: transparent;
  color: var(--pine-deep);
  border: 1.5px solid var(--pine-deep);
}
.btn:hover{ transform: translateY(-2px); }

/* Hero photo collage */
.collage{ position: relative; height: 460px; }
.collage img{
  position: absolute;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(20,60,45,0.18);
}
.collage .main-img{
  width: 62%; height: 80%;
  left: 0; top: 10px;
  z-index: 1;
}
.collage .top-img{
  width: 44%; height: 46%;
  right: 0; top: 0;
  z-index: 2;
  border: 4px solid var(--panel-border);
}
.collage .bottom-img{
  width: 46%; height: 42%;
  right: 6%; bottom: 0;
  z-index: 3;
  border: 4px solid var(--panel-border);
}

/* ---------- Section headers ---------- */
.section-head{ max-width: 640px; margin-bottom: 48px; }
.section-head h2{ font-size: clamp(1.9rem, 3vw, 2.5rem); }
.section-head p{ margin-top: 16px; color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Our Story ---------- */
.story-grid{
  display:grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 40px;
  align-items: stretch;
}
.story-quote{ padding: 44px 38px; display:flex; align-items:center; }
.story-quote blockquote{
  font-family:'Fraunces', serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.45;
  color: var(--pine-deep);
  margin:0;
}
.story-quote cite{
  display:block;
  margin-top: 18px;
  font-style: normal;
  font-family:'Manrope', sans-serif;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 600;
}
.story-body{ padding: 44px 42px; }
.story-body p + p{ margin-top: 18px; }

/* ---------- The Issue ---------- */
.issue-main{ padding: 46px 44px; margin-bottom: 28px; }
.issue-main p{ max-width: 68ch; color: var(--ink-soft); font-size: 1.05rem; }
.stat-row{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card{ padding: 32px 28px; }
a.stat-card{ text-decoration:none; color: inherit; display:block; transition: transform .2s ease; }
a.stat-card:hover{ transform: translateY(-3px); }
.stat-num{
  font-family:'Fraunces', serif;
  font-size: 2.6rem;
  color: var(--pine-deep);
  font-weight: 500;
}
.stat-label{ margin-top: 10px; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }

.game-callout{
  margin-top: 28px;
  padding: 36px 40px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.game-callout h3{ font-size: 1.3rem; margin-bottom: 8px; }
.game-callout p{ color: var(--ink-soft); max-width: 48ch; }
.game-callout .btn{ flex-shrink: 0; }

/* ---------- Challenge & Goal ---------- */
.split{ display:grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.split-card{ padding: 44px 40px; }
.split-card .tag{
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.split-card h3{ font-size: 1.6rem; margin-bottom: 16px; }
.split-card p{ color: var(--ink-soft); }
.split-card.goal{ background: linear-gradient(160deg, rgba(255,255,255,0.78), rgba(255,255,255,0.55)); }
[data-theme="dark"] .split-card.goal{ background: linear-gradient(160deg, rgba(78,227,240,0.1), rgba(78,227,240,0.03)); }

/* ---------- Placeholder blocks ---------- */
.results-placeholder{
  padding: 60px 44px;
  text-align:center;
  border: 1.5px dashed var(--placeholder-border);
  background: var(--placeholder-bg);
}
.results-placeholder h3{ font-size: 1.5rem; }
.results-placeholder p{ margin-top: 12px; color: var(--ink-soft); max-width: 50ch; margin-left:auto; margin-right:auto; }

/* ---------- Social Dilemma page ---------- */
.dilemma-layout{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items:start;
}
.dilemma-copy{ padding: 48px 44px; }
.dilemma-copy p + p{ margin-top: 16px; }
.dilemma-copy .trailer-note{
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--panel-border);
  font-size: 1rem;
  color: var(--ink-soft);
}
.dilemma-copy .trailer-note a{
  font-weight: 700;
  color: var(--pine-deep);
  text-decoration: underline;
}
.dilemma-gallery{
  position: relative;
  min-height: 540px;
}
.dilemma-gallery img{
  position: absolute;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0,0,0,0.28);
}
.dilemma-gallery .main-poster{
  width: 60%;
  left: 0;
  top: 40px;
  z-index: 1;
}
.dilemma-gallery .sundance-poster{
  width: 42%;
  right: 0;
  top: 0;
  z-index: 2;
}
.dilemma-gallery .quote-card{
  width: 44%;
  right: 4%;
  bottom: 0;
  z-index: 3;
}

/* ---------- Footer (fixed brand surface, unaffected by theme) ---------- */
footer{
  margin-top: 60px;
  background: var(--footer-bg);
  color: var(--footer-ink);
}
.footer-inner{ padding: 56px 32px 0; max-width: var(--maxw); margin: 0 auto; }
.footer-top{ display:flex; justify-content: space-between; align-items:flex-start; flex-wrap: wrap; gap: 24px; }
.footer-logo{
  font-family:'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--footer-ink);
  border: 1.5px solid rgba(234,250,241,0.5);
  padding: 14px 20px;
  line-height: 1.3;
}
.footer-social{ display:flex; gap: 12px; }
.footer-social a{
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(234,250,241,0.5);
  display:flex; align-items:center; justify-content:center;
  text-decoration:none;
}
.footer-social svg{ width: 16px; height: 16px; fill: var(--footer-ink); }
.footer-divider{ border: none; border-top: 1px solid var(--footer-line); margin: 40px 0 0; }
.footer-cols{
  display:grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr;
  gap: 24px;
  padding: 44px 0;
}
.footer-cols h4{ font-family:'Manrope', sans-serif; font-size: 1rem; font-weight: 700; color: var(--footer-ink); margin: 0 0 18px; }
.footer-cols ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction: column; gap: 12px; }
.footer-cols a{ text-decoration:none; color: var(--footer-ink-soft); font-size: 0.92rem; line-height: 1.4; }
.footer-cols a:hover{ color: var(--footer-ink); text-decoration: underline; }
.footer-bottom{
  border-top: 1px solid var(--footer-line);
  padding: 22px 0 26px;
  display:flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--footer-ink-soft);
}
.footer-bottom a{ text-decoration: underline; color: inherit; }

/* ---------- Reveal on scroll (single subtle effect) ---------- */
.reveal{ opacity: 0; transition: opacity 0.9s ease; }
.reveal.in{ opacity: 1; }

@media (prefers-reduced-motion: reduce){
  .reveal{ opacity: 1 !important; transition: none; }
  html{ scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .hero{ grid-template-columns: 1fr; }
  .collage{ height: 300px; order: -1; }
  .hero-copy{ padding: 12px 8px; }
  .story-grid{ grid-template-columns: 1fr; }
  .split{ grid-template-columns: 1fr; }
  .stat-row{ grid-template-columns: 1fr; }
  .dilemma-layout{ grid-template-columns: 1fr; }
  .dilemma-copy{ padding: 12px 8px; }
  .dilemma-gallery{ min-height: 0; display:flex; flex-direction: column; gap: 16px; }
  .dilemma-gallery img{ position: static; width: 100%; }
  .nav-links{ display:none; }
  .menu-toggle{ display:flex; }
  section{ padding: 80px 0; }
  .footer-cols{ grid-template-columns: 1fr 1fr; }
}

/* ---------- Phone tuning: larger Android (~6.9in, e.g. Galaxy S25/S26 Ultra) ---------- */
@media (max-width: 480px){
  .nav-inner{ padding: 14px 20px; gap: 12px; }
  .logo{ font-size: 1.45rem; }
  .lang-toggle{ min-width: 42px; height: 34px; font-size: 0.78rem; padding: 0 10px; }
  .search-toggle, .theme-toggle, .menu-toggle{ width: 34px; height: 34px; }
  .mobile-nav{ width: 86vw; padding: 84px 24px 24px; }
}

/* ---------- Phone tuning: iPhone 15 Pro Max (~6.7in) ---------- */
@media (max-width: 430px){
  .nav-inner{ padding: 12px 16px; gap: 10px; }
  .logo{ font-size: 1.3rem; }
  .nav-right{ gap: 10px; }
  .lang-toggle{ min-width: 38px; height: 32px; font-size: 0.74rem; padding: 0 8px; }
  .search-toggle, .theme-toggle, .menu-toggle{ width: 32px; height: 32px; }
  .mobile-nav{ width: 88vw; padding: 78px 20px 20px; }
  .mobile-nav a{ font-size: 1.05rem; padding: 14px 4px; }
}

@media (max-width: 520px){
  .wrap{ padding: 0 18px; }
  .hero-copy{ padding: 8px 4px; }
  .story-body, .story-quote, .issue-main, .split-card, .footer-inner{ padding: 30px 24px; }
  .nav-inner{ gap: 16px; }
  .nav-safe-ai{ font-size: 0.85rem; }
  .dilemma-gallery{ grid-template-columns: 1fr; }
}

:focus-visible{ outline: 2px solid var(--pine-deep); outline-offset: 2px; }
