:root {
  --bg: #0b0d10;
  --surface: #000000;
  --text: #f2f2f2;
  --muted: #8a8f98;
  --accent: #c62828;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  animation: breatheDark 30s ease-in-out infinite;
  transition: background-color 0.8s ease;
}

@keyframes breatheDark {
  0% {
    background-color: var(--bg);
  }

  50% {
    background-color: #161a20;
  }

  100% {
    background-color: var(--bg);
  }
}

body.light-mode {
  --bg: #ffffff;
  --surface: #f2f2f2;
  --text: #111;
  --muted: #555;
  animation: breatheLight 30s ease-in-out infinite;
}

@keyframes breatheLight {
  0% {
    background-color: #ffffff;
  }

  50% {
    background-color: #f0f4f8;
  }

  100% {
    background-color: #ffffff;
  }
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 1.5rem;
  /* News OS 3D Perspective Base */
  perspective: 1500px;
  transform-style: preserve-3d;
  /* Unified Spatial Rotation */
  transform: rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
  transition: transform 0.1s ease-out;
}

/* 3D Planes: Cockpit HUD Container (Non-flattening) */
.cockpit-hud {
  transform: translateZ(0px);
  /* Neutral base, children define depth */
  transform-style: preserve-3d;
  z-index: 5000;
  pointer-events: none;
  position: relative;
}

/* 3D Planes: Focused Story (Plane 3) */
.story-hud-console {
  position: fixed;
  top: 15vh;
  left: 10vw;
  width: 80vw;
  height: 70vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem;
  color: var(--text);
  z-index: 6000;
  display: none;
  flex-direction: column;
  transform: translateZ(100px);
  /* Plane 3 Depth */
  border-radius: 20px;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
}

/* 3D Planes: News Content (Base - Plane 5) */
.news-plane {
  transform: translateZ(-100px);
  /* Plane 5 Depth */
  transform-style: preserve-3d;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.8s ease;
}

/* Global HUD Overlay (Non-Blocking) */
.hud-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 10000;
  opacity: 0.3;
}

.hero {
  padding: 0;
  background-color: var(--surface);
  border-radius: 16px;
  transition: transform .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  height: 450px;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.hero>.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}

.hero a.hero-link {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 3rem;
  z-index: 2;
  position: relative;
  width: 100%;
}

.hero:hover {
  transform: scale(1.02) translateZ(20px);
}

/* Focus Mode: Universal Displacement */
body.focus-active .news-plane {
  transform: translateZ(-500px) rotateX(-5deg);
  opacity: 0.3;
  filter: blur(10px);
  pointer-events: none;
}

body.focus-active .cockpit-hud {
  pointer-events: auto;
}

/* Focus State for Individual Elements */
.card.focused {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(400px) scale(0.8) !important;
  z-index: 9999;
  width: 90vw;
  height: 90vh;
  opacity: 0;
  /* Hidden while HUD takes over */
  pointer-events: none;
}

/* Story Console HUD */
.story-hud-console {
  position: fixed;
  top: 15vh;
  left: 10vw;
  width: 80vw;
  height: 70vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3rem;
  color: var(--text);
  z-index: 6000;
  display: none;
  /* Controlled by JS */
  flex-direction: column;
  transform: translateZ(200px);
  border-radius: 20px;
  box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
}

.story-hud-console.active {
  display: flex;
}

.story-hud-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.story-hud-typewriter {
  font-size: 1.4rem;
  line-height: 1.6;
  font-family: 'Inter', system-ui, sans-serif;
  margin-top: 2rem;
}

.story-hud-title {
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.badge {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.headline {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 1rem 0;
  transition: font-weight .2s ease, letter-spacing 0.3s ease, text-shadow 0.3s ease;
}

.hero:hover .headline {
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.excerpt {
  color: #ddd;
}

.meta {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.listen-btn {
  background: var(--surface);
  border: 1px solid var(--muted);
  color: var(--text);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.listen-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

/* Grid cards only — scoped to .grid context to not conflict with cockpit */
.grid>.card {
  height: 300px;
}

.card {
  background-color: var(--surface);
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  transition: transform .6s cubic-bezier(0.165, 0.84, 0.44, 1), opacity .6s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.card .card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 100%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.card:hover .card-overlay {
  opacity: 0.8;
}

/* HUD Glint Effect */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.03) 50%,
      rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  transition: left 0.5s ease;
  z-index: 3;
}

.card:hover::after {
  left: 150%;
}

.card a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 1.5rem;
  z-index: 2;
  position: relative;
  width: 100%;
}

.card-title {
  font-size: 1.25rem;
  margin: 0.5rem 0 0 0;
  font-weight: 600;
  transition: font-weight 0.4s ease, letter-spacing 0.4s ease, text-shadow 0.4s ease, transform 0.4s ease;
  transform-origin: left bottom;
}

.card-excerpt-typing {
  font-family: monospace;
  font-size: 0.85rem;
  color: #ccc;
  margin: 0.5rem 0 0 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-3px) scale(1.02);
  z-index: 10;
}

.card:hover .card-title {
  font-weight: 800;
  letter-spacing: 0.5px;
  transform: scale(1.05);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

.card:hover .card-excerpt-typing {
  height: auto;
  opacity: 1;
  margin-top: 1rem;
}

body.light-mode .card:hover {
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.tag {
  font-size: 0.7rem;
  color: var(--accent);
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 12px;
}

.quick-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding: 1rem 0;
  border-top: 1px solid #222;
  flex-wrap: wrap;
  gap: 1rem;
}

body.light-mode .quick-actions {
  border-top-color: #ddd;
}

.quick-actions a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.quick-actions a:hover {
  background: var(--surface);
}

/* Header & Navbar */
header {
  border-bottom: 1px solid #222;
  padding: 1rem 0;
}

body.light-mode header {
  border-bottom-color: #ddd;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}

.brand span {
  color: var(--accent);
}

/* Phasing Logo */
:root {
  --glitch-speed: 0.15s;
  --offset: 3px;
}

.logo-container {
  position: relative;
  width: 240px;
  height: 133px;
  filter: drop-shadow(0 0 10px rgba(0, 242, 255, 0.2));
  display: flex;
  align-items: center;
}

.logo-layer {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%) translate(var(--logo-shift-x, 0), var(--logo-shift-y, 0));
  transition: transform 0.1s ease-out;
}

.normal {
  z-index: 5;
  opacity: 1;
}

.phase-1 {
  z-index: 4;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.1s ease-out;
  filter: hue-rotate(180deg) brightness(1.5);
}

.phase-1.active-phase {
  opacity: 0.6;
}

.phase-2 {
  z-index: 6;
  mix-blend-mode: color-dodge;
  opacity: 0;
  transition: opacity 0.1s ease-out;
}

.phase-2.active-phase {
  opacity: 0.4;
}

.noise-filter {
  filter: url(#glitch-noise);
}

/* Phasing Logo */

@keyframes jitter {
  0% {
    transform: translateY(-50%) translate(var(--logo-shift-x, 0), var(--logo-shift-y, 0));
  }

  20% {
    transform: translateY(-50%) translate(calc(var(--logo-shift-x, 0) + 2px), calc(var(--logo-shift-y, 0) - 1px));
  }

  40% {
    transform: translateY(-50%) translate(calc(var(--logo-shift-x, 0) - 2px), calc(var(--logo-shift-y, 0) + 2px));
  }

  60% {
    transform: translateY(-50%) translate(calc(var(--logo-shift-x, 0) + 1px), calc(var(--logo-shift-y, 0) + 1px));
  }

  80% {
    transform: translateY(-50%) translate(calc(var(--logo-shift-x, 0) - 1px), calc(var(--logo-shift-y, 0) - 2px));
  }

  100% {
    transform: translateY(-50%) translate(var(--logo-shift-x, 0), var(--logo-shift-y, 0));
  }
}

/* Wind Indicator */
#wind-arrow {
  display: inline-block;
  transform: rotate(var(--wind-deg, 0deg));
  transition: transform 1s ease;
  animation: windWobble 4s ease-in-out infinite;
}

@keyframes windWobble {

  0%,
  100% {
    transform: rotate(calc(var(--wind-deg, 0deg) - 5deg));
  }

  50% {
    transform: rotate(calc(var(--wind-deg, 0deg) + 5deg));
  }
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
}

#themeToggle {
  background: none;
  border: 1px solid var(--muted);
  color: var(--text);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.85rem;
}

#themeToggle:hover {
  background: var(--surface);
}

/* Story Page */
.story-header {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #222;
}

body.light-mode .story-header {
  border-bottom-color: #ddd;
}

.story-header h1 {
  font-size: 3rem;
  margin: 1rem 0;
  line-height: 1.1;
}

.story-content {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  opacity: 0.9;
}

.story-content p {
  margin-bottom: 1.5rem;
}

/* 3D Sky Container for Lensing Effect */
#sky-layers {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  perspective: 800px;
  overflow: hidden;
  pointer-events: none;
}

/* Starscape is now handled by Three.js (Phase 02 WebGL) */

/* Translucent Grey Clouds (Visible in Both Modes) */
.clouds-bg {
  position: absolute;
  top: -10vh;
  left: -20vw;
  width: 150vw;
  height: 120vh;
  /* Very subtle, large grey soft-edge seamless clouds */
  background: radial-gradient(ellipse at center, rgba(180, 180, 180, 0.06) 0%, rgba(180, 180, 180, 0) 60%),
    radial-gradient(circle at top left, rgba(150, 150, 150, 0.05) 0%, rgba(150, 150, 150, 0) 50%);
  background-size: 800px 600px;
  animation: driftGreyClouds 600s linear infinite alternate;
  pointer-events: none;
  opacity: 0;
  /* Adjusted dynamically by weather attribute */
  transition: opacity 2s ease;
  z-index: -1;
}

.clouds-bg-2 {
  background: radial-gradient(circle at 80% 80%, rgba(200, 200, 200, 0.04) 0%, rgba(200, 200, 200, 0) 70%);
  background-size: 1000px 800px;
  animation-duration: 800s;
  background-position: -200px 100px;
  opacity: 0;
}

/* Map Weather to Cloud Visibility */
body[data-weather^="cloudy"] .clouds-bg {
  opacity: 0.4;
}

body[data-weather^="cloudy"] .clouds-bg-2 {
  opacity: 0.6;
}

body[data-weather^="drizzle"] .clouds-bg,
body[data-weather^="rain"] .clouds-bg,
body[data-weather^="snow"] .clouds-bg,
body[data-weather^="thunderstorm"] .clouds-bg {
  opacity: 0.6;
}

body[data-weather^="drizzle"] .clouds-bg-2,
body[data-weather^="rain"] .clouds-bg-2,
body[data-weather^="snow"] .clouds-bg-2,
body[data-weather^="thunderstorm"] .clouds-bg-2 {
  opacity: 0.8;
}

body[data-weather="fog"] .clouds-bg {
  opacity: 0.8;
}

body[data-weather="fog"] .clouds-bg-2 {
  opacity: 0.9;
}

@keyframes driftGreyClouds {
  from {
    transform: translateX(calc(0px + var(--cloud-shift-x, 0px))) translateY(calc(0px + var(--cloud-shift-y, 0px))) scale(1);
  }

  to {
    transform: translateX(calc(-15vw + var(--cloud-shift-x, 0px))) translateY(calc(0px + var(--cloud-shift-y, 0px))) scale(1.1);
  }
}

/* Moon Drifter */
.moon-drifter {
  position: fixed;
  top: 10vh;
  left: -20vw;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: #f4f6f0;
  box-shadow: 0 0 50px #f4f6f0, inset -15px -15px 30px rgba(0, 0, 0, 0.2);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2s ease;
}

body[data-moon="full"]:not(.light-mode) .moon-drifter {
  opacity: 0.9;
  animation: driftMoon 600s linear infinite;
}

/* Dim stars on full moon */
body[data-moon="full"]:not(.light-mode) {
  --bg: #11151c;
  /* Lighter black */
}

body[data-moon="full"]:not(.light-mode) .stars-bg {
  opacity: 0.3 !important;
}

@keyframes driftMoon {
  from {
    transform: translateX(calc(0vw + var(--moon-shift-x, 0px))) translateY(calc(0px + var(--moon-shift-y, 0px)));
  }

  to {
    transform: translateX(calc(120vw + var(--moon-shift-x, 0px))) translateY(calc(-10vh + var(--moon-shift-y, 0px)));
  }
}

/* Sponsor Video Previews */
.sponsors-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
}

body.light-mode .sponsors-section {
  border-top-color: #ddd;
}

.sponsors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sponsor-card {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  height: 200px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

.sponsor-card video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: opacity 0.4s ease, transform 0.4s ease;
  transform: scale(1);
}

.sponsor-card:hover {
  transform: scale(1.05) translateY(-5px);
  z-index: 20;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
}

.sponsor-card:hover video {
  opacity: 1;
  transform: scale(1.02);
}

.sponsor-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  z-index: 2;
  pointer-events: none;
}

.sponsor-info h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #fff;
}

.sponsor-info p {
  margin: 0.3rem 0 0 0;
  font-size: 0.8rem;
  color: #ccc;
}

/* Shooting Star */
.shooting-star-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
}

body[data-moon="new"]:not(.light-mode) .shooting-star-container {
  opacity: 1;
}

.shooting-star {
  position: absolute;
  top: 20%;
  left: 80%;
  width: 100px;
  height: 2px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
  animation: shoot 12s linear infinite;
  transform: rotate(-45deg);
  opacity: 0;
}

@keyframes shoot {
  0% {
    transform: translate(0, 0) rotate(-45deg);
    opacity: 0;
  }

  5% {
    opacity: 1;
  }

  10% {
    transform: translate(-500px, 500px) rotate(-45deg);
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

/* Lightning */
.lightning-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}

body[data-weather="thunderstorm"] .lightning-flash {
  animation: lightning 15s infinite;
}

body[data-weather="thunderstorm"].light-mode .lightning-flash {
  background: #333;
  /* Dark flashes in day */
}

@keyframes lightning {

  0%,
  9%,
  11%,
  19%,
  21%,
  100% {
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  20% {
    opacity: 0.5;
  }
}

/* Time of day colors overrides */
body[data-time="twilight"] {
  --bg: #1c1427;
  --surface: #2a1f38;
}

body[data-time="day"].light-mode {
  --bg: #87CEEB;
  /* Sky blue */
  --surface: rgba(255, 255, 255, 0.8);
}

body[data-time="sunset"].light-mode {
  --bg: #ff7e5f;
  --surface: rgba(255, 240, 230, 0.9);
}

/* Weather Particles (Rain / Snow) */
.weather-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1s ease;
}

/* Rain Effect */
body[data-weather^="drizzle"] .weather-particles,
body[data-weather^="rain"] .weather-particles,
body[data-weather="thunderstorm"] .weather-particles {
  opacity: 1;
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><line x1="10" y1="0" x2="5" y2="20" stroke="rgba(150,150,150,0.4)" stroke-width="1"/><line x1="60" y1="30" x2="55" y2="50" stroke="rgba(150,150,150,0.3)" stroke-width="1.5"/><line x1="80" y1="70" x2="75" y2="90" stroke="rgba(150,150,150,0.5)" stroke-width="1"/></svg>') repeat;
  background-size: 100px 100px;
  animation: fallRain 0.6s linear infinite;
}

/* Snow Effect */
body[data-weather^="snow"] .weather-particles {
  opacity: 1;
  background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><circle cx="30" cy="50" r="2" fill="rgba(255,255,255,0.8)"/><circle cx="100" cy="90" r="3" fill="rgba(255,255,255,0.6)"/><circle cx="170" cy="140" r="1.5" fill="rgba(255,255,255,0.9)"/><circle cx="50" cy="180" r="2.5" fill="rgba(255,255,255,0.5)"/></svg>') repeat;
  background-size: 200px 200px;
  animation: fallSnow 15s linear infinite;
}

@keyframes fallRain {
  from {
    background-position: 0 0;
  }

  to {
    background-position: -20px 100px;
  }
}

@keyframes fallSnow {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 50px 200px;
  }
}

/* Agentic Console Tethering (Plane 2 - Closest) */
.ai-terminal-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateZ(200px) rotateX(2deg);
  /* Plane 2 Depth */
  width: 90%;
  max-width: 850px;
  z-index: 7000;
  pointer-events: auto;
}

.ai-terminal-bar {
  background: rgba(0, 0, 0, 0.85);
  /* Darker for cockpit feel */
  backdrop-filter: blur(25px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.ai-terminal-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.9);
  transform: translateY(-5px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 255, 255, 0.1);
}

.ai-terminal-bar input {
  background: transparent;
  border: none;
  color: white;
  flex: 1;
  font-size: 1.1rem;
  padding: 0.8rem 0.5rem;
  outline: none;
}

.ai-terminal-bar button {
  background: white;
  color: black;
  border: none;
  padding: 0.8rem 1.8rem;
  border-radius: 40px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ai-terminal-status {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
}

.ai-status-dot {
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 10px #4ade80;
  animation: pulseAi 2s infinite;
}

@keyframes pulseAi {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.2);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

/* 3D Story Card Elevations — scoped to .grid only */
.grid>.card {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.grid>.card:hover {
  transform: translateZ(40px) rotateX(2deg) rotateY(-2deg);
  z-index: 1000;
}