/* MIDI King marketing homepage (2026-08-16 redesign). Same brand tokens as
   the app itself (src/renderer/ui/styles.css) and the Hub (midi-king-hub/
   src/index.css) - champagne gold on near-black, Cormorant Garamond for
   display type, Inter for body copy. Self-hosted fonts, no CDN - see
   scripts/build-site.mjs, which copies the same .woff2 files the app ships. */

@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('./assets/fonts/Inter-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('./assets/fonts/CormorantGaramond-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('./assets/fonts/CormorantGaramond-SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --ink: #e9e6dd;
  --ink-dim: #a3a096;
  --ink-faint: #6c6960;
  --accent: #c9a961;
  --accent-rgb: 201, 169, 97;
  --accent-bright: #f3ead2;
  --bg: #050505;
  --panel-bg: rgba(20, 19, 22, 0.7);
  --panel-bg-solid: #121114;
  --line: rgba(255, 255, 255, 0.09);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --max-w: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Defensive backstop, not the primary fix (.hero's own overflow: hidden,
     below, is) - catches any future off-page-edge decorative element the
     same way .hero-embers' negative inset did on mobile. */
  overflow-x: hidden;
}

/* Soft ambient gold glow + faint grid, echoing the app's own backdrop -
   fixed so it doesn't repeat oddly at scroll-heavy page lengths. */
body {
  background-image:
    radial-gradient(ellipse 90vw 50vh at 50% -10%, rgba(var(--accent-rgb), 0.09), transparent 60%),
    radial-gradient(ellipse 70vw 40vh at 100% 40%, rgba(var(--accent-rgb), 0.05), transparent 65%),
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}

a { color: inherit; }
img { max-width: 100%; display: block; }

.eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.7rem;
}
.eyebrow.center { text-align: center; }
.center { text-align: center; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent-bright);
  margin: 0;
}
h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 0.6rem; }
h3 { font-size: 1.4rem; color: var(--accent); }

.section-sub {
  color: var(--ink-dim);
  max-width: 620px;
  margin: 0 auto 2.6rem;
  font-size: 1.02rem;
}

section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: #17140d;
  box-shadow: 0 0 0 rgba(var(--accent-rgb), 0);
}
.btn-gold:hover { box-shadow: 0 0 26px rgba(var(--accent-rgb), 0.45); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: rgba(var(--accent-rgb), 0.5); color: var(--accent-bright); }

/* ============ nav ============ */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
/* Subtle "you've scrolled" cue (site/main.js) - a touch more opaque/present
   once the hero has scrolled by, purely cosmetic. */
.nav.nav-scrolled {
  background: rgba(5, 5, 5, 0.92);
  border-bottom-color: rgba(var(--accent-rgb), 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent-bright);
  font-size: 1.05rem;
}
.nav-brand-mark { width: 26px; height: 26px; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.5)); }
.nav-links {
  display: flex;
  gap: 1.6rem;
  font-size: 0.88rem;
  color: var(--ink-dim);
}
.nav-links a { text-decoration: none; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--accent-bright); }
.nav-cta {
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.nav-cta:hover { background: rgba(var(--accent-rgb), 0.12); box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.3); }

@media (max-width: 780px) {
  .nav-links { display: none; }
}

/* ============ hero ============ */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
  padding-bottom: 4rem;
  /* Clips .hero-embers' negative inset (below) to the hero's own box - both
     the intended look (embers drift within the hero, not into the nav/
     features section) and required so their offscreen-left/right reach
     doesn't add horizontal scroll to the whole page on narrow viewports. */
  overflow: hidden;
}

/* Ambient drifting embers (site/main.js generates the .ember spans) - the
   same "glowing motes drifting up" language particles.js uses in the app
   itself, echoed here as a pure-CSS background flourish. Positioned behind
   everything else in the hero, never intercepts clicks. */
.hero-embers {
  position: absolute;
  inset: -10% -5% -5% -5%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.ember {
  position: absolute;
  bottom: 0;
  left: 0;
  width: var(--size, 3px);
  height: var(--size, 3px);
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 6px 1px rgba(var(--accent-rgb), 0.8);
  opacity: 0;
  animation: ember-rise var(--duration, 9s) ease-in var(--delay, 0s) infinite;
}
@keyframes ember-rise {
  0% { transform: translate(0, 0); opacity: 0; }
  8% { opacity: 0.85; }
  85% { opacity: 0.5; }
  100% { transform: translate(var(--drift, 0px), -115vh); opacity: 0; }
}
.hero-copy, .hero-art { position: relative; z-index: 1; }
.eyebrow { }
h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
  line-height: 1.05;
  margin-bottom: 1.2rem;
}
.hero-sub {
  color: var(--ink-dim);
  font-size: 1.08rem;
  max-width: 540px;
  margin: 0 0 1.8rem;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-note { color: var(--ink-faint); font-size: 0.85rem; }
.hero-art {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease;
}
.hero-art:hover {
  transform: translateY(-4px) scale(1.012);
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.6), 0 0 46px rgba(var(--accent-rgb), 0.18);
}
.hero-art img, .hero-art video { width: 100%; height: auto; display: block; }

/* Small, quiet control in the video's own corner - matches the "quiet
   premium" restraint main.js's own comment calls out for the hero's motion
   graphics, not a loud media-player-style bar. */
.hero-video-mute {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 9, 7, 0.55);
  backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.hero-video-mute:hover {
  border-color: rgba(var(--accent-rgb), 0.55);
  color: var(--accent-bright);
  background: rgba(10, 9, 7, 0.75);
}
.hero-video-mute svg { width: 18px; height: 18px; display: block; }
.hero-video-mute .icon-unmuted { display: none; }
.hero-video-mute:not(.is-muted) .icon-muted { display: none; }
.hero-video-mute:not(.is-muted) .icon-unmuted { display: block; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 2.5rem; }
  .hero-sub { max-width: none; }
}

/* ============ live demo ============ */

.demo-section { text-align: center; }
.demo-frame-wrap {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}
.demo-frame { width: 100%; height: 100%; border: 0; display: block; }
.demo-frame-launch {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(var(--accent-rgb), 0.08), transparent), #050505;
  border: none;
  color: var(--accent-bright);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
.demo-frame-launch:hover { background: radial-gradient(ellipse 70% 60% at 50% 45%, rgba(var(--accent-rgb), 0.16), transparent), #050505; }
.demo-frame-launch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--accent-rgb), 0.6);
  font-size: 1.4rem;
  color: var(--accent);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.25);
}
.demo-frame-wrap.launched .demo-frame-launch { display: none; }
.demo-hint { margin-top: 1.1rem; color: var(--ink-faint); font-size: 0.85rem; }
.demo-hint a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(var(--accent-rgb), 0.4); }

/* ============ features ============ */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.feature-card {
  padding: 1.8rem 1.9rem;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.feature-card h3 { margin-bottom: 0.9rem; }
.feature-card ul { margin: 0; padding-left: 1.1rem; color: var(--ink-dim); font-size: 0.94rem; }
.feature-card li { margin-bottom: 0.55rem; line-height: 1.45; }
.feature-card li:last-child { margin-bottom: 0; }
.feature-card li::marker { color: var(--accent); }

@media (max-width: 780px) {
  .feature-grid { grid-template-columns: 1fr; }
}

/* ============ gallery ============ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.4rem;
  margin-top: 2.5rem;
}
.gallery-item {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.gallery-item:hover { border-color: rgba(var(--accent-rgb), 0.4); box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.14); }
.gallery-item img { width: 100%; height: auto; display: block; transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item figcaption {
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  color: var(--ink-dim);
  border-top: 1px solid var(--line);
}

@media (max-width: 780px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* ============ pricing ============ */

.pricing { display: flex; justify-content: center; }
.pricing-card {
  width: 100%;
  max-width: 440px;
  text-align: center;
  padding: 2.6rem 2.2rem;
  background: var(--panel-bg);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
}
.price { margin: 0.3rem 0 0.2rem; }
.price-amount {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 600;
  /* A slow gold sheen sweeping across the figure - the one place on the page
     that earns a standing (not scroll-triggered) animation, since it's the
     page's actual focal number. background-clip text, not a filter/opacity
     trick, so it stays crisp at any size. */
  background: linear-gradient(100deg, var(--accent) 35%, var(--accent-bright) 50%, var(--accent) 65%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: price-sheen 5s ease-in-out infinite;
}
@keyframes price-sheen {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0 0; }
}
.price-sub { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1.6rem; }
.price-features {
  list-style: none;
  margin: 0 0 1.8rem;
  padding: 0;
  text-align: left;
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.price-features li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.price-features li:last-child { border-bottom: none; }
.price-features li::before { content: '✓'; color: var(--accent); font-weight: 700; }
.price-note { margin: 1.1rem 0 0; font-size: 0.8rem; color: var(--ink-faint); line-height: 1.5; }

/* ============ faq ============ */

.faq-list { max-width: 760px; margin: 2.5rem auto 0; }
.faq-list details {
  border-bottom: 1px solid var(--line);
  padding: 1.1rem 0;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 1.02rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: '+';
  color: var(--accent);
  font-size: 1.3rem;
  font-weight: 400;
  margin-left: 1rem;
  transition: transform 0.2s ease;
}
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list p { color: var(--ink-dim); font-size: 0.94rem; margin: 0.9rem 0 0; line-height: 1.55; }

/* ============ scroll-reveal ============ */
/* site/main.js adds .reveal to each target on load and .reveal-in the first
   time it scrolls into view (IntersectionObserver, one-shot). Plain opacity/
   transform so it's cheap and never affects layout. Skipped entirely when
   prefers-reduced-motion is set - see main.js's own guard - so there is no
   reduced-motion variant to maintain here. */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal-in { opacity: 1; transform: translateY(0); }
/* Staggered within a grid so a row doesn't snap in as one flat block. */
.feature-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.feature-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.feature-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.gallery-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.gallery-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.gallery-grid .reveal:nth-child(4) { transition-delay: 0.18s; }

/* ============ footer ============ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.6rem 1.5rem 3rem;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent-bright);
  margin-bottom: 0.9rem;
}
.footer-mark { width: 22px; height: 22px; opacity: 0.9; }
.footer-credits {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-faint);
  font-size: 0.78rem;
  line-height: 1.7;
}
.footer-credits a { color: var(--ink-dim); text-decoration: underline; text-decoration-color: var(--line); }

/* ============ reduced motion ============ */
/* Covers the one standing (not JS-gated) CSS animation, .price-amount's
   sheen - site/main.js's own reduceMotion check already skips creating the
   .ember/.reveal elements entirely, so there's nothing else here to disable. */
@media (prefers-reduced-motion: reduce) {
  .price-amount { animation: none; background-position: 0 0; }
  html { scroll-behavior: auto; }
}
