@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,700;0,800;1,700&family=Inter:wght@400;500;700&family=JetBrains+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Space+Grotesk:wght@500;700;800&display=swap');

/* ==========================================================================
   MAEVIS GENESIS PORTAL - STYLESHEET
   ========================================================================== */

/* Cascade Layers */
@layer base, tokens, components, utilities, animations;

@layer tokens {
  :root {
    /* Color Scheme */
    color-scheme: dark;

    /* Theme Surfaces (oklch-based) */
    --bg-primary: oklch(14% 0.005 0);       /* Deep black canvas */
    --bg-secondary: oklch(18% 0.008 0);     /* Base container background */
    --bg-tertiary: oklch(24% 0.01 0);       /* Inner panel/button background */
    
    /* Text Colors */
    --text-primary: oklch(99% 0 0);          /* Pure off-white */
    --text-secondary: oklch(75% 0.01 0);    /* Muted silver */
    --text-tertiary: oklch(50% 0.01 0);     /* Muted dark gray */
    
    /* Accents & States */
    --color-neon-green: oklch(78% 0.18 140); /* Vibrant terminal green */
    --color-neon-green-glow: oklch(78% 0.18 140 / 0.4);
    --color-alert-red: oklch(65% 0.22 20);   /* Muted alert red */
    
    /* The Immortals Gradient */
    --color-gradient-start: oklch(62% 0.28 300); /* Neon violet */
    --color-gradient-end: oklch(68% 0.23 45);    /* Neon orange/coral */
    
    /* Borders */
    --border-primary: oklch(35% 0.01 0);    /* Dark panel borders */
    --border-subtle: oklch(24% 0.01 0);     /* Subtle border line */
    
    /* Typography Fonts */
    --font-display: 'Barlow Condensed', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-extended: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;
    --font-body: 'JetBrains Mono', monospace;
    
    /* Border Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 32px;
    --radius-full: 9999px;
    
    /* Shadows & Glows */
    --shadow-flat-dark: 4px 4px 0px var(--border-primary);
    --shadow-flat-green: 4px 4px 0px var(--color-neon-green);
    --glow-green: 0 0 15px var(--color-neon-green-glow);
  }
}

@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
  }

  ::selection {
    background-color: var(--color-neon-green);
    color: var(--bg-primary);
  }

  scrollbar-color: var(--border-primary) var(--bg-primary);
  scrollbar-width: thin;

  h1, h2, h3, h4, h5, h6 {
    margin: 0;
    text-transform: uppercase;
    font-family: var(--font-extended);
  }

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

  img {
    max-width: 100%;
    height: auto;
    display: block;
  }
}

@layer components {
  /* Main wrapper layout */
  .app-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    position: relative;
    z-index: 10;
    perspective: 1000px; /* 3D Tilt perspective context */
  }

  /* Halftone Texture Overlay */
  .halftone-texture {
    position: relative;
  }

  .halftone-texture::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 2;
  }

  /* Scanlines and Film Grain effects */
  .film-grain {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 3;
  }

  .scanlines {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      rgba(18, 16, 16, 0) 50%, 
      rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 4;
    opacity: 0.85;
  }

  /* Faint Security Scanner Sweep Line */
  .scanner-sweep {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-neon-green), transparent);
    opacity: 0.12;
    box-shadow: 0 0 10px var(--color-neon-green-glow);
    pointer-events: none;
    z-index: 25;
    animation: scanDown 12s infinite linear;
  }

  /* Background Canvas for Dust & Glowing Particles */
  .bg-particles {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
  }

  /* 3D Mathematical Rotating Skull (Peeking Left Layout) */
  .skull-container {
    position: fixed;
    top: 50%;
    z-index: 5; /* Layered in front of CRT filters, behind app-container */
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    user-select: none;
  }

  .left-skull {
    left: 28%;
    transform: translate(-50%, -50%); /* Centers the skull closer to the card on desktop */
  }

  #hologram-canvas {
    width: 660px;
    height: 660px;
    pointer-events: none;
    user-select: none;
    filter: drop-shadow(0 0 15px rgba(236, 72, 153, 0.25)); /* Subtle pink/magenta glow bloom */
  }

  /* Responsive styling to hide skull on narrow viewports and center the central card */
  @media (max-width: 1100px) {
    .skull-container {
      display: none;
    }
    .main-content {
      align-self: center;
      margin-right: 0;
      margin-left: auto;
      margin-right: auto;
    }
  }

  /* Top System Navigation & Status Bar */
  .system-header {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    z-index: 20;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .brand-text {
    font-family: var(--font-extended);
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
    letter-spacing: 0.1em;
  }

  .system-badge {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
  }

  .header-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .status-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background-color: var(--text-tertiary);
  }

  .status-dot-active {
    background-color: var(--color-neon-green);
    box-shadow: var(--glow-green);
    animation: statusPulse 2s infinite ease-in-out;
  }

  .connection-code {
    color: var(--text-secondary);
  }

  .header-right {
    display: flex;
    align-items: center;
  }

  /* Game Route Container */
  .game-route-container {
    display: inline-flex;
    align-items: center;
    margin-right: 1.25rem;
    gap: 6px;
  }

  /* Game Route Hint & Arrow */
  .game-route-hint {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    color: var(--color-neon-green);
    text-shadow: 0 0 2px rgba(56, 176, 0, 0.4);
    letter-spacing: 1px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
  }

  .game-route-hint .hint-arrow {
    display: inline-block;
    font-weight: bold;
    animation: hintArrowPulse 1.5s infinite ease-in-out;
  }

  @keyframes hintArrowPulse {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(4px); opacity: 1; text-shadow: 0 0 5px var(--color-neon-green); }
  }

  /* Glowing Alert Animation for Button */
  .game-route-btn.pulse-alert {
    animation: btnGlowPulse 2.5s infinite ease-in-out;
  }

  @keyframes btnGlowPulse {
    0%, 100% {
      border-color: var(--border-primary);
      box-shadow: none;
    }
    50% {
      border-color: var(--color-neon-green);
      box-shadow: 0 0 8px rgba(56, 176, 0, 0.3);
      color: var(--color-neon-green);
    }
  }

  /* Game Route Button & Audio Toggler Button */
  .game-route-btn,
  .audio-toggle-btn {
    position: relative;
    overflow: hidden;
    background: transparent;
    border: 1px solid var(--border-primary);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    outline: none;
    display: inline-flex;
    align-items: center;
  }

  .audio-toggle-btn {
    margin-right: 1.25rem;
  }

  .game-route-btn:hover,
  .audio-toggle-btn:hover {
    border-color: var(--color-neon-green);
    color: var(--color-neon-green);
    box-shadow: var(--glow-green);
  }

  .clock-display {
    color: var(--text-secondary);
  }

  /* Main Central Section */
  .main-content {
    width: 100%;
    max-width: 680px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-block: 4rem;
    align-self: flex-end;
    margin-right: 12%; /* Shift slightly left to close the gap with the skull */
    z-index: 15;
  }

  /* Cyberpunk Modular Card Container */
  .terminal-card {
    position: relative;
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--shadow-flat-dark);
    overflow: hidden;
    
    /* 3D Tilt variable anchors */
    transform-style: preserve-3d;
    transform: rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Diagonal Glass Reflection Line */
  .glass-reflection {
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      105deg,
      transparent 35%,
      rgba(255, 255, 255, 0.03) 45%,
      rgba(255, 255, 255, 0.06) 50%,
      rgba(255, 255, 255, 0.03) 55%,
      transparent 65%
    );
    z-index: 6;
    pointer-events: none;
    animation: glassSweep 18s infinite linear;
  }

  /* Corner Decors */
  .corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: var(--color-neon-green);
    border-style: solid;
    z-index: 5;
    pointer-events: none;
  }
  .corner-tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
  .corner-tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
  .corner-bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
  .corner-br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }

  /* Window Title Bar */
  .terminal-window-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
  }

  .window-controls {
    display: flex;
    gap: 6px;
  }

  .ctrl-btn {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: var(--border-primary);
  }

  /* Terminal Body */
  .terminal-body {
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    transform: translateZ(20px); /* Lift inner content slightly for 3D parallax depth */
  }

  /* Title Block */
  .title-section {
    text-align: center;
  }

  .genesis-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 1.2rem + 4.5vw, 3.8rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    
    /* Immortals Gradient Animation */
    background: linear-gradient(135deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 50%, var(--color-gradient-start) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px oklch(62% 0.28 300 / 0.15);
    animation: moveGradient 8s infinite linear, breatheGlow 6s infinite ease-in-out;
  }

  .genesis-subtitle {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
    font-weight: 500;
  }

  /* Progress Bar */
  .progress-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .progress-header {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
  }

  .progress-track {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    height: 8px;
    border-radius: var(--radius-full);
    overflow: hidden;
    padding: 1px;
  }

  .progress-bar {
    height: 100%;
    /* Shimmer gradient overlay */
    background: linear-gradient(90deg, oklch(62% 0.28 300) 0%, var(--color-neon-green) 50%, oklch(62% 0.28 300) 100%);
    background-size: 200% auto;
    border-radius: var(--radius-full);
    box-shadow: 0 0 10px var(--color-neon-green-glow);
    transition: width 0.3s ease;
    animation: shimmerProgress 3s infinite linear;
  }

  /* Console Logger Panel */
  .console-logger {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
  }

  .console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    border-bottom: 1px dashed var(--border-subtle);
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
  }

  .console-pulse {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .console-pulse::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: var(--radius-full);
    background-color: var(--color-neon-green);
    box-shadow: var(--glow-green);
    animation: pulse 1s infinite alternate;
  }

  .console-output {
    height: 110px;
    overflow-y: auto;
    font-size: 0.7rem;
    line-height: 1.5;
    color: var(--text-secondary);
    scrollbar-width: none;
  }

  .console-output::-webkit-scrollbar {
    display: none;
  }

  .console-row {
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .console-row.info { color: var(--text-secondary); }
  .console-row.success { color: var(--color-neon-green); }
  .console-row.warn { color: var(--color-gradient-end); }
  .console-row.error { color: var(--color-alert-red); }

  /* Input Form */
  .form-container {
    border-top: 1px dashed var(--border-primary);
    padding-top: 1.5rem;
    text-align: center;
  }

  .form-title {
    font-family: var(--font-extended);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
  }

  .form-desc {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-bottom: 1.25rem;
  }

  .subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  @media (min-width: 576px) {
    .subscribe-form {
      flex-direction: row;
    }
  }

  .input-group {
    flex-grow: 1;
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding-inline: 0.85rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
  }

  .input-group:focus-within {
    border-color: var(--color-neon-green);
    box-shadow: 0 0 10px var(--color-neon-green-glow);
  }

  /* Input focus styles */
  .email-input:focus ~ .input-prefix {
    color: var(--color-neon-green);
    text-shadow: var(--glow-green);
  }

  .input-prefix {
    font-family: var(--font-mono);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-right: 0.5rem;
    transition: color 0.3s ease;
  }

  .email-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding-block: 0.75rem;
    outline: none;
  }

  .email-input::placeholder {
    color: var(--text-tertiary);
    transition: opacity 0.2s ease;
  }

  /* Placeholder flicker effect support */
  .placeholder-flicker::placeholder {
    animation: textFlicker 0.4s 1 linear;
  }

  .submit-button {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    transition: background-color 0.25s, border-color 0.25s, color 0.25s, transform 0.25s, box-shadow 0.25s;
  }

  .submit-button:hover {
    background-color: var(--color-neon-green);
    color: var(--bg-primary);
    border-color: var(--color-neon-green);
    box-shadow: var(--glow-green);
    transform: translateY(-1px); /* Elevation */
  }

  /* Click Flash / Ripple Support */
  .submit-button::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease-out, height 0.4s ease-out;
  }

  .submit-button:active {
    transform: scale(0.97);
  }

  .submit-button:active::after {
    width: 250px;
    height: 250px;
  }

  .form-response {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    min-height: 1.5rem;
    line-height: 1.4;
  }

  .form-response-success {
    color: var(--color-neon-green);
    text-shadow: var(--glow-green);
  }

  .form-response-error {
    color: var(--color-alert-red);
  }

  /* Footer Section */
  .system-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    border-top: 1px solid var(--border-subtle);
    padding-top: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-tertiary);
    z-index: 20;
  }

  @media (min-width: 768px) {
    .system-footer {
      flex-direction: row;
      justify-content: space-between;
    }
  }

  .footer-center {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .footer-tag {
    color: var(--text-tertiary);
  }

  .social-links {
    display: flex;
    gap: 0.5rem;
  }

  .social-capsule {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  }

  .social-capsule:hover {
    background-color: var(--color-neon-green);
    border-color: var(--color-neon-green);
    color: var(--bg-primary);
  }
}

@layer animations {
  @keyframes pulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
  }

  @keyframes slide-up {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Scanline screen brightness flicker */
  @keyframes terminal-flicker {
    0% { opacity: 0.99; }
    50% { opacity: 0.985; }
    100% { opacity: 1; }
  }

  /* Scanner downwards sweep animation */
  @keyframes scanDown {
    0% { top: -10px; opacity: 0; }
    5% { opacity: 0.12; }
    95% { opacity: 0.12; }
    100% { top: 100%; opacity: 0; }
  }

  /* Diagonal gloss sweep animation */
  @keyframes glassSweep {
    0% { left: -150%; }
    10% { left: 150%; }
    100% { left: 150%; }
  }

  /* Header gradient scroll */
  @keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
  }

  /* Title glow breathing */
  @keyframes breatheGlow {
    0% { text-shadow: 0 0 10px oklch(62% 0.28 300 / 0.1); }
    50% { text-shadow: 0 0 25px oklch(62% 0.28 300 / 0.3), 0 0 10px var(--color-neon-green-glow); }
    100% { text-shadow: 0 0 10px oklch(62% 0.28 300 / 0.1); }
  }

  /* Connection status slow pulse */
  @keyframes statusPulse {
    0% { opacity: 0.45; box-shadow: 0 0 4px var(--color-neon-green-glow); }
    50% { opacity: 1; box-shadow: 0 0 12px var(--color-neon-green), 0 0 4px var(--color-neon-green); }
    100% { opacity: 0.45; box-shadow: 0 0 4px var(--color-neon-green-glow); }
  }

  /* Progress bar shimmer gradient scroll */
  @keyframes shimmerProgress {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
  }

  /* Placeholder text flicker */
  @keyframes textFlicker {
    0% { opacity: 1; }
    15% { opacity: 0.15; }
    30% { opacity: 0.9; }
    45% { opacity: 0.05; }
    60% { opacity: 1; }
    80% { opacity: 0.3; }
    100% { opacity: 1; }
  }

  /* System Glitch class Keyframes */
  @keyframes glitchSplit {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 1px) skew(1deg); }
    40% { transform: translate(-1px, -1px) skew(-0.5deg); }
    60% { transform: translate(1.5px, 0.5px) skew(0.5deg); }
    80% { transform: translate(-0.5px, -1.5px) skew(0.2deg); }
    100% { transform: translate(0); }
  }

  @keyframes chromaticAberration {
    0% { text-shadow: 0.5px 0 0 red, -0.5px 0 0 blue; }
    50% { text-shadow: -1.5px 0.5px 0 red, 1px -0.5px 0 blue, 0 0 10px var(--color-neon-green-glow); }
    100% { text-shadow: 0.5px 0 0 red, -0.5px 0 0 blue; }
  }

  .glitch-active {
    animation: glitchSplit 0.22s infinite linear !important;
  }

  .glitch-active .genesis-title {
    animation: chromaticAberration 0.15s infinite linear !important;
  }

  /* Button ripple span styles */
  .btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    transform: scale(0);
    animation: btn-ripple-effect 0.55s ease-out;
    pointer-events: none;
  }
  @keyframes btn-ripple-effect {
    to {
      transform: scale(3.5);
      opacity: 0;
    }
  }
}

/* Responsive heights to prevent absolute overlap on short viewports */
@media (max-height: 720px) {
  .app-container {
    justify-content: flex-start;
    padding-top: 5rem;
    padding-bottom: 2rem;
  }
  .system-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    padding-bottom: 0.5rem;
  }
  .system-footer {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: 2.5rem;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
  }
  .main-content {
    padding-block: 1rem;
    margin-block: 0;
  }
}

/* Mobile-specific responsive styles */
@media (max-width: 768px) {
  .app-container {
    justify-content: flex-start;
    padding-top: 5rem;
    padding-bottom: 2rem;
    padding-inline: 0.75rem;
  }
  
  /* System Header Mobile Adjustments */
  .system-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 0.75rem;
  }

  .header-left {
    justify-content: center;
    width: 100%;
  }

  .header-center {
    justify-content: center;
    width: 100%;
    font-size: 0.7rem;
  }

  .header-right {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
  }

  .game-route-container {
    margin-right: 0 !important;
    gap: 4px;
  }

  .game-route-btn,
  .audio-toggle-btn {
    margin-right: 0 !important;
    padding: 3px 8px;
    font-size: 0.6rem;
  }

  .clock-display {
    font-size: 0.65rem;
    text-align: center;
  }

  /* Skull Container Centering & Scaling */
  .skull-container {
    display: flex !important;
    position: absolute;
    top: 18.5rem;
    left: 50%;
    z-index: 5;
  }

  #hologram-canvas {
    width: 280px;
    height: 280px;
  }

  /* Main Content Layout */
  .main-content {
    margin-top: 22.5rem; /* Push card down to sit perfectly under the skull with minimal gap */
    margin-right: 0 !important;
    width: 100%;
    max-width: 100%;
    padding-inline: 0.25rem;
    align-self: center;
  }
  
  .terminal-card {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    transform: none !important; /* Disable 3D tilt on mobile touch to avoid layout jumping */
  }

  .terminal-body {
    padding: 1.75rem 1.25rem;
    gap: 1.5rem;
  }

  .genesis-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .console-output {
    height: 95px;
  }

  .subscribe-form {
    flex-direction: column !important;
    gap: 0.75rem;
  }

  .submit-button {
    width: 100%;
    padding: 0.75rem 1rem;
  }
  
  /* Footer Mobile Adjustments */
  .system-footer {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    margin-top: 2.5rem;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
  }

  .footer-center {
    justify-content: center;
    gap: 0.5rem;
  }
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-delay: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
    transform: none !important;
  }
  #hologram-canvas {
    animation: none !important;
  }
}
