/* CSS Variables - Light Mode (default) */
:root {
  --background: #F9F6F0;
  --foreground: #252622;
  --primary: #EB5E28;
  --muted: #403D39;
  --muted-foreground: #6B6860;
  --border: #CCC5B9;
  --light-cream: #FFFCF2;

  --font-heading: 'Belleza', Georgia, 'Times New Roman', serif;
  --font-body: 'Lato', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --font-decorative: 'Mansalva', cursive;

  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --background: #252622;
  --foreground: #FFFCF2;
  --muted: #CCC5B9;
  --muted-foreground: #A8A299;
  --border: #403D39;
  --light-cream: #F9F6F0;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--foreground);
  background-color: var(--background);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--background);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--foreground);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--primary);
}

.logo-dot {
  color: var(--primary);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: transparent;
  color: var(--foreground);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: var(--border);
}

.theme-toggle .sun-icon {
  display: block;
}

.theme-toggle .moon-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
  display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
  display: block;
}

/* Hero Section */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

@media (min-width: 768px) {
  .hero {
    padding: 6rem 0 4rem;
  }
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  animation: fadeInUp 0.8s ease forwards;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.5rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 4rem;
  }
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 600px;
  margin: 0 auto 2rem;
  animation: fadeInUp 0.8s ease 0.1s forwards;
  opacity: 0;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 1.25rem;
  }
}

/* NVIDIA Badge (in footer) */
.nvidia-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.nvidia-badge img {
  max-width: 180px;
  height: auto;
  transition: filter var(--transition-normal);
}


.nvidia-member-of {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nvidia-copyright {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  max-width: 500px;
  text-align: center;
  line-height: 1.4;
}

/* Explainer Section */
.explainer-section {
  padding: 3rem 0 4rem;
}

@media (min-width: 768px) {
  .explainer-section {
    padding: 4rem 0 6rem;
  }
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.5rem;
    margin-bottom: 2.5rem;
  }
}

.primary {
  color: var(--primary);
}

/* Video Wrapper */
.video-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
}

.explainer-video {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
  margin-bottom: -10%;
}

[data-theme="dark"] .explainer-video {
  mix-blend-mode: screen;
  filter: invert(1) hue-rotate(180deg) brightness(1.3);
}

/* Video Caption (outside video) */
.video-caption {
  font-family: var(--font-decorative);
  font-size: 1rem;
  color: var(--muted-foreground);
  text-align: center;
  padding: 1rem 1rem 0;
  min-height: 3.5rem;
  max-width: 800px;
  margin: 0 auto;
  opacity: 0;
  transition: opacity var(--transition-slow);
}

@media (min-width: 640px) {
  .video-caption {
    font-size: 1.25rem;
    min-height: 4rem;
  }
}

@media (min-width: 768px) {
  .video-caption {
    font-size: 1.5rem;
    min-height: 4.5rem;
  }
}

.video-caption.visible {
  opacity: 1;
}

.video-caption.slide-in {
  animation: slideInCaption var(--transition-slow) ease forwards;
}

.video-caption.slide-out {
  animation: slideOutCaption var(--transition-slow) ease forwards;
}

/* Replay Button */
.replay-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.5rem auto 0;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: transparent;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.replay-button:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: var(--light-cream);
}

.replay-button.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Footer */
.footer {
  margin-top: auto;
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
  transition: border-color var(--transition-normal);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.copyright {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

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

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

@keyframes slideOutCaption {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

/* Selection */
::selection {
  background-color: var(--primary);
  color: var(--light-cream);
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
