/* =========================================
   AI / FUTURISTIC THEME - MAIN STYLESHEET
   ========================================= */

/* --- IMPORT FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&family=Orbitron:wght@400;700;900&display=swap');

/* --- CSS VARIABLES --- */
:root {
  /* Colors */
  --bg-dark: #050a14;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --primary: #00d4ff;
  /* Neon Cyan */
  --secondary: #a855f7;
  /* Purple */
  --accent: #ff007a;
  /* Pink Accent */
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.1);

  /* Glows */
  --glow-primary: 0 0 20px rgba(0, 212, 255, 0.4);
  --glow-secondary: 0 0 20px rgba(168, 85, 247, 0.4);
  --glow-text: 0 0 10px rgba(255, 255, 255, 0.2);

  /* Fonts */
  --font-main: 'Inter', sans-serif;
  --font-display: 'Orbitron', sans-serif;
}

/* --- RESET & GLOBAL --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

ul {
  list-style: none;
}

/* --- BACKGROUND ANIMATION (AI EFFECT) --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 15% 50%, rgba(0, 212, 255, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08), transparent 25%);
  z-index: -1;
  pointer-events: none;
  animation: bgPulse 10s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% {
    opacity: 0.8;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* --- BACKGROUND GRID (NEON AI EFFECT) --- */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--border-light) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 50px 50px;
  z-index: -2;
  opacity: 0.1;
  pointer-events: none;
}

/* --- FLOATING PARTICLES (AI DECOR) --- */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  background: var(--primary);
  border-radius: 50%;
  opacity: 0.3;
  filter: blur(5px);
  animation: floatAround 20s infinite linear;
}

.particle:nth-child(2) {
  background: var(--secondary);
  animation-duration: 25s;
  animation-delay: -5s;
}

.particle:nth-child(3) {
  background: var(--accent);
  animation-duration: 30s;
  animation-delay: -10s;
}

@keyframes floatAround {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(100vw, 50vh) scale(1.5);
  }

  66% {
    transform: translate(50vw, 100vh) scale(0.8);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

/* --- HEADER / NAVIGATION --- */
header {
  background: rgba(5, 10, 20, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: var(--glow-primary);
  letter-spacing: 1px;
}

nav ul {
  display: flex;
  gap: 2rem;
}

nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  letter-spacing: 0.5px;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary);
  transition: 0.3s;
  box-shadow: var(--glow-primary);
}

nav a:hover,
nav a.active {
  color: var(--primary);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

nav a:hover::after,
nav a.active::after {
  width: 100%;
}

/* --- HERO SECTION --- */
.hero,
.about-hero {
  text-align: center;
  padding: 6rem 2rem;
  position: relative;
  overflow: hidden;
}

.hero h2,
.about-hero h2 {
  font-family: var(--font-display);
  font-size: 3rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, white 40%, var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeIn 1s ease-out;
}

.hero p,
.about-hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 2rem;
  animation: fadeIn 1s ease-out 0.3s backwards;
}

/* Call to Action Container */
.cta-box {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light);
  padding: 2rem;
  border-radius: 16px;
  max-width: 500px;
  margin: 3rem auto 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.cta-box:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
}

.cta-box h3 {
  font-family: var(--font-display);
  color: var(--primary);
  margin-bottom: 1rem;
}

/* --- BUTTONS --- */
.play-btn {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #000;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
  display: inline-block;
  margin-top: 1rem;
}

.play-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
  color: #fff;
}

.play-btn:disabled {
  background: #334155;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- LAYOUTS (GRID/FLEX) --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 4rem 0;
}

.gallery img {
  border-radius: 12px;
  border: 1px solid var(--border-light);
  transition: transform 0.4s ease;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gallery img:hover {
  transform: scale(1.02);
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

/* --- CARD GRIDS (GAMES) --- */
.games-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin: 4rem auto;
  max-width: 1200px;
  padding: 0 2rem;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(5px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s ease;
}

.game-card:hover {
  transform: translateY(-10px);
  background: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}

.game-card h3 {
  font-family: var(--font-display);
  color: var(--primary);
  margin-bottom: 1rem;
  font-size: 1.4rem;
}

.game-card p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.95rem;
}

/* --- CONTACT PAGE --- */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 4rem;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  max-width: 1100px;
  margin: 3rem auto;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-light);
  color: #fff;
  padding: 1rem;
  border-radius: 8px;
  font-family: var(--font-main);
  transition: 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.social-btn {
  background: transparent;
  border: 1px solid var(--secondary);
  color: var(--secondary);
  box-shadow: none;
}

.social-btn:hover {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* --- SECTION HEADERS ON ABOUT/CONTACT --- */
.section-header {
  text-align: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--text-main);
  margin: 3rem 0;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* --- ABOUT PAGE (STACK & BOOK) --- */
.dhwani-intro {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  max-width: 800px;
  margin: 2rem auto;
}

.toggle-label {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem 1.5rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-label:hover {
  background: rgba(255, 255, 255, 0.1);
}

.info-box {
  color: var(--text-muted);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 1.5rem;
}

.toggle-box {
  display: none;
}

.toggle-box:checked+.toggle-label+.info-box {
  padding: 1.5rem;
  max-height: 500px;
  overflow-y: auto;
}

.toggle-box:checked+.toggle-label+.info-box::-webkit-scrollbar {
  width: 6px;
}

.toggle-box:checked+.toggle-label+.info-box::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 3px;
}

/* Stack Gallery */
.stack-container {
  width: 500px;
  height: 350px;
  margin: 3rem auto;
  position: relative;
  perspective: 1000px;
}

.stack-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #1e293b;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  transform-style: preserve-3d;
  cursor: pointer;
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.stack-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mock-cover {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  padding: 1rem;
}

.cover-writing {
  background: linear-gradient(135deg, #475569, #0f172a);
}

.cover-reading {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
}

.flick-out {
  animation: flickCard 0.6s forwards ease-in-out;
}

@keyframes flickCard {
  0% {
    transform: translateX(0) rotate(var(--rotation));
    opacity: 1;
  }

  50% {
    transform: translateX(400px) rotate(20deg);
    opacity: 0;
  }

  51% {
    z-index: -10;
  }

  100% {
    transform: translateX(0) rotate(var(--rotation));
    opacity: 1;
    z-index: -10;
  }
}

.stack-caption {
  text-align: center;
  font-size: 1.5rem;
  font-family: var(--font-display);
  color: var(--secondary);
  margin-top: 1rem;
  min-height: 2rem;
}

/* Book Teaser */
.book-teaser {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  overflow: hidden;
  max-width: 900px;
  margin: 4rem auto;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.book-cover {
  background: #000;
  color: #fff;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  background: linear-gradient(45deg, #000, #333);
  text-align: center;
}

.book-cover h3 {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  line-height: 1.2;
  letter-spacing: 2px;
}

.book-info {
  padding: 2.5rem;
}

.book-info h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.book-info h4 {
  color: var(--primary);
  margin-bottom: 1.5rem;
}

/* Timeline (Dhwani) */
.timeline {
  border-left: 2px solid var(--primary);
  margin: 2rem 0 2rem 1rem;
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.6rem;
  top: 1.5rem;
  width: 16px;
  height: 16px;
  background: var(--bg-dark);
  border: 2px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
}

.timeline-item h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* --- FOOTER --- */
footer {
  text-align: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }

  .contact-container {
    grid-template-columns: 1fr;
    padding: 2rem;
  }

  .book-teaser {
    flex-direction: column;
  }

  .book-cover {
    min-width: 100%;
    min-height: 300px;
  }

  .stack-container {
    width: 300px;
    height: 400px;
  }

  .timeline {
    margin-left: 0;
    padding-left: 1.5rem;
  }

  .timeline-item::before {
    left: -2.1rem;
  }
}

/* --- ANIMATIONS --- */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- UTILITY / SPECIFIC CLASSES --- */

/* Smaller Hero for Contact pg */
.hero-small {
  text-align: center;
  padding: 4rem 2rem;
  background: radial-gradient(circle at center, rgba(0, 212, 255, 0.1), transparent 70%);
}

.hero-small h2 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: #fff;
  margin-bottom: 1rem;
}

/* Card Titles (Stack Gallery) */
.card-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.text-uppercase {
  text-transform: uppercase;
}

.card-subtitle {
  font-style: italic;
  font-size: 1.1rem;
  opacity: 0.9;
}

.card-icon {
  margin-top: 1.5rem;
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.card-icon-large {
  margin-top: 1.5rem;
  width: 60px;
  height: 60px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

/* Text Highlights */
.instruction-text {
  text-align: center;
  margin-top: 2rem;
  color: var(--primary);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

.highlight-quote {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.1);
  border-left: 4px solid var(--primary);
  padding: 1rem;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.highlight-text {
  font-size: 1.25rem;
  color: var(--text-main);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* --- GAME SPECIFIC STYLES --- */
.game-board {
  display: grid;
  grid-template-columns: repeat(3, 100px);
  grid-template-rows: repeat(3, 100px);
  gap: 10px;
  margin: 2rem auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px;
  border: 1px solid var(--border-light);
  width: fit-content;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.cell {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 3rem;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.cell:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  box-shadow: inset 0 0 10px rgba(0, 212, 255, 0.2);
}

.cell.X {
  color: var(--primary);
  text-shadow: var(--glow-primary);
}

.cell.O {
  color: var(--secondary);
  text-shadow: var(--glow-secondary);
}

#statusText,
#message {
  font-size: 1.4rem;
  margin: 1.5rem 0;
  font-family: var(--font-display);
  color: var(--primary);
}

#guessInput {
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-light);
  color: #fff;
  padding: 1rem;
  font-size: 1.5rem;
  text-align: center;
  border-radius: 12px;
  width: 100%;
  max-width: 200px;
  margin-bottom: 2rem;
  font-family: var(--font-display);
}

#guessInput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--glow-primary);
}

@media (max-width: 480px) {
  .game-board {
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
  }

  .cell {
    font-size: 2.2rem;
  }
}