/* SALUTE! születésnapi kisfilm (Blenderben renderelt videó + HTML-feliratok). A tokenek a salute.css-szel egyeznek. */

:root {
  --bg: #0B0907;
  --kraft: #B88658;
  --kraft-hi: #D9AE7C;
  --kraft-ink: #2A1E12;
  --crema: #F1E9DA;
  --soft: #C2B7A5;
  --f-display: 'Marcellus', 'Trajan Pro', Georgia, serif;
  --f-script: 'Pinyon Script', 'Snell Roundhand', cursive;
  --f-text: 'Albert Sans', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100svh; overflow: hidden; background: var(--bg);
  color: var(--crema); font-family: var(--f-text); -webkit-font-smoothing: antialiased;
}
body.is-done { overflow-y: auto; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- a film: teljes képernyő, mögötte marad görgetéskor ---------- */

.film { position: fixed; inset: 0; overflow: hidden; background: var(--bg); }
.film-video, .film-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film-poster { opacity: 0; transition: opacity .6s; }
.show-poster .film-poster { opacity: 1; }
/* olvashatóság: a felirat oldalán sötétedik a kép, csak a végén */
.film-shade { position: absolute; inset: 0; opacity: 0; transition: opacity 1.6s ease;
  background: linear-gradient(to top, rgba(8, 6, 5, .94) 0%, rgba(8, 6, 5, .72) 38%, rgba(8, 6, 5, 0) 62%); }
.is-revealed .film-shade { opacity: 1; }
/* filmszemcse és sötétedő sarkok */
.film-grain { position: absolute; inset: -50%; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain .5s steps(4) infinite; }
.film::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, .55) 100%); }
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } 100% { transform: translate(1%, 3%); } }

/* ---------- feliratok: állón alul, fekvőn jobbra (a film ott hagy helyet) ---------- */

.bday {
  position: relative; z-index: 2; min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding: 50svh 22px max(28px, env(safe-area-inset-bottom)); text-align: center;
  visibility: hidden; pointer-events: none;
}
.is-revealed .bday { visibility: visible; pointer-events: auto; }
.bday-inner { width: 100%; max-width: 34rem; }
.bday p { margin: 0; }
.bday-inner > * { opacity: 0; transform: translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.is-revealed .bday-inner > * { opacity: 1; transform: none; }
.is-revealed .bday-inner > :nth-child(2) { transition-delay: .25s; }
.is-revealed .bday-inner > :nth-child(3) { transition-delay: .7s; }
.is-revealed .bday-inner > :nth-child(4) { transition-delay: 1.3s; }
.is-revealed .bday-inner > :nth-child(5) { transition-delay: 1.6s; }
.is-revealed .bday-inner > :nth-child(6) { transition-delay: 2.1s; }
.is-revealed .bday-inner > :nth-child(7) { transition-delay: 2.6s; }

.bday-kicker { font-size: .75rem; letter-spacing: .24em; text-transform: uppercase; color: var(--kraft-hi); font-weight: 600; }
.bday-script {
  font-family: var(--f-script); font-size: clamp(2.7rem, 9vw, 4.8rem); line-height: 1.15; padding: .05em .15em .1em;
  background: linear-gradient(100deg, #B88658 0%, #E8C38D 30%, #FFF0CF 45%, #E2B67C 60%, #B88658 100%);
  background-size: 220% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  transition: opacity .9s var(--ease), transform .9s var(--ease), background-position 3s ease .6s !important;
}
.is-revealed .bday-script { background-position: 0 0; }
.bday-title { margin: .1em 0 0; font-weight: 400; }
.bday-l1 { display: block; font-family: var(--f-display); font-size: clamp(1.3rem, 3.4vw, 1.9rem); letter-spacing: .03em; line-height: 1.25; }
.bday-logo { display: block; height: clamp(40px, 7vw, 62px); width: auto; margin: .35em auto 0; }
.bday-msg { margin-top: 1.1rem !important; font-size: 1.02rem; line-height: 1.6; color: var(--soft); }
.bday-sig { margin-top: .4rem !important; font-family: var(--f-script); font-size: 1.75rem; color: var(--kraft-hi); }
/* álló képernyőn a pizza alatt kevés a hely: tömörebb üzenet, hogy a gomb is látsszon */
@media (max-aspect-ratio: 1/1) {
  .bday-msg { margin-top: .8rem !important; font-size: .95rem; line-height: 1.5; }
  .bday-actions { margin-top: 1rem; }
}

.bday-actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: center; }
.bday-go {
  display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 26px; border-radius: 999px; border: 0;
  background: var(--kraft); color: var(--kraft-ink); font: 600 1.02rem/1 var(--f-text); text-decoration: none; cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: background .2s, transform .2s var(--ease);
}
.bday-go:hover { background: var(--kraft-hi); transform: translateY(-1px); }
.bday-go:focus-visible, .bday-replay:focus-visible, .gate-mute:focus-visible, .ctl-sound:focus-visible, .ctl-skip:focus-visible, .gate-seen:focus-visible {
  outline: 2px solid var(--crema); outline-offset: 3px;
}
.is-done .bday-actions .bday-go { animation: glow 2.6s ease-in-out infinite 1s; }
@keyframes glow { 50% { box-shadow: 0 0 40px rgba(232, 131, 58, .4), 0 10px 30px rgba(0, 0, 0, .35); } }
.bday-replay {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 6px; border: 0; background: none;
  color: var(--soft); font: 500 .95rem var(--f-text); cursor: pointer;
}
.bday-replay:hover { color: var(--crema); }

.bday-note {
  margin: 1.4rem auto 0; padding: 14px 16px; border: 1px solid rgba(184, 134, 88, .35); border-radius: 12px;
  background: rgba(16, 13, 10, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  text-align: left; font-size: .86rem; line-height: 1.55; color: var(--soft); display: grid; gap: 6px;
}
.bday-note b { color: var(--crema); font-weight: 600; }
.bday-note b::before { content: '🤌 '; }

@media (min-aspect-ratio: 1/1) {
  .film-shade { background: linear-gradient(to left, rgba(8, 6, 5, .9) 0%, rgba(8, 6, 5, .62) 34%, rgba(8, 6, 5, 0) 56%); }
  .bday { justify-content: center; align-items: flex-end; text-align: left; padding: 40px 5vw; }
  .bday-inner { max-width: min(34rem, 44vw); }
  .bday-logo { margin-left: 0; }
  .bday-actions { justify-content: flex-start; }
}
/* alacsony fekvő képernyő (telefon fekve): kisebb betűk */
@media (min-aspect-ratio: 1/1) and (max-height: 560px) {
  .bday-script { font-size: 2.4rem; }
  .bday-msg, .bday-note p:not(:first-child) { display: none; }
}

/* ---------- vezérlők ---------- */

.ctl-sound {
  position: fixed; z-index: 6; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(241, 233, 218, .2); background: rgba(12, 10, 8, .5); color: var(--crema); cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.ctl-sound .i-on { display: none; }
.ctl-sound[aria-pressed="true"] .i-on { display: block; }
.ctl-sound[aria-pressed="true"] .i-off { display: none; }
.ctl-skip {
  position: fixed; z-index: 6; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(241, 233, 218, .16); background: rgba(12, 10, 8, .45);
  color: var(--soft); font: 500 .9rem var(--f-text); cursor: pointer; letter-spacing: .02em;
}
.ctl-skip:hover { color: var(--crema); }

/* ---------- kezdőkép ---------- */

.gate {
  position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px; text-align: center; background: radial-gradient(90% 70% at 50% 42%, #1E1712 0%, #100D0A 60%, #080605 100%);
  transition: opacity 1.1s ease, visibility 1.1s;
}
.gate.is-gone { opacity: 0; visibility: hidden; }
.gate-ember {
  width: 14px; height: 14px; border-radius: 50%; margin-bottom: 18px;
  background: radial-gradient(circle, #FFE3A6 0%, #F49A3E 45%, rgba(196, 80, 42, 0) 75%);
  box-shadow: 0 0 24px 8px rgba(232, 131, 58, .45), 0 0 80px 30px rgba(196, 80, 42, .18);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(1.35); box-shadow: 0 0 34px 12px rgba(232, 131, 58, .55), 0 0 110px 40px rgba(196, 80, 42, .22); } }
.gate-script { margin: 0; font-family: var(--f-script); font-size: clamp(2.4rem, 8vw, 3.6rem); line-height: 1.2; color: var(--kraft-hi); }
.gate-sub { margin: 0 0 14px; color: var(--soft); font-size: 1.02rem; }
.gate-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gate-mute { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--soft); font: 500 .95rem var(--f-text); cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.gate-mute:hover { color: var(--crema); }
.gate-load { min-height: 1.2em; margin: 4px 0 0; font-size: .82rem; color: #9C907E; }
.gate-seen { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); color: var(--soft); font-size: .85rem; text-underline-offset: 4px; padding: 10px; }

@media (prefers-reduced-motion: reduce) {
  .gate-ember, .film-grain, .is-done .bday-actions .bday-go { animation: none; }
  .gate, .bday-inner > * { transition: none; }
}

/* ---------- Messenger-előnézet kép (?og): végkép + felirat, 1200 × 630 ---------- */

.og body { width: 1200px; height: 630px; min-height: 0; }
.og .film { width: 1200px; height: 630px; }
.og .ctl-sound, .og .ctl-skip, .og .gate, .og .bday-msg, .og .bday-sig, .og .bday-actions, .og .bday-note, .og .film-grain { display: none !important; }
.og .bday { min-height: 630px; height: 630px; padding: 40px 56px; justify-content: center; align-items: flex-end; text-align: left; }
.og .bday-inner { max-width: 520px; }
.og .bday-script { font-size: 4.4rem; white-space: nowrap; }
.og .bday-l1 { font-size: 2.2rem; }
.og .bday-logo { height: 72px; margin-left: 0; }
