/* ============================================================
   Sagar @ 31 — birthday site
   ============================================================ */
:root {
  --ink: #16100c;
  --ink2: #1e1610;
  --ink3: #261b13;
  --cream: #fbf3e7;
  --cream2: #f3e6d2;
  --gold: #f3b64a;
  --gold-2: #ffd27a;
  --gold-deep: #cf8a2c;
  --rose: #ff5d73;
  --text: #f4e9db;
  --muted: rgba(244, 233, 219, 0.62);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; width: 100%; }
.wrap.narrow { max-width: 760px; }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
.kicker {
  font-size: 12px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin-bottom: 14px;
}
.sec-sub { color: var(--muted); font-size: clamp(15px, 1.6vw, 18px); margin-top: 10px; }

/* confetti canvas */
#confetti {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 60;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  padding: 13px 24px; border-radius: 100px; cursor: pointer;
  border: 1.5px solid transparent; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  color: #2a1c0a; box-shadow: 0 12px 30px -12px rgba(243, 182, 74, 0.7);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -14px rgba(243, 182, 74, 0.85); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: rgba(244, 233, 219, 0.28); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

/* ============ HERO ============ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  text-align: center; overflow: hidden; isolation: isolate;
}
.hero-slides { position: absolute; inset: 0; z-index: -3; }
.hero-slides .slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; animation: heroFade 42s infinite; transform: scale(1.1);
}
.hero-slides .slide:nth-child(1) { animation-delay: 0s; }
.hero-slides .slide:nth-child(2) { animation-delay: 7s; transform-origin: top right; }
.hero-slides .slide:nth-child(3) { animation-delay: 14s; transform-origin: bottom left; }
.hero-slides .slide:nth-child(4) { animation-delay: 21s; transform-origin: top left; }
.hero-slides .slide:nth-child(5) { animation-delay: 28s; transform-origin: bottom right; }
.hero-slides .slide:nth-child(6) { animation-delay: 35s; }
@keyframes heroFade {
  0%   { opacity: 0; transform: scale(1.1); }
  3%   { opacity: 1; }
  14%  { opacity: 1; }
  18%  { opacity: 0; transform: scale(1.18); }
  100% { opacity: 0; transform: scale(1.18); }
}
.hero-veil {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(22, 16, 12, 0.2), rgba(22, 16, 12, 0.55) 55%, rgba(22, 16, 12, 0.94) 100%),
    linear-gradient(180deg, rgba(22, 16, 12, 0.55), rgba(22, 16, 12, 0.35) 40%, rgba(22, 16, 12, 0.92));
}

.hero-inner { position: relative; padding: 0 24px; max-width: 900px; margin: 0 auto; }
.eyebrow {
  font-size: clamp(12px, 1.4vw, 15px); letter-spacing: 0.26em; text-transform: uppercase;
  color: var(--gold-2); font-weight: 700; margin-bottom: 22px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}
.hero h1 { font-family: var(--serif); line-height: 0.92; margin: 0 auto; }
.hero h1 .line { display: block; }
.hero h1 .line:first-child {
  font-weight: 500; font-style: italic; font-size: clamp(28px, 6vw, 64px);
  color: var(--cream); opacity: 0.92; letter-spacing: 0;
}
.hero h1 .big {
  font-weight: 900; font-size: clamp(110px, 26vw, 300px); line-height: 0.82;
  background: linear-gradient(180deg, #fff5e0, var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 18px 40px rgba(243, 182, 74, 0.35));
}
.hero h1 .big sup { font-size: 0.28em; vertical-align: super; font-weight: 800; }
.hero h1 .name {
  font-weight: 600; font-size: clamp(46px, 12vw, 132px); color: var(--cream);
  letter-spacing: -0.02em; margin-top: 4px;
}
.hero h1 .name .dot { color: var(--rose); }
.hero-sub {
  max-width: 620px; margin: 26px auto 0; color: rgba(244, 233, 219, 0.86);
  font-size: clamp(16px, 1.9vw, 21px); text-shadow: 0 2px 16px rgba(0, 0, 0, 0.5);
}
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

.scroll-cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid rgba(244, 233, 219, 0.45); border-radius: 16px; }
.scroll-cue span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; background: var(--gold-2); border-radius: 4px; transform: translateX(-50%); animation: cue 1.6s infinite; }
@keyframes cue { 0% { opacity: 0; transform: translate(-50%, 0); } 40% { opacity: 1; } 80% { opacity: 0; transform: translate(-50%, 14px); } 100% { opacity: 0; } }

/* balloons */
.balloons { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.balloon { position: absolute; bottom: -140px; width: 46px; height: 58px; border-radius: 50% 50% 48% 48%; opacity: 0.0; animation: float 16s infinite ease-in; }
.balloon::after { content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); border: 4px solid transparent; border-top-color: inherit; }
.balloon::before { content: ''; position: absolute; bottom: -70px; left: 50%; width: 1px; height: 70px; background: rgba(255, 255, 255, 0.25); transform: translateX(-50%); }
.b1 { left: 8%;  background: var(--rose);   animation-delay: 0s; }
.b2 { left: 28%; background: var(--gold);   animation-delay: 4s; }
.b3 { left: 52%; background: #6cc4ff;        animation-delay: 8s; }
.b4 { left: 72%; background: #b388ff;        animation-delay: 2s; }
.b5 { left: 90%; background: var(--gold-2);  animation-delay: 6s; }
@keyframes float { 0% { transform: translateY(0) rotate(-4deg); opacity: 0; } 10% { opacity: 0.85; } 90% { opacity: 0.85; } 100% { transform: translateY(-112svh) rotate(4deg); opacity: 0; } }

/* ============ LETTER ============ */
.letter {
  background: linear-gradient(180deg, var(--cream), var(--cream2));
  color: #3a2a1c; padding: clamp(70px, 11vw, 140px) 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.letter .kicker { color: var(--gold-deep); }
.letter h2 { font-size: clamp(38px, 7vw, 76px); color: #2c1d10; margin-bottom: 22px; }
.letter-body { font-size: clamp(17px, 1.9vw, 21px); color: #4a3826; }
.letter-body p { margin-bottom: 20px; }
.letter-body em { font-style: italic; color: var(--gold-deep); font-weight: 600; }
.letter-body .sign { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 26px); color: #2c1d10; margin-top: 34px; line-height: 1.4; }
.letter-body .sign span { font-size: 0.7em; color: #6a5238; font-style: italic; }

/* ============ ARC (career timeline) ============ */
.arc { background: var(--ink); padding: clamp(70px, 11vw, 130px) 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.timeline { list-style: none; max-width: 720px; margin: 0 auto; position: relative; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--gold), rgba(243, 182, 74, 0.12)); }
.timeline li { position: relative; padding: 0 0 26px 40px; }
.timeline li:last-child { padding-bottom: 0; }
.t-dot { position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 2px solid var(--gold); box-shadow: 0 0 0 4px rgba(243, 182, 74, 0.12); }
.t-dot.now { background: var(--gold); box-shadow: 0 0 0 4px rgba(243, 182, 74, 0.22), 0 0 22px 4px rgba(243, 182, 74, 0.5); }
.t-card { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(244, 233, 219, 0.1); border-radius: 14px; padding: 16px 22px; }
.t-when { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 4px; }
.t-card h3 { font-family: var(--serif); font-weight: 600; font-size: clamp(20px, 3vw, 26px); color: var(--cream); margin-bottom: 6px; }
.t-card p { color: var(--muted); font-size: 15.5px; }
.t-card em { color: var(--gold-2); font-style: italic; }
.arc-foot { text-align: center; max-width: 620px; margin: 34px auto 0; color: rgba(244, 233, 219, 0.82); font-size: clamp(15px, 1.8vw, 18px); font-family: var(--serif); font-style: italic; }

/* ============ STATS ============ */
.stats { background: var(--ink2); padding: clamp(50px, 8vw, 90px) 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; text-align: center; }
.stat .num { display: block; font-family: var(--serif); font-weight: 900; font-size: clamp(40px, 7vw, 74px); line-height: 1; background: linear-gradient(180deg, #fff5e0, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .num.inf { font-size: clamp(46px, 8vw, 82px); }
.stat .lbl { display: block; margin-top: 10px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

/* ============ JOURNEY ============ */
.journey { padding: clamp(70px, 11vw, 140px) 0; background: radial-gradient(120% 60% at 50% -10%, var(--ink3), var(--ink) 60%); }
.sec-head { text-align: center; max-width: 640px; margin: 0 auto clamp(40px, 6vw, 70px); }
.sec-head h2 { font-size: clamp(34px, 6vw, 66px); }

.chapter { margin-bottom: clamp(48px, 7vw, 84px); }
.chapter-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 26px; }
.chapter-year { font-family: var(--serif); font-weight: 900; font-size: clamp(40px, 8vw, 90px); line-height: 1; color: rgba(244, 233, 219, 0.14); letter-spacing: -0.02em; }
.chapter-rule { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(243, 182, 74, 0.5), transparent); }
.chapter-count { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

.masonry { columns: 3 280px; column-gap: 16px; }
.masonry .cell { break-inside: avoid; margin-bottom: 16px; position: relative; border-radius: 14px; overflow: hidden; cursor: pointer; background: var(--ink3); box-shadow: var(--shadow); transform: translateZ(0); }
.masonry .cell img { width: 100%; height: auto; transition: transform .5s ease, filter .5s ease; }
.masonry .cell::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55)); opacity: 0; transition: opacity .35s ease; }
.masonry .cell .cap { position: absolute; left: 14px; bottom: 12px; z-index: 2; font-size: 13px; font-weight: 600; color: #fff; opacity: 0; transform: translateY(6px); transition: .35s ease; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8); }
.masonry .cell:hover img { transform: scale(1.06); }
.masonry .cell:hover::after, .masonry .cell:hover .cap { opacity: 1; transform: translateY(0); }

/* ============ CAKE ============ */
.cake-sec { padding: clamp(70px, 11vw, 130px) 0; text-align: center; background: var(--ink2); }
.cake-stage { display: flex; justify-content: center; align-items: flex-end; min-height: 300px; margin: 40px 0 6px; }
.cake { position: relative; width: 230px; height: 230px; cursor: pointer; outline: none; }
.cake .plate { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 270px; height: 26px; background: radial-gradient(ellipse at center, #efe2cf, #c9b89c); border-radius: 50%; box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.6); }
.cake .layer { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 14px 14px 8px 8px; }
.cake .layer.bottom { bottom: 18px; width: 200px; height: 96px; background: linear-gradient(180deg, #8a4a2f, #6f3a24); box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.25); }
.cake .layer.top { bottom: 104px; width: 170px; height: 64px; background: linear-gradient(180deg, #9a5436, #7c4127); }
.cake .icing { position: absolute; left: 50%; transform: translateX(-50%); bottom: 150px; width: 174px; height: 30px; background: linear-gradient(180deg, #fff3e3, #f6dcc0); border-radius: 16px 16px 50% 50%; box-shadow: 0 6px 0 -2px #f6dcc0; }
.cake .icing::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -8px; height: 16px; background: radial-gradient(circle at 12px -2px, #fff3e3 9px, transparent 10px) 0 0 / 24px 18px repeat-x; }
.cake .candles { position: absolute; left: 50%; transform: translateX(-50%); bottom: 168px; display: flex; gap: 16px; z-index: 3; }
.candle { position: relative; width: 8px; height: 46px; border-radius: 3px; background: repeating-linear-gradient(45deg, var(--rose) 0 6px, #fff 6px 12px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.flame { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); width: 16px; height: 24px; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; background: radial-gradient(ellipse at 50% 75%, #fff8c4 0%, #ffd23e 35%, #ff9a1f 70%, #ff6a00 100%); box-shadow: 0 0 18px 6px rgba(255, 160, 40, 0.6); transform-origin: 50% 90%; animation: flicker 0.18s infinite alternate; transition: opacity .5s ease, transform .5s ease; }
.flame::before { content: ''; position: absolute; inset: 0; top: 30%; margin: auto; width: 7px; height: 11px; border-radius: 50%; background: radial-gradient(ellipse at 50% 70%, #7fb2ff 0%, rgba(127, 178, 255, 0) 70%); }
.candle:nth-child(2) .flame { animation-duration: 0.22s; }
.candle:nth-child(3) .flame { animation-duration: 0.16s; }
.candle:nth-child(4) .flame { animation-duration: 0.2s; }
.candle:nth-child(5) .flame { animation-duration: 0.24s; }
@keyframes flicker { from { transform: translateX(-50%) scaleY(1) rotate(-2deg); } to { transform: translateX(-52%) scaleY(1.12) rotate(2deg); } }
.cake.out .flame { opacity: 0; transform: translateX(-50%) scaleY(0.1); box-shadow: none; }
.candle::after { content: ''; position: absolute; top: -20px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: rgba(220, 220, 220, 0.0); transform: translateX(-50%); }
.cake.out .candle::after { animation: smoke 1.4s ease-out forwards; }
@keyframes smoke { 0% { opacity: 0.5; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-30%, -40px) scale(2.6); background: rgba(200, 200, 200, 0.25); } }

.cake-done { font-family: var(--serif); font-weight: 900; font-size: clamp(26px, 4vw, 44px); background: linear-gradient(180deg, #fff5e0, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; transform: translateY(10px) scale(0.96); transition: .5s cubic-bezier(.2, .9, .3, 1.3); pointer-events: none; margin-top: 8px; min-height: 1.2em; }
.cake-done.show { opacity: 1; transform: translateY(0) scale(1); }
#relight { margin-top: 18px; }

/* ============ WISHES ============ */
.wishes { padding: clamp(70px, 11vw, 130px) 0; background: var(--ink); }
.wish-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.wish-grid li { background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(244, 233, 219, 0.1); border-radius: 14px; padding: 18px 18px 18px 48px; position: relative; font-size: 15.5px; color: rgba(244, 233, 219, 0.9); }
.wish-grid li::before { content: counter(w); counter-increment: w; position: absolute; left: 16px; top: 16px; font-family: var(--serif); font-weight: 900; font-size: 18px; color: var(--gold); }
.wish-grid { counter-reset: w; }

/* ============ FOOTER ============ */
.foot { background: linear-gradient(180deg, var(--ink), #0d0907); text-align: center; padding: clamp(70px, 11vw, 130px) 0 60px; }
.foot-big { font-size: clamp(34px, 6vw, 64px); background: linear-gradient(180deg, #fff5e0, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.foot-sub { color: var(--muted); margin-top: 10px; font-size: 17px; }
.foot-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 30px 0; }
.foot-credit { color: rgba(244, 233, 219, 0.4); font-size: 13px; letter-spacing: 0.1em; margin-top: 20px; }

/* ============ LIGHTBOX ============ */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10, 7, 5, 0.95); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); animation: lbIn .25s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.lb-fig { max-width: 92vw; max-height: 88svh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lb-fig img { max-width: 92vw; max-height: 80svh; width: auto; height: auto; border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9); }
.lb-fig figcaption { color: var(--muted); font-size: 14px; letter-spacing: 0.08em; }
.lb-close { position: absolute; top: 18px; right: 22px; background: none; border: none; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; opacity: 0.8; }
.lb-close:hover { opacity: 1; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; width: 54px; height: 54px; border-radius: 50%; font-size: 30px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lb-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }

/* ============ REVEAL ============ */
.reveal { transition: opacity .8s ease, transform .8s cubic-bezier(.2, .8, .2, 1); }
.js .reveal { opacity: 0; transform: translateY(28px); }
.reveal.in { opacity: 1; transform: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 18px; }
  .eyebrow { letter-spacing: 0.14em; font-size: 11px; }
  .hero-sub { font-size: 16px; }
  .masonry { columns: 2 160px; column-gap: 12px; }
  .masonry .cell { margin-bottom: 12px; border-radius: 11px; }
  .lb-nav { width: 44px; height: 44px; font-size: 24px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .hero h1 .big { filter: drop-shadow(0 10px 24px rgba(243, 182, 74, 0.3)); }
}
@media (max-width: 400px) { .masonry { columns: 2 130px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-slides .slide { animation: none; opacity: 1; }
  .hero-slides .slide:not(:first-child) { display: none; }
  .balloon, .scroll-cue span, .flame { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
