/* ============================================
   MATZE WIRD 29 — Cinematic Birthday Experience
   ============================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #06060c;
  --bg-elevated: #0c0c16;
  --bg-card: #10101c;
  --bg-card-border: rgba(212, 168, 83, 0.08);
  --text: #f2ede3;
  --text-dim: #6e6a78;
  --gold: #d4a853;
  --gold-light: #f0d48a;
  --gold-glow: rgba(212, 168, 83, 0.4);
  --purple: #b44dff;
  --purple-glow: rgba(180, 77, 255, 0.35);
  --pink: #ff5c8a;
  --font-display: 'Syne', sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}

::selection {
  background: var(--gold);
  color: var(--bg);
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--purple), var(--pink));
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px var(--gold-glow);
}

/* ===== Particle Canvas ===== */
#particle-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
}

/* ===== Balloons ===== */
.balloons {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.balloon {
  position: absolute;
  bottom: -80px;
  font-size: 2rem;
  animation: balloon-rise linear infinite;
  opacity: 0.5;
  filter: blur(0.5px);
}

@keyframes balloon-rise {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  5% { opacity: 0.5; }
  95% { opacity: 0.4; }
  100% { transform: translateY(-110vh) rotate(15deg); opacity: 0; }
}

/* ===== Intro Overlay ===== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.intro-overlay.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.intro-text {
  position: relative;
  z-index: 2;
  text-align: center;
}

.intro-save {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.2em;
  color: var(--gold);
  opacity: 0;
  animation: intro-fade 1.5s ease 0.5s forwards;
}

@keyframes intro-fade {
  0% { opacity: 0; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-bg-orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.3;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  top: -20%;
  left: -10%;
  animation: orb-drift-1 20s ease-in-out infinite alternate;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--purple-glow) 0%, transparent 70%);
  bottom: -15%;
  right: -10%;
  animation: orb-drift-2 25s ease-in-out infinite alternate;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 92, 138, 0.15) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: orb-drift-3 18s ease-in-out infinite alternate;
}

@keyframes orb-drift-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(80px, 60px) scale(1.2); }
}
@keyframes orb-drift-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-60px, -40px) scale(1.15); }
}
@keyframes orb-drift-3 {
  0% { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-40%, -60%) scale(1.3); }
}

.hero-content {
  text-align: center;
  z-index: 2;
  position: relative;
  padding: 0 2rem;
}

.hero-eyebrow {
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(0.9rem, 2vw, 1.2rem);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.name-line {
  display: flex;
  justify-content: center;
  font-size: clamp(4rem, 12vw, 9rem);
  letter-spacing: -0.02em;
}

.char-wrap {
  display: inline-block;
  overflow: hidden;
}

.char {
  display: inline-block;
  animation: char-reveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 0.07s + 0.5s);
  transform: translateY(120%);
}

.char-wrap:nth-child(1) .char { --i: 0; }
.char-wrap:nth-child(2) .char { --i: 1; }
.char-wrap:nth-child(3) .char { --i: 2; }
.char-wrap:nth-child(4) .char { --i: 3; }
.char-wrap:nth-child(5) .char { --i: 4; }

@keyframes char-reveal {
  to { transform: translateY(0); }
}

.wird-line {
  display: block;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 4vw, 2.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-dim);
  margin: 0.4em 0 0.2em;
  opacity: 0;
  animation: fade-in 1s ease 1s forwards;
}

.age-line {
  display: inline-flex;
  gap: 0.02em;
  font-size: clamp(7rem, 22vw, 16rem);
  color: var(--gold);
  cursor: default;
  position: relative;
  text-shadow:
    0 0 40px var(--gold-glow),
    0 0 80px rgba(212, 168, 83, 0.15),
    0 0 120px rgba(212, 168, 83, 0.05);
  opacity: 0;
  animation: age-entrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) 1.3s forwards;
}

@keyframes age-entrance {
  0% { opacity: 0; transform: scale(0.5); filter: blur(20px); }
  60% { opacity: 1; transform: scale(1.05); filter: blur(0px); }
  100% { opacity: 1; transform: scale(1); filter: blur(0px); }
}

.age-digit {
  display: inline-block;
  transition: transform 0.15s ease;
}

.age-line:hover .age-digit {
  animation: digit-bounce 0.4s ease;
}

.age-line:hover .age-digit:nth-child(2) {
  animation-delay: 0.08s;
}

@keyframes digit-bounce {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
}

/* Age glitch states */
.age-line.glitching {
  animation: glitch-shake 0.1s steps(3) !important;
  opacity: 1 !important;
}

@keyframes glitch-shake {
  0% { transform: translate(0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -1px); }
  100% { transform: translate(0); }
}

.age-line.glitching::after {
  content: '40';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple);
  font-family: var(--font-display);
  font-size: inherit;
  font-weight: 800;
  text-shadow: 0 0 40px var(--purple-glow), 0 0 80px var(--purple-glow);
  opacity: 0.85;
  animation: glitch-clip 0.1s steps(2);
}

@keyframes glitch-clip {
  0% { clip-path: inset(5% 0 55% 0); opacity: 0.9; }
  50% { clip-path: inset(35% 0 5% 0); opacity: 0.8; }
  100% { clip-path: inset(0% 0 0% 0); opacity: 0.7; }
}

.hero-tagline {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fade-in 1s ease 1.8s forwards;
}

.hero-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding: 0.8rem 2.5rem;
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 100px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  backdrop-filter: blur(10px);
  background: rgba(212, 168, 83, 0.05);
  opacity: 0;
  animation: fade-in 1s ease 2.1s forwards;
}

.badge-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
}

.scroll-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin-top: 3rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  opacity: 0;
  animation: fade-in 1s ease 2.4s forwards;
}

.scroll-cta:hover { color: var(--gold); }

.scroll-cta svg {
  animation: arrow-bounce 2s ease-in-out infinite;
}

@keyframes arrow-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(6px); opacity: 1; }
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* ===== Sections Common ===== */
.section {
  position: relative;
  padding: 8rem 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section-wave {
  position: absolute;
  left: 0;
  right: 0;
  color: var(--bg);
  line-height: 0;
}

.section-wave-top {
  top: -1px;
}

.section-wave svg {
  width: 100%;
  height: 80px;
}

.section-heading {
  text-align: center;
  margin-bottom: 3.5rem;
}

.heading-accent {
  display: block;
  font-family: var(--font-serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--gold);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.heading-main {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-sub {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  margin-top: -2rem;
  margin-bottom: 3rem;
}

/* ===== Countdown / Flip Clock ===== */
.countdown-section {
  background: var(--bg-elevated);
  padding-top: 10rem;
}

.countdown-grid {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.flip-card {
  text-align: center;
}

.flip-card-inner {
  position: relative;
  width: clamp(80px, 18vw, 140px);
  height: clamp(90px, 20vw, 150px);
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  box-shadow:
    0 4px 20px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Single centered number */
.flip-card-inner span {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-glow);
}

/* Divider line across the middle */
.flip-card-inner::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,0.06);
}

/* Top half subtle gradient */
.flip-card-inner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 1;
}

/* Hide the separate top/bottom divs - use single span */
.flip-top, .flip-bottom { display: none; }

.flip-card-inner.flipping {
  animation: flip-pulse 0.4s ease-in-out;
}

@keyframes flip-pulse {
  0% { transform: scaleY(1); }
  30% { transform: scaleY(0.85); }
  60% { transform: scaleY(1.03); }
  100% { transform: scaleY(1); }
}

.flip-label {
  margin-top: 0.6rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}

.flip-sep {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--gold);
  opacity: 0.3;
  align-self: center;
  margin-top: -1.5rem;
  animation: sep-pulse 2s ease-in-out infinite;
}

@keyframes sep-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ===== Photos ===== */
.photos-section {
  padding-bottom: 6rem;
}

.photo-gallery {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  grid-template-rows: 1fr 1fr;
  gap: 1.5rem;
  min-height: 500px;
}

.photo-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  cursor: default;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.03, 0.98, 0.52, 0.99);
  border: 1px solid rgba(255,255,255,0.04);
}

.photo-glow {
  position: absolute;
  inset: -2px;
  border-radius: 22px;
  background: conic-gradient(from 180deg, var(--gold), var(--purple), var(--pink), var(--gold));
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
}

.photo-card:hover .photo-glow {
  opacity: 0.4;
  animation: glow-spin 4s linear infinite;
}

@keyframes glow-spin {
  to { filter: hue-rotate(360deg); }
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.03, 0.98, 0.52, 0.99), filter 0.6s ease;
  filter: saturate(0.85) brightness(0.9);
}

.photo-card:hover img {
  transform: scale(1.05);
  filter: saturate(1.1) brightness(1);
}

.photo-main {
  grid-row: 1 / 3;
}

.photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 1.5rem 1.5rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
  transform: translateY(0);
}

.photo-overlay span {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold);
}

/* ===== Info Cards ===== */
.info-section {
  background: var(--bg-elevated);
  padding-top: 10rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.info-card {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99), border-color 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}

.info-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--gold-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.info-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 168, 83, 0.25);
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.info-card:hover::before { opacity: 0.15; }

.info-icon-wrap {
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.info-icon {
  width: 48px;
  height: 48px;
  color: var(--gold);
}

.info-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--gold);
  position: relative;
  z-index: 1;
}

.info-main {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  position: relative;
  z-index: 1;
}

.info-detail {
  font-size: 0.9rem;
  color: var(--text-dim);
  position: relative;
  z-index: 1;
}

/* ===== Fun Facts ===== */
.facts-section {
  padding-bottom: 6rem;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.fact-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--bg-card-border);
  transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99), box-shadow 0.4s ease;
}

.fact-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.fact-number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--gold-glow);
}

.fact-card p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Glitch Number */
.glitch-number {
  position: relative;
  display: inline-block;
  cursor: default;
}

.glitch-number::before,
.glitch-number::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.glitch-number:hover::before {
  content: '40';
  opacity: 0.8;
  color: var(--purple);
  animation: g1 0.3s steps(2) infinite;
  clip-path: inset(20% 0 30% 0);
}

.glitch-number:hover::after {
  content: '40';
  opacity: 0.5;
  color: var(--pink);
  animation: g2 0.3s steps(2) infinite reverse;
  clip-path: inset(60% 0 5% 0);
}

@keyframes g1 {
  0% { transform: translate(3px, -2px); }
  50% { transform: translate(-3px, 2px); }
  100% { transform: translate(2px, 3px); }
}
@keyframes g2 {
  0% { transform: translate(-2px, 3px); }
  50% { transform: translate(3px, -3px); }
  100% { transform: translate(-3px, -2px); }
}

.hidden-note {
  color: var(--gold);
  cursor: help;
  font-weight: 600;
}

.facts-footnote {
  text-align: center;
  margin-top: 2.5rem;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-dim);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.facts-footnote.visible {
  opacity: 0.7;
  transform: translateY(0);
}

/* ===== Footer ===== */
.footer {
  padding: 4rem 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.footer-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 80px;
  background: radial-gradient(ellipse, var(--gold-glow) 0%, transparent 70%);
  opacity: 0.3;
}

.footer p {
  color: var(--text-dim);
  font-size: 0.9rem;
  position: relative;
}

.footer-age {
  cursor: default;
  transition: color 0.3s ease;
  position: relative;
}

/* ===== Scroll Reveal System ===== */
[data-reveal] {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delay via data attribute */
[data-delay="100"] { transition-delay: 0.1s; }
[data-delay="150"] { transition-delay: 0.15s; }
[data-delay="200"] { transition-delay: 0.2s; }
[data-delay="300"] { transition-delay: 0.3s; }
[data-delay="350"] { transition-delay: 0.35s; }
[data-delay="400"] { transition-delay: 0.4s; }
[data-delay="500"] { transition-delay: 0.5s; }
[data-delay="600"] { transition-delay: 0.6s; }
[data-delay="800"] { transition-delay: 0.8s; }
[data-delay="1000"] { transition-delay: 1.0s; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .info-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
  .facts-grid { grid-template-columns: 1fr 1fr; }
  .photo-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: auto;
  }
  .photo-main { grid-row: auto; }
  .photo-card img { height: 280px; }
}

@media (max-width: 600px) {
  .countdown-grid { gap: 0.5rem; }
  .flip-sep { font-size: 1.5rem; margin-top: -1rem; }
  .hero-date-badge { gap: 0.6rem; padding: 0.6rem 1.5rem; font-size: 0.85rem; }
  .facts-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .section { padding: 5rem 0; }
}

/* ===== Grain overlay (subtle texture) ===== */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 8999;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}
