/* ══════════════════════════════════════════════════════════════
   PlantCraft AI — intro film overlay
   One clock (the <video> element), DOM text cues, sound toggle,
   replay = full first-time experience + transition. Every time.
   ══════════════════════════════════════════════════════════════ */

.pc-intro {
  position: fixed; inset: 0; z-index: 1000;
  background: #0f1419;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  opacity: 1; visibility: visible;
  transition: opacity 1.05s ease, visibility 0s linear 1.05s;
}
.pc-intro.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.pc-intro.is-ending .pc-intro-video { transform: scale(1.07); }
.pc-intro.is-restarting .pc-intro-video,
.pc-intro.is-restarting .pc-intro-cues { opacity: .15; transition: opacity .22s ease; }

.pc-intro-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1); transition: transform 1.3s ease, opacity .22s ease;
  background: #0f1419 url('/intro/poster.jpg') center/cover no-repeat;
}

/* legibility scrim — gentle, keeps footage visible */
.pc-intro-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 68% 46% at 50% 50%, rgba(8,12,16,.38) 0%, rgba(8,12,16,0) 72%),
    linear-gradient(180deg, rgba(8,12,16,.42) 0%, rgba(8,12,16,0) 22%,
                     rgba(8,12,16,0) 62%, rgba(8,12,16,.55) 100%);
}

/* ─── text cues ─── */
.pc-intro-cues { position: absolute; inset: 0; pointer-events: none; }
.pc-cue {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -46%);
  width: min(92vw, 1000px);
  text-align: center;
  opacity: 0; filter: blur(6px);
  transition: opacity .45s ease, filter .45s ease, transform .45s ease;
  font-family: 'Fraunces', Georgia, serif;
  color: #f4f8f5;
  text-shadow: 0 2px 22px rgba(0,0,0,.55), 0 1px 3px rgba(0,0,0,.6);
  line-height: 1.14;
}
.pc-cue.on { opacity: 1; filter: blur(0); transform: translate(-50%, -50%); }

.pc-cue--eyebrow {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 600; font-size: clamp(.95rem, 2.2vw, 1.25rem);
  letter-spacing: .34em; text-transform: uppercase;
  color: #c9e7d3;
}
.pc-cue--mid { font-weight: 600; font-size: clamp(1.5rem, 3.8vw, 2.5rem); }
.pc-cue--big { font-weight: 700; font-size: clamp(2.1rem, 6.2vw, 4.4rem); letter-spacing: -.015em; }
.pc-cue--accent { color: #7fe8a4; font-style: italic; }
.pc-cue--red { color: #ff6b5e; }
.pc-cue--cold { color: #cfe3ee; font-style: italic; }
.pc-cue--up { transform: translate(-50%, -108%); }
.pc-cue--up.on { transform: translate(-50%, -115%); }
.pc-cue--down { transform: translate(-50%, 12%); }
.pc-cue--down.on { transform: translate(-50%, 8%); }

/* stacked fact chips */
.pc-cue--chip {
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 600; font-size: clamp(1rem, 2.6vw, 1.5rem);
  color: #eef6ef; letter-spacing: .01em;
  background: rgba(10, 16, 20, .58);
  border: 1px solid rgba(126, 232, 164, .35);
  border-radius: 999px;
  padding: .55em 1.3em;
  width: auto; max-width: 92vw;
  backdrop-filter: blur(4px);
}
.pc-cue--chip[data-slot="0"] { transform: translate(-50%, calc(-50% - 3.6rem)); }
.pc-cue--chip[data-slot="1"] { transform: translate(-50%, -50%); }
.pc-cue--chip[data-slot="2"] { transform: translate(-50%, calc(-50% + 3.6rem)); }
.pc-cue--chip.on[data-slot="0"] { transform: translate(-50%, calc(-50% - 3.4rem)); }
.pc-cue--chip.on[data-slot="2"] { transform: translate(-50%, calc(-50% + 3.4rem)); }

/* end card */
.pc-cue--endcard .pc-endcard-mark {
  font-weight: 700; font-size: clamp(2.6rem, 7.5vw, 5rem); letter-spacing: -.02em;
}
.pc-cue--endcard .pc-endcard-mark span { color: #57df8d; }
.pc-cue--endcard .pc-endcard-sub {
  display: block; margin-top: .9rem;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 500; font-size: clamp(.85rem, 2vw, 1.05rem);
  letter-spacing: .18em; text-transform: uppercase; color: #b9cec0;
}

/* ─── controls ─── */
.pc-intro-progress {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: rgba(255,255,255,.12);
}
.pc-intro-progress-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #2e7d4f, #57df8d);
  transform-origin: left center; transform: scaleX(0);
}

.pc-intro-sound {
  position: absolute; left: 50%; bottom: max(4.5vh, 28px); transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 16px 38px; border-radius: 999px; border: 2px solid rgba(87,223,141,.9);
  background: rgba(14, 22, 17, .78); color: #eafff0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 1.18rem; font-weight: 700; letter-spacing: .01em;
  cursor: pointer; z-index: 3;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 0 0 rgba(87,223,141,.55);
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
  animation: pc-sound-pulse 1.8s ease-out infinite;
}
.pc-intro-sound:hover { background: rgba(23, 38, 28, .9); transform: translateX(-50%) scale(1.04); }
.pc-intro-sound .pc-sound-main { display: flex; align-items: center; gap: 10px; }
.pc-intro-sound .pc-sound-icon { font-size: 1.35rem; line-height: 1; }
.pc-intro-sound .pc-sound-sub {
  font-size: .78rem; font-weight: 500; letter-spacing: .08em;
  color: #a8cdb4; text-transform: uppercase;
}
.pc-intro-sound.is-on {
  animation: none; border-color: rgba(87,223,141,.45);
  background: rgba(14, 22, 17, .6);
  font-size: 1rem; padding: 12px 26px;
}
@keyframes pc-sound-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(87,223,141,.55); }
  70%  { box-shadow: 0 0 0 22px rgba(87,223,141,0); }
  100% { box-shadow: 0 0 0 0 rgba(87,223,141,0); }
}

.pc-intro-skip {
  position: absolute; top: max(2.8vh, 18px); right: max(3vw, 18px); z-index: 3;
  padding: 10px 18px; border-radius: 8px;
  background: rgba(10, 15, 19, .55); border: 1px solid rgba(255,255,255,.22);
  color: #dbe7dd; font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: .92rem; font-weight: 600; cursor: pointer;
  backdrop-filter: blur(6px); transition: background .2s ease, border-color .2s ease;
}
.pc-intro-skip:hover { background: rgba(20, 30, 36, .8); border-color: rgba(87,223,141,.6); }

/* autoplay-blocked fallback */
.pc-intro-bigplay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); z-index: 4;
  display: flex; align-items: center; gap: 14px;
  padding: 20px 44px; border-radius: 999px; border: 2px solid #57df8d;
  background: rgba(14, 22, 17, .85); color: #eafff0;
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: 1.3rem; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(8px);
}
.pc-intro-bigplay:hover { background: rgba(23, 38, 28, .95); }
.pc-intro [hidden] { display: none !important; }

/* ─── homepage reveal animation (runs after EVERY play-through) ─── */
.pc-intro-done main .hero > * {
  animation: pc-rise .9s cubic-bezier(.22,.8,.3,1) both;
}
.pc-intro-done main .hero > *:nth-child(1) { animation-delay: .05s; }
.pc-intro-done main .hero > *:nth-child(2) { animation-delay: .15s; }
.pc-intro-done main .hero > *:nth-child(3) { animation-delay: .25s; }
.pc-intro-done main .hero > *:nth-child(4) { animation-delay: .35s; }
.pc-intro-done main .hero > *:nth-child(5) { animation-delay: .45s; }
.pc-intro-done main .hero > *:nth-child(6) { animation-delay: .55s; }
@keyframes pc-rise {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* header replay chip (inserted by intro.js) */
.pc-replay-chip {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  margin-right: 12px; padding: 8px 15px; border-radius: 8px;
  background: transparent; border: 1.5px solid rgba(74,222,128,.55);
  color: #4ade80; font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-size: .85rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.pc-replay-chip:hover { background: rgba(74,222,128,.12); border-color: #4ade80; transform: translateY(-1px); }
.pc-replay-chip .pc-replay-icon { font-size: .8rem; }

/* the chip shares the header — keep its neighbours on one line */
.site-header .wordmark, .site-header .header-cta { white-space: nowrap; }

/* while the film is up, nothing else floats above it */
html.pc-intro-active #pbfd-bubble,
html.pc-intro-active #pbfd-panel { display: none !important; }

@media (max-width: 600px) {
  .pc-intro-sound { width: min(86vw, 420px); padding: 15px 20px; font-size: 1.08rem; }
  .pc-cue--chip[data-slot="0"] { transform: translate(-50%, calc(-50% - 3.2rem)); }
  .pc-cue--chip[data-slot="2"] { transform: translate(-50%, calc(-50% + 3.2rem)); }
  .pc-cue--chip.on[data-slot="0"] { transform: translate(-50%, calc(-50% - 3rem)); }
  .pc-cue--chip.on[data-slot="2"] { transform: translate(-50%, calc(-50% + 3rem)); }
  .pc-replay-chip { padding: 6px 10px; font-size: .76rem; margin-right: 8px; gap: 5px; }
  .pc-replay-watch { display: none; }
}
@media (max-width: 380px) {
  .pc-replay-chip { padding: 6px 8px; }
  .pc-replay-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-intro, .pc-intro-video, .pc-cue { transition-duration: .01s !important; }
  .pc-intro-sound { animation: none; }
  .pc-intro-done main .hero > * { animation: none; }
}
