/* =====================================================================
   DIFRESHHELLAS — HERO SEQUENCE (#intro) + preloader. Used by index.html.
   Behaviour lives in js/hero.js.
   ===================================================================== */
.seq { position: relative; padding: 0; background: var(--black); }
html.js .seq { height: 540vh; height: 540svh; }
.seq-stage {
  position: relative; height: 100vh; height: 100svh; overflow: hidden;
  background: var(--black);
}
html.js .seq-stage { position: sticky; top: 0; transform-origin: 50% 0%; will-change: transform, opacity; }
.seq-poster, .seq-canvas, .seq-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.seq-poster { object-fit: cover; }
.seq-canvas { display: block; }
html.js .seq-poster { transition: opacity .6s ease; }
.seq.has-frame .seq-poster { opacity: 0; }
.seq-overlay { pointer-events: none; overflow: visible; z-index: 1; }
.seq-overlay path { fill: none; transition: opacity .45s ease; opacity: 0; }
.ov-coin { stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 3 7; stroke-linecap: round; }
.seq-overlay .ov-mask { stroke: #fff; stroke-width: 16; stroke-dasharray: 1; stroke-linecap: round; opacity: 1; transition: none; }
.ov-turn { stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ov-product { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 1; stroke-linecap: round; stroke-linejoin: round; }
.ov-coinfall { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 1; stroke-linecap: round; stroke-linejoin: round; }

/* A top scrim keeps the transparent header readable over bright frames */
.seq-stage::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 150px; pointer-events: none; z-index: 2;
  background: linear-gradient(to bottom, rgba(11,10,9,.78), rgba(11,10,9,0));
}
/* A floor-to-text vignette so captions stay readable on bright frames */
.seq-stage::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 42%; pointer-events: none; z-index: 2;
  background: linear-gradient(to top, rgba(11,10,9,.86), rgba(11,10,9,0));
}

/* Beat 1 title: beside the machine on landscape screens, above it on portrait.
   The render already carries the DIFRESH wordmark on the cover, so the title
   never sits on top of the machine. */
.seq-title {
  position: absolute; z-index: 3; left: clamp(16px, 5vw, 72px); top: 50%;
  transform: translateY(-58%); pointer-events: none; text-align: left;
  transition: opacity .8s var(--arrive), transform 1.1s var(--arrive);
}
.seq-title .eyebrow { color: var(--ink-2); opacity: 0; margin-bottom: .4rem; transition: opacity 1s var(--arrive) .5s; }
.seq-word {
  margin: 0; font: 400 clamp(64px, 10vw, 176px)/.84 var(--font-brand); color: var(--ink);
  letter-spacing: .01em; text-transform: uppercase;
}
.seq-word span {
  display: inline-block; transform: translateY(105%); clip-path: inset(0 0 100% 0);
  transition: transform 1.2s var(--arrive), clip-path 1.2s var(--arrive);
}
.seq-title.in .seq-word span { transform: none; clip-path: inset(-10% -5% -10% -5%); }
.seq-title.in .eyebrow { opacity: 1; }
.seq-title.gone { opacity: 0; transform: translateY(calc(-58% - 40px)); }
@media (orientation: portrait) and (max-width: 900px) {
  .seq-title { left: 0; right: 0; top: calc(128px + 1.5svh); transform: none; text-align: center; }
  .seq-title .eyebrow { display: none; }
  .seq-word { font-size: clamp(52px, 15vw, 110px); }
  .seq-title.gone { transform: translateY(-30px); }
}

/* Beat captions */
.seq-caps {
  list-style: none; margin: 0; padding: 0; position: absolute; z-index: 3;
  left: clamp(16px, 5vw, 72px); bottom: clamp(28px, 8vh, 88px);
  width: min(440px, calc(100% - 32px)); height: 1px;
  transition: opacity .4s ease;
}
.seq-cap { position: absolute; left: 0; bottom: 0; width: 100%; }
.seq-cap > * { display: block; opacity: 0; transform: translateY(18px); transition: opacity .45s ease, transform .9s var(--arrive); }
.seq-cap.on > * { opacity: 1; transform: none; }
.seq-cap.on > *:nth-child(2) { transition-delay: .06s; }
.seq-cap.on > *:nth-child(3) { transition-delay: .12s; }
.cap-num { font: 400 13px/1 var(--font-display); letter-spacing: .14em; color: var(--mute); margin-bottom: .7rem; }
.cap-head { font: 400 clamp(34px, 5.4vw, 64px)/.95 var(--font-display); text-transform: uppercase; color: var(--ink); margin-bottom: .55rem; }
:lang(el) .cap-head, :lang(el) .seq-end-line { font-weight: 800; }
.cap-text { font-size: clamp(15px, 1.3vw, 18px); color: var(--ink-2); line-height: 1.45; }

/* End state (after beat 5): the page headline, tagline and CTAs over the final frame */
.seq-end {
  position: absolute; z-index: 4; left: clamp(16px, 5vw, 72px); bottom: clamp(32px, 9vh, 96px);
  width: min(520px, 38vw); pointer-events: none;
}
.seq-end.on { pointer-events: auto; }
.seq-end > * { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform 1.1s var(--arrive); }
.seq-end.on > * { opacity: 1; transform: none; }
.seq-end.on > *:nth-child(2) { transition-delay: .07s; }
.seq-end.on > *:nth-child(3) { transition-delay: .16s; }
.seq-end.on > *:nth-child(4) { transition-delay: .26s; }
.seq-end .eyebrow { color: var(--ink-2); margin-bottom: .8rem; }
.seq-end-title { font-size: clamp(36px, 4.4vw, 76px); line-height: .95; margin: 0 0 1rem; }
.seq-end-tag { font-size: clamp(15px, 1.15vw, 17px); color: var(--ink-2); max-width: 46ch; margin: 0 0 1.6rem; }
.seq.at-end .seq-caps { opacity: 0; }
.seq-end .btn { padding: 15px 30px; }

/* Skip Intro (kept from the old splash, now floats over the sequence) */
#intro-skip {
  position: fixed; z-index: 120;
  right: clamp(16px, 3vw, 32px); bottom: calc(clamp(16px, 3vw, 32px) + env(safe-area-inset-bottom));
  background: rgba(11,10,9,.55); border: 1px solid rgba(241,231,217,.35); color: var(--ink);
  padding: 11px 22px; border-radius: 50px; font: 500 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: opacity .4s ease, transform .5s var(--arrive), border-color .3s ease;
}
#intro-skip:hover { border-color: var(--ink); }
html:not(.in-intro) #intro-skip, #intro-skip.gone { opacity: 0; transform: translateY(12px); pointer-events: none; }

@media (max-width: 760px) {
  .seq-caps { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .seq-end { left: 16px; right: 16px; width: auto; bottom: calc(28px + env(safe-area-inset-bottom)); }
  .seq-end-title { font-size: clamp(34px, 10vw, 52px); }
  .seq-end-tag { font-size: 14.5px; margin-bottom: 1.2rem; }
  .seq-end .btn { padding: 13px 22px; font-size: 14px; }
}

/* Header while the intro plays: clear, with the chapter counter */
html.in-intro .site-header { background: transparent; border-bottom-color: transparent; backdrop-filter: none; box-shadow: none; }
.chapter {
  position: absolute; z-index: 4; left: clamp(16px, 5vw, 72px); top: 92px;
  display: flex; align-items: center; gap: 12px; color: var(--ink-2);
  opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .4s ease, transform .6s var(--arrive);
}
html.in-intro .seq:not(.at-end) .chapter { opacity: 1; transform: none; }
.ch-num { font: 400 14px/1 var(--font-display); letter-spacing: .1em; }
.ch-num b { font-weight: 400; color: var(--ink); }
.ch-num span { color: var(--mute); }
.ch-bars { display: flex; gap: 4px; }
.ch-bars i { width: 22px; height: 2px; background: var(--line); overflow: hidden; }
.ch-bars s { display: block; height: 100%; background: var(--gold); transform: scaleX(0); transform-origin: left; text-decoration: none; }
@media (max-width: 600px) {
  .chapter { left: 16px; gap: 10px; }
  .ch-bars i { width: 16px; }
}

/* Static storyboard (reduced motion) */
.seq-board { display: none; }
.seq.seq-static { height: auto !important; }
.seq.seq-static .seq-stage { position: relative; height: auto; min-height: 70vh; min-height: 70svh; }
.seq.seq-static .seq-canvas, .seq.seq-static .seq-overlay, .seq.seq-static .seq-caps, .seq.seq-static .seq-end { display: none; }
.seq.seq-static .seq-title .eyebrow, .seq.seq-static .seq-word span { opacity: 1; transform: none; clip-path: none; }
.seq.seq-static .seq-board {
  display: grid; gap: 1.5rem; list-style: none; padding: 3rem clamp(16px, 4vw, 2rem); margin: 0 auto; max-width: 1200px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.seq-board img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); margin-bottom: .8rem; }
.seq-board .seq-cap { position: static; }
.seq-board .seq-cap > * { opacity: 1; transform: none; }
.seq-board .cap-head { font-size: 28px; }

/* No JS: the section is the poster with the title */
html:not(.js) .seq-title .eyebrow { opacity: 1; }
html:not(.js) .seq-word { opacity: 1; }
html:not(.js) .seq-caps, html:not(.js) .seq-end, html:not(.js) #intro-skip, html:not(.js) .seq-canvas { display: none; }

/* Preloader: spinning gold coin, 0→100, then curtains lift */
#preloader { display: none; }
html.preload #preloader { display: block; position: fixed; inset: 0; z-index: 2000; }
html.preload, html.preload body { overflow: hidden; }
html.preload-done #preloader { pointer-events: none; }
.pre-curtain { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--black); transition: transform 1.1s var(--glide); }
.pre-curtain.top { top: 0; }
.pre-curtain.bottom { bottom: 0; }
html.preload-done .pre-curtain.top { transform: translateY(-101%); }
html.preload-done .pre-curtain.bottom { transform: translateY(101%); }
.pre-inner { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; transition: opacity .35s ease; }
html.preload-done .pre-inner { opacity: 0; }
.pre-coin {
  width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #F6E2A2 0%, var(--gold) 46%, #8C6B22 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 236, 180, .45), inset 0 0 0 7px rgba(140, 107, 34, .35);
  animation: coin-spin 1.4s linear infinite;
}
@keyframes coin-spin { to { transform: rotateY(360deg); } }
.pre-count { font: 400 clamp(64px, 12vw, 132px)/.9 var(--font-display); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: center; }
.pre-label { margin: 0; font: 500 11px/1 var(--font); letter-spacing: .32em; color: var(--mute); }
@media (prefers-reduced-motion: reduce) { html.preload #preloader { display: none; } html.preload, html.preload body { overflow: auto; } }

/* Portrait phones: the machine fills the frame, so the end headline needs a
   deeper floor fade to stay readable over it */
.seq-stage::after { transition: height .8s var(--arrive), opacity .8s ease; }
@media (orientation: portrait) and (max-width: 900px) {
  .seq.at-end .seq-stage::after {
    height: 78%;
    background: linear-gradient(to top, rgba(11,10,9,.96) 0%, rgba(11,10,9,.9) 45%, rgba(11,10,9,0) 100%);
  }
}
