/* Burger Prof. — Történet oldal (narancs márkatéma, marka.css után).
   Elöl az érzés (fekete kártya, krém szó), hátul a történet (krém kártya, fekete szöveg).
   Méretek: a nagy szavak a kártyához igazodnak (tortenet.js), a cím és a szöveg mérsékelt. */

.story-top { position: sticky; top: 0; z-index: 40; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Nyitás ---------- */
.story-intro { padding: var(--s6) var(--gutter) var(--s4); }
.intro-in { position: relative; max-width: 1120px; margin: 0 auto; min-height: 120px; }
.story-intro h1 { color: var(--cream); font-size: clamp(44px, 12vw, 96px); line-height: 0.95; margin: 0; }
.story-intro .prof-c { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 92px; opacity: 0.28; pointer-events: none; }
.story-intro .prof-c img { width: 100%; height: auto; display: block; }
@media (min-width: 768px) { .story-intro .prof-c { width: 150px; } }

/* ---------- Idővonal ---------- */
.story-wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }
.timeline { list-style: none; margin: 0; padding: var(--s3) 0 var(--s6) 30px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.ch { position: relative; padding: var(--s3) 0; }
.node { position: absolute; left: -30px; top: calc(var(--s3) + 26px); width: 19px; height: 19px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); }
.ch.is-in .node { background: var(--ink); }

/* ---------- Fordítható kártya ---------- */
.flip { display: grid; perspective: 1400px; }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid var(--ink); border-radius: var(--r-md); box-shadow: 6px 6px 0 var(--ink); transition: transform 520ms cubic-bezier(.2,.8,.2,1); }
.front { display: grid; align-content: center; justify-items: center; gap: var(--s2); min-height: 300px; padding: var(--s4) var(--s2); background: var(--ink); color: var(--cream); cursor: pointer; text-align: center; font: inherit; }
.front .ch-no { font-weight: 800; font-size: var(--fs-14); letter-spacing: 0.14em; color: var(--soft-dark); }
.front .word { font-family: var(--font-display); font-size: clamp(40px, 11vw, 76px); line-height: 1; white-space: nowrap; color: var(--cream); }
/* ---------- Smasher-jelenet: a kártya interaktivitása ---------- */
.hint { display: block; line-height: 0; }
.stage { display: block; overflow: visible; filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
.stage .smasher, .stage .ball, .stage .patty, .stage .steam, .stage .glow { transform-box: fill-box; }
.stage .ball { transform-origin: 50% 100%; }
.stage .patty { transform-origin: 50% 100%; opacity: 0; transform: scaleX(.5); }
.stage .steam { opacity: 0; }
.stage .cheese { opacity: 0; transform-box: fill-box; transform-origin: 50% 100%; }
.stage .glow { transform-origin: 50% 50%; }
/* Várakozás: a lap kicsit emelkedik-süllyed, néha „megcélozza” a golyót, alatta izzik a lap */
.js .ch.is-in .flip:not(.smashed) .stage .smasher { animation: tease 2.8s cubic-bezier(.45,0,.25,1) 300ms infinite; }
.js .ch.is-in .flip:not(.smashed) .stage .ball { animation: wobble 2.8s cubic-bezier(.45,0,.25,1) 300ms infinite; }
.js .ch.is-in .flip:not(.smashed) .stage .glow { animation: heat 2.8s ease-in-out 300ms infinite; }
@keyframes tease { 0%, 100% { transform: translateY(-6px); } 50% { transform: translateY(0); } 72% { transform: translateY(-10px); } 80% { transform: translateY(14px); } 88% { transform: translateY(-4px); } }
@keyframes wobble { 0%, 76%, 100% { transform: none; } 81% { transform: scale(1.12, .86); } 88% { transform: scale(.97, 1.03); } }
@keyframes heat { 0%, 100% { opacity: .55; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.05); } }
/* Lecsapás */
.flip.smashing .stage .smasher { animation: slam 620ms cubic-bezier(.6,0,.2,1) forwards; }
.flip.smashing .stage .ball { animation: squash 620ms cubic-bezier(.6,0,.2,1) forwards; }
.flip.smashing .stage .patty { animation: spread 620ms cubic-bezier(.2,.9,.3,1.2) forwards; }
.flip.smashing .stage .steam { animation: sizzle 620ms ease-out forwards; }
.flip.smashing .front { animation: card-smash 620ms cubic-bezier(.4,0,.2,1); }
@keyframes slam { 0% { transform: translateY(-6px); } 22% { transform: translateY(-18px); } 42% { transform: translateY(39px); } 46% { transform: translateY(37px); } 50% { transform: translateY(38.5px); } 64% { transform: translateY(38px); } 100% { transform: translateY(-8px); } }
@keyframes squash { 0%, 38% { transform: none; opacity: 1; } 46% { transform: scale(2.2, .25); opacity: 0; } 100% { transform: scale(2.2, .25); opacity: 0; } }
@keyframes spread { 0%, 40% { opacity: 0; transform: scaleX(.5); } 52% { opacity: 1; transform: scaleX(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes sizzle { 0%, 42% { opacity: 0; transform: translateY(8px) scale(.9); } 62% { opacity: .95; } 100% { opacity: 0; transform: translateY(-22px) scale(1.15); } }
/* Leszmashelés után ráolvad a sajtlap, és egy ideig még gőzölög */
@keyframes cheese-drop { 0% { opacity: 0; transform: translateY(-26px) rotate(-6deg); } 60% { opacity: 1; transform: translateY(1px) rotate(0); } 100% { opacity: 1; transform: none; } }
@keyframes steam-idle { 0%, 100% { opacity: 0; transform: translateY(6px); } 40% { opacity: .5; } 90% { opacity: 0; transform: translateY(-18px); } }
@keyframes card-smash { 0%, 38% { transform: none; } 46% { transform: scale(1.03, .94); } 100% { transform: none; } }
/* Leszmashelve: lapos, ropogós hús marad, a lap felemelve pihen */
.flip.smashed:not(.smashing) .stage .ball { opacity: 0; }
.flip.smashed:not(.smashing) .stage .patty { opacity: 1; transform: none; }
.flip.smashed:not(.smashing) .stage .smasher { transform: translateY(-8px); }
.flip.smashed:not(.smashing) .stage .glow { opacity: .35; }
.flip.smashed:not(.smashing) .stage .cheese { opacity: 1; animation: cheese-drop 520ms cubic-bezier(.3,1.4,.5,1) both; }
.js .flip.smashed:not(.smashing) .stage .steam { animation: steam-idle 3s ease-out infinite; }

/* ---------- 10 húsgolyó: az út végig ---------- */
.meat-track { position: sticky; top: 76px; z-index: 30; display: flex; justify-content: center; gap: 8px; width: max-content; max-width: calc(100% - 2 * var(--gutter)); margin: 0 auto var(--s2); padding: 10px 16px; background: var(--ink); border-radius: var(--r-pill); box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.meat-track .mt { display: grid; place-items: center; width: 22px; height: 22px; }
.meat-track .mt i { display: block; width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #ff7a86, #e8414f 35%, #b81f33 75%, #6e0e1c); box-shadow: inset 0 -2px 0 rgba(0,0,0,.35); transition: width 300ms cubic-bezier(.2,.9,.3,1.3), height 300ms cubic-bezier(.2,.9,.3,1.3), border-radius 300ms; }
.meat-track .mt.done i { width: 24px; height: 7px; border-radius: 50% / 60%; background: linear-gradient(#f6c21c 0 35%, transparent 35%), radial-gradient(ellipse at 50% 80%, #9a3a2c, #5a1f10 60%, #2a0c05); }
.meat-track.all { box-shadow: 0 0 0 3px var(--yellow), 0 6px 18px rgba(0,0,0,.25); }
@media (max-width: 400px) { .meat-track { gap: 4px; padding: 8px 12px; } .meat-track .mt { width: 18px; } .meat-track .mt i { width: 15px; height: 15px; } .meat-track .mt.done i { width: 19px; height: 6px; } }
.front:focus-visible { outline: 3px solid var(--cream); outline-offset: -8px; }

.back { background: var(--cream); color: var(--ink); overflow: hidden; transform: rotateY(180deg); display: grid; align-content: start; }
.flip.flipped .front { transform: rotateY(-180deg); }
.flip.flipped .back { transform: rotateY(0); }
.back-body { position: relative; padding: var(--s3); display: grid; gap: var(--s1); }
.after { font-family: var(--font-display); font-size: clamp(28px, 7vw, 44px); line-height: 1; color: var(--ink); margin: 0 0 4px; }
.back h2 { font-family: var(--font-body); font-weight: 800; font-size: clamp(22px, 5.2vw, 28px); line-height: 1.12; margin: 0; text-wrap: balance; }
.ch-text { font-size: var(--fs-16); line-height: 1.5; margin: 4px 0 0; max-width: var(--measure); }
.flip-back { justify-self: end; margin-top: var(--s1); width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--ink); background: transparent; font-size: 20px; font-weight: 800; cursor: pointer; color: var(--ink); }

.tone-dark .back { background: var(--ink); color: var(--cream); }
.tone-dark .back .after { color: var(--orange); }
.tone-dark .flip-back { border-color: var(--cream); color: var(--cream); }
.tone-dark .front { background: var(--cream); color: var(--ink); }
.tone-dark .front .word { color: var(--ink); }
.tone-dark .front .ch-no { color: var(--soft); }

.ch-photos { display: grid; gap: 3px; background: var(--ink); }
.ch-photos.n2 { grid-template-columns: 1fr 1fr; }
.ch-photos figure { margin: 0; }
.ch-photos img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.img-slot { display: block; border-bottom: 3px solid var(--ink); }
.img-slot img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: cover; object-position: 50% 30%; }
.img-slot:not(.has-img) { display: grid; place-items: center; aspect-ratio: 4 / 3; color: var(--soft); font-weight: 800; font-size: var(--fs-14); }

@media (min-width: 900px) {
  .timeline { padding-left: 0; }
  .timeline::before { left: 50%; transform: translateX(-1px); }
  .ch { display: grid; grid-template-columns: 1fr 1fr; column-gap: 72px; padding: var(--s4) 0; }
  .node { left: 50%; transform: translateX(-50%); top: calc(var(--s4) + 30px); }
  .side-left .flip { grid-column: 1; }
  .side-right .flip { grid-column: 2; }
  .front { min-height: 340px; }
}

/* Beúszás */
.js .ch .flip { opacity: 0; transform: translateY(28px); transition: opacity 260ms ease-out, transform 260ms ease-out; }
.js .ch.is-in .flip { opacity: 1; transform: none; }

/* ---------- Pecsét ---------- */
.stamp-reveal { display: grid; place-items: center; padding: var(--s4) var(--gutter) var(--s6); }
.stamp-reveal img { width: min(220px, 60vw); height: auto; }
.js .stamp-reveal img { opacity: 0; transform: scale(0.5) rotate(-40deg); transition: opacity 260ms ease-out, transform 420ms cubic-bezier(.2,1.5,.4,1); }
.js .stamp-reveal.on img { opacity: 1; transform: none; }

/* ---------- Zárás: a burger a döntés-szavakból ---------- */
.finale { background: var(--ink); color: var(--cream); padding: var(--s6) var(--gutter) var(--s8); overflow: hidden; }
.finale-in { max-width: 720px; margin: 0 auto; display: grid; justify-items: center; text-align: center; gap: var(--s2); }
.wstack { display: grid; gap: 6px; width: min(100%, 420px); }
.wl { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 18px; border-radius: 12px; color: var(--ink); }
.wl b { font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 7vw, 36px); line-height: 1; }
.wl small { font-weight: 800; font-size: var(--fs-14); }
.wl-top { height: 46px; border-radius: 999px 999px 12px 12px; background: #E9A55B; }
.wl-sauce { background: #F2B9A6; } /* burgerszósz: majonéz + ketchup, halvány rózsaszínes */
.wl-pickle { background: #8DAA45; }
.wl-cheese { background: var(--yellow); }
.wl-patty { background: #5A341C; color: var(--cream); }
.wl-bun { background: #E9A55B; border-radius: 12px 12px 26px 26px; }
.js .wstack .wl { opacity: 0; transform: translateY(-60px); transition: opacity 200ms ease-out, transform 300ms cubic-bezier(.2,1.5,.4,1); transition-delay: calc(var(--k, 6) * 110ms); }
.js .wstack .wl-top { --k: 7; }
.js .wstack.on .wl { opacity: 1; transform: none; }

.counter { font-family: var(--font-display); font-size: clamp(54px, 16vw, 112px); line-height: 1; margin: var(--s4) 0 0; color: var(--orange); font-variant-numeric: tabular-nums; white-space: nowrap; }
.counter-label { font-weight: 800; font-size: var(--fs-20); margin: 0; }

/* Plakát a záró sorokkal; jobb széle mögül kihajol a Prof. (prof-b) */
.poster-wrap { position: relative; width: 100%; margin-top: 140px; }
.poster { position: relative; z-index: 1; width: 100%; background: var(--orange); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r-md); padding: var(--s4) var(--s3); display: grid; justify-items: center; gap: var(--s2); }
.poster h2 { color: var(--cream); font-size: clamp(28px, 7vw, 44px); line-height: 1; margin: 0; max-width: 14ch; }
.finale-line { font-weight: 800; font-size: var(--fs-16); max-width: 30ch; margin: 0; text-wrap: balance; }
.finale-cta { max-width: 320px; }
.poster-wrap .prof-b { position: absolute; right: -28px; top: -118px; width: 160px; z-index: 0; transform: rotate(12deg); }
.poster-wrap .prof-b img { width: 100%; height: auto; display: block; }
@media (min-width: 768px) { .poster-wrap .prof-b { width: 220px; right: -90px; top: -150px; } }

.story .footer { padding-bottom: var(--s6); }

@media (prefers-reduced-motion: reduce) {
  .face { transition: none; }
  .js .ch .flip, .js .stamp-reveal img, .js .wstack .wl { opacity: 1; transform: none; transition: none; }
  .stage *, .flip.smashing .front { animation: none !important; }
  .meat-track .mt i { transition: none; }
}

/* A hosszú érzés-szó ne feszítse szét a kártyát (a betűméretet a tortenet.js igazítja) */
.ch, .flip, .face { min-width: 0; }
.front { width: 100%; overflow: hidden; }
.front .word { max-width: 100%; }
.ch-text { font-weight: 400; }

/* Zárás: a valódi harapás, a „Egy harapás, és megérted.” fölött */
.finale-photo { margin: calc(-1 * var(--s6)) 0 var(--s1); width: min(100%, 380px); border: 3px solid var(--ink); border-radius: var(--r-md); overflow: hidden; transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--ink); }
.finale-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }

/* Sáv: számláló és a következő, még le nem smashelt golyó lüktet */
.meat-track { align-items: center; }
.meat-track .mt-count { margin-left: 6px; font-weight: 800; font-size: var(--fs-14); color: var(--cream); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.meat-track .mt.next i { animation: mt-pulse 1.4s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(237,206,8,.8); }
@keyframes mt-pulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(237,206,8,.75); } 50% { transform: scale(1.18); box-shadow: 0 0 0 5px rgba(237,206,8,0); } }
@media (prefers-reduced-motion: reduce) { .meat-track .mt.next i { animation: none; outline: 2px solid var(--yellow); outline-offset: 2px; } }

/* Zárás: a kép a plakáton belül marad, nincs figura */
.poster-wrap { margin-top: var(--s4); }
.poster-wrap .prof-b { display: none; }
.finale-photo { margin: 0 0 var(--s1); width: min(100%, 380px); transform: rotate(-1.5deg); }
.poster h2 { color: var(--cream); font-size: clamp(34px, 9vw, 60px); max-width: 12ch; }

/* Laborjelentés-kártya a burgerszámlálónak */
.lab-card { position: relative; margin-top: var(--s4); width: min(100%, 360px); background: var(--cream); color: var(--ink); border: 3px solid var(--ink); border-radius: var(--r-md); box-shadow: 8px 8px 0 var(--orange); padding: 30px 22px 20px; transform: rotate(-2deg); display: grid; justify-items: center; gap: 2px; background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(0,0,0,.07) 27px 28px); }
.lab-head { position: absolute; top: 10px; left: 14px; display: flex; gap: 5px; }
.lab-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); opacity: .2; }
.lab-dot:first-child { background: var(--orange); opacity: 1; }
.lab-label { margin: 0; font-weight: 800; font-size: var(--fs-14); letter-spacing: .14em; text-transform: uppercase; }
.lab-card .counter { margin: 0; color: var(--orange); -webkit-text-stroke: 1.5px var(--ink); }
.lab-card .counter-label { margin: 0; font-weight: 800; font-size: var(--fs-20); color: var(--ink); }

/* A szám mindig férjen bele a kártyába */
.lab-card { width: min(100%, 420px); overflow: hidden; }
.lab-card .counter { font-size: clamp(44px, 13vw, 72px); }

/* 14 743 → BURGER: nagy fekete címke kis smasherrel, ami a számolás végén lecsap */
.lab-card .counter-label { display: none; }
.lab-unit { margin: 6px 0 0; display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 12px; background: var(--ink); color: var(--cream); border-radius: 999px; transform: rotate(2deg); }
.lab-unit span { font-family: var(--font-display); font-size: clamp(26px, 8vw, 38px); line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.lab-smasher rect { transform-box: fill-box; }
.lab-unit .lab-smasher rect { transform: translateY(-4px); }
.lab-unit.smashed .lab-smasher rect { animation: lab-slam 520ms cubic-bezier(.6,0,.2,1) both; }
.lab-unit .lab-smasher ellipse { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(.45, 2); }
.lab-unit.smashed .lab-smasher ellipse { animation: lab-flat 520ms cubic-bezier(.6,0,.2,1) both; }
.lab-unit.smashed { animation: lab-pop 520ms cubic-bezier(.2,1.5,.4,1) both; }
@keyframes lab-slam { 0% { transform: translateY(-4px); } 40% { transform: translateY(6px); } 100% { transform: translateY(0); } }
@keyframes lab-flat { 0%, 35% { transform: scale(.45, 2); } 50% { transform: scale(1.15, .8); } 100% { transform: none; } }
@keyframes lab-pop { 0%, 35% { transform: rotate(2deg) scale(1); } 50% { transform: rotate(-1deg) scale(1.08, .92); } 100% { transform: rotate(2deg) scale(1); } }
@media (prefers-reduced-motion: reduce) { .lab-unit.smashed, .lab-unit.smashed .lab-smasher rect, .lab-unit.smashed .lab-smasher ellipse { animation: none; } .lab-unit .lab-smasher rect, .lab-unit .lab-smasher ellipse { transform: none; } }

/* A nyitócím mérése miatt a h1 ne nyúljon a doboz fölé */
.story-intro h1 { max-width: 100%; overflow: hidden; }
.intro-in { overflow: hidden; }
