/* ==========================================================================
   Happy Birthday, Sunday Lalbiaknia — Siruk
   1. Tokens & themes      6. Horn meter          11. Terminal
   2. Base & utilities     7. Ugly meter           12. Footer
   3. Loader & backdrop    8. Gallery              13. Lightbox & toast
   4. Nav                  9. Timeline             14. Responsive
   5. Hero + stats        10. Quiz & wishes       15. Reduced motion
   ========================================================================== */

/* ─────────────────────────── 1. TOKENS & THEMES ────────────────────────── */
:root {
  --green: #8be04e;
  --green-dk: #5aa32c;
  --pink: #ff3d81;
  --purple: #a855f7;
  --cyan: #4cc9f0;
  --yellow: #ffd23f;

  --bg: #07070c;
  --bg-2: #0c0c15;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.12);
  --line-2: rgba(255, 255, 255, 0.22);
  --text: #f4f4f8;
  --muted: #a2a2b8;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.9);
  --shadow-hard: 6px 6px 0 var(--line-2);

  --font-display: 'Bungee', 'Arial Black', sans-serif;
  --font-meme: 'Anton', 'Arial Black', sans-serif;
  --font-body: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', cursive;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --maxw: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme='day'] {
  --bg: #f4f2ec;
  --bg-2: #ffffff;
  --surface: rgba(15, 15, 25, 0.035);
  --surface-2: rgba(15, 15, 25, 0.06);
  --line: rgba(15, 15, 25, 0.14);
  --line-2: rgba(15, 15, 25, 0.26);
  --text: #12121c;
  --muted: #55556b;
  --shadow: 0 18px 44px -20px rgba(15, 15, 25, 0.4);
  --shadow-hard: 6px 6px 0 var(--line-2);
}

/* the hero title is gradient-clipped text, so it needs its own light-mode ramp.
   background-image (not the shorthand) so background-clip: text survives. */
[data-theme='day'] .glitch {
  background-image: linear-gradient(180deg, #1a1a28 35%, #4a4a68 100%);
}

/* ───────────────────────────── 2. BASE & UTILITIES ─────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  background: var(--surface-2);
  padding: 0.15em 0.45em;
  border-radius: 6px;
  font-size: 0.9em;
}

::selection { background: var(--pink); color: #fff; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--green); color: #06210a; padding: 12px 20px;
  border-radius: 0 0 var(--r-sm) 0; font-weight: 700;
}
.skip:focus { left: 0; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--green);
  font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(139, 224, 78, 0.7);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 12px rgba(139, 224, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 224, 78, 0); }
}

/* buttons */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); border-color: var(--line-2); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn--primary {
  --btn-bg: linear-gradient(135deg, var(--green), #b6f06a);
  --btn-fg: #06210a;
  border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(139, 224, 78, 0.9);
}
.btn--primary:hover { box-shadow: 0 16px 34px -12px rgba(139, 224, 78, 1); }
.btn--ghost { background: var(--surface); }
.btn--party {
  --btn-bg: linear-gradient(135deg, var(--pink), var(--purple));
  --btn-fg: #fff;
  border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(255, 61, 129, 0.9);
}
.btn--horn {
  --btn-bg: linear-gradient(135deg, var(--yellow), #ff9f1c);
  --btn-fg: #2a1400;
  border-color: transparent;
  box-shadow: 0 10px 26px -12px rgba(255, 210, 63, 0.9);
}

/* section scaffold */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 96px 22px;
  position: relative;
}
.section__head { max-width: 640px; margin-bottom: 40px; }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.4vw, 3.2rem);
  line-height: 1.02;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section__sub { margin: 0; color: var(--muted); font-size: 1.02rem; }

/* reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ───────────────────────── 3. LOADER & BACKDROP ───────────────────────── */
.loader {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { width: min(420px, 86vw); text-align: center; }
.loader__headshot {
  width: 118px; height: 118px; margin: 0 auto 22px;
  border-radius: 50%; overflow: hidden;
  border: 3px solid var(--green);
  box-shadow: 0 0 0 8px rgba(139, 224, 78, 0.12);
  animation: bob 1.6s var(--ease) infinite;
}
.loader__headshot img { width: 100%; height: 100%; object-fit: cover; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(3deg); } }
.loader__label { font-family: var(--font-display); font-size: 1rem; margin: 0 0 16px; }
.dots i { animation: blink 1.4s infinite; font-style: normal; }
.dots i:nth-child(2) { animation-delay: 0.2s; }
.dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }
.loader__bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.loader__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--cyan));
  border-radius: 99px; transition: width 0.3s var(--ease);
}
.loader__msg { margin: 14px 0 0; font-size: 0.82rem; color: var(--muted); min-height: 1.2em; }

#confetti {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 900;
}
.starfield {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(900px 520px at 10% 8%, rgba(139, 224, 78, 0.14), transparent 60%),
    radial-gradient(700px 700px at 50% 110%, rgba(255, 61, 129, 0.12), transparent 60%),
    var(--bg);
}
.grain {
  position: fixed; inset: -50%; z-index: 800; pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.6s steps(3) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-4%, 3%); }
  66% { transform: translate(3%, -3%); }
  100% { transform: translate(0, 0); }
}

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 700;
  background: transparent;
}
.scroll-progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink));
  transition: width 0.1s linear;
}

/* floating headshot that drifts around the page */
.sprinkler {
  position: fixed; z-index: 690; left: 24px; bottom: 24px;
  width: 66px; height: 66px; border-radius: 50%;
  overflow: visible; pointer-events: none;
  opacity: 0; transform: scale(0.6);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.sprinkler.is-on { opacity: 1; transform: none; }
.sprinkler img {
  width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--green);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.8);
  animation: bob 3.4s var(--ease) infinite;
}
.sprinkler__bubble {
  position: absolute; left: 78px; top: 50%; transform: translateY(-50%);
  background: var(--text); color: var(--bg);
  padding: 6px 12px; border-radius: var(--r-pill);
  font-size: 0.78rem; font-weight: 700; white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ──────────────────────────────── 4. NAV ──────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 600;
  display: flex; align-items: center; gap: 18px;
  padding: 12px clamp(16px, 4vw, 40px);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, padding 0.3s, background 0.3s;
}
.nav.is-stuck { border-bottom-color: var(--line); padding-top: 8px; padding-bottom: 8px; }
.nav__brand { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.nav__brand img { border-radius: 8px; }
.nav__brandtext { font-family: var(--font-display); letter-spacing: 0.02em; }
.nav__sep { color: var(--green); }
.nav__page { color: var(--muted); font-size: 0.85rem; font-family: ui-monospace, monospace; }
.nav__links { display: flex; gap: 4px; margin-left: auto; }
.nav__links a {
  padding: 7px 12px; border-radius: var(--r-pill);
  font-size: 0.85rem; font-weight: 600; color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface-2); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1rem;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform 0.18s var(--ease), background 0.2s;
}
.iconbtn:hover { transform: translateY(-2px) scale(1.06); background: var(--surface-2); }
.iconbtn .iconbtn__off { display: none; }
.iconbtn[aria-pressed='false'] .iconbtn__on { display: none; }
.iconbtn[aria-pressed='false'] .iconbtn__off { display: inline; }
.nav__burger { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.nav__burger span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.25s; }
.nav__burger[aria-expanded='true'] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav__burger[aria-expanded='true'] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded='true'] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ────────────────────────── 5. HERO & STATS ───────────────────────────── */
.hero { position: relative; padding: 140px 22px 0; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(900px 520px at 78% 18%, rgba(139, 224, 78, 0.16), transparent 62%),
              radial-gradient(700px 500px at 12% 8%, rgba(255, 61, 129, 0.14), transparent 62%);
}
.hero__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(24px, 5vw, 60px); align-items: center;
}
.hero__kicker {
  display: block; font-family: var(--font-hand); font-size: clamp(1.5rem, 3.2vw, 2.3rem);
  color: var(--green); font-weight: 700; line-height: 1;
  transform: rotate(-2deg); margin-bottom: 2px;
}
.hero__title {
  font-family: var(--font-meme);
  font-size: clamp(3rem, 11vw, 7.4rem);
  line-height: 0.86; margin: 0 0 18px;
  letter-spacing: 0.005em;
}
.glitch {
  position: relative; display: block;
  background: linear-gradient(180deg, #fff 30%, #cfcfe0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  background: inherit; -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; pointer-events: none;
}
.glitch::before { text-shadow: 3px 0 var(--pink); }
.glitch::after { text-shadow: -3px 0 var(--cyan); }
.hero__title:hover .glitch::before { animation: gl1 0.5s steps(2) infinite; opacity: 0.85; }
.hero__title:hover .glitch::after { animation: gl2 0.5s steps(2) infinite; opacity: 0.85; }
@keyframes gl1 { 0% { transform: translate(2px, -1px); } 50% { transform: translate(-3px, 1px); } 100% { transform: translate(2px, -1px); } }
@keyframes gl2 { 0% { transform: translate(-2px, 1px); } 50% { transform: translate(3px, -1px); } 100% { transform: translate(-2px, 1px); } }

.hero__role { color: var(--muted); margin: 0 0 10px; font-size: 1rem; }
.hero__role strong { color: var(--green); }
.hero__tagline {
  font-family: var(--font-hand); font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  color: var(--yellow); margin: 0 0 26px; min-height: 1.6em;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 34px; }

.countdown {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 20px 12px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.countdown__unit { display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.countdown__unit b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; }
.countdown__unit span { font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.countdown__note {
  flex-basis: 100%; margin: 4px 0 0; text-align: center;
  font-size: 0.78rem; color: var(--muted);
}
.countdown.is-today {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink), 0 18px 50px -18px rgba(255, 61, 129, 0.8);
  animation: todayGlow 2.2s ease-in-out infinite;
}
.countdown.is-today .countdown__note { color: var(--pink); font-weight: 700; }
@keyframes todayGlow {
  50% { box-shadow: 0 0 0 4px rgba(255, 61, 129, 0.25), 0 18px 50px -18px rgba(255, 61, 129, 0.9); }
}

/* portrait */
.hero__portrait { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.portrait { position: relative; width: min(380px, 84vw); }
.portrait__frame {
  position: relative; border-radius: 22px; overflow: hidden;
  background: var(--surface-2);
  border: 3px solid var(--line-2);
  box-shadow: var(--shadow);
  transform: rotate(2.2deg);
  transition: transform 0.5s var(--ease);
}
.portrait:hover .portrait__frame { transform: rotate(0deg) scale(1.02); }
.portrait__frame img { width: 100%; display: block; }
.portrait__px {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.portrait__tag {
  position: absolute; left: 14px; bottom: 14px;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  padding: 4px 12px; border-radius: var(--r-pill);
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  backdrop-filter: blur(6px);
}
.portrait__sticker {
  position: absolute;
  padding: 7px 14px; border-radius: var(--r-pill);
  font-weight: 800; font-size: 0.82rem;
  background: var(--green); color: #06210a;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.9);
  animation: float 5s var(--ease) infinite;
}
.portrait__sticker--1 { top: 6%; left: -18px; transform: rotate(-9deg); background: var(--yellow); color: #2a1400; }
.portrait__sticker--2 { top: 32%; right: -22px; transform: rotate(8deg); background: var(--cyan); color: #04212c; }
.portrait__sticker--3 { bottom: 26%; left: -24px; transform: rotate(6deg); background: var(--pink); color: #fff; animation-delay: -1.4s; }
.portrait__sticker--4 { bottom: 6%; right: -14px; transform: rotate(-7deg); animation-delay: -2.6s; }
@keyframes float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}
.portrait__shake {
  font-size: 0.8rem; color: var(--muted); font-weight: 700;
  border: 1px dashed var(--line-2); border-radius: var(--r-pill); padding: 6px 14px;
  transition: 0.2s;
}
.portrait__shake:hover { color: var(--text); border-color: var(--green); }
.portrait.is-shaking { animation: shake 0.5s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-1deg); }
  40% { transform: translateX(7px) rotate(1deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}

/* marquee */
.hero__marquee {
  margin-top: 70px; padding: 12px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; background: var(--surface);
}
.marquee__track { display: flex; width: max-content; animation: slide 26s linear infinite; }
.marquee__track span {
  font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0.06em;
  color: var(--muted); padding-right: 2rem; white-space: nowrap;
}
@keyframes slide { to { transform: translateX(-50%); } }

/* stats */
.stats-section { padding-top: 56px; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}
.stat {
  padding: 22px 18px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  text-align: center; transition: transform 0.25s var(--ease), border-color 0.25s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--green); }
.stat__value { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1; color: var(--green); }
.stat__label { margin-top: 8px; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.04em; }

/* ───────────────────────────── 6. ROAST MACHINE ────────────────────────── */
.roastbox {
  display: grid; grid-template-columns: 200px 1fr; gap: 26px;
  padding: clamp(20px, 3vw, 32px);
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--surface), transparent 70%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.roastbox__face {
  position: relative; border-radius: var(--r-md); overflow: hidden;
  border: 2px solid var(--line-2); aspect-ratio: 1; align-self: start;
}
.roastbox__face img { width: 100%; height: 100%; object-fit: cover; }
.roastbox__mood {
  position: absolute; inset: auto 0 0 0; padding: 8px; text-align: center;
  font-size: 1.6rem; background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}
.roastbox__face.is-hurt { animation: shake 0.45s; }
.roastbox__output {
  min-height: 132px; display: flex; align-items: center;
  font-family: var(--font-meme); font-size: clamp(1.25rem, 3vw, 2.05rem);
  line-height: 1.22; letter-spacing: 0.01em;
  padding: 18px 20px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px dashed var(--line-2);
}
.roastbox__output.is-nice { border-color: var(--green); }
.roastbox__placeholder { font-family: var(--font-body); font-size: 1rem; color: var(--muted); font-weight: 400; }
.roastbox__placeholder em { color: var(--green); }
.roastbox__cursor { display: inline-block; width: 3px; height: 1em; background: var(--green); vertical-align: -0.12em; animation: caret 0.7s steps(2) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.roastbox__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.roastbox__count { margin-left: auto; font-size: 0.8rem; color: var(--muted); }
.roastbox__count b { color: var(--pink); font-family: var(--font-display); }

/* ─────────────────────────── 7. HORN-O-METER ───────────────────────────── */
.meter {
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.meter__head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.meter__readout { display: flex; align-items: baseline; gap: 2px; }
.meter__readout b { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.6rem); line-height: 1; color: var(--yellow); }
.meter__readout span { color: var(--muted); font-weight: 700; }
.meter__label strong { display: block; font-family: var(--font-display); font-size: 1.15rem; color: var(--pink); }
.meter__label span { color: var(--muted); font-size: 0.9rem; }

.meter__track { position: relative; height: 44px; }
.meter__track input[type='range'] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-appearance: none; appearance: none; background: transparent; margin: 0; z-index: 2;
}
.meter__fill {
  position: absolute; left: 0; top: 12px; height: 20px; width: 50%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--green), var(--yellow) 45%, var(--pink) 78%, var(--purple));
  box-shadow: 0 0 24px -4px rgba(255, 61, 129, 0.7);
  transition: width 0.08s linear;
}
.meter__track::before {
  content: ''; position: absolute; left: 0; right: 0; top: 12px; height: 20px;
  border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line);
}
.meter__ticks { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.meter__ticks i { width: 2px; height: 10px; background: var(--line-2); border-radius: 2px; }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 4px solid var(--pink);
  box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.8);
  cursor: grab;
}
input[type='range']::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.1); }
input[type='range']::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 4px solid var(--pink); cursor: grab;
}
.meter__foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.meter__hint { margin: 0; font-size: 0.82rem; color: var(--muted); }
.meter__foot .btn--horn.is-looping { animation: throb 0.7s infinite; }
@keyframes throb { 50% { transform: scale(1.06); } }

/* ─────────────────────────── 8. UGLY-O-METER ───────────────────────────── */
.ugly { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(20px, 4vw, 40px); align-items: center; }
.ugly__viewer { position: relative; max-width: 360px; }
.ugly__frame {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  border: 3px solid var(--line-2); box-shadow: var(--shadow);
  background: var(--surface-2);
  aspect-ratio: 4 / 5;
}
.ugly__frame img,
.ugly__px {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: filter 0.15s linear;
}
.ugly__px {
  position: absolute; inset: 0;
  image-rendering: pixelated; opacity: 0; pointer-events: none;
}
.ugly__scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(transparent 0 3px, rgba(0, 0, 0, 0.16) 3px 4px);
  mix-blend-mode: multiply; opacity: 0.5;
}
.ugly__readout {
  margin-top: 14px; display: flex; align-items: baseline; gap: 8px; justify-content: center;
}
.ugly__readout b { font-family: var(--font-display); font-size: 2rem; color: var(--pink); }
.ugly__readout span { color: var(--muted); font-weight: 700; }

/* viewfinder HUD */
.ugly__hud {
  position: absolute; inset: 12px 12px auto; pointer-events: none;
  display: flex; align-items: center; gap: 8px;
  font-family: ui-monospace, monospace; font-size: 0.62rem; letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.ugly__hudrec {
  width: 7px; height: 7px; border-radius: 50%; background: #ff3d81;
  box-shadow: 0 0 8px #ff3d81;
  animation: blink 1.1s steps(2) infinite;
}
.ugly__hudval { margin-left: auto; color: var(--yellow); }
.ugly__cross {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(50% - 1px), rgba(255, 255, 255, 0.16) 50%, transparent calc(50% + 1px)),
    linear-gradient(to bottom, transparent calc(50% - 1px), rgba(255, 255, 255, 0.16) 50%, transparent calc(50% + 1px));
}

/* live spec readout */
.ugly__specs {
  margin: 26px 0 0; padding: 16px 18px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 18px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-2);
}
.ugly__spec { display: flex; flex-direction: column; gap: 2px; }
.ugly__spec dt { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.ugly__spec dd {
  margin: 0; font-family: ui-monospace, monospace; font-size: 0.92rem;
  font-weight: 700; color: var(--green);
}
.ugly__spec--wide { grid-column: 1 / -1; }
.ugly__spec--wide dd { color: var(--yellow); }
.ugly__slider { display: block; }
.ugly__slider span { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.1em; text-transform: uppercase; }
.ugly__slider input[type='range'] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; border-radius: 99px; margin: 0;
  background: linear-gradient(90deg, var(--green), var(--yellow), var(--pink), var(--purple));
}
.ugly__slider input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  border: 4px solid var(--purple); cursor: grab; box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.7);
}
.ugly__slider input[type='range']::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  border: 4px solid var(--purple); cursor: grab;
}
.ugly__comment {
  font-family: var(--font-hand); font-size: 1.5rem; color: var(--yellow);
  margin: 18px 0 22px; min-height: 2em;
}
.ugly__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ────────────────────────────── 9. GALLERY ─────────────────────────────── */
.gallery {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  grid-auto-rows: 220px;
}
.gcard {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; text-align: left; padding: 0;
  min-height: 0; min-width: 0;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.gcard:hover { transform: translateY(-5px); border-color: var(--green); box-shadow: var(--shadow); }
.gcard--wide { grid-column: span 2; }
.gcard--tall { grid-row: span 2; }
.gcard--square { grid-column: span 1; grid-row: span 1; }
.gcard img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), filter 0.4s; }
.gcard:hover img { transform: scale(1.07); filter: saturate(1.1); }
.gcard__veil {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 32%, rgba(0, 0, 0, 0.88) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px; gap: 6px;
}
.gcard__badge {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.14em;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--green); color: #06210a;
}
.gcard__badge--team { background: var(--cyan); color: #04212c; }
.gcard__title { font-family: var(--font-display); font-size: 1.05rem; color: #fff; }
.gcard__occasion { font-size: 0.82rem; color: rgba(255, 255, 255, 0.75); line-height: 1.45; }

/* ───────────────────────────── 10. TIMELINE ────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0 0 0 30px; position: relative; }
.timeline::before {
  content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--green), var(--pink));
  opacity: 0.5;
}
.tl {
  position: relative; margin-bottom: 14px; border-radius: var(--r-md);
  border: 1px solid transparent; transition: 0.25s;
}
.tl::before {
  content: ''; position: absolute; left: -30px; top: 20px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--green);
  transition: 0.25s;
}
.tl.is-open::before { background: var(--pink); border-color: var(--pink); box-shadow: 0 0 0 6px rgba(255, 61, 129, 0.18); }
.tl__btn {
  width: 100%; display: flex; align-items: center; gap: 16px; text-align: left;
  padding: 16px 20px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line);
  transition: 0.25s;
}
.tl__btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.tl__year { font-family: var(--font-display); font-size: 1.05rem; color: var(--green); min-width: 82px; }
.tl__title { font-weight: 700; flex: 1; }
.tl__plus { color: var(--muted); font-size: 1.2rem; transition: transform 0.3s var(--ease); }
.tl.is-open .tl__plus { transform: rotate(45deg); color: var(--pink); }
.tl__body {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.45s var(--ease), opacity 0.3s, padding 0.3s;
  padding: 0 20px;
  color: var(--muted); font-size: 0.94rem;
}
.tl.is-open .tl__body { max-height: 220px; opacity: 1; padding: 4px 20px 20px 118px; }

/* ─────────────────────── 11. QUIZ & WISH WALL ─────────────────────────── */
.quiz {
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--r-lg); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
}
.quiz__progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
.quiz__progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--pink)); transition: width 0.4s var(--ease); }
.quiz__count { margin: 0 0 6px; font-size: 0.78rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.quiz__q { font-family: var(--font-display); font-size: clamp(1.15rem, 2.6vw, 1.6rem); margin: 0 0 20px; line-height: 1.2; }
.quiz__options { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.qopt {
  padding: 15px 18px; border-radius: var(--r-md); text-align: left;
  background: var(--bg-2); border: 1px solid var(--line);
  font-weight: 600; transition: 0.2s var(--ease);
}
.qopt:hover:not(:disabled) { border-color: var(--green); transform: translateX(4px); }
.qopt:disabled { cursor: default; opacity: 0.65; }
.qopt.is-right { border-color: var(--green); background: rgba(139, 224, 78, 0.14); opacity: 1; }
.qopt.is-wrong { border-color: var(--pink); background: rgba(255, 61, 129, 0.14); opacity: 1; }
.quiz__why { margin: 18px 0 0; color: var(--yellow); font-family: var(--font-hand); font-size: 1.25rem; min-height: 1.4em; }
.quiz__resulthead { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.quiz__resulthead img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 3px solid var(--green); }
.quiz__resulthead h3 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 6px; }
.quiz__resulthead p { margin: 0; color: var(--muted); }
.quiz__resultactions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.wishform {
  display: grid; gap: 12px; grid-template-columns: 1fr 2fr auto;
  align-items: start; margin-bottom: 26px;
}
.wishform input, .wishform textarea {
  padding: 13px 16px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--line);
  resize: vertical; transition: border-color 0.2s;
}
.wishform input:focus, .wishform textarea:focus { border-color: var(--green); outline: none; }
.wishes { columns: 3 260px; column-gap: 16px; }
.wish {
  break-inside: avoid; margin-bottom: 16px; padding: 18px;
  border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); position: relative;
  box-shadow: 0 10px 26px -18px rgba(0, 0, 0, 0.9);
  transition: transform 0.25s var(--ease), border-color 0.25s;
}
.wish:hover { transform: rotate(-0.7deg) translateY(-3px); border-color: var(--green); }
.wish__text { margin: 0 0 12px; font-size: 0.95rem; }
.wish__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wish__name { font-weight: 700; font-size: 0.84rem; color: var(--green); }
.wish__like {
  display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem;
  color: var(--muted); padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line); transition: 0.2s;
}
.wish__like:hover { color: var(--pink); border-color: var(--pink); }
.wish__like.is-liked { color: var(--pink); border-color: var(--pink); background: rgba(255, 61, 129, 0.12); }

/* ───────────────────────────── 12. TERMINAL ────────────────────────────── */
.term {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line-2);
  background: #05050a; box-shadow: var(--shadow);
}
[data-theme='day'] .term { background: #0a0a12; }
.term__bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #cfcfdd; font-size: 0.8rem;
}
.term__dots { display: flex; gap: 6px; }
.term__dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__dots i:nth-child(2) { background: #febc2e; }
.term__dots i:nth-child(3) { background: #28c840; }
.term__title { font-family: ui-monospace, monospace; }
.term__clear { margin-left: auto; color: #9a9ab0; font-size: 0.75rem; font-family: ui-monospace, monospace; }
.term__clear:hover { color: #fff; }
.term__out {
  height: 340px; overflow-y: auto; padding: 18px;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.86rem; line-height: 1.7; color: #d6d6e6;
  white-space: pre-wrap; word-break: break-word;
}
.term__out .t-echo { color: #8be04e; }
.term__out .t-err { color: #ff6b9d; }
.term__out .t-dim { color: #6e6e85; }
.term__out .t-hi { color: #ffd23f; }
.term__out .t-cy { color: #4cc9f0; }
.term__in { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.term__prompt { font-family: ui-monospace, monospace; font-size: 0.86rem; color: #8be04e; white-space: nowrap; }
.term__in input {
  flex: 1; background: none; border: 0; outline: none;
  font-family: ui-monospace, monospace; font-size: 0.86rem; color: #fff;
}

/* ─────────────────────────────── 13. FOOTER ────────────────────────────── */
.footer { border-top: 1px solid var(--line); padding: 56px 22px 80px; position: relative; }
.footer__in { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 26px; }
.footer__brand { display: flex; align-items: center; gap: 14px; }
.footer__name { margin: 0; font-family: var(--font-display); font-size: 1.05rem; }
.footer__motto { margin: 4px 0 0; color: var(--muted); font-size: 0.86rem; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer__links a { color: var(--muted); font-size: 0.9rem; border-bottom: 1px solid transparent; transition: 0.2s; }
.footer__links a:hover { color: var(--green); border-bottom-color: var(--green); }
.footer__note { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.7; }
.totop {
  position: fixed; right: 24px; bottom: 24px; z-index: 650;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #06210a; font-size: 1.1rem; font-weight: 800;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.9);
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: 0.3s var(--ease);
}
.totop.is-on { opacity: 1; pointer-events: auto; transform: none; }
.totop:hover { transform: translateY(-3px); }

/* ──────────────────── 14. LIGHTBOX, TOAST, MISC ────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 950;
  display: grid; place-items: center; padding: 24px;
  background: rgba(3, 3, 8, 0.92); backdrop-filter: blur(8px);
  animation: fade 0.25s var(--ease);
}
.lightbox[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.lightbox__fig { margin: 0; max-width: min(900px, 92vw); }
.lightbox__fig img {
  width: 100%; max-height: 72vh; object-fit: contain;
  border-radius: var(--r-md); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -30px #000;
}
.lightbox__fig figcaption { margin-top: 16px; display: flex; flex-direction: column; gap: 6px; }
.lightbox__fig b { font-family: var(--font-display); font-size: 1.1rem; }
.lightbox__fig span { color: var(--muted); font-size: 0.9rem; }
.lightbox__close {
  position: fixed; top: 22px; right: 22px; width: 42px; height: 42px;
  border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 1rem; color: #fff;
}
.lightbox__close:hover { background: var(--pink); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 990;
  transform: translate(-50%, 30px);
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--text); color: var(--bg);
  font-weight: 700; font-size: 0.88rem;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.9);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.floating-emoji {
  position: fixed; z-index: 880; pointer-events: none;
  font-size: 1.7rem; animation: floatUp 1.9s var(--ease) forwards;
}
@keyframes floatUp {
  to { transform: translate(var(--dx, 0), -180px) rotate(var(--rot, 20deg)); opacity: 0; }
}

/* ────────────────────────────── 14b. RESPONSIVE ────────────────────────── */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__cta, .countdown { justify-content: center; }
  .hero__cta { flex-wrap: wrap; }
  .portrait__sticker--1 { left: -6px; }
  .portrait__sticker--2 { right: -6px; }
  .portrait__sticker--3 { left: -8px; }
  .portrait__sticker--4 { right: -4px; }
  .roastbox { grid-template-columns: 1fr; }
  .roastbox__face { width: 160px; }
  .ugly { grid-template-columns: 1fr; }
  .wishform { grid-template-columns: 1fr; }
  .nav__links {
    position: fixed; inset: 60px 0 auto; flex-direction: column; gap: 0;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    border-bottom: 1px solid var(--line);
    padding: 10px 22px 18px;
    transform: translateY(-120%); transition: transform 0.35s var(--ease);
  }
  .nav__links.is-open { transform: none; }
  .nav__links a { padding: 12px 4px; font-size: 1rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav__burger { display: flex; }
  .nav__page { display: none; }
  .gcard--wide { grid-column: span 1; }
  .gcard--tall { grid-row: span 1; }
  .gallery { grid-auto-rows: 240px; }
}

@media (max-width: 620px) {
  .section { padding: 68px 18px; }
  .hero { padding-top: 112px; }
  .countdown { width: 100%; justify-content: space-between; }
  .countdown__unit { min-width: 46px; }
  .roastbox__output { font-size: 1.15rem; min-height: 160px; }
  .wishes { columns: 1; }
  .tl__body, .tl.is-open .tl__body { padding-left: 20px; }
  .sprinkler { width: 54px; height: 54px; left: 14px; bottom: 76px; }
  .sprinkler__bubble { left: 64px; }
}

/* ──────────────────────── 15. REDUCED MOTION ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .grain { display: none; }
}
