/** Fable Five · $50k premium polish — base layer + progressive unlock tiers */

html.pm-premium {
  scroll-behavior: smooth;
}

html.pm-premium body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Ambient music states: red off · green on · yellow listening ── */
.ambient-toggle.ambient-off {
  color: #ff4d6d !important;
  border-color: rgba(255, 77, 109, 0.65) !important;
  box-shadow: 0 0 20px rgba(255, 77, 109, 0.25) !important;
  opacity: 1 !important;
}
.ambient-toggle.ambient-on {
  color: #00ff88 !important;
  border-color: rgba(0, 255, 136, 0.55) !important;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.28) !important;
  opacity: 1 !important;
}
.ambient-toggle.ambient-listening {
  color: #ffc940 !important;
  border-color: rgba(255, 201, 64, 0.65) !important;
  box-shadow: 0 0 28px rgba(255, 201, 64, 0.35) !important;
  animation: fableListenPulse 1.4s ease-in-out infinite;
}
@keyframes fableListenPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ── FAQ · fluent accordion ── */
html.pm-premium .faq details {
  transition: border-color 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease, background 0.28s ease;
}
html.pm-premium .faq details[open] {
  transform: translateY(-2px);
  background: rgba(8, 14, 22, 0.92);
}
html.pm-premium .faq details.is-speaking {
  border-color: rgba(255, 201, 64, 0.45);
  box-shadow: 0 0 32px rgba(255, 201, 64, 0.12);
}
html.pm-premium .faq summary {
  transition: color 0.2s ease;
}
html.pm-premium .faq details[open] summary {
  color: var(--cyan, #00d4ee);
}
html.pm-premium .faq details .faq-answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease, transform 0.32s ease;
}
html.pm-premium .faq details[open] .faq-answer {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0);
}

/* ── Rebuttal Lab · smooth expand ── */
html.pm-premium .rebuttal-card {
  transition: transform 0.25s ease;
}
html.pm-premium .rebuttal-card.is-open {
  transform: translateY(-2px);
}
html.pm-premium .rebuttal-q {
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
html.pm-premium .rebuttal-card.is-open .rebuttal-q {
  border-color: rgba(0, 212, 238, 0.45);
  box-shadow: 0 0 24px rgba(0, 212, 238, 0.12);
}
html.pm-premium .rebuttal-a {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}
html.pm-premium .rebuttal-card.is-open .rebuttal-a {
  max-height: 480px;
  opacity: 1;
  margin-top: 0.35rem;
  padding: 1rem;
}
html.pm-premium .rebuttal-card.is-speaking .rebuttal-q {
  border-color: rgba(255, 201, 64, 0.5);
}

/* ── Magnetic premium buttons ── */
html.pm-premium .btn-primary,
html.pm-premium .btn-command,
html.pm-premium .dock-btn--command,
html.pm-premium [data-magnetic] {
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
  will-change: transform;
}
html.pm-premium .btn-primary.is-magnetic-hover {
  box-shadow: 0 8px 40px rgba(232, 50, 138, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* ── Fable tier: Neural Link — command glow ── */
html.fable-neural .command-portal-shell,
html.fable-neural [data-command-open] {
  position: relative;
}
html.fable-neural .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0, 212, 238, 0.08), transparent 60%);
  z-index: 0;
}

/* ── Fable tier: Data Hunter — card depth ── */
html.fable-hunter .service-card,
html.fable-hunter .investment-card,
html.fable-hunter .pm-os-panel,
html.fable-hunter .form-wrap {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}
html.fable-hunter .service-card:hover,
html.fable-hunter .investment-card:hover,
html.fable-hunter .pm-os-panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(0, 212, 238, 0.15);
}

/* ── Fable tier: Skin Walker — persona accent ── */
html.fable-skin[data-persona="overbooked"] { --fable-accent: #ffc940; }
html.fable-skin[data-persona="marketing"] { --fable-accent: #8c50ff; }
html.fable-skin[data-persona="operator"] { --fable-accent: #00ff88; }
html.fable-skin[data-persona="owner"] { --fable-accent: #e8328a; }
html.fable-skin .pm-os-hud-inner {
  border-color: color-mix(in srgb, var(--fable-accent, #e8328a) 35%, transparent);
}

/* ── Fable tier: Mode Shift — lang shimmer ── */
html.fable-mode.lang-flash .site-header {
  animation: fableLangFlash 0.55s ease;
}
@keyframes fableLangFlash {
  0% { box-shadow: inset 0 -2px 0 rgba(0, 212, 238, 0); }
  40% { box-shadow: inset 0 -2px 0 rgba(0, 212, 238, 0.8); }
  100% { box-shadow: inset 0 -2px 0 rgba(0, 212, 238, 0); }
}

/* ── Fable tier: Empire Apex — full premium depth ── */
html.fable-apex .section,
html.fable-apex .hero {
  backdrop-filter: blur(8px) saturate(1.15);
}
html.fable-apex .gradient-text {
  background-size: 200% auto;
  animation: fableGradientShift 8s ease infinite;
}
@keyframes fableGradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}
html.fable-apex .pm-scroll-progress {
  height: 3px;
  background: linear-gradient(90deg, #e8328a, #00d4ee, #ffc940);
  box-shadow: 0 0 16px rgba(0, 212, 238, 0.4);
}

html[data-a11y-reduce-motion="true"] .ambient-toggle.ambient-listening,
html[data-a11y-reduce-motion="true"] .gradient-text,
html[data-a11y-reduce-motion="true"] .hero-logo-wrap {
  animation: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   Fable Showcase · full $50k stack on first open (homepage)
   ═══════════════════════════════════════════════════════════════ */

html.pm-premium::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

html.fable-showcase .pm-scroll-progress {
  height: 3px;
  background: linear-gradient(90deg, #e8328a, #00d4ee, #ffc940);
  box-shadow: 0 0 20px rgba(0, 212, 238, 0.45);
  transition: opacity 0.3s ease;
}

html.fable-showcase .gradient-text {
  background-size: 200% auto;
  animation: fableGradientShift 8s ease infinite;
}

html.fable-showcase .hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 0%, rgba(0, 212, 238, 0.1), transparent 62%);
  z-index: 0;
}

html.fable-showcase .service-card,
html.fable-showcase .investment-card,
html.fable-showcase .pm-os-panel,
html.fable-showcase .form-wrap,
html.fable-showcase .journey-frame,
html.fable-showcase .position-pillar {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

html.fable-showcase .service-card:hover,
html.fable-showcase .investment-card:hover,
html.fable-showcase .pm-os-panel:hover,
html.fable-showcase .journey-frame:hover,
html.fable-showcase .position-pillar:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.48), 0 0 0 1px rgba(0, 212, 238, 0.18);
}

html.fable-showcase .section,
html.fable-showcase .hero {
  backdrop-filter: blur(6px) saturate(1.12);
}

html.fable-showcase .hero-logo-wrap {
  animation: fableLogoBreath 7s ease-in-out infinite;
  filter: drop-shadow(0 0 40px rgba(0, 212, 238, 0.25)) drop-shadow(0 0 60px rgba(232, 50, 138, 0.15));
}

@keyframes fableLogoBreath {
  0%, 100% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-6px); }
}

html.fable-showcase.lang-flash .site-header {
  animation: fableLangFlash 0.55s ease;
}

html.fable-showcase[data-persona="overbooked"] { --fable-accent: #ffc940; }
html.fable-showcase[data-persona="marketing"] { --fable-accent: #8c50ff; }
html.fable-showcase[data-persona="operator"] { --fable-accent: #00ff88; }
html.fable-showcase[data-persona="owner"] { --fable-accent: #e8328a; }

html.fable-showcase .pm-os-hud-inner {
  border-color: color-mix(in srgb, var(--fable-accent, #e8328a) 35%, transparent);
  box-shadow: 0 0 32px color-mix(in srgb, var(--fable-accent, #e8328a) 12%, transparent);
}

/* Hero cinematic entrance */
html.pm-premium .hero.fable-hero-enter .hero-grid > *,
html.pm-premium .hero.fable-hero-enter .hero-visual {
  opacity: 0;
  transform: translateY(32px);
}

html.pm-premium .hero.fable-hero-ready .hero-grid > *,
html.pm-premium .hero.fable-hero-ready .hero-visual {
  opacity: 1;
  transform: none;
  transition: opacity 1s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}

html.pm-premium .hero.fable-hero-ready .hero-visual {
  transition-delay: 0.15s;
}

html.pm-premium .hero.fable-hero-ready .convo-chip {
  animation: fableChipIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

html.pm-premium .hero.fable-hero-ready .convo-chip:nth-child(1) { animation-delay: 0.55s; }
html.pm-premium .hero.fable-hero-ready .convo-chip:nth-child(2) { animation-delay: 0.62s; }
html.pm-premium .hero.fable-hero-ready .convo-chip:nth-child(3) { animation-delay: 0.69s; }
html.pm-premium .hero.fable-hero-ready .convo-chip:nth-child(4) { animation-delay: 0.76s; }
html.pm-premium .hero.fable-hero-ready .convo-chip:nth-child(5) { animation-delay: 0.83s; }

@keyframes fableChipIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Scroll-triggered section reveals */
html.pm-premium .fable-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--fable-stagger, 0s);
}

html.pm-premium .fable-reveal.fable-in-view {
  opacity: 1;
  transform: none;
}

html.fable-showcase .journey-frame {
  border-color: rgba(0, 212, 238, 0.12);
}

html.fable-showcase .journey-frame:hover {
  border-color: rgba(232, 50, 138, 0.35);
}

html.fable-showcase .site-header {
  backdrop-filter: blur(16px) saturate(1.2);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

html.fable-showcase .site-header.is-scrolled,
html.fable-showcase:not(.fable-hero-enter) .site-header {
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35), inset 0 -1px 0 rgba(0, 212, 238, 0.15);
}

html.fable-showcase .btn-primary {
  box-shadow: 0 4px 28px rgba(232, 50, 138, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

html.fable-showcase .btn-primary:hover {
  box-shadow: 0 8px 44px rgba(232, 50, 138, 0.42), 0 0 24px rgba(0, 212, 238, 0.15);
}

html.fable-showcase .corp-bar {
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(0, 212, 238, 0.2);
}

html.fable-showcase .fable-five-title {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--neon-cyan, #00d4ee);
}

html.fable-showcase .fable-skill.unlocked {
  animation: fableSkillPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fableSkillPop {
  0% { transform: scale(0.85); opacity: 0.6; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
