/* ============================================================
   PlaydiaEmu — Landing Page Styles
   Palette inspired by Bandai Playdia / CD-era interactive TV:
     Orange      #E8553A / #C9442C
     Teal        #4FD1C5 / #2BB5AA
     Violet      #A78BFA
     Dark        #0A0E14 / #111820 / #1A2030 / #252D3D
   ============================================================ */

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --orange: #E8553A;
  --orange-dark: #C9442C;
  --teal: #4FD1C5;
  --teal-dark: #2BB5AA;
  --violet: #A78BFA;
  --violet-dark: #7C6FE0;
  --dark: #0A0E14;
  --dark-2: #111820;
  --dark-3: #1A2030;
  --dark-4: #252D3D;
  --text: #E8ECF1;
  --text-dim: #8B95A5;
  --radius: 12px;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--dark);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Soft disc-scan overlay ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(232, 85, 58, 0.02) 2px,
    rgba(232, 85, 58, 0.02) 4px
  );
}

/* ============================================================
   NAV
   ============================================================ */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}

#navbar.scrolled {
  background: rgba(10, 14, 20, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(232, 85, 58, 0.25);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-logo img { height: 36px; width: auto; }

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

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s;
  font-weight: 500;
}

.nav-links a:hover { color: var(--orange); }

.nav-github {
  display: flex;
  align-items: center;
}

.lang-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}

.lang-toggle:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: 0.3s;
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 96px 24px 80px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#disc-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.14;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 920px;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-title-line { display: block; }

.hero-title-line.accent {
  background: linear-gradient(135deg, var(--orange), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 400;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto 28px;
  opacity: 0.85;
}

.hero-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-badges img { height: 28px; }

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.25s;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 4px 24px rgba(232, 85, 58, 0.3);
}

.btn-primary:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(232, 85, 58, 0.4);
}

.btn-secondary {
  background: var(--dark-4);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: #3a3a3a;
  transform: translateY(-2px);
}

.hero-shot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-shot-frame {
  position: relative;
  width: min(420px, 88vw);
  aspect-ratio: 4 / 3;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 6px rgba(232, 85, 58, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.55);
}

.hero-shot-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  background: #000;
}

.hero-shot-scan {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
}

.hero-shot-tag {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 2;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--teal);
  background: rgba(10, 14, 20, 0.75);
  border: 1px solid rgba(79, 209, 197, 0.35);
  border-radius: 999px;
  padding: 2px 10px;
  font-family: var(--font-mono);
}

.hero-shot-note {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.8rem;
  animation: fadeInUp 1s 1.5s both;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-dim);
  border-bottom: 2px solid var(--text-dim);
  transform: rotate(45deg);
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translateY(0); opacity: 1; }
  50% { transform: rotate(45deg) translateY(6px); opacity: 0.5; }
}

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 100px 0; }

.section-dark { background: var(--dark-2); }

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-subtitle {
  text-align: center;
  color: var(--text-dim);
  font-size: 1.05rem;
  margin-bottom: 56px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-text h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about-text p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-text strong { color: var(--orange); }

.diagram-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.diagram-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 16px;
  background: var(--dark-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  min-width: 120px;
  transition: 0.3s;
}

.diagram-node:hover {
  border-color: var(--violet);
  transform: translateY(-4px);
}

.diagram-node.highlight {
  border-color: var(--orange);
  box-shadow: 0 0 30px rgba(232, 85, 58, 0.12);
}

.diagram-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.disc-icon {
  background:
    radial-gradient(circle at center, var(--dark-3) 0 22%, transparent 23%),
    linear-gradient(135deg, var(--orange), var(--orange-dark));
  box-shadow: 0 4px 16px rgba(232, 85, 58, 0.3);
}

.stream-icon {
  background: linear-gradient(135deg, var(--violet), var(--violet-dark));
  box-shadow: 0 4px 16px rgba(167, 139, 250, 0.3);
}

.emu-icon {
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
  box-shadow: 0 4px 16px rgba(79, 209, 197, 0.3);
}

.diagram-node span { font-weight: 600; font-size: 0.9rem; }
.diagram-node small { color: var(--text-dim); font-size: 0.75rem; text-align: center; }

.diagram-arrow {
  font-size: 1.5rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ============================================================
   STATS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.stat-item {
  text-align: center;
  padding: 40px 16px;
  background: var(--dark-3);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  transition: 0.3s;
}

.stat-item:hover {
  border-color: var(--orange);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(232, 85, 58, 0.15);
}

.stat-number {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--orange), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.stat-sub {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ============================================================
   FEATURES
   ============================================================ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px 28px;
  background: var(--dark-2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange), var(--teal));
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-card:hover::before { opacity: 1; }

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(232, 85, 58, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--orange);
}

.feature-icon svg { width: 24px; height: 24px; }

.feature-card h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.feature-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ============================================================
   GALLERY
   ============================================================ */
.gallery-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-sans);
}

.filter-btn:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.filter-btn.active {
  background: var(--orange);
  color: #fff;
  border-color: var(--orange);
}

.gallery-pages {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
}

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

.gallery-page.active { display: grid; }

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--dark-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  aspect-ratio: 4 / 3;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.gallery-item:hover {
  transform: translateY(-4px);
  border-color: rgba(232, 85, 58, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  background: #000;
}

.gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text);
  text-align: left;
}

.gallery-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.gallery-nav button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--dark-3);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: 0.2s;
}

.gallery-nav button:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
}

.gallery-nav button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.gallery-dots {
  display: flex;
  gap: 8px;
}

.gallery-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: 0.2s;
}

.gallery-dots span.active {
  background: var(--orange);
  transform: scale(1.25);
}

.gallery-more {
  text-align: center;
  margin-top: 32px;
}

.gallery-more a {
  color: var(--teal);
  font-weight: 600;
}

.gallery-more a:hover { text-decoration: underline; }

/* ============================================================
   ARCHITECTURE
   ============================================================ */
.arch-diagram {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.arch-layer {
  background: var(--dark-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}

.arch-frontend { border-color: rgba(232, 85, 58, 0.35); }
.arch-core { border-color: rgba(79, 209, 197, 0.35); background: rgba(79, 209, 197, 0.04); }

.arch-label {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--dark);
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.arch-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.arch-box {
  background: var(--dark-3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 18px 20px;
  min-width: 180px;
  text-align: center;
}

.arch-box strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text);
}

.arch-box small {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.5;
}

.arch-box.core-box {
  width: 100%;
  border-color: rgba(79, 209, 197, 0.4);
}

.arch-box.small-box {
  min-width: 100px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.core-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.core-modules span {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(79, 209, 197, 0.1);
  border: 1px solid rgba(79, 209, 197, 0.28);
  color: var(--teal);
}

.arch-connector {
  height: 40px;
  display: flex;
  justify-content: center;
}

.arch-connector svg {
  width: 100px;
  height: 40px;
}

/* ============================================================
   QUICK START
   ============================================================ */
.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.quickstart-card {
  background: var(--dark-3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: 0.3s;
}

.quickstart-card:hover {
  border-color: rgba(232, 85, 58, 0.4);
  transform: translateY(-4px);
}

.qs-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.qs-header h3 { font-size: 1.15rem; }

.qs-icon { font-size: 1.4rem; }

.qs-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.qs-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.qs-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(232, 85, 58, 0.18);
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.qs-step p {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.qs-step code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--teal);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 10px;
  word-break: break-all;
  text-align: left;
}

/* ============================================================
   FOOTER
   ============================================================ */
#footer {
  background: var(--dark);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand img { margin-bottom: 10px; height: 36px; width: auto; }

.footer-name {
  display: block;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.footer-brand p {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 260px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links h4 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.footer-links a {
  color: var(--text);
  font-size: 0.9rem;
  opacity: 0.85;
  transition: color 0.2s, opacity 0.2s;
}

.footer-links a:hover {
  color: var(--orange);
  opacity: 1;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ============================================================
   REVEAL / ANIMATIONS
   ============================================================ */
.fade-in-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .about-grid,
  .features-grid,
  .quickstart-grid,
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .gallery-page { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: rgba(10, 14, 20, 0.97);
    border-bottom: 1px solid rgba(232, 85, 58, 0.25);
    padding: 8px 0 16px;
  }

  .nav-links.open { display: flex; }

  .nav-links a,
  .nav-links .lang-toggle {
    padding: 12px 24px;
    border-radius: 0;
    border: none;
    text-align: left;
    background: transparent;
  }

  .nav-github { justify-content: flex-start; padding: 12px 24px; }

  .section { padding: 72px 0; }

  .about-grid,
  .features-grid,
  .quickstart-grid,
  .footer-grid,
  .stats-grid,
  .gallery-page {
    grid-template-columns: 1fr;
  }

  .diagram-arrow { transform: rotate(90deg); }

  .hero-scroll { display: none; }
}
