/* ============================================
   FLICK: THE TANGLE — theflickseries.com
   Design tokens grounded in the game's own
   Okabe-Ito colourblind-safe palette.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Base palette — pulled from Verdania's night forest, not a generic dark theme */
  --bg:        #101d16;   /* deep forest, near-black */
  --bg-raised: #16281f;   /* one step up, for cards/panels */
  --bg-line:   #24382e;   /* hairline borders on dark */
  --paper:     #ede2c4;   /* field-journal parchment */
  --paper-line:#d8c9a3;

  /* Text */
  --ink:       #0e1712;   /* near-black text on parchment */
  --cream:     #f2ede0;   /* primary text on dark */
  --sage:      #93a89a;   /* secondary/muted text on dark */

  /* Accent — literally the game's own accessibility palette, not decoration */
  --teal:      #2fd7c4;   /* bioluminescent mushroom glow */
  --vermillion:#d55e00;   /* Okabe-Ito red-orange: Stomper-blind state */
  --azure:     #0072b2;   /* Okabe-Ito blue: Sparker-friendly state */
  --gold:      #d9a441;   /* warm accent, badges/stamps */

  --radius: 3px;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max: 1180px;
}

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

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(ellipse 1400px 900px at 50% -10%, #1c3226 0%, var(--bg) 55%);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--teal); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

h1 { font-weight: 700; }

p { margin: 0 0 1em; max-width: 62ch; }
p.lede { max-width: 46ch; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(16, 29, 22, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bg-line);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
}
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand span {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
}
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--sage);
  transition: color 0.15s;
}
.nav-links a:hover, .nav-links a.current { color: var(--cream); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--bg-line);
  border-radius: var(--radius);
  width: 42px; height: 42px;
  color: var(--cream);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle svg { width: 20px; height: 20px; }

.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 10px 0 18px;
  border-top: 1px solid var(--bg-line);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  z-index: 39;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}
.nav-drawer a {
  text-decoration: none;
  color: var(--sage);
  padding: 12px 4px;
  font-size: 1rem;
  border-bottom: 1px solid var(--bg-line);
}
.nav-drawer a:last-child { border-bottom: none; }
.nav-drawer.open { display: flex; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary {
  background: var(--teal);
  color: #08211c;
}
.btn-primary:hover { background: #4de3d1; }
.btn-ghost {
  background: transparent;
  border-color: var(--bg-line);
  color: var(--cream);
}
.btn-ghost:hover { border-color: var(--sage); }

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 90px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero-eyebrow {
  color: var(--teal);
  font-size: 0.92rem;
  font-weight: 600;
  margin: 0 0 18px;
}
.hero h1 {
  font-size: clamp(2.4rem, 4.4vw, 3.6rem);
  color: var(--cream);
}
.hero h1 em {
  font-style: italic;
  color: var(--teal);
}
.hero .lede {
  color: var(--sage);
  font-size: 1.1rem;
  margin-top: 18px;
}
.hero-actions {
  display: flex;
  gap: 14px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-single .container {
  display: block;
  max-width: 760px;
}
.hero-single .hero-actions { margin-bottom: 22px; }
.hero-platforms {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--sage);
  font-size: 0.95rem;
  margin: 0;
}
.hero-art {
  position: relative;
}
.hero-art img, .hero-art video {
  border-radius: 6px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,0.6);
  width: 100%;
  display: block;
}
.hero-badge {
  position: absolute;
  bottom: -18px;
  left: -18px;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: var(--radius);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
  transform: rotate(-3deg);
}
/* Platform tick-off: when a store goes live, add class="plat live" to that one <span> in the HTML.
   Nothing else needs to change — the checkmark and colour update automatically. */
.plat::before { content: "○ "; color: #8a836c; }
.plat.live::before { content: "✓ "; color: #2F6B3A; font-weight: 700; }

/* ---------- Video carousel — bigger stage than the image one, video-appropriate controls ---------- */
.video-carousel .carousel-slide { background: #000; }
.video-carousel video {
  width: 100%;
  display: block;
  aspect-ratio: 16/9;
  background: #000;
}
.video-carousel .carousel-caption {
  position: static;
  background: var(--bg-raised);
  padding: 16px 20px;
  font-size: 0.98rem;
  color: var(--cream);
  max-width: none;
}
.video-carousel .carousel-arrow { top: calc(50% - 30px); transform: none; }

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg-raised); border-top: 1px solid var(--bg-line); border-bottom: 1px solid var(--bg-line); }

.kicker {
  font-family: var(--serif);
  font-style: italic;
  color: var(--teal);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.section-head p { color: var(--sage); font-size: 1.05rem; }

/* ---------- The Trick: colour states ---------- */
.states-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.state-card {
  background: var(--bg);
  border: 1px solid var(--bg-line);
  border-radius: 6px;
  padding: 26px 20px;
  text-align: left;
}
.state-swatch {
  width: 44px; height: 44px;
  border-radius: 50%;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.state-swatch svg { width: 22px; height: 22px; }
.state-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.state-card p { color: var(--sage); font-size: 0.93rem; margin: 0; }

/* ---------- World map ---------- */
.map-wrap {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--bg-line);
}
.worlds-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 24px;
  font-family: var(--serif);
  text-align: center;
}
.worlds-list div {
  padding: 14px 8px;
  background: var(--bg-raised);
  font-size: 0.95rem;
}

/* ---------- Footage ---------- */
.footage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.footage-grid-3 { grid-template-columns: repeat(3, 1fr); }
.footage-card {
  background: var(--bg);
  border: 1px solid var(--bg-line);
  border-radius: 8px;
  overflow: hidden;
}
.footage-card video { width: 100%; display: block; background: #000; }
.footage-caption {
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--sage);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 3px 10px;
}

/* ---------- Promises ---------- */
.promises {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--bg-line);
  border: 1px solid var(--bg-line);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 40px;
}
.promise {
  background: var(--bg);
  padding: 32px 28px;
}
.promise .num { color: var(--vermillion); font-family: var(--serif); font-size: 0.95rem; margin-bottom: 10px; display: block; }
.promise h3 { font-size: 1.15rem; }
.promise p { color: var(--sage); font-size: 0.93rem; margin: 0; }

/* ---------- Signal / email capture ---------- */
.signal {
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 56px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.signal h2 { color: var(--ink); }
.signal p { color: #55503f; }
.signal-form { display: flex; gap: 10px; }
.signal-form input {
  flex: 1;
  padding: 13px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--paper-line);
  font-family: var(--sans);
  font-size: 0.98rem;
  background: #fbf8ef;
  color: var(--ink);
}
.signal .btn-primary { background: var(--ink); color: var(--paper); }
.signal .btn-primary:hover { background: #223028; }
.signal-note { font-size: 0.82rem; color: #8a836c; margin-top: 10px; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--bg-line);
  padding: 48px 0;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0; margin: 0;
  font-size: 0.9rem;
  color: var(--sage);
}
.footer-links a { text-decoration: none; color: var(--sage); }
.footer-links a:hover { color: var(--cream); }

.social-icons {
  display: flex;
  gap: 14px;
  align-items: center;
}
.social-icons a {
  color: var(--sage);
  display: flex;
  transition: color 0.15s;
}
.social-icons a:hover { color: var(--teal); }
.social-icons svg { width: 20px; height: 20px; }
.footer-meta { font-size: 0.85rem; color: var(--sage); }

/* ---------- Press / privacy page shared ---------- */
.page-header {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--bg-line);
}
.page-header .kicker { margin-bottom: 10px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 2.2em; font-size: 1.5rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--sage); }
.prose ul { color: var(--sage); padding-left: 1.2em; }
.prose li { margin-bottom: 0.5em; }
.prose strong { color: var(--cream); }

.fact-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 40px;
  font-size: 0.95rem;
}
.fact-table tr { border-bottom: 1px solid var(--bg-line); }
.fact-table td { padding: 12px 0; }
.fact-table td:first-child { color: var(--sage); width: 40%; }
.fact-table td:last-child { color: var(--cream); font-weight: 500; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 32px 0;
}
.asset-card {
  border: 1px solid var(--bg-line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-raised);
}
.asset-card img { aspect-ratio: 3/4; object-fit: cover; width: 100%; }
.asset-card .asset-label {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--sage);
  display: flex;
  justify-content: space-between;
}
.asset-card a { color: var(--teal); text-decoration: none; font-weight: 600; }

.notice {
  background: var(--bg-raised);
  border: 1px solid var(--bg-line);
  border-left: 3px solid var(--vermillion);
  border-radius: 6px;
  padding: 18px 22px;
  font-size: 0.92rem;
  color: var(--sage);
  margin: 28px 0;
}
.notice strong { color: var(--cream); }

/* ---------- Footer disclaimer ---------- */
.footer-disclaimer {
  width: 100%;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-line);
  font-size: 0.82rem;
  color: var(--sage);
  opacity: 0.85;
}
.flavour-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}
.flavour-tab {
  background: var(--bg-raised);
  border: 1px solid var(--bg-line);
  border-radius: 8px;
  padding: 12px 18px;
  text-align: left;
  cursor: pointer;
  color: var(--cream);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}
.flavour-tab:hover { border-color: var(--sage); }
.flavour-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #08211c;
}
.flavour-name { font-weight: 700; font-size: 0.95rem; }
.flavour-desc { font-size: 0.78rem; opacity: 0.8; }
.flavour-tab.active .flavour-desc { opacity: 0.75; }

.now-playing {
  background: var(--paper);
  color: var(--ink);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 32px;
}
.now-playing-info { display: flex; flex-direction: column; margin-bottom: 12px; }
.now-playing-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8a836c; }
.now-playing-title { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; }
.now-playing audio { width: 100%; }
.now-playing-note { font-size: 0.85rem; color: var(--vermillion); margin: 10px 0 0; min-height: 1.2em; }

.scene-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.scene-card {
  background: var(--bg-raised);
  border: 1px solid var(--bg-line);
  border-radius: 6px;
  padding: 18px 14px;
  color: var(--cream);
  font-family: var(--serif);
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
}
.scene-card:hover { border-color: var(--teal); }
.scene-card.active { background: var(--teal); color: #08211c; border-color: var(--teal); font-weight: 600; }

@media (max-width: 900px) {
  .scene-grid { grid-template-columns: repeat(2, 1fr); }
  .flavour-tab { min-width: 130px; }
}
@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 320px; margin: 0 auto; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .states-grid { grid-template-columns: repeat(2, 1fr); }
  .worlds-list { grid-template-columns: repeat(2, 1fr); }
  .footage-grid, .footage-grid-3 { grid-template-columns: 1fr; }
  .promises { grid-template-columns: 1fr; }
  .signal { grid-template-columns: 1fr; padding: 36px 24px; }
  .signal-form { flex-direction: column; }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Carousel ---------- */
.carousel {
  position: relative;
  margin-top: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--bg-line);
}
.carousel-track {
  display: flex;
  transition: transform 0.4s ease;
}
.carousel-slide {
  min-width: 100%;
  position: relative;
}
.carousel-slide img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.carousel-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: var(--cream);
  padding: 40px 24px 18px;
  margin: 0;
  font-size: 0.95rem;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(16,29,22,0.7);
  border: 1px solid var(--bg-line);
  color: var(--cream);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
}
.carousel-arrow:hover { background: var(--teal); color: #08211c; }
.carousel-arrow.prev { left: 14px; }
.carousel-arrow.next { right: 14px; }
.carousel-dots {
  position: absolute;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.carousel-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
}
.carousel-dots button.active { background: var(--teal); }

@media (max-width: 900px) {
  .carousel-slide img { aspect-ratio: 4/3; }
  .carousel-arrow { width: 34px; height: 34px; }
  .video-carousel .carousel-arrow {
    width: 26px; height: 26px;
    top: 34%;
    font-size: 0.7rem;
  }
}
