/* ============================================================
   MIRAI LABO — INNER PAGE COMPONENTS
   Loaded after site.css on pages that need them.
   ============================================================ */

/* ── PHASE LIST (production) ────────────────────────────── */
.phase-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.phase-list li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: clamp(20px, 4vw, 48px);
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.phase-n {
  font-family: var(--display);
  font-size: 46px;
  line-height: 0.9;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.phase-list h3 { margin-bottom: 10px; }
.phase-list p { max-width: var(--max-read); margin: 0; }

/* ── FAQ ────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--line); max-width: 860px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 40px 22px 0;
  position: relative;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 6px; top: 20px;
  font-family: var(--mono);
  color: var(--gold);
  font-size: 18px;
  transition: transform 0.25s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 40px 26px 0; margin: 0; max-width: var(--max-read); }

/* ── ARCHIVE GRID (work) ────────────────────────────────── */
.archive { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.archive .work-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; }
.archive .work-card.pending { cursor: default; }
.archive .meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.archive h3 { font-size: 22px; }
.archive .wide { grid-column: span 2; }

/* ── REGISTRY (shinjitsu) ───────────────────────────────── */
.registry { border: 1px solid var(--line); background: var(--line); display: grid; gap: 1px; }
.record { background: var(--white); padding: 28px 32px; }
.record-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.record h3 { font-size: 24px; margin-bottom: 6px; }
.record .cat {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.record p { font-size: 13px; color: var(--muted); max-width: 68ch; margin: 0 0 14px; }
.record .tech {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--faint);
  line-height: 1.9;
}
.record-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

/* Record detail page */
.record-table { border: 1px solid var(--line); background: var(--white); margin-top: 40px; }
.record-table div {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-bottom: 1px solid var(--line);
}
.record-table div:last-child { border-bottom: 0; }
.record-table dt {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 16px 20px;
  border-right: 1px solid var(--line);
  margin: 0;
}
.record-table dd { padding: 16px 20px; margin: 0; font-size: 13px; }

/* ── LOG ────────────────────────────────────────────────── */
.log-index { border-top: 1px solid var(--line); margin-bottom: 80px; }
.log-index a {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.2s;
}
.log-index a:hover { color: var(--gold); }
.log-index .when { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; color: var(--faint); white-space: nowrap; }

.article { max-width: var(--max-read); padding-bottom: 72px; margin-bottom: 72px; border-bottom: 1px solid var(--line); }
.article:last-child { border-bottom: 0; }
.article-meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.article h2 { margin-bottom: 28px; }
.article-body p { margin-bottom: 20px; color: var(--muted); }
.article-body p:first-child { font-size: 17px; color: var(--ink); }
.article-body strong { color: var(--ink); font-weight: 500; }
.article-body h3 { margin: 36px 0 14px; }
.article-body ul, .article-body ol { color: var(--muted); padding-left: 20px; }
.article-body li { margin-bottom: 10px; }
.article-sign {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── ORIGINALS / BLUE HORIZON ───────────────────────────── */
.bh-hero {
  background: var(--blue-deep);
  color: #eaf1ff;
  padding-block: clamp(80px, 11vw, 150px);
  position: relative;
  overflow: hidden;
}
.bh-hero .eyebrow { color: #9dc2ff; }
.bh-hero .eyebrow::before { background: #9dc2ff; }
.bh-hero h1 { color: #fff; }
.bh-hero p { color: rgba(234,241,255,0.75); }
.bh-sun {
  position: absolute;
  left: 50%; top: 20%;
  width: min(420px, 60vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: rgba(37,103,213,0.28);
  border: 1px solid rgba(160,196,255,0.3);
  pointer-events: none;
}
.bh-line { position: absolute; left: 0; right: 0; top: 62%; height: 1px;
  background: linear-gradient(to right, transparent, rgba(160,196,255,0.45), transparent); }

.ep-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ep-card { display: flex; flex-direction: column; gap: 12px; }
.ep-card .n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--gold); }

.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.slot {
  aspect-ratio: 3/4;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 6px;
  padding: 16px;
  background: var(--sink);
  border: 1px dashed var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Authored-content slot — must never read as finished copy */
.pending-block {
  border: 1px dashed var(--gold);
  background: var(--gold-soft);
  padding: clamp(28px, 4vw, 48px);
  max-width: 820px;
}
.pending-block .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
  margin-bottom: 14px;
}

/* ── ABOUT ──────────────────────────────────────────────── */
.people { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.person { background: var(--white); padding: clamp(32px, 4vw, 56px); position: relative; }
.person .idx {
  position: absolute; right: 32px; top: 24px;
  font-family: var(--display); font-size: 72px; line-height: 1;
  color: var(--sink);
}
.person h3 { font-size: 34px; margin-bottom: 6px; }
.person .role {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 18px;
}
.person .where { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--faint); margin-bottom: 22px; }

/* ── BRIEF FORM ─────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.field label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); margin: 0; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 13px 16px;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { min-height: 130px; resize: vertical; }
.req { color: var(--gold); }
.form-step {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 12px; margin: 48px 0 28px;
}
.form-step::before { content:''; width: 22px; height: 1px; background: var(--gold); }
.next-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.next-steps li { display: flex; gap: 16px; align-items: flex-start; }
.next-steps .n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em; color: var(--gold); padding-top: 3px; }

/* ── 404 ────────────────────────────────────────────────── */
.notfound { min-height: 62vh; display: grid; place-content: center; text-align: center; gap: 8px; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1000px) {
  .archive { grid-template-columns: repeat(2, 1fr); }
  .archive .wide { grid-column: span 2; }
  .ep-grid { grid-template-columns: repeat(2, 1fr); }
  .slot-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .phase-list li { grid-template-columns: 1fr; gap: 12px; }
  .phase-n { font-size: 34px; }
  .archive, .ep-grid { grid-template-columns: 1fr; }
  .archive .wide { grid-column: span 1; }
  .record-table div { grid-template-columns: 1fr; }
  .record-table dt { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .person .idx { display: none; }
}

/* ── BLUE HORIZON · OCEAN PALETTE ───────────────────────────
   The series page runs on its own surface. Rather than override every
   component, the design tokens are redefined inside this wrapper — so
   cards, borders, tables and type all re-tone automatically. */
.bh-page {
  --paper:     #071d49;
  --white:     #0b2455;
  --sink:      #061a41;
  --ink:       #eef4ff;
  --muted:     rgba(226,236,255,0.74);
  --faint:     rgba(157,194,255,0.60);
  --line:      rgba(157,194,255,0.20);
  --line-soft: rgba(157,194,255,0.12);
  --gold-soft: rgba(167,125,52,0.14);

  background: var(--blue-deep);
  color: var(--muted);
  position: relative;
}
/* Subtle depth — light falling from the surface, darker with depth.
   Cheaper and calmer than a texture image. */
.bh-page::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(90,150,240,0.16), transparent 62%),
    linear-gradient(to bottom, transparent 60%, rgba(2,10,28,0.55));
}
.bh-page > * { position: relative; }
.bh-page h1, .bh-page h2, .bh-page h3 { color: var(--ink); }
.bh-page .eyebrow { color: #9dc2ff; }
.bh-page .eyebrow::before { background: #9dc2ff; }
.bh-page .btn-ghost { border-color: var(--line); color: var(--ink); }
.bh-page .btn-ghost:hover { background: rgba(157,194,255,0.10); }

/* ── BLUE HORIZON · STAGE (logo over cycling wallpaper) ─────
   One block: the wallpapers cycle behind, the series logo sits on
   them. The wallpapers carry no type of their own, so the lockup
   can live on the plate instead of beside it. */
.bh-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--blue-deep);
  min-height: min(74vh, 760px);
  display: flex;
  align-items: flex-end;
}
.bh-stage .bh-slides { position: absolute; inset: 0; z-index: -2; }
.bh-stage .bh-slides figure {
  position: absolute; inset: 0; margin: 0;
  opacity: 0; transition: opacity 1.4s ease;
}
.bh-stage .bh-slides figure img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: 62% 42%;
}
.bh-stage .bh-slides figure:first-child,
.bh-stage .bh-slides figure.on { opacity: 1; }
.js .bh-stage .bh-slides figure:first-child:not(.on) { opacity: 0; }
.bh-stage::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(7,29,73,0.90) 0%, rgba(7,29,73,0.62) 42%, rgba(7,29,73,0.18) 72%),
    linear-gradient(to bottom, rgba(7,29,73,0.55) 0%, transparent 34%, rgba(7,29,73,0.80) 100%);
}
.bh-stage-inner { width: 100%; padding-block: clamp(52px, 7vw, 92px); }
.bh-stage .lead {
  color: rgba(234,241,255,0.86);
  margin-top: 22px;
  max-width: 560px;
}
.bh-dots {
  display: flex; gap: 10px;
  margin: 0; padding: 0; list-style: none;
}
.bh-dots button {
  width: clamp(26px, 4vw, 46px); height: 3px;
  padding: 0; border: 0; cursor: pointer;
  background: rgba(255,255,255,0.30);
  transition: background 0.3s;
}
.bh-dots button:hover { background: rgba(255,255,255,0.6); }
.bh-dots button[aria-current="true"] { background: #fff; }

.bh-stage .bh-dots {
  position: static;
  justify-content: flex-start;
  margin-top: clamp(28px, 4vw, 44px);
  padding-inline: var(--gutter);
  max-width: var(--max);
  margin-inline: auto;
}

/* ── BLUE HORIZON · SERIES LOGO ─────────────────────────── */
.bh-logo {
  display: block;
  width: min(520px, 66vw);
  height: auto;
  margin: 6px 0 0 -6px;   /* the mark carries its own optical padding */
}

/* ── BLUE HORIZON · ISLAND MAP ──────────────────────────────
   Without JS every location panel is visible and the map reads as a
   labelled plate followed by six illustrated entries. The script
   collapses that into one panel driven by the pins. */
.bh-island-section { background: var(--sink); }

.bh-map-plate { position: relative; border: 1px solid var(--line); background: var(--blue-deep); }
.bh-map-plate > img { display: block; width: 100%; height: auto; }

.bh-pin {
  position: absolute;
  width: 30px; height: 30px;
  margin: -15px 0 0 -15px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.85);
  background: rgba(7,29,73,0.55);
  backdrop-filter: blur(2px);
  color: #fff;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.25s, transform 0.25s;
}
.bh-pin:hover { background: var(--gold); transform: scale(1.14); }
.bh-pin[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); }
/* Pins are meaningless without the script that drives them. */
html:not(.js) .bh-pin { display: none; }

.bh-places { margin-top: 28px; }
/* `display:grid` on these panels outranks the UA `[hidden]` rule, so the
   attribute has to be matched at the same specificity or the switcher
   sets hidden and nothing moves. */
.bh-place[hidden], .bh-cast-panel[hidden] { display: none; }
.bh-place { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(20px, 3vw, 40px); align-items: center; }
.bh-place + .bh-place { margin-top: 40px; }        /* no-JS stacking */
.js .bh-place + .bh-place { margin-top: 0; }
.bh-place img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.bh-place-copy .n {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--gold); margin-bottom: 10px;
}
.bh-place-copy h3 { font-size: 30px; margin-bottom: 12px; }

/* ── BLUE HORIZON · CAST ────────────────────────────────── */
.bh-cast-tabs { display: flex; flex-wrap: wrap; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 28px; }
.bh-cast-tab {
  flex: 1 1 auto;
  padding: 14px 18px;
  border: 0; cursor: pointer;
  background: var(--white);
  text-align: left;
  transition: background 0.25s, color 0.25s;
}
.bh-cast-tab b {
  display: block;
  font-family: var(--display); font-size: 19px; font-weight: 400;
  letter-spacing: 0.05em; color: var(--ink);
}
.bh-cast-tab i {
  display: block; font-style: normal;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--faint); margin-top: 3px;
}
.bh-cast-tab:hover { background: var(--sink); }
.bh-cast-tab[aria-selected="true"] { background: var(--ink); }
.bh-cast-tab[aria-selected="true"] b { color: var(--paper); }
.bh-cast-tab[aria-selected="true"] i { color: var(--gold); }

.bh-cast-panel { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.bh-cast-panel + .bh-cast-panel { margin-top: 64px; }
.js .bh-cast-panel + .bh-cast-panel { margin-top: 0; }
.bh-cast-art img { width: 100%; height: auto; display: block; background: var(--white); border: 1px solid var(--line); }
.bh-noart {
  aspect-ratio: 4/3; display: grid; place-content: center;
  background: var(--sink); border: 1px dashed var(--line);
  color: var(--faint); font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.bh-cast-copy .n {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 12px;
}
.bh-cast-copy h3 { font-size: clamp(34px, 4.4vw, 52px); margin-bottom: 20px; }
.bh-cast-copy h3 em { font-style: normal; color: var(--faint); font-size: 0.62em; }
.bh-cast-copy p { color: var(--muted); margin-bottom: 16px; max-width: 56ch; }

.bh-facts { margin: 26px 0 0; border-top: 1px solid var(--line); }
.bh-facts div { display: grid; grid-template-columns: 132px 1fr; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.bh-facts dt {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--faint); margin: 0;
}
.bh-facts dd { margin: 0; font-size: 13px; color: var(--ink); }

/* ── BLUE HORIZON · CRAFT ───────────────────────────────── */
.bh-craft { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.bh-craft-card img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; background: var(--white); border: 1px solid var(--line); margin-bottom: 14px; }
.bh-craft-card .n { font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.bh-craft-card h3 { font-size: 24px; margin-bottom: 8px; }
.bh-craft-card p { font-size: 13px; }

@media (max-width: 900px) {
  .bh-place, .bh-cast-panel { grid-template-columns: 1fr; }
  .bh-craft { grid-template-columns: 1fr; }
  .bh-cast-tab { flex: 1 1 40%; }
  .bh-pin { width: 26px; height: 26px; margin: -13px 0 0 -13px; font-size: 10px; }
  .bh-facts div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 760px) {
  .bh-stage { min-height: min(72vh, 620px); }
  .bh-stage .bh-slides figure img { object-position: 66% 40%; }
  /* The lockup sits at the foot on narrow screens, so the wash has to
     run vertically — the horizontal one leaves the logo on bright water. */
  .bh-stage::after {
    background: linear-gradient(to bottom,
      rgba(7,29,73,0.50) 0%, rgba(7,29,73,0.18) 26%,
      rgba(7,29,73,0.86) 68%, rgba(7,29,73,0.96) 100%);
  }
  .bh-stage .lead { font-size: 15px; }
}
