/* ==========================================================================
   OBV GAME — Fixed-Viewport Cinematic Scroll-Stage Design System
   ========================================================================== */

:root {
  --bg: #07080a;
  --surface: rgba(12, 14, 19, 0.68);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.24);

  --text: #f5f5f7;
  --text-secondary: #a1a6b3;
  --text-muted: #686e7b;

  --accent: #5be4ea;
  --accent-warm: #f28c38;

  --font-display: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --nav-h: 74px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden; /* Pure virtual-scroll animated stage */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  touch-action: none;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input {
  font-family: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: rgba(91, 228, 234, 0.25);
  color: #fff;
}

/* ==========================================================================
   Preloader & Top Progress Hairline
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg);
  display: grid;
  place-items: center;
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo {
  height: 68px;
  width: auto;
  display: block;
  filter: drop-shadow(0 8px 28px rgba(91, 228, 234, 0.18));
}

.timeline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 80;
  background: rgba(255, 255, 255, 0.06);
}

.timeline-bar-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  box-shadow: 0 0 12px rgba(91, 228, 234, 0.6);
}

/* ==========================================================================
   Three.js Canvas & Adaptive Atmospheric Scrim
   ========================================================================== */
#studio-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  pointer-events: none;
}

.stage-scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(7, 8, 10, 0.12) 0%, rgba(7, 8, 10, 0.72) 100%);
  transition: background 0.6s ease;
}

.stage-scrim[data-focus="left"] {
  background:
    linear-gradient(90deg, rgba(7, 8, 10, 0.86) 0%, rgba(7, 8, 10, 0.56) 40%, rgba(7, 8, 10, 0.12) 72%, rgba(7, 8, 10, 0.34) 100%),
    radial-gradient(circle at 72% 48%, transparent 15%, rgba(7, 8, 10, 0.62) 85%);
}

.stage-scrim[data-focus="right"] {
  background:
    linear-gradient(270deg, rgba(7, 8, 10, 0.88) 0%, rgba(7, 8, 10, 0.58) 42%, rgba(7, 8, 10, 0.12) 72%, rgba(7, 8, 10, 0.32) 100%),
    radial-gradient(circle at 28% 50%, transparent 15%, rgba(7, 8, 10, 0.62) 85%);
}

.stage-scrim[data-focus="center"] {
  background:
    radial-gradient(circle at 50% 48%, rgba(7, 8, 10, 0.42) 0%, rgba(7, 8, 10, 0.84) 100%);
}

.stage-scrim[data-focus="bottom"] {
  background:
    linear-gradient(180deg, rgba(7, 8, 10, 0.84) 0%, rgba(7, 8, 10, 0.58) 54%, rgba(7, 8, 10, 0.25) 100%);
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 60;
  display: flex;
  align-items: center;
}

.nav-inner {
  width: min(1220px, 100% - 48px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  padding: 2px 0;
}

.brand-logo-img {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease);
}

.brand:hover .brand-logo-img {
  transform: scale(1.03);
  filter: drop-shadow(0 6px 20px rgba(91, 228, 234, 0.25));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-item {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  position: relative;
  padding: 5px 0;
  transition: color 0.2s ease;
}

.nav-item::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.28s var(--ease);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
}

.nav-item.active::after,
.nav-item:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-switch {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(14, 16, 22, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.32s var(--ease);
  pointer-events: none;
}

.lang-switch[data-active="en"] .lang-thumb {
  transform: translateX(100%);
}

.lang-opt {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 10px 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  transition: color 0.25s ease;
}

.flag-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.22);
  opacity: 0.72;
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.lang-opt:hover {
  color: var(--text);
}

.lang-opt:hover .flag-icon {
  opacity: 1;
}

.lang-opt.active {
  color: #07080a;
  font-weight: 600;
}

.lang-opt.active .flag-icon {
  opacity: 1;
  transform: scale(1.04);
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.menu-toggle span {
  width: 18px;
  height: 1.5px;
  background: var(--text);
}

/* ==========================================================================
   Right Chapter Rail & Bottom-Left Counter
   ========================================================================== */
.chapter-rail {
  position: fixed;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rail-dot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  padding: 4px 0;
  transition: color 0.25s ease;
}

.rail-dot::after {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  transition: height 0.32s var(--ease), background 0.32s var(--ease), box-shadow 0.32s var(--ease);
}

.rail-dot span {
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.rail-dot:hover span,
.rail-dot.active span {
  opacity: 1;
  transform: translateX(0);
}

.rail-dot.active {
  color: var(--text);
}

.rail-dot.active::after {
  height: 24px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(91, 228, 234, 0.6);
}

.chapter-counter {
  position: fixed;
  left: 32px;
  bottom: 28px;
  z-index: 55;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.chapter-counter strong {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 500;
}

/* ==========================================================================
   Buttons & Shared Tokens
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.22s var(--ease), background 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--text);
  color: #07080a;
  font-weight: 600;
}

.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.16);
}

.btn-ghost {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--accent);
  background: rgba(91, 228, 234, 0.12);
  transform: translateY(-2px);
}

.btn-outline {
  border: 1px solid var(--line);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   Fixed Stage & Animated Chapters
   ========================================================================== */
.stage {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.chapter {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 12px) 0 56px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  will-change: transform, opacity, filter;
}

.container {
  width: min(1180px, 100% - 96px);
  margin: 0 auto;
}

.chapter-grid-left {
  display: grid;
  grid-template-columns: minmax(0, 600px) 1fr;
  align-items: center;
}

.chapter-grid-right {
  display: grid;
  grid-template-columns: 1fr minmax(0, 580px);
  align-items: center;
}

.chapter-grid-right .chapter-block {
  grid-column: 2;
}

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.section-label span:first-child {
  color: var(--accent);
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  display: inline-block;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 5.5vw, 4.65rem);
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: -0.04em;
  margin-bottom: 22px;
}

.title-accent {
  background: linear-gradient(110deg, #ffffff 10%, #5be4ea 58%, #f28c38 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.6vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.lead-text {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
  color: var(--text-secondary);
  max-width: 500px;
  line-height: 1.72;
  margin-bottom: 34px;
}

.body-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.72;
  margin-bottom: 16px;
}

.body-text.strong-lead {
  color: var(--text);
  font-size: 1.08rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 8px;
}

/* Chapter 0 Scroll Hint */
.chapter-hint {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.scroll-mouse {
  width: 20px;
  height: 32px;
  border-radius: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.scroll-mouse i {
  width: 2.5px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  animation: wheelBob 1.7s ease-in-out infinite;
}

@keyframes wheelBob {
  0%, 100% { transform: translateY(0); opacity: 1; }
  65% { transform: translateY(9px); opacity: 0.2; }
}

/* Chapter 1 Facts Strip */
.facts-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.fact strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.fact span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Chapter 2 Approach Pillars */
.chapter-center {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.approach-header {
  max-width: 640px;
}

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

.pillar-card {
  padding: 28px 26px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 17, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  will-change: transform;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.pillar-card:hover {
  border-color: var(--accent);
  background: rgba(16, 19, 27, 0.82);
}

.pillar-num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 16px;
}

.pillar-card h3 {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.pillar-card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.68;
}

/* Chapter 3 First Game */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(91, 228, 234, 0.34);
  background: rgba(91, 228, 234, 0.08);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: #c8f7f9;
  margin-bottom: 18px;
}

.game-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin: 26px 0 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.spec-cell span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.spec-cell strong {
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text);
}

/* Chapter 4 Contact */
.contact-stage {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: start;
}

.notify-form {
  margin-top: 24px;
  max-width: 460px;
}

.notify-row {
  display: flex;
  gap: 10px;
}

.notify-row input {
  flex: 1;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.72);
  backdrop-filter: blur(10px);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.notify-row input:focus {
  border-color: var(--accent);
}

.form-msg {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  min-height: 1.2em;
  color: #6ee7b7;
}

.form-msg.error {
  color: #fda4af;
}

.contact-side {
  display: grid;
  gap: 32px;
  padding-left: 40px;
  border-left: 1px solid var(--line);
}

.contact-block {
  display: grid;
  gap: 12px;
}

.email-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.studio-email {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.75rem);
  font-weight: 600;
  transition: color 0.2s ease;
}

.studio-email:hover {
  color: var(--accent);
}

.copy-btn {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.social-links a {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 19, 0.55);
  font-size: 0.84rem;
  color: var(--text-secondary);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}

.social-links a:hover {
  border-color: var(--line-strong);
  color: var(--text);
  transform: translateY(-2px);
}

.stage-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
}

.stage-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.back-start-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.back-start-btn:hover {
  color: var(--accent);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .container {
    width: calc(100% - 64px);
  }
  .chapter-grid-left,
  .chapter-grid-right,
  .contact-stage {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .chapter-grid-right .chapter-block {
    grid-column: 1;
  }
  .pillars-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .pillar-card {
    padding: 18px 20px;
  }
  .contact-side {
    padding-left: 0;
    padding-top: 22px;
    border-left: none;
    border-top: 1px solid var(--line);
  }
  .chapter-rail {
    right: 14px;
  }
  .rail-dot span {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    width: calc(100% - 40px);
  }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 16px;
    right: 16px;
    padding: 20px;
    border-radius: 18px;
    background: rgba(11, 13, 18, 0.96);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .nav-links.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }
  .nav-cta {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .chapter-counter {
    left: 20px;
    bottom: 18px;
  }
  .chapter-hint {
    bottom: 18px;
  }
  .notify-row {
    flex-direction: column;
  }
  .facts-strip {
    gap: 10px;
  }
  .hero-title {
    font-size: 2.35rem;
  }
  .section-heading {
    font-size: 1.65rem;
  }
  .pillar-card p {
    font-size: 0.84rem;
  }
}
