/* ============================================================
   MIRAI LABO — HOMEPAGE COMPONENTS
   Loaded after site.css. Page-specific only.
   Hero proportions follow the approved prototype:
   copy stacked above, explainer full-width below.
   ============================================================ */

/* ── HERO ───────────────────────────────────────────────── */
/* No top padding — the band runs straight off the header. */
.hero { padding-block: 0 var(--section-y); }

/* ── HERO ───────────────────────────────────────────────────
   Full-bleed portrait band. The plate's own ground samples at
   ~#e9e6e0, so the band is set to the same value and the wash
   below extends the photograph instead of sitting on top of it.
   The plate is mirrored: the subject is framed left, which is
   exactly where the headline sits. */
.hero-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #e9e6e0;
  margin-inline: calc(-1 * clamp(20px, 5vw, 64px));
  margin-bottom: clamp(48px, 6vw, 84px);
  min-height: min(58vw, 640px);
  display: flex;
  align-items: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 38%;
  transform: scaleX(-1);
}
.hero-stage::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg,
    #e9e6e0 0%, rgba(233,230,224,0.94) 30%,
    rgba(233,230,224,0.62) 50%, rgba(233,230,224,0) 72%);
}
.hero-inner {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 64px);
}
.hero-copy { max-width: 640px; }
.hero-copy h1 { font-size: clamp(52px, 9vw, 112px); margin-bottom: 28px; }
.hero-copy h1 em { font-style: normal; color: var(--gold); }
.hero-intro { font-size: clamp(17px, 1.7vw, 21px); max-width: 540px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin-top: 36px; }
.hero-credit {
  position: absolute;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(14px, 2vw, 22px);
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

@media (max-width: 760px) {
  /* A landscape plate cropped to a tall box zooms to an ear. Show the
     frame at its own ratio, then set the copy beneath it on paper. */
  .hero-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--paper);
  }
  /* Keep the credit attached to the frame it describes. */
  .hero-bg     { order: 1; }
  .hero-credit { order: 2; }
  .hero-inner  { order: 3; }
  .hero-bg {
    position: relative;
    z-index: 0;
    height: auto;
    aspect-ratio: 16 / 10;
    object-position: 30% 30%;
  }
  .hero-stage::before { display: none; }
  .hero-inner { padding: clamp(28px, 7vw, 44px) clamp(20px, 5vw, 64px) 0; }
  .hero-credit {
    position: static;
    padding: 10px clamp(20px, 5vw, 64px) 0;
    text-align: right;
  }
}

/* ── PRODUCTION EXPLAINER ───────────────────────────────── */
.demo {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
}
.demo-top {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.demo-top b { color: var(--gold); font-weight: 400; }

.stage {
  position: relative;
  min-height: min(62vw, 720px);
  background: #e9e8e2;
  overflow: hidden;
}
.stage-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.stage-layer .tag {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}

.stage-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(17,18,15,0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17,18,15,0.055) 1px, transparent 1px);
  background-size: 112px 112px;
}

/* 01 · brief — floating card, as in the prototype */
.layer-brief {
  inset: 50% auto auto 50%;
  width: min(570px, 74%);
  height: auto;
  transform: translate(-50%, -45%);
  padding: clamp(28px, 4vw, 64px);
  background: var(--white);
  box-shadow: 0 28px 90px rgba(24,23,19,0.10);
  text-align: left;
  place-content: start;
  gap: 20px;
}
.layer-brief p {
  font-family: var(--display);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
}
.demo[data-phase="0"] .layer-brief { opacity: 1; transform: translate(-50%, -50%); }

/* 02–04 · real production artefacts */
.layer-doc { padding: 0; }
.layer-doc img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--sink);
}
.layer-doc .tag {
  position: absolute;
  left: 20px; bottom: 18px;
  z-index: 2;
  background: rgba(17,18,15,0.78);
  color: var(--paper);
  padding: 7px 13px;
}

/* 05 · motion */
.layer-motion { background: #111; padding: 0; }
.layer-motion video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.layer-motion .tag {
  position: absolute;
  left: 24px; bottom: 22px;
  z-index: 2;
  color: var(--paper);
  background: rgba(17,18,15,0.72);
  padding: 7px 13px;
}

/* phase switching */
.demo[data-phase="1"] .layer-composition,
.demo[data-phase="2"] .layer-world,
.demo[data-phase="3"] .layer-character,
.demo[data-phase="4"] .layer-motion { opacity: 1; transform: none; }

/* controls */
.demo-controls { padding: 30px 8px 10px; }

.demo-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 2px;
  background: var(--line);
  outline: none; margin: 0 0 6px; cursor: pointer;
}
.demo-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: var(--gold); cursor: pointer;
}
.demo-range::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%;
  background: var(--gold); cursor: pointer;
}

.phase-labels {
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--faint);
}
.phase-labels span { flex: 1; text-align: center; }
.phase-labels span:first-child { text-align: left; }
.phase-labels span:last-child { text-align: right; }
.phase-labels span.on { color: var(--gold); }

.phase-copy {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(24px, 4vw, 48px);
  padding-top: 32px;
  margin-top: 26px;
  border-top: 1px solid var(--line-soft);
  min-height: 96px;
}
.phase-copy strong {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: 0.03em;
  font-weight: 400;
  line-height: 1.05;
}
.phase-copy p { color: var(--muted); font-size: 15px; margin: 0; max-width: 56ch; }

.demo-disclaimer {
  max-width: 1320px;
  margin: 18px auto 0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: 0.04em;
  color: var(--faint);
}

/* ── STATEMENT ──────────────────────────────────────────── */
.statement { text-align: center; }
.statement .neg {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 2.2;
  margin-bottom: 24px;
}
.statement h2 { max-width: 20ch; margin-inline: auto; }

/* ── TWO ENGINES ────────────────────────────────────────── */
.engine-tabs { display: flex; border: 1px solid var(--line); width: fit-content; margin-bottom: 40px; }
.engine-tabs button {
  background: none; border: 0; padding: 14px 28px; cursor: pointer;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); transition: background 0.25s, color 0.25s;
}
.engine-tabs button + button { border-left: 1px solid var(--line); }
.engine-tabs button[aria-selected="true"] { background: var(--ink); color: var(--paper); }

.engine-panel {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  border: 1px solid var(--line);
  background: var(--white);
  padding: clamp(32px, 4vw, 56px);
}
.engine-panel h3 { margin-bottom: 16px; }
.engine-word {
  font-family: var(--display);
  font-size: clamp(56px, 9vw, 130px);
  line-height: 0.85;
  color: var(--sink);
  letter-spacing: 0.02em;
}
.engine-panel[data-engine="originals"] .engine-word { color: var(--blue-soft); }
.engine-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.engine-metrics span {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line); padding: 5px 11px;
}

/* ── BLUE HORIZON ───────────────────────────────────────── */
.horizon {
  position: relative; overflow: hidden;
  background: var(--blue-deep); color: #eaf1ff;
  padding-block: clamp(80px, 10vw, 132px);
}
/* Series plate carries the section. Held right of centre so the
   open water sits under the headline and the reef stays in frame. */
.horizon-sky { position: absolute; inset: 0; pointer-events: none; }
.horizon-sky img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 66% 46%;
}
.horizon-sky::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--blue-deep) 0%, rgba(7,29,73,0.90) 34%, rgba(7,29,73,0.52) 62%, rgba(7,29,73,0.34) 100%),
    linear-gradient(to bottom, rgba(7,29,73,0.45), transparent 30%, rgba(7,29,73,0.55));
}
.horizon .container { position: relative; z-index: 2; }
.horizon .eyebrow { color: #9dc2ff; }
.horizon .eyebrow::before { background: #9dc2ff; }
.horizon h2 { color: #fff; font-size: clamp(52px, 9vw, 116px); }
.horizon p { color: rgba(234,241,255,0.75); }

.live-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: #6ee7a8; margin-right: 8px;
}

.episode-rail {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: rgba(160,196,255,0.2);
  border: 1px solid rgba(160,196,255,0.2); margin-top: 56px;
}
.episode-rail a {
  background: var(--blue-deep);
  display: flex; flex-direction: column; gap: 6px;
  padding: 0 26px 26px;
  color: inherit;
  transition: background 0.3s;
}
.episode-rail a:hover { background: #0a2557; }
.episode-rail img {
  width: calc(100% + 52px);
  margin: 0 -26px 20px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.episode-rail span { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: #9dc2ff; }
.episode-rail strong {
  font-family: var(--display); font-size: 24px; font-weight: 400;
  letter-spacing: 0.03em; color: #fff;
}
.episode-rail small { font-size: 11px; color: rgba(234,241,255,0.55); }
.episode-rail a:hover strong { color: #9dc2ff; }

/* ── FEATURED CASE ──────────────────────────────────────── */
.featured {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: clamp(28px, 4vw, 56px); align-items: center;
}
.featured dl {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin: 28px 0 0; padding-top: 22px;
  border-top: 1px solid var(--line);
}
.featured dt {
  font-family: var(--mono); font-size: 9px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--faint); margin-bottom: 5px;
}
.featured dd { margin: 0; font-size: 14px; }

/* ── WORK CARDS ─────────────────────────────────────────── */
.work-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.work-card .meta {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold);
}
.work-card h3 { font-size: 24px; }
.work-card.pending { cursor: default; }

/* ── STUDIO ─────────────────────────────────────────────── */
.studio-split {
  display: grid; grid-template-columns: 0.85fr 1fr;
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.studio-split img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }

/* ── CONTACT ────────────────────────────────────────────── */
.contact-split {
  display: grid; grid-template-columns: 1.1fr 1fr;
  gap: clamp(32px, 5vw, 64px); align-items: end;
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1000px) {
  .engine-panel { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .studio-split { grid-template-columns: 1fr; }
  .contact-split { grid-template-columns: 1fr; }
  .episode-rail { grid-template-columns: repeat(2, 1fr); }
  .phase-copy { grid-template-columns: 1fr; gap: 12px; }
}

@media (max-width: 620px) {
  .stage { min-height: 78vw; }
  .episode-rail { grid-template-columns: 1fr; }
  .featured dl { grid-template-columns: 1fr 1fr; }
  .engine-tabs { width: 100%; }
  .engine-tabs button { flex: 1; padding-inline: 12px; }
  .phase-labels span { font-size: 8px; letter-spacing: 0.08em; }
  .layer-brief { width: 86%; }
}
