/* CSS Design System for Pavel's Birthday Scroll-Story Website */

/* Reset and base variables */
:root {
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Unbounded', system-ui, -apple-system, sans-serif;

  --bg-color: #ff6f00;
  /* Starts as bright tiger orange */
  --accent-tiger: #ff7e1d;
  --accent-gold: #ffc837;
  --accent-blue: #00f2fe;
  --accent-red: #ff3366;
  --accent-cosmic: #8a2be2;
  --accent-beer: #f1a80a;

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.45);

  --card-bg: rgba(10, 10, 12, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --card-blur: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-body);
  color: var(--text-primary);
  font-size: 16px;
  transition: background-color 1s cubic-bezier(0.45, 0, 0.55, 1);
}

/* Fixed ambient color gradient glow */
.bg-glow {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 80vmax;
  height: 80vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 126, 29, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
  z-index: 1;
  pointer-events: none;
  filter: blur(40px);
  transition: background 1.2s ease, opacity 1.2s ease;
  opacity: 0.8;
}

/* Inline slide images next to text */
.slide-img {
  width: 100%;
  max-width: 320px;
  max-height: 32vh;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
  display: block;
  z-index: 2;
}

.slide-img:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* Empty placeholder where a photo will go later */
.photo-slot {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0.25rem 0;
}

/* Large featured photo on the main screen */
.hero-feature {
  display: block;
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

/* Row of several photos. MOBILE-FIRST: never more than 2 across on a phone,
   otherwise portrait photos get squeezed into tiny distorted slivers.
   Desktop widens back to 3/4-up in the 768px breakpoint below. */
.photo-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  width: 100%;
  max-width: 440px;
  margin: 0.4rem auto;
}

.photo-group.cols-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 380px;
}

/* The 3-photo group: on a phone show 2 on top + the 3rd as a full-width
   banner so there's no lonely half-width orphan. Reset on desktop. */
.photo-group:not(.cols-2):not(.cols-4) > :nth-child(3):last-child {
  grid-column: 1 / -1;
  aspect-ratio: 16 / 10;
}

/* Hero photo grid: 2x2 on phones so each photo is large enough,
   widens to a 4-up row on tablet/desktop (see 768px breakpoint). */
.photo-group.cols-4 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 360px;
  gap: 0.5rem;
}

.photo-group img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.photo-group img:hover {
  transform: scale(1.04);
}

/* Main snap scrolling container */
main {
  width: 100%;
  height: 100dvh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Hide scrollbar on Firefox */
  -ms-overflow-style: none;
  /* Hide scrollbar on IE */
  position: relative;
  z-index: 3;
}

main::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar on Chrome/Safari */
}

/* Individual Sections */
section {
  width: 100%;
  min-height: 100dvh;
  height: auto;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 3.5rem 1.5rem;
  overflow: hidden;
}

/* Transparent container replacing the card style */
.section-card {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: flex-start;
  text-align: left;
}

/* For slides with images (on mobile, stacked column style) */
.section-card:has(.slide-img) {
  align-items: center;
  text-align: left;
}

/* Floating emojis / small decors in section cards */
.decor-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: float-icon 4s ease-in-out infinite alternate;
}

.decor-icon.tiger-head {
  animation: tiger-pulse 2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 10px rgba(255, 126, 29, 0.6));
}

.decor-icon.diamond-gem {
  animation: diamond-sparkle 3s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 12px rgba(0, 242, 254, 0.7));
}

.decor-icon.sauna-steam {
  animation: steam-rise 5s linear infinite;
}

/* Typography styles */
.section-card p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-primary);
  font-weight: 400;
  letter-spacing: -0.01em;
  word-wrap: break-word;
}

/* Styling for specific emphasized text segments within Text.md paragraphs */
.shout {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-tiger);
  display: block;
  margin-bottom: 0.5rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.sub-shout {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #ff9d4d;
  display: block;
  line-height: 1.4;
  margin-top: 0.25rem;
}

.neon-green {
  color: #00ffcc;
  font-weight: 700;
}

.highlight-gold {
  color: var(--accent-gold);
  font-weight: 700;
}

.highlight-blue {
  color: var(--accent-blue);
  font-weight: 700;
}

.highlight-red {
  color: var(--accent-red);
  font-weight: 700;
}

.highlight-beer {
  color: var(--accent-beer);
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.bold-tagline {
  font-weight: 700;
  border-left: 3px solid var(--accent-gold);
  padding-left: 0.75rem;
  margin-top: 0.5rem;
  color: var(--text-primary);
}

/* Floating interactive UI elements */
.ui-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Scroll guide indicator at the bottom */
.scroll-guide {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: opacity 0.5s ease;
  opacity: 0.8;
}

.scroll-guide.hidden {
  opacity: 0;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-bottom: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: arrow-bounce 2s infinite;
}

/* Vertical navigation dots indicator */
.nav-dots {
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: auto;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
}

.nav-dot.active {
  background-color: var(--text-primary);
  transform: scale(1.6);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Warning Sound Button style on Slide 0 */
.danger-sound-btn {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 850;
  color: #ffffff;
  background: rgba(255, 51, 102, 0.12);
  border: 2px dashed var(--accent-red);
  border-radius: 14px;
  padding: 0.9rem 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1.25rem;
  align-self: center;
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.15);
  animation: danger-pulse 1.8s infinite alternate;
  pointer-events: auto;
  /* Clickable */
}

.danger-sound-btn:active {
  transform: scale(0.96);
  background: rgba(255, 51, 102, 0.25);
}

.danger-sound-btn.playing {
  background: rgba(0, 255, 204, 0.12);
  border-color: #00ffcc;
  color: #00ffcc;
  box-shadow: 0 0 15px rgba(0, 255, 204, 0.2);
  animation: playing-pulse 1.8s infinite alternate;
}

@keyframes danger-pulse {
  0% {
    box-shadow: 0 0 8px rgba(255, 51, 102, 0.15);
    border-color: rgba(255, 51, 102, 0.5);
  }

  100% {
    box-shadow: 0 0 22px rgba(255, 51, 102, 0.5);
    border-color: rgba(255, 51, 102, 1);
  }
}

@keyframes playing-pulse {
  0% {
    box-shadow: 0 0 8px rgba(0, 255, 204, 0.15);
    border-color: rgba(0, 255, 204, 0.5);
  }

  100% {
    box-shadow: 0 0 22px rgba(0, 255, 204, 0.5);
    border-color: rgba(0, 255, 204, 1);
  }
}

/* Particle system styles */
.particle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
  animation-fill-mode: both;
  opacity: 0;
}

/* Custom CSS-only keyframe animations */
@keyframes arrow-bounce {

  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }

  50% {
    transform: translateY(6px) rotate(45deg);
  }
}

@keyframes float-icon {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  100% {
    transform: translateY(-8px) rotate(5deg);
  }
}

@keyframes tiger-pulse {
  0% {
    transform: scale(1) rotate(-3deg);
    filter: drop-shadow(0 0 5px rgba(255, 126, 29, 0.4));
  }

  100% {
    transform: scale(1.12) rotate(3deg);
    filter: drop-shadow(0 0 15px rgba(255, 126, 29, 0.8));
  }
}

@keyframes diamond-sparkle {
  0% {
    transform: scale(0.95) rotate(-5deg);
    filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.5)) brightness(1);
  }

  100% {
    transform: scale(1.08) rotate(5deg);
    filter: drop-shadow(0 0 18px rgba(0, 242, 254, 0.9)) brightness(1.2);
  }
}

@keyframes steam-rise {
  0% {
    transform: translateY(5px) scale(0.9) rotate(0deg);
    opacity: 0.3;
  }

  50% {
    transform: translateY(-5px) scale(1.1) rotate(10deg);
    opacity: 0.7;
  }

  100% {
    transform: translateY(-15px) scale(1) rotate(-10deg);
    opacity: 0;
  }
}

/* Animations for JS spawned particles */
@keyframes spark-float {
  0% {
    transform: translateY(100vh) translateX(0) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 0.8;
  }

  90% {
    opacity: 0.6;
  }

  100% {
    transform: translateY(-10vh) translateX(var(--drift)) scale(1.2);
    opacity: 0;
  }
}

@keyframes snow-fall {
  0% {
    transform: translateY(-10px) translateX(0) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: 0.9;
  }

  90% {
    opacity: 0.7;
  }

  100% {
    transform: translateY(105vh) translateX(var(--drift)) rotate(360deg);
    opacity: 0;
  }
}

@keyframes bubble-rise {
  0% {
    transform: translateY(105vh) translateX(0) scale(0.6);
    opacity: 0;
  }

  10% {
    opacity: 0.4;
  }

  80% {
    opacity: 0.3;
  }

  100% {
    transform: translateY(-10vh) translateX(var(--drift)) scale(1.5);
    opacity: 0;
  }
}

@keyframes star-twinkle {

  0%,
  100% {
    opacity: 0.1;
    transform: scale(0.7);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Layout adjustments for tablet/desktop */
@media (min-width: 768px) {
  body {
    font-size: 17px;
  }

  /* Comfortable reading column, centered on wide screens */
  .section-card {
    max-width: 720px;
    gap: 1.9rem;
  }

  .section-card p {
    font-size: 1.25rem;
    line-height: 1.75;
  }

  .nav-dots {
    right: 2.5rem;
    gap: 1rem;
  }

  /* Larger media on desktop */
  .slide-img,
  .photo-slot {
    max-width: 460px;
  }

  /* Restore the wider photo rows on tablet/desktop (plenty of room here) */
  .photo-group {
    grid-template-columns: repeat(3, 1fr);
    max-width: 460px;
    gap: 0.6rem;
  }

  .photo-group.cols-2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 460px;
  }

  .photo-group.cols-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 520px;
  }

  /* No banner-orphan on desktop: 3rd photo goes back to a normal cell */
  .photo-group:not(.cols-2):not(.cols-4) > :nth-child(3):last-child {
    grid-column: auto;
    aspect-ratio: 3 / 4;
  }

  .slide-img {
    max-height: 50vh;
  }

  .main-gif {
    width: 150px;
    height: 150px;
  }

  /* Slide 0 hero: centered, fits within one screen */
  #slide-0 .section-card {
    max-width: 640px;
    align-items: center;
    text-align: center;
  }

  #slide-0 .slide-img {
    max-width: 360px;
    max-height: 42vh;
  }

  .hero-feature {
    max-width: 560px;
  }
}

/* Big desktop / landscape: cap the column so it doesn't float lost in whitespace */
@media (min-width: 1200px) {
  .section-card {
    max-width: 760px;
  }
}

/* Slanted Tiger Hazard Stripe for Slide 0 */
.tiger-stripe-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  /* Wider stripe */
  background: repeating-linear-gradient(-45deg,
      #ff6f00,
      #ff6f00 25px,
      #000000 25px,
      #000000 50px);
  background-size: 70.7px 70.7px;
  /* Seamless tiling for 45deg stripes */
  box-shadow: 0 -6px 25px rgba(0, 0, 0, 0.5);
  z-index: 5;
  animation: tiger-stripe-move 1.2s linear infinite, tiger-glitch 0.25s infinite alternate;
}

@keyframes tiger-stripe-move {
  0% {
    background-position: 0 0;
  }

  100% {
    background-position: 70.7px 0;
  }
}

@keyframes tiger-glitch {

  0%,
  100% {
    transform: translateY(0) skewX(0deg);
    filter: brightness(1) contrast(1);
  }

  20% {
    transform: translateY(-1px) skewX(1deg);
    filter: brightness(1.1) contrast(1.1);
  }

  40% {
    transform: translateY(1px) skewX(-1deg);
  }

  60% {
    transform: translateY(0) skewX(0.5deg);
    filter: contrast(1.15);
  }

  80% {
    transform: translateY(-2px) skewX(-0.5deg);
  }
}

/* Slide 0: High-Contrast Black Tiger Text on Solid Orange Background */
#slide-0 .section-card {
  color: #000000;
  text-shadow: none;
  /* Remove muddy dark shadows */
  gap: 0.85rem;
  /* Tighter spacing so hero photo + text + button fit the screen */
}

/* Keep the hero photo modest and the button clear of the tiger stripe */
#slide-0 {
  padding-bottom: 6rem;
}

#slide-0 .slide-img {
  max-height: 26vh;
}

#slide-0 .decor-icon {
  margin-bottom: 0;
}

/* Animated GIF header on the main screen */
.main-gif {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  animation: float-icon 4s ease-in-out infinite alternate;
}

#slide-0 .section-card .shout {
  color: #000000;
  /* Pure black bold heading */
}

#slide-0 .section-card p {
  color: #000000;
  /* Pure black text */
  font-weight: 500;
  /* Slightly thicker for premium look */
}

#slide-0 .danger-sound-btn {
  background: #0a0a0a;
  border: 2px solid #0a0a0a;
  color: #ff7e1d;
  /* Tiger-orange text on solid black — on-theme and bold */
  border-radius: 999px;
  /* Premium pill shape */
  padding: 1rem 2rem;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  animation: black-pulse 2.2s infinite alternate;
}

#slide-0 .danger-sound-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
}

#slide-0 .danger-sound-btn:active {
  transform: translateY(0) scale(0.97);
  background: #000000;
}

#slide-0 .danger-sound-btn.playing {
  background: #ffc837;
  border-color: #ffc837;
  color: #1a1200;
  /* Bright gold fill — clearly brighter than the orange page, reads as "ON" */
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 200, 55, 0.6);
  animation: playing-black-pulse 2s infinite alternate;
}

@keyframes black-pulse {
  0% {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(0, 0, 0, 0.3);
  }

  100% {
    box-shadow: 0 11px 28px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(0, 0, 0, 0);
  }
}

@keyframes playing-black-pulse {
  0% {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), 0 0 14px rgba(255, 200, 55, 0.45);
  }

  100% {
    box-shadow: 0 11px 28px rgba(0, 0, 0, 0.4), 0 0 28px rgba(255, 200, 55, 0.85);
  }
}

/* Responsive adjustments for devices with small viewport height */
@media (max-height: 720px) {
  section {
    padding: 2.25rem 1.25rem;
  }
  
  .section-card {
    gap: 0.75rem;
  }
  
  .decor-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
  }
  
  .slide-img {
    max-height: 26vh;
    max-width: 250px;
  }
  
  .danger-sound-btn {
    padding: 0.7rem 1.25rem;
    margin-top: 0.75rem;
    font-size: 0.75rem;
  }
  
  .tiger-stripe-bottom {
    height: 48px;
    background-size: 50px 50px;
  }
}