/* Molecule — site styles.
 *
 * Every token here is lifted from the game (www/src/config/theme.js and
 * www/css/style.css), not invented: deep-space #010409 field, sky-500 accent,
 * slate text ladder, Plus Jakarta Sans at heavy weights, uppercase labels with
 * wide tracking, glassy panels. The site commits to the game's single dark
 * look on purpose — there is no light theme to be had in a petri dish. */

/* Self-hosted Plus Jakarta Sans — the same variable woff2 the game bundles
   (www/fonts), same unicode-range split. font-display: swap, as the game's
   fonts.css argues: text in a fallback beats no text. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../fonts/plusjakartasans-200-800-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(../fonts/plusjakartasans-200-800-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg:            #010409;   /* GameTheme.COLOR_BG            */
  --panel:         #1e293b;   /* GameTheme.COLOR_BG_PANEL      */
  --primary:       #0ea5e9;   /* GameTheme.COLOR_PRIMARY       */
  --primary-light: #38bdf8;   /* GameTheme.COLOR_PRIMARY_LIGHT */
  --text:          #e2e8f0;   /* slate-200 */
  --text-2:        #94a3b8;   /* slate-400 */
  --text-3:        #64748b;   /* slate-500 */
  --line:          rgba(56, 189, 248, 0.10);
  --font: 'Plus Jakarta Sans', 'Noto Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Background layers ───────────────────────────────────────────────────── */

#field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 55%, rgba(1, 4, 9, 0.85) 100%),
    linear-gradient(to bottom, rgba(1, 4, 9, 0.35), transparent 20%, transparent 80%, rgba(1, 4, 9, 0.6));
}

main, .nav, .footer { position: relative; z-index: 2; }

/* ── Type helpers ────────────────────────────────────────────────────────── */

.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--primary-light);
  margin-bottom: 1.1rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
}

.sub {
  color: var(--text-2);
  max-width: 34rem;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
}

/* The wordmark — MOL[E]CULE, exactly the menu's treatment. */
.logo .e, .nav-logo .e, .footer-logo .e { color: var(--primary); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.9rem clamp(1.2rem, 4vw, 3rem);
  background: rgba(1, 4, 9, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-logo {
  font-weight: 800;
  letter-spacing: -0.05em;
  font-size: 1.15rem;
  color: #fff;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 1.6rem;
}

.nav-links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  transition: color 0.2s;
}

.nav-links a:hover { color: #fff; }

.nav-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.nav-social a {
  display: flex;
  align-items: center;
  transition: transform 0.2s, opacity 0.2s;
  opacity: 0.85;
}

.nav-social a:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.nav-social svg {
  width: 18px;
  height: 18px;
  fill: #e2e8f0;   /* monochrome-on-dark glyphs; YouTube overrides inline */
}

.nav-cta {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  text-decoration: none;
  padding: 0.55rem 1.1rem;
  border-radius: 2rem;
  background: rgba(2, 132, 199, 0.65);      /* sky-600/65 — the START button */
  transition: background 0.2s;
}

.nav-cta:hover { background: rgba(14, 165, 233, 0.8); }

/* ── Hero ────────────────────────────────────────────────────────────────── */

.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: 7rem clamp(1.2rem, 5vw, 4rem) 4rem;
  flex-wrap: wrap;
}

.hero-copy { max-width: 34rem; }

.logo {
  font-size: clamp(3.4rem, 9vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 60px rgba(14, 165, 233, 0.35);
  margin-bottom: 1.4rem;
}

.tagline {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 1rem;
}

.hero .sub { margin-bottom: 2.4rem; }

/* The launch note sits right on top of the badge it explains. */
.cta-eyebrow { margin-bottom: 0.85rem; }

/* App Store badge style — hand-drawn stand-in for the official artwork
   (swapped for the real localized badge at launch). System font stack on
   purpose: on Apple devices it renders in SF, the badge's own face. */
.btn-appstore {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 1.6rem 0.75rem 1.3rem;
  background: #000;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  border-radius: 0.8rem;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-appstore:hover {
  transform: translateY(-2px);
  border-color: #fff;
  box-shadow: 0 10px 40px rgba(14, 165, 233, 0.2);
}

.btn-apple {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  fill: #fff;
}

.btn-appstore-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.12;
}

.btn-appstore-text small {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.btn-appstore-text strong {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ── Phone frame / live sim ──────────────────────────────────────────────── */

.hero-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.phone {
  width: min(320px, 78vw);
  aspect-ratio: 9 / 19;
  border-radius: 2.6rem;
  padding: 10px;
  background: linear-gradient(160deg, #0f172a, #020617);
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow:
    0 0 80px rgba(14, 165, 233, 0.14),
    0 30px 60px rgba(0, 0, 0, 0.6);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 2rem;
  overflow: hidden;
  background: var(--bg);
}

.phone-screen video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-caption {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ── Sections shared ─────────────────────────────────────────────────────── */

section { padding: clamp(4rem, 10vw, 8rem) clamp(1.2rem, 5vw, 4rem); }

.worlds, .follow { text-align: center; }

.worlds h2, .follow h2 { margin-bottom: 1rem; }

.worlds .eyebrow, .follow .eyebrow { margin-bottom: 0.9rem; }

.follow .sub { margin: 0 auto 2.6rem; }

/* ── Dimensions — the game's world strip, desktop-scaled ─────────────────── */
/* Structure and numbers mirror .world-select / .world-bubble in the game's
   style.css: staggered spheres, bonds between them, the selected one larger
   and lit. Orb faces are painted by the vendored WorldOrb into canvases. */

.worlds-sub { margin: 0 auto; }

.world-select {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(14px, 4vw, 44px);
  margin: 4rem auto 0;
  width: fit-content;
  max-width: 96vw;
  /* How far the odd spheres hang below the even ones — the zigzag. */
  --chain-rise: clamp(36px, 7vw, 72px);
  /* Room for the risen row + labels below the low row. */
  padding-bottom: 0.5rem;
}

/* Odd worlds sit low, even ones high — the zigzag from the game's sketch. */
.world-bubble:nth-of-type(odd) { margin-top: var(--chain-rise); }

.world-chain {
  position: absolute;
  left: 0;
  top: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.world-bond {
  stroke: rgba(226, 232, 240, 0.42);
  stroke-width: 2;
  stroke-linecap: round;
}

.world-bubble {
  position: relative;
  z-index: 1;
  width: auto;
  min-width: 64px;
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  transition: transform 0.18s ease;
}

.world-bubble-orb {
  position: relative;
  /* 7px of transparent padding on every side — the JS paints the tour's
     progress ring out there, clear of the sphere. The negative margin hands
     the space back so the layout (and the chain geometry) doesn't move. */
  width: calc(clamp(52px, 7vw, 84px) + 14px);
  height: calc(clamp(52px, 7vw, 84px) + 14px);
  margin: -7px;
  display: block;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--bubble-accent, #0ea5e9) 45%, transparent));
}

.world-bubble-num {
  position: relative;
  font-weight: 800;
  font-size: clamp(8px, 1.2vw, 11px);
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: rgba(226, 232, 240, 0.5);
  line-height: 1;
  transition: color 0.2s;
}

.world-bubble:hover .world-bubble-num { color: rgba(226, 232, 240, 0.85); }

.world-bubble.is-selected { transform: scale(1.34); }
.world-bubble.is-selected .world-bubble-num { color: var(--bubble-accent, #0ea5e9); }
.world-bubble.is-selected .world-bubble-orb {
  filter: drop-shadow(0 0 20px color-mix(in srgb, var(--bubble-accent, #0ea5e9) 85%, transparent));
}

.world-bubble:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 12px;
}

.world-caption {
  margin-top: 2.6rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  transition: color 0.3s;
}

/* ── Features ────────────────────────────────────────────────────────────── */

.features {
  max-width: 52rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: clamp(3rem, 8vw, 5.5rem);
}

.feature h2 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  margin-bottom: 0.7rem;
}

.feature p {
  color: var(--text-2);
  max-width: 30rem;
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
}

.feature:nth-child(even) { text-align: right; }
.feature:nth-child(even) p { margin-left: auto; }

.grad {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.grad-sky   { background-image: linear-gradient(to right, #38bdf8, #0ea5e9); }
.grad-green { background-image: linear-gradient(to right, #86efac, #4ade80); }
.grad-fire  { background-image: linear-gradient(to right, #ffb057, #ff6a13); }
.grad-void  { background-image: linear-gradient(to right, #e2e8f0, #64748b); }

/* ── Social ──────────────────────────────────────────────────────────────── */

.social-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.8rem;
  border-radius: 2rem;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.social:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.15);
}

.social-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: #fff;   /* monochrome-on-dark brand glyphs; YouTube overrides inline */
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 2.4rem clamp(1.2rem, 5vw, 4rem) 3rem;
  border-top: 1px solid var(--line);
  background: rgba(1, 4, 9, 0.5);
}

.footer-logo {
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #fff;
}

.footer-fine {
  font-size: 0.72rem;
  color: var(--text-3);
  letter-spacing: 0.06em;
}

/* ── Reveal on scroll ────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .nav-links { display: none; }
  .nav { gap: 1rem; }
  .nav-social { gap: 0.8rem; }
  .nav-cta { white-space: nowrap; padding: 0.5rem 0.85rem; }
  .hero { padding-top: 6rem; text-align: center; }
  .hero-copy .sub { margin-left: auto; margin-right: auto; }
  .feature:nth-child(even) { text-align: left; }
  .feature:nth-child(even) p { margin-left: 0; }
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .world-bubble, .nav-social a, .social, .btn-appstore { transition: none; }
}
