/* Homepage layout and studio. Shared product-page styles live in vision.css. */
.mirror-home {
  --mirror-top: 84px;
  --mirror-anchor: 96px;
  overflow-x: clip;
}

.mirror-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  column-gap: clamp(26px, 5vw, 84px);
  align-items: start;
  max-width: 1540px;
  margin-inline: auto;
  padding: var(--mirror-top) clamp(24px, 6vw, 100px) 48px;
}

.mirror-chapters { grid-area: 1 / 1; min-width: 0; }
.mirror-home section[id] { scroll-margin-top: var(--mirror-anchor); }

.mirror-chapters .hero,
.mirror-chapters .beat {
  align-items: center;
  justify-content: center;
  padding: 24px 0;
  text-align: left;
}

.mirror-chapters .hero {
  min-height: min(680px, calc(100svh - var(--mirror-top) - 28px));
  align-items: flex-start;
}

.mirror-chapters .hero-copy { max-width: 600px; }
.mirror-chapters .hero h1 { font-size: clamp(46px, 5.5vw, 86px); }
.mirror-chapters .hero .sub { max-width: 450px; }
.mirror-chapters .hero-actions { justify-content: flex-start; }
.mirror-chapters .beat { min-height: clamp(370px, 74svh, 650px); justify-content: flex-start; }

.mirror-chapters .card {
  width: 100%;
  max-width: 510px;
  background: #fbf7f0;
}

.mirror-chapters .card .eyebrow { font-size: 11px; color: var(--terracotta-deep); }
.mirror-chapters .chips { display: flex; }

.mirror-stage {
  grid-area: 1 / 2;
  position: sticky;
  top: var(--mirror-top);
  isolation: isolate;
  height: min(680px, calc(100svh - var(--mirror-top) - 28px));
  min-height: 230px;
  border: 1px solid #dac7b6;
  border-radius: 26px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 47%, #fff9ef 0%, #f6e9da 50%, #e8d6c5 100%);
}

.mirror-stage-name, .mirror-stage-caption {
  position: absolute;
  inset-inline: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
  color: #73533e;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .15em;
  line-height: 1.3;
  text-transform: uppercase;
}

.mirror-stage-name { top: 20px; }
.mirror-stage-name span { width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); }
.mirror-stage-caption { bottom: 18px; justify-content: space-between; font-variant-numeric: tabular-nums; }
.mirror-stage-caption span:last-child { text-align: right; }

.mirror-stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, #a96f4433 1px, transparent 1px),
    linear-gradient(#a96f4433 1px, transparent 1px);
  background-size: 25px 25px;
  background-position: center;
  mask-image: radial-gradient(ellipse at center, #000 15%, transparent 72%);
  opacity: 0;
  pointer-events: none;
}

.mirror-render { position: absolute; inset: 38px 8px 40px; display: grid; place-items: center; }
.mirror-poster { width: 100%; height: 100%; min-height: 0; object-fit: contain; mix-blend-mode: multiply; }
.mirror-canvas { position: absolute; inset: 0; width: 100%; height: 100%; visibility: hidden; }
.mirror-stage.is-rendered .mirror-canvas { visibility: visible; }
.mirror-stage.is-rendered .mirror-poster { opacity: 0; }
.mirror-stage:not(.is-rendered) .mirror-stage-grid { display: none; }

@media (max-width: 900px) {
  .mirror-home { --mirror-top: 76px; --mirror-anchor: 86px; }
  .mirror-home #topbar.header-scrolled { background: var(--cream); }
  .mirror-story {
    --mirror-stage-height: clamp(156px, 36svh, 325px);
    display: block;
    padding-inline: clamp(16px, 4vw, 36px);
    padding-bottom: 32px;
  }

  .mirror-stage {
    grid-area: 1 / 1;
    z-index: 1;
    height: var(--mirror-stage-height);
    min-height: 0;
    border-radius: 20px;
    box-shadow: 0 9px 22px -18px #633d26aa;
  }

  .mirror-render { inset: 29px 5px 29px; }
  .mirror-stage-name, .mirror-stage-caption { inset-inline: 14px; font-size: 9px; }
  .mirror-stage-name { top: 12px; }
  .mirror-stage-caption { bottom: 11px; }

  .mirror-home #topbar:not([data-nav-ready]) + main .mirror-story { padding-top: 0; }
  .mirror-chapters { grid-area: 2 / 1; }
  .mirror-chapters .hero {
    min-height: auto;
    padding: 32px 3px;
  }

  .mirror-chapters .hero h1 { font-size: clamp(43px, 9vw, 68px); }
  .mirror-chapters .hero .sub { margin-top: 16px; }
  .mirror-chapters .hero-actions { margin-top: 22px; gap: 8px; }
  .mirror-chapters .hero-actions .btn { padding: 11px 16px; font-size: 12px; }
  .mirror-chapters .beat {
    min-height: clamp(254px, 49svh, 460px);
    padding: 16px 0;
  }
  .mirror-chapters a,
  .mirror-chapters section[id] {
    scroll-margin-top: calc(var(--mirror-anchor) + var(--mirror-stage-height));
  }
  .mirror-chapters .card { max-width: 600px; padding: clamp(20px, 5vw, 36px); }
  .mirror-chapters .card p:not(.eyebrow) { font-size: 14px; }
  .mirror-chapters .card h2 { font-size: clamp(29px, 7vw, 42px); }
}

@media (max-width: 700px) {
  .mirror-home { --mirror-top: 68px; --mirror-anchor: 78px; }
}

@media (max-width: 370px) {
  .mirror-home #topbar { padding-inline: 16px; gap: 8px; }
  .mirror-home .header-actions { gap: 4px; }
  .mirror-home #topbar .logo { font-size: 22px; }
  .mirror-home .header-login { gap: 4px; padding: 5px 6px; font-size: 10px; letter-spacing: 0; }
  .mirror-home .header-login small { padding-inline: 4px; font-size: 8px; letter-spacing: .04em; }
}

@media (560px <= width <= 900px) and (max-height: 470px) {
  .mirror-story {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  }
  .mirror-chapters { grid-area: 1 / 1; }
  .mirror-stage { grid-area: 1 / 2; height: calc(100svh - var(--mirror-top) - 14px); }
  .mirror-chapters a,
  .mirror-chapters section[id] { scroll-margin-top: var(--mirror-anchor); }
}

@media (max-width: 559px) and (max-height: 380px) {
  .mirror-stage { position: relative; top: auto; }
  .mirror-chapters a,
  .mirror-chapters section[id]:not(#hero) { scroll-margin-top: var(--mirror-anchor); }
}

@media (prefers-reduced-motion: reduce) {
  .mirror-stage .mirror-canvas, .mirror-stage .mirror-stage-grid { display: none; }
  .mirror-stage.is-rendered .mirror-poster { opacity: 1; }
}

@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .mirror-stage { position: relative; top: auto; }
  .mirror-chapters a,
  .mirror-chapters section[id]:not(#hero) { scroll-margin-top: var(--mirror-anchor); }
}
