/* -- Indicating what the script is for: Styles with Mobile UI Fixes & Optimization */

:root {
  /* COLORS */
  --bg-dark: #020617; 
  --bg-panel: rgba(255, 255, 255, 0.03);
  --border-light: rgba(255, 255, 255, 0.1);
  
  --primary: #a78bfa;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* DIMENSIONS */
  --nav-height: 70px;
  --container-width: 1200px;
  --radius: 20px;
  
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* RESET */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

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

/* --- LIQUID ETHER BACKGROUND --- */
#liquid-ether-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  pointer-events: auto; 
}
main, header, footer { position: relative; z-index: 10; }
a, button, .spotlight-card, canvas { pointer-events: auto; }

/* --- SHINY TEXT --- */
.shiny-text {
  color: #b5b5b5a4;
  background: linear-gradient(
    120deg,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.8) 50%,
    rgba(255, 255, 255, 0) 60%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  display: inline-block;
  animation: shine 3s linear infinite;
  text-decoration: none;
}

@keyframes shine {
  0% { background-position: 100%; }
  100% { background-position: -100%; }
}

/* --- UI COMPONENTS --- */
.glass-nav {
  position: fixed; top: 0; width: 100%; height: var(--nav-height);
  background: rgba(2, 6, 23, 0.85); /* Slightly darker for better mobile read */
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  pointer-events: auto;
}

.nav-container {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: var(--container-width);
  margin: 0 auto; padding: 0 24px;
}

.logo { 
  display: flex; align-items: center; gap: 0; 
  font-family: var(--font-display); 
  font-weight: 800; 
  font-size: 1.8rem; /* Made bigger as requested */
  letter-spacing: -0.03em;
  line-height: 1;
}

/* SAFETY: Hide the logo-mark globally so it disappears from 404/Arcade automatically */
.logo-mark {
  display: none !important; 
}

.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a {
  text-decoration: none; color: var(--text-muted); font-size: 0.95rem; font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: white; }

.btn-primary {
  background: rgba(255,255,255,0.1);
  color: white !important;
  padding: 10px 24px; border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.3s;
}

/* HERO */
.hero-section {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  text-align: center; 
  padding: 120px 24px 60px;
}

.status-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 99px;
  background: rgba(15, 23, 42, 0.6); 
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem; color: #a5b4fc; margin-bottom: 32px;
  backdrop-filter: blur(4px);
  max-width: 100%; /* Prevent overflow on small screens */
  text-align: left;
}
.pulse-dot {
  flex-shrink: 0; /* Prevent dot from squishing */
  width: 8px; height: 8px; background: #4ade80; border-radius: 50%;
  box-shadow: 0 0 12px #4ade80; animation: pulse 2s infinite;
}

h1 {
  font-family: var(--font-display);
  /* Adjusted clamp for mobile safety */
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 1.1; 
  margin-bottom: 24px;
  letter-spacing: -0.04em; font-weight: 700;
  word-wrap: break-word; /* Prevent overflow */
}

.gradient-text {
  background: linear-gradient(to right bottom, #fff 30%, #a5b4fc 80%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: 1.2rem; color: var(--text-muted);
  max-width: 600px; margin: 0 auto 48px;
  line-height: 1.7; font-weight: 400;
}

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

.btn-glow {
  background: white; color: black;
  padding: 14px 32px; border-radius: 12px;
  text-decoration: none; font-weight: 600; font-size: 1rem;
  display: flex; align-items: center; gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-glow:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(255, 255, 255, 0.2); }

.link-sub { color: var(--text-muted); text-decoration: none; font-size: 1rem; display: flex; gap: 10px; align-items: center; transition: 0.2s; }
.link-sub:hover { color: white; }

/* SECTIONS */
.section-padding { padding: 120px 0; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 900px; }

.section-header { text-align: center; margin-bottom: 80px; }
.section-header h2 { font-size: 3rem; font-family: var(--font-display); margin-bottom: 16px; letter-spacing: -0.02em; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

/* CARDS */
.glass-panel, .bento-card, .goal-item, .contact-box {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease;
  will-change: transform, opacity; /* Mobile Optimization */
}

/* Spotlight Overlay */
.spotlight-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(
    800px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), 
    rgba(255, 255, 255, 0.08),
    transparent 40%
  );
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
}
/* Ensure spotlight is visible on hover OR when active class is added by JS */
.spotlight-card:hover::before, .spotlight-card.touch-active::before { opacity: 1; }
.spotlight-card:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-4px); }

/* BENTO GRID */
.bento-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px;
}
.bento-card {
  padding: 40px; 
  display: flex; flex-direction: column; justify-content: space-between; 
  height: 100%; min-height: 320px;
}
.card-content { z-index: 2; position: relative; }
.card-tags { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.card-tags span {
  font-size: 0.75rem; text-transform: uppercase; font-weight: 600; letter-spacing: 0.5px;
  background: rgba(255,255,255,0.05); padding: 6px 12px; border-radius: 99px; color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.05);
}
.bento-card h3 { font-size: 1.5rem; margin-bottom: 12px; font-weight: 600; color: white; }

/* PROFILE */
.profile-panel { padding: 60px; text-align: center; backdrop-filter: blur(20px); }
.stats-row { 
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; 
  margin-top: 48px; padding-top: 48px; border-top: 1px solid var(--border-light); 
}
.stat strong { display: block; font-size: 2rem; margin-bottom: 8px; font-weight: 700; color: white; }
.stat span { font-size: 0.8rem; letter-spacing: 2px; color: var(--text-muted); text-transform: uppercase; }

/* GOALS */
.goals-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.goal-item { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.goal-icon { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255,255,255,0.05); }
.goal-icon.pending { background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.1); }
.goal-content h3 { font-size: 1.2rem; margin-bottom: 8px; color: white; }

/* CONTACT */
.contact-box {
  padding: 80px 24px; text-align: center;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4), rgba(15, 23, 42, 0));
}
.contact-methods { display: flex; justify-content: center; gap: 24px; margin-top: 40px; flex-wrap: wrap; }
.method-card {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border-light);
  padding: 16px 32px; border-radius: 16px; text-decoration: none;
  transition: 0.3s;
}

/* ARCADE */
.arcade-highlight {
  margin: 60px auto 0; max-width: 500px;
  background: rgba(0,0,0,0.4); border: 1px solid var(--border-light);
  border-radius: 24px; padding: 40px;
}
.aura-text {
  font-family: var(--font-display); font-size: 1.8rem;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  display: block; margin-bottom: 12px; font-weight: 700;
}
.btn-surprise {
  display: inline-flex; margin-top: 32px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  padding: 16px 40px; border-radius: 99px; color: white;
  text-decoration: none; font-weight: 600; font-size: 1.1rem;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
  transition: 0.3s;
}
.arcade-section {
  position: relative;
  isolation: isolate;
}
.arcade-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(800px circle at 50% -10%, rgba(124, 58, 237, 0.2), transparent 60%);
  opacity: 0.8;
  z-index: -1;
}
.arcade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.arcade-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(2, 6, 23, 0.3);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.arcade-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px circle at 20% 0%, rgba(56, 189, 248, 0.14), transparent 60%);
  opacity: 0.5;
  pointer-events: none;
}
.arcade-card:hover {
  transform: translateY(-6px);
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.45);
}
.arcade-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.arcade-card h3 {
  font-size: 1.4rem;
  font-family: var(--font-display);
}
.arcade-card p {
  color: var(--text-muted);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-row span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.status-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.status-build {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.4);
}
.status-playable {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.4);
}
.status-concept {
  color: #fcd34d;
  background: rgba(234, 179, 8, 0.18);
  border-color: rgba(234, 179, 8, 0.4);
}
.arcade-meta {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.arcade-meta strong {
  color: #e2e8f0;
}
.system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.system-card {
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--border-light);
  background: rgba(2, 6, 23, 0.6);
}
.system-card h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.system-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.arcade-systems {
  background: rgba(15, 23, 42, 0.4);
}
.protocol-list {
  list-style: none;
  display: grid;
  gap: 20px;
  margin: 0 auto;
  max-width: 700px;
}
.protocol-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: rgba(2, 6, 23, 0.55);
}
.protocol-step {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  background: rgba(167, 139, 250, 0.2);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.4);
}
.protocol-list h3 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}
.protocol-list p {
  color: var(--text-muted);
}

/* FOOTER */
.footer-bottom { 
  margin-top: 80px; border-top: 1px solid var(--border-light); padding-top: 40px;
  display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-muted);
}

/* --- MOBILE OPTIMIZATION & RESPONSIVE FIXES --- */
@media (max-width: 900px) {
  /* Fix Typography Overlap */
  h1 { font-size: 2.75rem; }
  .section-header h2 { font-size: 2.2rem; }
  
  /* Layout Adjustments */
  .section-padding { padding: 80px 0; }
  .profile-panel { padding: 40px 24px; }
  
  /* Fix Grid Overlap */
  .stats-row { grid-template-columns: 1fr; gap: 32px; }
  .bento-grid, .goals-wrapper { grid-template-columns: 1fr; }
  
  /* Fix Navigation Overlap & Stacking */
  .nav-links {
    position: fixed; 
    top: var(--nav-height); 
    left: 0; right: 0;
    height: auto;
    background: #020617; /* Solid background to prevent see-through mess */
    flex-direction: column; 
    padding: 40px 24px; 
    gap: 24px;
    border-bottom: 1px solid var(--border-light);
    transform: translateY(-150%); 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1); 
    z-index: 999; /* Ensure it is ABOVE main content */
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  }
  .nav-links.active { transform: translateY(0); }
  
  /* Mobile Menu Button */
  .mobile-toggle { display: block; background: none; border: none; padding: 10px; cursor: pointer; }
  .mobile-toggle span { display: block; width: 24px; height: 2px; background: white; margin: 6px 0; transition: 0.3s; }
  
  /* Button Animation */
  .mobile-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
  .mobile-toggle.open span:nth-child(2) { opacity: 0; }
  .mobile-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

  /* Footer Fix */
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
  
  /* Adjust method cards for small screens */
  .contact-methods { flex-direction: column; }
  .method-card { justify-content: flex-start; }

  .arcade-card { padding: 24px; }
  .protocol-list li { grid-template-columns: 1fr; }
  .protocol-step { width: 42px; height: 42px; }
}

.game-shell {
  margin-top: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.75);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.85));
}

.game-btn {
  appearance: none;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: linear-gradient(135deg, #0891b2, #1d4ed8);
  color: #f8fafc;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.game-btn.ghost {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.45);
}

.game-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(8, 145, 178, 0.25);
}
.game-btn:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.8);
  outline-offset: 2px;
}

.game-status {
  margin: 0;
  color: #93c5fd;
  font-size: 0.84rem;
  flex: 1 1 160px;
}


.touch-dpad {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.touch-dpad .game-btn {
  min-width: 38px;
  padding: 8px 10px;
}

.game-shell canvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 52 / 30;
  background: #020617;
  touch-action: none;
}
#block-game {
  aspect-ratio: 52 / 36;
}


@media (max-width: 640px) {
  .game-toolbar {
    gap: 8px;
  }

  .game-btn {
    padding: 8px 12px;
  }

  .game-status {
    flex-basis: 100%;
  }

  .touch-dpad {
    flex-basis: 100%;
  }
}
