/* Dreamless: one deliberate night palette. Deep-water teal for the title world, warm amber for the waking one. */
:root {
  --night: #061418;
  --deep: #0b2a30;
  --teal: #5fd0c8;
  --mist: #cfe6e4;
  --muted: #8aa7a8;
  --amber: #f0b46a;
  --line: rgba(207, 230, 228, 0.14);
  --display: "Shippori Mincho", "Hiragino Mincho ProN", Georgia, serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--mist);
  font: 17px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
img { max-width: 100%; display: block; }
.wrap {
  max-width: 68rem;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Hero: the title frame bleeds in from the right, text sits in the dark water on the left. */
.hero {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 900px);
  display: grid;
  align-items: end;
  background: var(--night);
}
.hero-art {
  position: absolute;
  inset: 0 0 0 auto;
  width: 70%;
  height: 100%;
  object-fit: cover;
  object-position: 80% 50%;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 35%);
  mask-image: linear-gradient(to right, transparent 0%, #000 35%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--night) 0%, rgba(6, 20, 24, 0) 30%);
  pointer-events: none;
}
.hero .bubbles, .hero .wrap { z-index: 1; }
.hero .wrap { position: relative; width: 100%; padding-block: 5rem 4.5rem; }
.kana {
  font-family: var(--display);
  font-size: clamp(1.35rem, 5.2vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--teal);
  margin: 0;
  text-shadow: 0 0 40px rgba(95, 208, 200, 0.35);
}
h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 1rem 0 0;
  letter-spacing: 0.02em;
}
.logline { max-width: 30rem; margin: 1.25rem 0 0; color: var(--mist); font-size: 1.1rem; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 2rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  background: rgba(6, 20, 24, 0.55);
}
.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; margin-top: 1.5rem; align-items: center; }
.btn {
  display: inline-block;
  padding: 0.8rem 1.4rem;
  background: var(--teal);
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
}
.btn:hover { background: var(--mist); }
.btn.ghost { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.btn.ghost:hover { color: var(--night); background: var(--mist); }
/* Hero buttons: same size side by side, full width and stacked on a phone */
.hero .cta .btn { min-width: 14.5rem; text-align: center; }

/* Bubbles drift up through the hero. Decorative only. */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubbles span {
  position: absolute;
  bottom: -20px;
  width: var(--s);
  height: var(--s);
  left: var(--x);
  border: 1px solid rgba(207, 230, 228, 0.45);
  border-radius: 50%;
  animation: rise var(--d) linear infinite;
  animation-delay: var(--t);
}
@keyframes rise { to { transform: translateY(-105vh); opacity: 0; } }

/* Frames strip */
.teaser { padding-block: 4.5rem 0; scroll-margin-top: 1rem; }
.teaser video, .teaser iframe { display: block; border: 0; width: min(100%, 360px); height: auto; aspect-ratio: 9 / 16; border-radius: 6px; background: #000; }
.episodes { padding-block: 4.5rem 0; scroll-margin-top: 1rem; display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.episodes iframe { display: block; border: 0; width: min(100%, 360px); height: auto; aspect-ratio: 9 / 16; border-radius: 6px; background: #000; }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; max-height: 640px; overflow-y: auto; }
.ep-list button { display: flex; gap: 0.9rem; align-items: center; width: 100%; padding: 0.5rem; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: var(--mist); font: inherit; text-align: left; cursor: pointer; }
.ep-list button:hover { background: var(--deep); }
.ep-list button[aria-current="true"] { border-color: var(--teal); background: var(--deep); }
.ep-list button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.ep-list img { width: 54px; height: 96px; object-fit: cover; border-radius: 4px; flex: none; background: #000; }
.ep-list span { display: grid; font-size: 0.95rem; line-height: 1.4; }
.ep-list b { font-weight: 400; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.ep-list button[aria-current="true"] b { color: var(--teal); }
.ep-pick { max-width: 34rem; }
.ep-more { margin: 1rem 0 0; font-size: 0.9rem; }
@media (max-width: 720px) {
  .episodes { grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
  .ep-player iframe { margin-inline: auto; }
  .ep-list { grid-auto-flow: column; grid-auto-columns: 132px; max-height: none; overflow-x: auto; overflow-y: hidden; padding-bottom: 0.5rem; scroll-snap-type: x mandatory; }
  .ep-list li { scroll-snap-align: start; }
  .ep-list button { flex-direction: column; align-items: flex-start; height: 100%; }
  .ep-list img { width: 100%; height: auto; aspect-ratio: 9 / 16; }
}
.frames { padding-block: 4.5rem 3rem; }
.eyebrow { font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.25rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid figure { margin: 0; }
.grid img { aspect-ratio: 3 / 4; width: 100%; height: auto; object-fit: cover; object-position: 50% 40%; border-radius: 4px; }
.grid figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; }

/* Premise + haiku */
.story { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 3rem; padding-block: 2rem 5rem; align-items: start; }
.story h2, .page h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 0.75rem; }
.story p { margin: 0 0 1rem; max-width: 36rem; }
.haiku {
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.9;
  border-left: 2px solid var(--amber);
  padding-left: 1.25rem;
  color: var(--mist);
  margin: 0;
}
.haiku small { display: block; margin-top: 0.75rem; font-family: var(--body); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; }

/* Sections added in Settings → Brand page (site/series.js): text and buttons on their own, and a video */
.story.solo { grid-template-columns: minmax(0, 44rem); }
.story.solo .cta { margin-top: 0.5rem; }
.video-block { padding-block: 2rem 4rem; }
.video-block iframe { display: block; border: 0; border-radius: 6px; background: #000; width: min(100%, 360px); height: auto; aspect-ratio: 9 / 16; }
.video-block.wide iframe { width: min(100%, 960px); aspect-ratio: 16 / 9; }
.video-caption { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }

/* Director's statement (Settings → Brand page) */
/* Cuts and bonuses: the Part 1 films side by side, then the series song */
.cuts { padding-block: 1rem 5rem; }
.cuts > p:not(.eyebrow) { max-width: 44rem; margin: 0 0 1.75rem; color: var(--mist); }
.cut-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.cut { margin: 0; }
.cut-play, .cut-frame { display: block; width: 100%; aspect-ratio: 9 / 16; border: 0; border-radius: 6px; background: #000; }
.cut-play { position: relative; padding: 0; overflow: hidden; cursor: pointer; border: 1px solid var(--line); }
.cut-play img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.9; transition: opacity 0.2s; }
.cut-play:hover img, .cut-play:focus-visible img { opacity: 1; }
.cut-play:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.cut-play span { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: 3.2rem; height: 3.2rem; border-radius: 50%; background: rgba(6, 20, 24, 0.72); color: var(--mist); display: grid; place-items: center; font-size: 1.1rem; border: 1px solid var(--line); }
.cut figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 0.75rem; margin-top: 0.6rem; font-size: 0.95rem; }
.cut figcaption a { font-size: 0.85rem; }
.song { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 2.5rem; margin-top: 3.5rem; align-items: start; }
.song video { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 6px; background: #000; }
.song h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 1rem; }
.song audio { width: 100%; max-width: 26rem; }
.song-dl { margin: 0.4rem 0 1.5rem; font-size: 0.9rem; }
.lyrics { font-family: var(--display); line-height: 1.8; color: var(--mist); border-left: 2px solid var(--amber); padding-left: 1.25rem; }
.lyrics p { margin: 0 0 1rem; }
.song-credit { color: var(--muted); font-size: 0.9rem; margin-top: 1.25rem; }
@media (max-width: 900px) { .cut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .song { grid-template-columns: 1fr; gap: 1.5rem; } .song video { max-width: 360px; } }

.statement { padding-block: 1rem 5rem; }
.statement h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 1.25rem; }
.statement figure { margin: 0; max-width: 44rem; }
.statement blockquote { margin: 0; border-left: 2px solid var(--amber); padding-left: 1.25rem; font-family: var(--display); font-size: 1.15rem; line-height: 1.8; color: var(--mist); }
.statement blockquote p { margin: 0 0 1rem; }
.statement figcaption { display: flex; align-items: center; gap: 0.9rem; margin-top: 1.5rem; }
.statement figcaption img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.statement figcaption small { display: block; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.08em; }

/* Creator & press */
.press { padding-block: 1rem 5rem; scroll-margin-top: 1rem; }
.press-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 3rem; align-items: start; border-top: 1px solid var(--line); padding-top: 2.5rem; }
.press h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: 0 0 0.75rem; }
.press p { margin: 0 0 1rem; max-width: 36rem; }
.press-who { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.press-who img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--line); }
.press-who h2 { margin: 0; }
.press-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.press-links a, .press-facts a { color: var(--teal); }
.press-facts { margin: 0; font-size: 0.95rem; }
.press-facts dt { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-top: 1rem; }
.press-facts dt:first-child { margin-top: 0; }
.press-facts dd { margin: 0.2rem 0 0; overflow-wrap: anywhere; }
.press-kit { margin-top: 1.5rem !important; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.press-kit small { color: var(--muted); font-size: 0.8rem; }

footer { border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: space-between; padding-block: 1.75rem; font-size: 0.85rem; color: var(--muted); }
footer nav { display: flex; gap: 1.25rem; }

/* Text pages (privacy) */
.page { max-width: 44rem; padding-block: 3.5rem 5rem; }
.page header { margin-bottom: 2.5rem; }
.page header a { text-decoration: none; font-family: var(--display); color: var(--teal); letter-spacing: 0.08em; }
.page h1 { margin-top: 1.25rem; }
.page h2 { margin-top: 2.5rem; font-size: 1.3rem; }
.page p, .page ul { margin: 0 0 1rem; }
.page ul { padding-left: 1.2rem; }
.page li { margin-bottom: 0.4rem; }
.page code { font-size: 0.88em; color: var(--amber); overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 760px) {
  .press-grid { grid-template-columns: 1fr; gap: 2rem; }
  .hero { min-height: 0; }
  .hero-art { width: 100%; height: 58vw; min-height: 240px; object-position: 75% 50%; -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent); mask-image: linear-gradient(to bottom, #000 70%, transparent); }
  .hero::after { background: linear-gradient(0deg, var(--night) 0%, var(--night) 45%, rgba(6, 20, 24, 0) 75%); }
  .hero .wrap { padding-block: max(256px, calc(58vw + 16px)) 3rem; }
  .hero .cta .btn { flex: 1 1 100%; min-width: 0; }
  .grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; gap: 0.75rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
  .grid figure { scroll-snap-align: start; }
  .story { grid-template-columns: 1fr; gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .bubbles, .status::before { animation: none; display: none; }
  .bubbles span { animation: none; }
}

/* The logo mark: an eye that stays open at the waterline. */
.mark { border-radius: 18px; margin-bottom: 1.5rem; box-shadow: 0 0 40px rgba(95, 208, 200, 0.15); }
.brand { display: inline-flex; align-items: center; gap: 0.75rem; }
.brand img { border-radius: 8px; }

/* Studio name bar (MicroMedia.ai), above the series hero */
.studio-bar { position: absolute; inset: 0 0 auto 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px max(16px, env(safe-area-inset-left)); font-size: 0.9rem; }
.studio-name { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--mist); font-weight: 700; text-decoration: none; letter-spacing: 0.01em; }
.studio-name img { border-radius: 6px; }
.studio-tag { color: var(--muted); }
@media (max-width: 480px) { .studio-tag { display: none; } }
