/* ============================================================
   HERO CHARACTER — interactive frame-sequence hero
   Light (default): white centre glow → dusty rose → light maroon edges.
   Dark: same layout, maroon/near-black edges with a white "spotlight"
   behind the character (frames are multiplied onto the glow, so the
   white video background disappears in both themes).
   ============================================================ */

.hero.hc {
  --hc-ink: #3a1820;
  --hc-ink-2: rgba(58, 24, 32, 0.66);
  --hc-ink-3: rgba(58, 24, 32, 0.6);
  --hc-accent: #8e3444;
  --hc-rose: #e7c3c8;
  --hc-rose-2: #cf98a0;
  --hc-maroon: #9a4a57;
  --hc-glow: #ffffff;
  --hc-pill: rgba(255, 255, 255, 0.72);
  --hc-pill-line: rgba(142, 52, 68, 0.16);
  --hc-handoff: var(--bg);
  --hc-nav-h: clamp(64px, 9vh, 92px);

  position: relative;
  height: auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  color: var(--hc-ink);
  font-family: var(--f-display);
}

[data-theme="dark"] .hero.hc {
  --hc-ink: #f6e9ea;
  --hc-ink-2: rgba(246, 233, 234, 0.7);
  --hc-ink-3: rgba(246, 233, 234, 0.44);
  --hc-accent: #f0a7b2;
  --hc-rose: #6d2a36;
  --hc-rose-2: #41141d;
  --hc-maroon: #1d070b;
  --hc-glow: #ffffff;
  --hc-pill: rgba(40, 12, 18, 0.62);
  --hc-pill-line: rgba(240, 167, 178, 0.22);
}

/* ---------- background ---------- */
.hc-bg {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 55%, transparent 55%, color-mix(in srgb, var(--hc-maroon) 55%, transparent) 100%),
    radial-gradient(ellipse 62% 78% at 50% 62%, var(--hc-glow) 0%, var(--hc-glow) 30%, var(--hc-rose) 64%, var(--hc-rose-2) 86%, var(--hc-maroon) 100%);
}
[data-theme="dark"] .hc-bg {
  /* tighter spotlight so the edges read as a dark room */
  background:
    radial-gradient(ellipse 120% 90% at 50% 55%, transparent 50%, rgba(8, 2, 4, 0.7) 100%),
    radial-gradient(ellipse 30% 60% at 50% 64%, #ffffff 0%, #fbf3f3 34%, #e7c3c8 56%, var(--hc-rose) 70%, var(--hc-rose-2) 86%, var(--hc-maroon) 100%);
}
.hc-glow {
  position: absolute;
  left: 50%; top: 60%;
  width: min(70vw, 980px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 62%);
  filter: blur(20px);
  animation: hcBreathe 7s ease-in-out infinite;
}
[data-theme="dark"] .hc-glow { width: min(40vw, 620px); }
@keyframes hcBreathe { 0%,100% { opacity: .85; transform: translate(-50%,-50%) scale(1); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.04); } }

/* bottom handoff into the next section */
.hero.hc::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 44px; z-index: 3;
  background: linear-gradient(to bottom, transparent, var(--hc-handoff));
  pointer-events: none;
}

/* ---------- stage ---------- */
.hc-stage {
  position: absolute; z-index: 1;
  top: var(--hc-nav-h);
  bottom: 44px;
  left: 50%;
  transform: translateX(-50%);
  width: min(100vw, calc((100svh - var(--hc-nav-h) - 44px) * 16 / 9));
  display: flex; align-items: flex-end; justify-content: center;
  mix-blend-mode: multiply;          /* white video background vanishes into the glow */
}
.hc-canvas {
  display: block;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity .8s ease;
  -webkit-mask-image: radial-gradient(ellipse 72% 92% at 50% 60%, #000 62%, transparent 100%);
          mask-image: radial-gradient(ellipse 72% 92% at 50% 60%, #000 62%, transparent 100%);
}
.hc.hc-ready .hc-canvas { opacity: 1; }

.hc-fallback {
  position: absolute; bottom: 8%; left: 50%;
  transform: translateX(-50%);
  height: 62%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: 28px;
  box-shadow: 0 40px 80px -30px rgba(90, 30, 40, .35);
  opacity: 0; transition: opacity .6s ease;
}
.hc.hc-nomedia .hc-fallback { opacity: 1; }
.hc.hc-nomedia .hc-hint { display: none; }

/* ---------- left intro ---------- */
.hc-intro {
  position: absolute; z-index: 4;
  left: max(var(--gutter), 84px);   /* clear the journey-trail rail on the far left */
  top: calc(var(--hc-nav-h) + 6vh);
  max-width: 26vw;
}
.hc-eyebrow {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--hc-ink-3);
  margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.hc-eyebrow::before { content: ''; width: 22px; height: 1px; background: currentColor; }
/* Big editorial name block (top-left), Playfair Display */
.hc-name {
  display: flex; flex-direction: column;
  font-family: 'Playfair Display', var(--f-serif);
  font-weight: 700;
  font-size: clamp(44px, 5vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.025em;
  color: var(--hc-ink);
  margin: 0;
}
.hc-last { font-weight: 600; color: var(--hc-name-2, #b46b78); }
[data-theme="dark"] .hc-last { color: #e9a3ae; }
.hc-role {
  margin-top: 18px;
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--hc-ink-2);
}
.hc-hint {
  margin-top: 30px;
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--hc-ink-3);
}
.hc-hint-track {
  position: relative; width: 46px; height: 22px;
  border-radius: 99px;
  border: 1px solid var(--hc-pill-line);
  background: var(--hc-pill);
}
.hc-hint-track svg {
  position: absolute; top: 3px; left: 4px;
  width: 14px; height: 14px;
  color: var(--hc-accent);
  animation: hcCursor 3.2s cubic-bezier(.6,0,.3,1) infinite;
}
@keyframes hcCursor {
  0%, 12%  { transform: translateX(0); }
  30%, 42% { transform: translateX(24px); }
  60%, 72% { transform: translateX(12px) scale(.86); }
  88%,100% { transform: translateX(0); }
}
.hc-hint-touch { display: none; }

/* ---------- contextual message (right column) ---------- */
.hc-message {
  position: absolute; z-index: 4;
  right: var(--gutter);
  top: 36%;
  transform: translateY(-50%) translateY(8px);
  max-width: 260px;
  padding: 12px 18px;
  border-radius: 16px 16px 16px 4px;
  background: var(--hc-pill);
  border: 1px solid var(--hc-pill-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -22px rgba(90, 30, 40, .45);
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(18px, 1.5vw, 23px);
  line-height: 1.2;
  color: var(--hc-ink);
  opacity: 0;
  transition: opacity .35s ease, transform .45s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.hc-message.is-on { opacity: 1; transform: translateY(-50%); }
.hc-message[data-side="left"] { border-radius: 16px 16px 4px 16px; }

/* ---------- bottom cue ---------- */
.hc-cue {
  position: absolute; z-index: 4;
  left: 50%; bottom: 54px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--hc-ink-2);
  padding: 9px 16px; border-radius: 99px;
  background: var(--hc-pill); border: 1px solid var(--hc-pill-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  white-space: nowrap;
  transition: color .3s, border-color .3s, transform .3s;
}
.hc-cue:hover { color: var(--hc-accent); border-color: var(--hc-accent); }
.hc-cue svg { width: 12px; height: 12px; animation: hcBob 1.8s ease-in-out infinite; }
@keyframes hcBob { 0%,100% { transform: translateY(-1px); } 50% { transform: translateY(3px); } }
.hc[data-hc-greet="2"] .hc-cue { color: var(--hc-accent); border-color: var(--hc-accent); transform: translateX(-50%) scale(1.06); }

/* ---------- nav legibility while the hero is on screen ---------- */
html[data-hero-in] .nav { mix-blend-mode: normal; }
html[data-theme="light"][data-hero-in] .nav-logo,
html[data-theme="light"][data-hero-in] .nav-menu a,
html[data-theme="light"][data-hero-in] .nav-cta,
html[data-theme="light"][data-hero-in] .nav-mobile-btn,
html[data-theme="light"][data-hero-in] .nav-theme-toggle { color: #3a1820 !important; }
html[data-theme="light"][data-hero-in] .nav-cta { border-color: rgba(58,24,32,.25); }
html[data-theme="dark"][data-hero-in] .nav-logo,
html[data-theme="dark"][data-hero-in] .nav-menu a,
html[data-theme="dark"][data-hero-in] .nav-cta,
html[data-theme="dark"][data-hero-in] .nav-mobile-btn,
html[data-theme="dark"][data-hero-in] .nav-theme-toggle { color: #f6e9ea !important; }

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .hc-intro { max-width: 28vw; }
  .hc-name { font-size: clamp(40px, 4.8vw, 60px); }
  .hc-message { max-width: 210px; }
}

/* ---------- mobile / touch: centre experience only ---------- */
@media (max-width: 899px), (hover: none), (pointer: coarse) {
  .hero.hc {
    min-height: 100svh;
    display: flex; flex-direction: column; align-items: center;
    padding: calc(var(--hc-nav-h) + 6px) 20px 96px;
  }
  .hc-intro {
    position: relative; left: auto; top: auto; transform: none;
    max-width: none; text-align: center; order: 1;
  }
  .hc-eyebrow { justify-content: center; margin-bottom: 10px; }
  .hc-eyebrow::before { display: none; }
  .hc-name { font-size: clamp(36px, 10.5vw, 52px); align-items: center; }
  .hc-role { margin-top: 10px; font-size: 11px; }
  .hc-hint { margin-top: 12px; }
  .hc-hint-track { display: none; }
  .hc-hint-mouse { display: none; }
  .hc-hint-touch { display: inline; }

  .hc-stage {
    position: relative; order: 2;
    top: auto; bottom: auto; left: auto; transform: none;
    width: min(100%, 520px, calc(60svh * 8 / 9));
    flex: 0 0 auto;
    aspect-ratio: var(--hc-ar, 8 / 9);
    margin: auto 0;
  }
  .hc-canvas {
    -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 58%, #000 66%, transparent 100%);
            mask-image: radial-gradient(ellipse 80% 90% at 50% 58%, #000 66%, transparent 100%);
  }
  .hc-message {
    right: auto; left: 50%; top: auto; bottom: 100px;
    transform: translate(-50%, 8px);
    text-align: center; border-radius: 16px;
    white-space: nowrap; max-width: calc(100vw - 40px);
  }
  .hc-message.is-on { transform: translate(-50%, 0); }
  .hc-cue { bottom: 40px; }
  .hc-bg { background:
    radial-gradient(ellipse 110% 70% at 50% 58%, var(--hc-glow) 0%, var(--hc-glow) 34%, var(--hc-rose) 68%, var(--hc-rose-2) 90%, var(--hc-maroon) 100%); }
  [data-theme="dark"] .hc-bg { background:
    radial-gradient(ellipse 80% 52% at 50% 58%, #ffffff 0%, #fbf3f3 30%, #e7c3c8 52%, var(--hc-rose) 72%, var(--hc-rose-2) 88%, var(--hc-maroon) 100%); }
  .hc-glow { top: 58%; width: 120vw; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-glow, .hc-hint-track svg, .hc-cue svg { animation: none; }
}
