/* ==========================================================================
   Homepage — dark, editorial, consumer feel.
   Only applies to body.page-home. Other pages keep the white utility theme.
   ========================================================================== */

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/InstrumentSerif.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Circular Std";
  src: url("/fonts/Circular-Std-Medium-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

body.page-home {
  --surface-page: #000000;
  --surface-raised: #111111;
  --surface-sunken: #0a0a0a;
  --surface-inverse: #ffffff;
  --surface-translucent: rgba(0, 0, 0, 0.72);
  --scrim: rgba(0, 0, 0, 0.6);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.74);
  --text-tertiary: rgba(255, 255, 255, 0.52);
  --text-on-inverse: #111111;
  --text-on-inverse-secondary: rgba(17, 17, 17, 0.62);

  --border-subtle: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --border-inverse: rgba(17, 17, 17, 0.16);

  --brand-primary: #ffffff;
  --brand-primary-hover: #e8e8e8;
  --brand-on-primary: #111111;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.45);

  --font-logo: "Circular Std", system-ui, sans-serif;
  --font-heading: "Circular Std", system-ui, sans-serif;
  --font-editorial: "Instrument Serif", Georgia, serif;

  background: var(--surface-page);
  color: var(--text-primary);
}

/* Logo and headings both use Circular Std; body stays Instrument Serif. */
body.page-home .site-wordmark,
body.page-home .home-hero-title,
body.page-home .home-hero-sub,
body.page-home .home-section-heading,
body.page-home .demo-caption h3,
body.page-home .concept-arrow,
body.page-home .concept-output,
body.page-home .home-step-number,
body.page-home .home-step-title,
body.page-home .home-faq summary {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.01em;
}

body.page-home .site-header {
  position: relative;
  border-bottom: none;
  background: transparent;
}

body.page-home .site-wordmark {
  font-size: 1.5rem;
  color: var(--text-primary);
}

body.page-home .site-nav-links a {
  color: var(--text-secondary);
}

body.page-home .site-nav-links a:hover,
body.page-home .site-nav-links a[aria-current="page"] {
  color: var(--text-primary);
}

body.page-home .support-banner {
  background: var(--surface-inverse);
  color: var(--text-on-inverse);
}

body.page-home .support-banner-dismiss {
  color: var(--text-on-inverse-secondary);
}

body.page-home .support-banner-dismiss:hover {
  color: var(--text-on-inverse);
}

body.page-home .support-banner {
  position: relative;
  z-index: 10;
  background: var(--surface-sunken);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

/* --- Hero -------------------------------------------------------------------- */

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-block: var(--space-9) var(--space-8);
  text-align: center;
}

.home-hero-title {
  font-size: clamp(3.25rem, 12vw, 7.5rem);
  line-height: 0.95;
  max-width: 14ch;
  margin-inline: auto;
}

.home-hero-sub {
  margin-top: var(--space-5);
  font-family: var(--font-heading);
  font-size: clamp(1.625rem, 5vw, 2.75rem);
  line-height: 1.2;
  color: var(--text-secondary);
}

.home-hero-lead {
  margin-top: var(--space-6);
  font-family: var(--font-editorial);
  font-size: var(--text-xl);
  color: var(--text-secondary);
  max-width: 34ch;
  margin-inline: auto;
}

.home-hero-cta {
  margin-top: var(--space-7);
}

.home-hero-cta .btn {
  font-size: var(--text-xl);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
}

.home-hero-notes {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-1);
  font-family: var(--font-editorial);
  font-size: var(--text-base);
  color: var(--text-tertiary);
}

.home-hero .restore-prompt {
  margin: var(--space-7) auto 0;
  max-width: 26rem;
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text-primary);
  display: grid;
  gap: var(--space-4);
  justify-items: center;
}

.home-hero .restore-text {
  font-family: var(--font-editorial);
  font-size: var(--text-base);
  color: var(--text-secondary);
}

/* --- Shared homepage sections ------------------------------------------------ */

.home-section {
  padding-block: var(--space-9);
}

.home-section + .home-section {
  border-top: 1px solid var(--border-subtle);
}

.home-section-heading {
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.05;
  text-align: center;
  max-width: 18ch;
  margin-inline: auto;
}

.home-section-lead {
  margin-top: var(--space-4);
  font-family: var(--font-editorial);
  font-size: var(--text-xl);
  text-align: center;
  color: var(--text-secondary);
  max-width: 40ch;
  margin-inline: auto;
}

/* --- Example slideshow demos ------------------------------------------------- */

.home-example {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  margin-top: var(--space-8);
}

.demo-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.demo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--border-subtle);
  border-radius: inherit;
  pointer-events: none;
}

.demo-slideshow {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1a1a;
}

.demo-slideshow[data-shape="portrait"] {
  aspect-ratio: 9 / 16;
  max-width: 360px;
  margin-inline: auto;
}

.demo-slideshow[data-shape="square"] {
  aspect-ratio: 1 / 1;
  max-width: 480px;
  margin-inline: auto;
}

.demo-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1);
  transition: opacity 900ms ease, transform 8000ms linear;
  will-change: opacity, transform;
}

.demo-slide.is-active {
  opacity: 1;
  transform: scale(1.06);
}

.demo-caption {
  margin-top: var(--space-5);
  text-align: center;
}

.demo-caption h3 {
  font-size: var(--text-2xl);
}

.demo-caption p {
  margin-top: var(--space-2);
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.demo-caption .btn {
  margin-top: var(--space-4);
}

@media (prefers-reduced-motion: reduce) {
  .demo-slide {
    transition: none;
  }

  .demo-slide.is-active {
    transform: scale(1);
  }
}

/* --- Photos in. Video out. --------------------------------------------------- */

.home-concept {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  justify-items: center;
  margin-top: var(--space-8);
}

.concept-stack {
  position: relative;
  width: min(260px, 70vw);
  aspect-ratio: 3 / 4;
}

.concept-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-subtle);
  transform-origin: center bottom;
}

.concept-photo:nth-child(1) {
  transform: rotate(-8deg) translateX(-18px);
}

.concept-photo:nth-child(2) {
  transform: rotate(4deg) translateX(10px) translateY(-8px);
}

.concept-photo:nth-child(3) {
  transform: rotate(-2deg) translateX(-4px) translateY(-16px);
}

.concept-arrow {
  font-family: var(--font-heading);
  font-size: var(--text-3xl);
  color: var(--text-tertiary);
}

.concept-output {
  width: min(260px, 70vw);
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--text-secondary);
}

/* --- Music demo -------------------------------------------------------------- */

.home-music-player {
  max-width: 28rem;
  margin: var(--space-8) auto 0;
  padding: var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.music-demo-track {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.music-demo-wave {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  height: 40px;
}

.music-demo-bar {
  flex: 1;
  height: 100%;
  background: var(--border-strong);
  border-radius: var(--radius-full);
  animation: music-bar 1.2s ease-in-out infinite alternate;
}

.music-demo-bar:nth-child(2) { animation-delay: 0.1s; }
.music-demo-bar:nth-child(3) { animation-delay: 0.25s; }
.music-demo-bar:nth-child(4) { animation-delay: 0.05s; }
.music-demo-bar:nth-child(5) { animation-delay: 0.35s; }
.music-demo-bar:nth-child(6) { animation-delay: 0.15s; }
.music-demo-bar:nth-child(7) { animation-delay: 0.3s; }
.music-demo-bar:nth-child(8) { animation-delay: 0.2s; }

@keyframes music-bar {
  0% { transform: scaleY(0.25); }
  100% { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .music-demo-bar {
    animation: none;
    transform: scaleY(0.6);
  }
}

.music-demo-meta {
  margin-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  font-family: var(--font-editorial);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

/* --- Use cases --------------------------------------------------------------- */

.home-use-cases {
  margin-top: var(--space-8);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
}

.home-use-cases a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.home-use-cases a:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* --- Steps ------------------------------------------------------------------- */

.home-steps {
  margin-top: var(--space-8);
  display: grid;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  counter-reset: step;
}

.home-step {
  text-align: center;
}

.home-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
}

.home-step-title {
  margin-top: var(--space-4);
  font-size: var(--text-2xl);
}

.home-step-text {
  margin-top: var(--space-2);
  font-family: var(--font-editorial);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 34ch;
  margin-inline: auto;
}

/* --- Free block -------------------------------------------------------------- */

.home-free {
  text-align: center;
}

.home-free-list {
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-3);
  list-style: none;
  padding: 0;
  font-family: var(--font-editorial);
  font-size: var(--text-xl);
  color: var(--text-secondary);
}

/* --- FAQ --------------------------------------------------------------------- */

.home-faq {
  margin-top: var(--space-8);
  max-width: var(--container-narrow);
  margin-inline: auto;
  display: grid;
  gap: var(--space-3);
}

.home-faq details {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.home-faq summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  cursor: pointer;
  list-style: none;
}

.home-faq summary::after {
  content: "+";
  margin-left: auto;
  padding-left: var(--space-4);
  color: var(--text-tertiary);
  font-weight: var(--weight-regular);
  transition: transform var(--duration-base) var(--ease-standard);
}

.home-faq details[open] summary::after {
  transform: rotate(45deg);
}

.home-faq details > div {
  padding: 0 var(--space-5) var(--space-5);
  font-family: var(--font-editorial);
  color: var(--text-secondary);
}

.home-faq p + p {
  margin-top: var(--space-3);
}

/* --- Final CTA --------------------------------------------------------------- */

.home-final-cta {
  text-align: center;
}

.home-final-cta .btn {
  margin-top: var(--space-5);
  font-size: var(--text-xl);
  padding: var(--space-4) var(--space-8);
}

/* --- Footer overrides -------------------------------------------------------- */

body.page-home .site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-page);
}

body.page-home .site-footer-links a {
  color: var(--text-tertiary);
}

body.page-home .site-footer-links a:hover {
  color: var(--text-primary);
}

body.page-home .site-footer-copy {
  color: var(--text-tertiary);
}

/* --- Desktop adjustments ----------------------------------------------------- */

@media (min-width: 768px) {
  .home-example {
    grid-template-columns: 1.2fr 0.8fr;
    gap: var(--space-8);
  }

  .home-example.is-flipped {
    grid-template-columns: 0.8fr 1.2fr;
  }

  .home-example.is-flipped .demo-frame {
    order: 2;
  }

  .home-example.is-flipped .demo-caption {
    order: 1;
    text-align: left;
  }

  .demo-caption {
    text-align: left;
  }

  .home-concept {
    grid-template-columns: 1fr auto 1fr;
  }

  .home-steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
  }
}

@media (min-width: 1024px) {
  .home-hero {
    padding-block: var(--space-9);
  }
}
