/* ==========================================================
   Animație de intrare — 5 Senses Bar (durată totală: 5 secunde)

   0.0 – 2.5s    „loading bar” din 5 iconuri (văz, miros, gust, auz, atingere)
                 + textul „Se activează simțurile. Începe experiența.”
   2.6 – 3.15s   cele 5 iconuri zboară în locurile lor din logo și se unesc
   2.9 – 3.7s    logo-ul se formează în jurul lor (aceeași culoare ca iconurile)
   3.7 – 4.65s   logo-ul rămâne pe ecran
   4.65 – 5.0s   ecranul se estompează și se vede site-ul
   ========================================================== */

.intro {
  --i-pearl: #f7f4ee;
  --i-espresso: #38261f;    /* iconuri, text, logo */
  --i-cocoa: #82634f;
  --i-w: min(320px, 58vw, 37vh);   /* lățimea logo-ului */

  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--i-pearl);
  overflow: hidden;
  animation: introOut .35s 4.65s forwards;
}
.intro *, .intro *::before, .intro *::after { box-sizing: border-box; }

.intro-on .intro { display: block; }
html.intro-on, html.intro-on body { overflow: hidden; }

/* Sărit manual */
.intro.is-skipped { animation: introOut .35s 0s forwards; }

@keyframes introOut {
  from { opacity: 1; }
  to   { opacity: 0; visibility: hidden; }
}

/* ---------- Logo (în spatele iconurilor) ---------- */
/* Cercul logo-ului este centrat pe ecran (puțin mai sus de mijloc) */
.intro__stage {
  position: absolute;
  left: 50%;
  top: 46%;
  width: var(--i-w);
  aspect-ratio: 1742 / 2512;
  transform: translate(-50%, -29.5%);
}
.intro__logo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  clip-path: circle(0% at 50% 29.5%);
  animation: logoReveal .8s 2.9s cubic-bezier(.3, .6, .2, 1) both;
}
@keyframes logoReveal {
  from { clip-path: circle(0%   at 50% 29.5%); }
  to   { clip-path: circle(100% at 50% 29.5%); }
}

/* ---------- Loading din 5 iconuri + text ---------- */
.intro__loader {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max-content;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  animation: loaderIn .25s 0s both;
}
@keyframes loaderIn { from { opacity: 0; } to { opacity: 1; } }

.intro__senses {
  display: flex;
  gap: clamp(14px, 4.2vw, 30px);
}

.sense {
  --size: clamp(30px, 8vw, 46px);
  width: var(--size);
  height: var(--size);
  color: var(--i-espresso);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  /* după 5 secunde: zboară spre locul din logo (--dx, --dy, --s sunt calculate în intro.js) */
  animation:
    senseFly  .55s 2.6s cubic-bezier(.65, 0, .3, 1) both,
    senseFade .18s 2.98s ease-out both;
}
@keyframes senseFly {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(var(--s, 1)); }
}
@keyframes senseFade {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* conturul slab, ca un „loc gol” în bară */
.sense__ghost { stroke-opacity: .16; }
/* iconul se desenează, pe rând: văz → miros → gust → auz → atingere */
.sense__draw {
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1.02;
  opacity: 0;
  animation: senseDraw .45s calc(var(--t) * .5) cubic-bezier(.5, 0, .3, 1) both;
}
@keyframes senseDraw {
  from { stroke-dashoffset: 1.02; opacity: 0; }
  4%   { opacity: 1; }
  to   { stroke-dashoffset: 0;    opacity: 1; }
}

.intro__text {
  margin: clamp(22px, 3.6vh, 36px) 0 0;
  font-family: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(20px, 2.4vw, 27px);
  line-height: 1.25;
  letter-spacing: .02em;
  text-align: center;
  color: var(--i-espresso);
}
.intro__text span { display: block; }
.intro__text span:nth-child(1) { animation: lineIn .3s .2s both, lineOut .2s 2.5s forwards; }
.intro__text span:nth-child(2) { animation: lineIn .3s 2.05s both, lineOut .2s 2.5s forwards; }
@keyframes lineIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lineOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ---------- Buton „Sari peste” ---------- */
.intro__skip {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 14px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: "DM Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--i-cocoa);
  opacity: 0;
  animation: skipIn .4s .3s both;
}
.intro__skip:hover { text-decoration: underline; text-underline-offset: 5px; }
@keyframes skipIn { from { opacity: 0; } to { opacity: .85; } }
