:root {
  --bg-deep: #030305;
  --bg-panel: rgba(255, 255, 255, 0.03);
  --bg-panel-hover: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.08);
  --text-main: #fcfcfc;
  --text-muted: #a1a1aa;
  
  /* App Colors */
  --cyan: #17e7e7;
  --green: #00f315;
  --amber: #ff8a06;
  --pink: #ff2f8e;
  --yellow: #fff200;

  --max-width: 1200px;
  --nav-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* --- Ambient Background --- */
.ambient-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  animation: float 20s infinite ease-in-out alternate;
}

.orb-cyan { width: 600px; height: 600px; background: var(--cyan); top: -10%; left: -10%; }
.orb-pink { width: 500px; height: 500px; background: var(--pink); bottom: 10%; right: -5%; animation-delay: -5s; }
.orb-amber { width: 400px; height: 400px; background: var(--amber); top: 40%; left: 40%; animation-delay: -10s; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(100px, 50px) scale(1.1); }
}

/* Background Grid */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

/* --- Cursor Spotlight --- */
.cursor-spotlight {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
  mix-blend-mode: screen;
}

/* --- Shared Components --- */
.page-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.glass-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: 24px;
}

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

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

.magnetic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.3s ease;
}

.btn-text {
  position: relative;
  z-index: 2;
}

.primary-action {
  background: #fff;
  color: #000;
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.15);
}
.primary-action:hover {
  box-shadow: 0 12px 40px rgba(255, 255, 255, 0.25);
}

.secondary-text-link {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.8;
  transition: opacity 0.2s, transform 0.2s;
}

.secondary-text-link:hover {
  opacity: 1;
  transform: translateX(4px);
}

.secondary-text-link .arrow {
  transition: transform 0.2s;
}

.secondary-text-link:hover .arrow {
  transform: translateX(4px);
}

/* --- Navigation --- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--nav-height);
  padding: 0 24px;
  margin-top: 24px;
  border-radius: 99px;
  position: sticky;
  top: 24px;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

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

.nav .app-link {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 20px;
  font-size: 0.85rem;
}
.nav .app-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Typography --- */
.shimmer-text {
  background: linear-gradient(90deg, var(--text-muted) 0%, #fff 50%, var(--text-muted) 100%);
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.gradient-text {
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

/* --- Hero Section --- */
.hero {
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 80px 0;
}

.hero-title {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 32px;
}

.lead {
  font-size: clamp(1.1rem, 2vw, 1.3rem);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 500px;
  margin-bottom: 48px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Device Stage */
.device-stage {
  position: relative;
  height: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.glow-ring {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  animation: spin 20s linear infinite;
}

.glow-ring::after {
  content: '';
  position: absolute;
  top: -2px; left: 50%;
  width: 4px; height: 4px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 20px 4px var(--cyan);
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.phone {
  position: absolute;
  top: 0; bottom: 0;
  margin: auto;
  width: 280px; /* Fixed width, use CSS scale for responsiveness */
  aspect-ratio: 430 / 932;
  border-radius: 46px; /* Scaled down from 50px */
  background: #000;
  border: 4px solid #333438; /* Titanium edge */
  box-shadow: 
    inset 0 0 0 4px #000, /* inner bezel */
    inset 0 0 12px rgba(255,255,255,0.05),
    0 40px 80px -20px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255,255,255,0.1);
  overflow: visible; /* to allow buttons to show outside */
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

/* Titanium side buttons */
.phone::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 100px;
  width: 4px;
  height: 50px;
  background: #333438;
  border-radius: 4px 0 0 4px;
  box-shadow: 0 65px 0 #333438; /* Second volume button */
}
.phone::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 120px;
  width: 4px;
  height: 65px;
  background: #333438;
  border-radius: 0 4px 4px 0;
}

.status-bar {
  position: absolute;
  top: 16px;
  left: 26px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  pointer-events: none;
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-icons svg {
  opacity: 0.9;
  height: 10px;
  width: auto;
}

.dynamic-island {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 28px;
  background: #000;
  border-radius: 20px;
  z-index: 40;
  box-shadow: inset 0 0 2px rgba(255,255,255,0.1);
}

.screen-content {
  flex: 1;
  position: relative;
  background: #0a0a0c;
  overflow: hidden;
  border-radius: 44px; /* inner screen radius perfectly matching bezel */
  border: 4px solid #000; /* Bezels */
}

.screen-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Interactive Hover Swapping States --- */
.phone.active-front {
  transform: translateZ(60px) rotateY(-8deg) rotateX(4deg);
  z-index: 2;
  right: 12%;
  left: auto;
  opacity: 1;
}

.phone.active-back {
  transform: translateZ(-40px) rotateY(-15deg) rotateX(2deg) scale(0.85);
  left: 5%;
  right: auto;
  opacity: 0.7;
  z-index: 1;
}

/* When the user hovers over the stage, we reveal them better */
.device-stage:hover .phone.active-front {
  transform: translateZ(90px) rotateY(0deg) rotateX(0deg);
}
.device-stage:hover .phone.active-back {
  transform: translateZ(-20px) rotateY(-6deg) rotateX(0deg) scale(0.9);
  opacity: 0.9;
  left: 2%; /* Slide it out a bit more to see it */
}

/* If you hover directly on the back phone, bring it up even more to hint it is clickable */
.phone.active-back:hover {
  transform: translateZ(0px) rotateY(-3deg) rotateX(0deg) scale(0.95) !important;
  opacity: 1 !important;
  z-index: 3;
}

/* --- Interactive Game UI --- */
.game-ui {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 60px 20px 40px;
  background: #050505;
  color: #fff;
}

.game-header {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: auto;
}
.game-header .highlight { color: var(--cyan); }

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: auto;
  aspect-ratio: 1;
}

.grid-btn {
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s, filter 0.2s, box-shadow 0.2s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.grid-btn:hover {
  transform: scale(0.95);
  filter: brightness(1.1);
}

.grid-btn:active, .grid-btn.active {
  transform: scale(0.9);
}

/* Base Colors matching OEM game */
.grid-btn.color-1 { background: #ff9500; }
.grid-btn.color-2 { background: #ff2d55; }
.grid-btn.color-3 { background: #32ade6; }
.grid-btn.color-4 { background: #007aff; }
.grid-btn.color-5 { background: #ff3b30; }
.grid-btn.color-6 { background: #ffffff; }
.grid-btn.color-7 { background: #34c759; }
.grid-btn.color-8 { background: #af52de; }
.grid-btn.color-9 { background: #ffcc00; }

/* Active States */
.color-1.active { box-shadow: 0 0 30px #ff9500, inset 0 0 20px rgba(255,255,255,0.5); }
.color-2.active { box-shadow: 0 0 30px #ff2d55, inset 0 0 20px rgba(255,255,255,0.5); }
.color-3.active { box-shadow: 0 0 30px #32ade6, inset 0 0 20px rgba(255,255,255,0.5); }
.color-4.active { box-shadow: 0 0 30px #007aff, inset 0 0 20px rgba(255,255,255,0.5); }
.color-5.active { box-shadow: 0 0 30px #ff3b30, inset 0 0 20px rgba(255,255,255,0.5); }
.color-6.active { box-shadow: 0 0 30px #ffffff, inset 0 0 20px rgba(0,0,0,0.2); }
.color-7.active { box-shadow: 0 0 30px #34c759, inset 0 0 20px rgba(255,255,255,0.5); }
.color-8.active { box-shadow: 0 0 30px #af52de, inset 0 0 20px rgba(255,255,255,0.5); }
.color-9.active { box-shadow: 0 0 30px #ffcc00, inset 0 0 20px rgba(255,255,255,0.5); }

.game-footer {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Interactive Menu UI (Back Phone) --- */
.menu-ui {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 80px 24px 40px;
  background: #050505;
  color: #fff;
  align-items: center;
}

.menu-header {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: auto;
  margin-top: 40px;
}
.menu-header .highlight { color: var(--cyan); }

.menu-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  margin-bottom: auto;
}

.menu-btn {
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.menu-btn:hover {
  background: rgba(255,255,255,0.12);
  transform: scale(0.98);
}

.menu-footer {
  font-size: 0.9rem;
  color: var(--cyan);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* --- Training Bento Grid --- */
.training {
  padding: 120px 0;
}

.section-header {
  margin-bottom: 64px;
  text-align: center;
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.bento-item {
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease, transform 0.3s ease;
}

.bento-item:hover {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-4px);
}

.span-2 { grid-column: span 2; }
.span-full { grid-column: span 3; }

.bento-icon {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 200;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 16px;
  margin-bottom: 8px;
}

.bento-item h3 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.bento-item p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 1.05rem;
}

.bento-content-row {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.bento-content-row .bento-icon {
  border-bottom: none;
  padding: 0;
  margin: 0;
  font-size: 4rem;
  line-height: 1;
}

/* --- Statement --- */
.statement {
  margin: 100px 0;
  padding: 80px 60px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 60px;
  align-items: center;
}

.statement-text {
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.floating-grid {
  width: 100%;
  border-radius: 16px;
  animation: float-y 6s ease-in-out infinite alternate;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

@keyframes float-y {
  0% { transform: translateY(0); }
  100% { transform: translateY(-20px); }
}

/* --- Support & Privacy --- */
.support-privacy {
  padding: 120px 0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.privacy-body {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 48px;
}

.support-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Animations & Utilities --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.slide-down {
  animation: slide-down 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .device-stage {
    height: 500px;
  }
  .phone.active-front {
    right: 50%;
    transform: translateZ(60px) translateX(30%) rotateY(-8deg) rotateX(4deg);
  }
  .phone.active-back {
    left: 50%;
    transform: translateZ(-40px) translateX(-50%) rotateY(-15deg) rotateX(2deg) scale(0.85);
  }
  .device-stage:hover .phone.active-front {
    transform: translateZ(90px) translateX(30%) rotateY(0deg) rotateX(0deg);
  }
  .device-stage:hover .phone.active-back {
    transform: translateZ(-20px) translateX(-60%) rotateY(-6deg) rotateX(0deg) scale(0.9);
    left: 50%;
  }
  
  .bento-grid {
    grid-template-columns: 1fr;
  }
  .span-2, .span-full {
    grid-column: span 1;
  }
  .bento-content-row {
    flex-direction: column;
    gap: 20px;
  }
  
  .statement {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 60px 30px;
  }
  .statement-visual {
    max-width: 200px;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .nav {
    flex-direction: row;
    height: auto;
    padding: 12px 16px;
    gap: 16px;
  }
  .nav nav {
    width: auto;
    justify-content: space-between;
    gap: 16px;
  }
  .nav .app-link {
    padding: 6px 16px;
    font-size: 0.8rem;
  }
  .nav .nav-link {
    display: none; /* Hide text links on mobile */
  }
  .brand-text {
    display: none; /* Keep just the app icon to save space */
  }
  .brand img {
    margin-right: 0;
  }
  .hero {
    padding: 20px 0;
  }
  .hero-actions {
    flex-direction: column;
    gap: 24px;
  }
  .device-stage {
    height: 450px;
  }
  .phone.active-front {
    transform: translateZ(60px) translateX(35%) rotateY(-5deg) scale(0.85);
  }
  .phone.active-back {
    transform: translateZ(-40px) translateX(-60%) rotateY(-10deg) scale(0.75);
  }
  .device-stage:hover .phone.active-front {
    transform: translateZ(90px) translateX(35%) rotateY(0deg) scale(0.85);
  }
  .device-stage:hover .phone.active-back {
    transform: translateZ(-20px) translateX(-70%) rotateY(-6deg) scale(0.8);
  }
  .section-title {
    font-size: 2.2rem;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .support-links {
    flex-direction: column;
  }
}
