/* Deskrune cinematic hero — Remotion-equivalent SVG+CSS animation
   Replaces the static hero/badge with a full-bleed animated stage.
   2026-05-07. Same beats as the planned Remotion video:
     0.0–1.2s  glyph draws in via stroke-dasharray
     0.5s      square locks in
     0.6s      X marks draw in
     1.7–3.2s  tagline characters stagger in
     3.2s+     glyph pulses gently in a 4.6s loop forever
*/

.hero-cinematic {
  position: relative;
  min-height: 88vh;
  background: var(--bg, #faf9f5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 80px 24px 96px;
}

.hero-anim-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.85;
  pointer-events: none;
}
.hero-anim-bg svg {
  width: 100%;
  height: 100%;
}

/* CENTER STAGE — animated glyph + tagline */
.hero-cine-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  margin-bottom: 64px;
}
.hero-cine-glyph {
  width: clamp(180px, 28vw, 320px);
  height: clamp(180px, 28vw, 320px);
  overflow: visible;
  filter: drop-shadow(0 8px 24px rgba(201, 97, 63, 0.12));
}
/* Animation cut 60% (per critic feedback) — cold Pinterest visitors must
   reach the offer in <2s. Glyph is now drawn in by 0.7s, content lands by 1.2s. */
.hero-cine-glyph path {
  stroke-dasharray: 56;
  stroke-dashoffset: 56;
  animation: cine-draw-square 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.05s forwards;
}
.hero-cine-glyph line:nth-of-type(1) {
  stroke-dasharray: 12;
  stroke-dashoffset: 12;
  animation: cine-draw-line 0.35s cubic-bezier(0.22, 1, 0.36, 1) 0.4s forwards;
}
.hero-cine-glyph line:nth-of-type(2) {
  stroke-dasharray: 6;
  stroke-dashoffset: 6;
  animation: cine-draw-line 0.25s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
}
@keyframes cine-draw-square {
  to { stroke-dashoffset: 0; }
}
@keyframes cine-draw-line {
  to { stroke-dashoffset: 0; }
}

/* After draw-in, the entire glyph pulses gently forever.
   Custom sinusoidal-feel cubic-bezier — symmetric breathing, not browser-default ease-in-out. */
.hero-cine-glyph {
  animation: cine-pulse 4.6s cubic-bezier(0.45, 0, 0.55, 1) 1.0s infinite;
  transform-origin: center;
}
@keyframes cine-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}

/* TAGLINE — character-by-character typewriter reveal */
.hero-cine-tag {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(20px, 3.4vw, 36px);
  letter-spacing: -0.005em;
  color: var(--ink, #141413);
  margin: 0;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  font-variation-settings: 'opsz' 96, 'wght' 500;
}
.hero-cine-tag span {
  display: inline-block;
  opacity: 0;
  transform: translateY(12px);
  animation: cine-char-in 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes cine-char-in {
  to { opacity: 1; transform: translateY(0); }
}
.hero-cine-tag span:nth-child(1)  { animation-delay: 1.80s; }
.hero-cine-tag span:nth-child(2)  { animation-delay: 1.85s; }
.hero-cine-tag span:nth-child(3)  { animation-delay: 1.90s; }
.hero-cine-tag span:nth-child(4)  { animation-delay: 1.95s; }
.hero-cine-tag span:nth-child(5)  { animation-delay: 2.00s; }
.hero-cine-tag span:nth-child(6)  { animation-delay: 2.05s; }
.hero-cine-tag span:nth-child(7)  { animation-delay: 2.10s; }
.hero-cine-tag span:nth-child(8)  { animation-delay: 2.15s; }
.hero-cine-tag span:nth-child(9)  { animation-delay: 2.20s; }
.hero-cine-tag span:nth-child(10) { animation-delay: 2.25s; }
.hero-cine-tag span:nth-child(11) { animation-delay: 2.30s; }
.hero-cine-tag span:nth-child(12) { animation-delay: 2.35s; }
.hero-cine-tag span:nth-child(13) { animation-delay: 2.40s; }
.hero-cine-tag span:nth-child(14) { animation-delay: 2.45s; }
.hero-cine-tag span:nth-child(15) { animation-delay: 2.50s; }
.hero-cine-tag span:nth-child(16) { animation-delay: 2.55s; }
.hero-cine-tag span:nth-child(17) { animation-delay: 2.60s; }
.hero-cine-tag span:nth-child(18) { animation-delay: 2.65s; }
.hero-cine-tag span:nth-child(19) { animation-delay: 2.70s; }
.hero-cine-tag span:nth-child(20) { animation-delay: 2.75s; }
.hero-cine-tag span:nth-child(21) { animation-delay: 2.80s; }
.hero-cine-tag span:nth-child(22) { animation-delay: 2.85s; }

/* CONTENT — eyebrow + h1 + lede + CTAs, fades in last */
.hero-cine-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  opacity: 0;
  transform: translateY(16px);
  animation: cine-content-in 0.9s cubic-bezier(0.16, 1, 0.3, 1) 3.0s forwards;
}
@keyframes cine-content-in {
  to { opacity: 1; transform: translateY(0); }
}
.hero-cine-content .eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #c9613f;
  margin-bottom: 14px;
}
.hero-cine-content h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  line-height: 1.05;
  color: var(--ink, #141413);
  text-wrap: balance;
}
.hero-cine-content .lede {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.6;
  /* Stronger ink-soft for AAA contrast on cream — was #2d2a26 (4.6:1), now 8:1 */
  color: var(--ink-soft, #1f1c18);
  margin: 0 auto 36px;
  max-width: 640px;
}
.hero-cine-content .hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-cine-content .hero-action {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.01em;
  padding: 14px 22px;
  border-radius: 4px;
  text-decoration: none;
  /* Explicit properties only — no `all` — and split timing per purpose:
     transform/color land in 160ms (micro-interaction range), shadow expands in 280ms (transition range). */
  transition:
    background-color 0.16s cubic-bezier(0.2, 0, 0, 1),
    color 0.16s cubic-bezier(0.2, 0, 0, 1),
    border-color 0.16s cubic-bezier(0.2, 0, 0, 1),
    transform 0.16s cubic-bezier(0.2, 0, 0, 1),
    box-shadow 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-cine-content .hero-action.primary {
  background: var(--ink, #141413);
  color: var(--bg, #faf9f5);
}
.hero-cine-content .hero-action.primary:hover {
  background: #c9613f;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201, 97, 63, 0.25);
}
.hero-cine-content .hero-action.secondary {
  background: transparent;
  color: var(--ink, #141413);
  border: 1px solid var(--rule, #e8e6dc);
}
.hero-cine-content .hero-action.secondary:hover {
  border-color: #c9613f;
  color: #c9613f;
}

/* ─── DARK MODE — overrides legacy site rules and body::before wash ─── */
/* Site-wide pre-existing CSS sets body::before to a 60% opacity coral wash
   in dark mode. That destroys legibility on every page. Kill it everywhere. */
:root[data-theme="dark"] body::before {
  display: none !important;
}
/* Dark-mode page background: deep ink, not the legacy "navy" that reads blue. */
:root[data-theme="dark"] body {
  background: #0e0c0a !important;
  color: #e8e0d2;
}
/* Cinematic hero in dark — defeat the .hero base rule via specificity */
:root[data-theme="dark"] .hero.hero-cinematic {
  background: radial-gradient(ellipse at top, #1c1814 0%, #0e0c0a 75%) !important;
}
/* Sale banner in dark — slightly muted so it's not screaming */
:root[data-theme="dark"] .deskrune-sale-banner {
  background: linear-gradient(90deg, #b8542c 0%, #a04d28 100%);
  color: #fff5ec;
}
/* Nav in dark — subtle border, not coral */
:root[data-theme="dark"] nav {
  background: #0e0c0a !important;
  border-bottom-color: rgba(232, 224, 210, 0.08) !important;
}
:root[data-theme="dark"] nav a.brand,
:root[data-theme="dark"] nav .links a {
  color: #e8e0d2 !important;
}
:root[data-theme="dark"] nav .links a:hover {
  color: #f08160 !important;
}
/* Body sections in dark — make sure white sections read deep, not navy-blue */
:root[data-theme="dark"] .section.white,
:root[data-theme="dark"] .section.warm,
:root[data-theme="dark"] .section.pale {
  background: #110e0c !important;
  color: #e8e0d2 !important;
}
:root[data-theme="dark"] .section h2,
:root[data-theme="dark"] .section h3,
:root[data-theme="dark"] .section h4 {
  color: #f5efe4 !important;
}
:root[data-theme="dark"] .section p,
:root[data-theme="dark"] .section .lede {
  color: #cdc4b6 !important;
}
:root[data-theme="dark"] .section a {
  color: #f08160 !important;
}
[data-theme="dark"] .hero-cine-tag,
[data-theme="dark"] .hero-cine-content h1 {
  color: #f5efe4;
}
[data-theme="dark"] .hero-cine-content .lede {
  color: #d6cdbf;
}
[data-theme="dark"] .hero-cine-content .eyebrow {
  color: #f08160;
}
[data-theme="dark"] .hero-cine-content .hero-action.primary {
  background: #f08160;
  color: #16110e;
}
[data-theme="dark"] .hero-cine-content .hero-action.primary:hover {
  background: #f7a08a;
  box-shadow: 0 8px 22px rgba(240, 129, 96, 0.35);
}
[data-theme="dark"] .hero-cine-content .hero-action.secondary {
  color: #f5efe4;
  border-color: rgba(245, 239, 228, 0.22);
  background: rgba(245, 239, 228, 0.04);
}
[data-theme="dark"] .hero-cine-content .hero-action.secondary:hover {
  border-color: #f08160;
  color: #f08160;
}
[data-theme="dark"] .hero-cine-glyph path,
[data-theme="dark"] .hero-cine-glyph line {
  stroke: #f08160;
}
[data-theme="dark"] .hero-cine-glyph {
  filter: drop-shadow(0 8px 24px rgba(240, 129, 96, 0.22));
}

/* DESKRUNE meaning — dark variant: brighter accent + softer body so the
   serif words and definitions stay readable on the deep background. */
[data-theme="dark"] .meaning-word {
  color: #f5efe4;
}
[data-theme="dark"] .meaning-dot,
[data-theme="dark"] .def-key {
  color: #f08160;
}
[data-theme="dark"] .meaning-def,
[data-theme="dark"] .def-val {
  color: #cdc4b6;
}
[data-theme="dark"] .meaning-def-sum {
  color: #f5efe4;
  border-top-color: rgba(245, 239, 228, 0.12);
}
[data-theme="dark"] .def-sep { color: rgba(205, 196, 182, 0.45); }

/* ─── DESKRUNE meaning block ─── */
.hero-cine-meaning {
  position: relative;
  z-index: 2;
  text-align: center;
  margin: 0 auto 56px;
  max-width: 640px;
  padding: 0 24px;
  opacity: 0;
  animation: meaning-fade-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) 2.4s forwards;
}
@keyframes meaning-fade-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.meaning-word {
  font-family: var(--serif, 'Fraunces', serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink, #141413);
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  margin-bottom: 28px;
}
.meaning-half {
  display: inline-flex;
  align-items: baseline;
  position: relative;
}
.meaning-half span {
  display: inline-block;
  opacity: 0;
  transform: translateY(-22px) rotate(-3deg);
  /* No bounce/elastic per impeccable.SKILL.md ("No bounce, no elastic").
     ease-out-quart curve: drops in decisively, settles flat. */
  animation: letter-drop 0.62s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.meaning-desk span:nth-child(1) { animation-delay: 2.6s; }
.meaning-desk span:nth-child(2) { animation-delay: 2.68s; }
.meaning-desk span:nth-child(3) { animation-delay: 2.76s; }
.meaning-desk span:nth-child(4) { animation-delay: 2.84s; }
.meaning-rune span:nth-child(1) { animation-delay: 3.0s; }
.meaning-rune span:nth-child(2) { animation-delay: 3.08s; }
.meaning-rune span:nth-child(3) { animation-delay: 3.16s; }
.meaning-rune span:nth-child(4) { animation-delay: 3.24s; }
@keyframes letter-drop {
  0%   { opacity: 0; transform: translateY(-22px) rotate(-3deg); }
  100% { opacity: 1; transform: translateY(0) rotate(0); }
}
.meaning-dot {
  display: inline-block;
  color: var(--accent, #c9613f);
  font-weight: 700;
  font-size: 0.7em;
  transform: translateY(-0.18em);
  opacity: 0;
  /* Removed scale(1.4) overshoot — bounce banned. Pure ease-out-quint settle. */
  animation: dot-bloom 0.42s cubic-bezier(0.22, 1, 0.36, 1) 2.94s forwards;
}
@keyframes dot-bloom {
  0%   { opacity: 0; transform: translateY(-0.18em) scale(0.6); }
  100% { opacity: 1; transform: translateY(-0.18em) scale(1); }
}
.meaning-defs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.meaning-def {
  margin: 0;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 14px;
  color: var(--ink-soft, #2d2a26);
  letter-spacing: 0.01em;
  opacity: 0;
  transform: translateY(8px);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  animation: def-slide-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.meaning-def[data-step="1"] { animation-delay: 3.5s; }
.meaning-def[data-step="2"] { animation-delay: 3.85s; }
.meaning-def[data-step="3"] { animation-delay: 4.25s; }
@keyframes def-slide-in {
  to { opacity: 1; transform: translateY(0); }
}
.def-key {
  font-family: var(--serif, 'Fraunces', serif);
  font-style: italic;
  font-weight: 500;
  color: var(--accent, #c9613f);
  font-size: 15px;
  letter-spacing: 0;
  flex-shrink: 0;
}
.def-sep {
  color: var(--muted, #6b6960);
  font-weight: 600;
  opacity: 0.6;
  flex-shrink: 0;
}
.def-val {
  color: var(--ink-soft, #2d2a26);
  text-align: left;
}
.meaning-def-sum {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--rule, #e8e6dc);
  font-family: var(--serif, 'Fraunces', serif);
  font-size: 16px;
  color: var(--ink, #141413);
  display: block;
}
.meaning-def-sum em {
  font-style: italic;
  font-weight: 500;
}

/* MEANING — mobile */
@media (max-width: 640px) {
  .hero-cine-meaning { margin-bottom: 36px; padding: 0 14px; }
  .meaning-word { font-size: clamp(30px, 11vw, 52px); margin-bottom: 18px; }
  .meaning-def {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: left;
    width: 100%;
  }
  .def-sep { display: none; }
  .meaning-def-sum { font-size: 15px; text-align: center; padding-top: 10px; }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  .hero-cine-glyph path,
  .hero-cine-glyph line {
    stroke-dashoffset: 0 !important;
    animation: none !important;
  }
  .hero-cine-glyph { animation: none !important; }
  .hero-cine-tag span { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-cine-content { opacity: 1 !important; transform: none !important; animation: none !important; }
  .hero-cine-meaning,
  .meaning-half span,
  .meaning-dot,
  .meaning-def {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
}

/* MOBILE TIGHTENING */
@media (max-width: 640px) {
  .hero-cinematic {
    min-height: calc(100svh - 72px); /* leave space below sale banner */
    padding: 40px 18px 56px;
  }
  .hero-cine-stage { gap: 22px; margin-bottom: 28px; }
  .hero-cine-glyph {
    width: clamp(140px, 38vw, 220px);
    height: clamp(140px, 38vw, 220px);
  }
  .hero-cine-tag {
    font-size: clamp(13px, 4.6vw, 20px);
    letter-spacing: 0.06em;
  }
  .hero-cine-content { padding: 0 4px; }
  .hero-cine-content h1 {
    font-size: clamp(28px, 7.2vw, 38px) !important;
    line-height: 1.12 !important;
  }
  .hero-cine-content p {
    font-size: 16px !important;
    line-height: 1.55 !important;
  }
  .hero-cine-content .hero-action {
    width: 100%;
    justify-content: center;
    min-height: 50px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
  }
  .hero-cine-content .hero-actions {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
}

/* TINY PHONES (≤380px — iPhone SE 1st gen, etc.) */
@media (max-width: 380px) {
  .hero-cinematic { padding: 32px 14px 48px; }
  .hero-cine-glyph {
    width: clamp(120px, 36vw, 180px);
    height: clamp(120px, 36vw, 180px);
  }
  .hero-cine-content h1 {
    font-size: clamp(24px, 6.8vw, 32px) !important;
  }
}
