/* Author: VIVI x Codex */
:root {
  --bg: #f3ebdf;
  --paper: rgba(252, 248, 242, 0.84);
  --paper-strong: rgba(255, 251, 245, 0.94);
  --ink: #1e2330;
  --muted: #6e6a67;
  --burnt: #c95d36;
  --gold: #efc977;
  --sage: #7d9578;
  --berry: #7b4257;
  --line: rgba(30, 35, 48, 0.12);
  --shadow: 0 24px 64px rgba(42, 35, 28, 0.12);
  --radius-xl: 34px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 18%, rgba(248, 228, 171, 0.24), transparent 0 24%),
    linear-gradient(180deg, #2b1620 0%, #4a2631 26%, #8b6143 58%, #2e201c 100%);
  font-family: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.stage-curtain,
.stage-light,
.stage-floor {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.stage-curtain {
  top: 0;
  width: 18vw;
  min-width: 90px;
  height: 100vh;
  background:
    linear-gradient(90deg, rgba(76, 12, 25, 0.96), rgba(122, 22, 42, 0.92) 48%, rgba(87, 9, 28, 0.96)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.02) 0 18px,
      rgba(0, 0, 0, 0.08) 18px 34px
    );
  box-shadow: inset -12px 0 24px rgba(0, 0, 0, 0.18);
}

.curtain-left {
  left: 0;
  transform: perspective(900px) rotateY(-10deg);
  transform-origin: left center;
}

.curtain-right {
  right: 0;
  transform: perspective(900px) rotateY(10deg);
  transform-origin: right center;
}

.stage-light {
  top: -8vh;
  width: 36vw;
  height: 60vh;
  opacity: 0.42;
  filter: blur(14px);
  background: radial-gradient(circle at top, rgba(255, 242, 196, 0.95), rgba(255, 222, 149, 0.24) 38%, transparent 72%);
}

.light-left {
  left: 14vw;
  transform: rotate(-10deg);
}

.light-right {
  right: 14vw;
  transform: rotate(10deg);
}

.stage-floor {
  left: -10vw;
  right: -10vw;
  bottom: -12vh;
  height: 34vh;
  background:
    radial-gradient(ellipse at center top, rgba(248, 215, 161, 0.1), transparent 55%),
    repeating-linear-gradient(
      90deg,
      rgba(60, 35, 27, 0.94) 0 48px,
      rgba(84, 48, 34, 0.94) 48px 96px
    );
  transform: perspective(900px) rotateX(74deg);
  transform-origin: bottom center;
  opacity: 0.78;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.42;
  pointer-events: none;
}

.ambient-left {
  top: -8rem;
  left: -10rem;
  background: rgba(201, 93, 54, 0.22);
}

.ambient-right {
  top: 22rem;
  right: -12rem;
  background: rgba(123, 66, 87, 0.2);
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 96px;
}

.hero-panel,
.section {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.48);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 42px;
  border-radius: 40px;
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% -10%, rgba(239, 201, 119, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 44%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--burnt);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  font-weight: 700;
}

.hero-copy h1,
.section-head h2,
.cast-spotlight h3,
.case-card h3 {
  margin: 0;
  line-height: 0.96;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.hero-copy h1 {
  font-size: clamp(3.4rem, 8vw, 6.5rem);
  max-width: 8ch;
}

.hero-lede,
.section-head p,
.spotlight-body,
.case-card p,
.protocol-card p {
  color: var(--muted);
  line-height: 1.78;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

.hero-lede {
  max-width: 47ch;
  font-size: 1.08rem;
  margin: 18px 0 0;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.hero-points span,
.spotlight-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(30, 35, 48, 0.08);
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  font-size: 0.95rem;
}

.stage-label,
.split-kicker,
.case-tag,
.spotlight-kicker {
  margin: 0 0 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

.split-kicker,
.case-tag,
.spotlight-kicker {
  color: var(--burnt);
}

.section {
  margin-top: 24px;
  padding: 34px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 24%);
  pointer-events: none;
}

.section-head {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  max-width: 14ch;
}

.section-head p {
  margin: 0;
  max-width: 55ch;
}

.split-grid,
.case-grid,
.protocol-grid {
  display: grid;
  gap: 18px;
}

.split-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero-compact-grid {
  margin-top: 22px;
}

.hero-compact-grid .split-card {
  padding: 20px 20px 18px;
}

.hero-compact-grid .split-card h3 {
  font-size: 1.45rem;
}

.hero-compact-grid .split-card ul {
  margin-top: 10px;
}

.split-card,
.case-card,
.protocol-card,
.cast-spotlight {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
}

.split-card {
  padding: 24px;
  background: rgba(255, 255, 255, 0.62);
}

.split-card h3,
.protocol-card h3 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.split-card ul,
.case-card ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
  line-height: 1.72;
}

.accent-coral {
  background: linear-gradient(180deg, rgba(255, 236, 225, 0.76), rgba(255, 251, 247, 0.88));
}

.accent-sage {
  background: linear-gradient(180deg, rgba(228, 240, 228, 0.78), rgba(251, 255, 251, 0.9));
}

.cast-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
}

.stage-section {
  padding-top: 26px;
}

.cast-list {
  display: grid;
  gap: 10px;
}

.cast-button {
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.cast-button:hover,
.cast-button.is-active {
  transform: translateY(-2px);
  border-color: rgba(201, 93, 54, 0.34);
  background: rgba(255, 247, 241, 0.9);
}

.cast-name {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.cast-role {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.95rem;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

.cast-spotlight {
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(239, 201, 119, 0.22), transparent 26%),
    rgba(255, 255, 255, 0.72);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.cast-spotlight h3 {
  font-size: clamp(2.1rem, 5vw, 4rem);
}

.spotlight-line {
  margin: 12px 0 10px;
  font-size: 1.2rem;
  color: var(--berry);
}

.spotlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.spotlight-visual {
  display: grid;
  place-items: center;
}

.avatar {
  position: relative;
  width: 190px;
  height: 220px;
}

.avatar-halo {
  position: absolute;
  inset: 18px 22px 22px;
  border-radius: 32px;
  background: radial-gradient(circle at 50% 30%, rgba(239, 201, 119, 0.42), rgba(255, 255, 255, 0.2) 55%, transparent 78%);
}

.avatar-head {
  position: absolute;
  top: 34px;
  left: 66px;
  width: 58px;
  height: 64px;
  background: #f4d3b6;
  border-radius: 48% 48% 46% 46%;
  z-index: 2;
}

.avatar-hair {
  position: absolute;
  z-index: 3;
}

.avatar-body {
  position: absolute;
  top: 88px;
  left: 50px;
  width: 86px;
  height: 104px;
  border-radius: 30px 30px 24px 24px;
  z-index: 1;
}

.avatar-prop {
  position: absolute;
  z-index: 4;
}

.avatar-vivi .avatar-hair {
  top: 20px;
  left: 54px;
  width: 84px;
  height: 82px;
  background: #2f2130;
  border-radius: 48px 48px 34px 34px;
}

.avatar-vivi .avatar-body {
  background: linear-gradient(180deg, #da7247, #b64e2e);
}

.avatar-vivi .avatar-prop {
  right: 26px;
  top: 108px;
  width: 34px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(180deg, #232634, #404a63);
  transform: rotate(12deg);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.avatar-peter .avatar-hair {
  top: 24px;
  left: 60px;
  width: 72px;
  height: 46px;
  background: #3a302f;
  border-radius: 38px 38px 22px 22px;
}

.avatar-peter .avatar-body {
  background: linear-gradient(180deg, #73939e, #49616a);
}

.avatar-peter .avatar-prop {
  left: 18px;
  top: 104px;
  width: 44px;
  height: 68px;
  border-radius: 18px;
  background: #d3b06f;
  transform: rotate(-14deg);
}

.avatar-alex .avatar-hair {
  top: 18px;
  left: 52px;
  width: 86px;
  height: 72px;
  background: #6c4a59;
  border-radius: 40px 42px 36px 36px;
}

.avatar-alex .avatar-body {
  background: linear-gradient(180deg, #8f90c7, #6669a8);
}

.avatar-alex .avatar-prop {
  left: 14px;
  top: 98px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #f5eef8, #cfb7da 65%, #9c80ad 100%);
}

.avatar-elys .avatar-hair {
  top: 20px;
  left: 58px;
  width: 76px;
  height: 68px;
  background: #473738;
  border-radius: 40px 40px 28px 28px;
}

.avatar-elys .avatar-body {
  background: linear-gradient(180deg, #f0b4c2, #de8ca1);
  width: 78px;
  left: 56px;
}

.avatar-elys .avatar-prop {
  left: 18px;
  top: 106px;
  width: 54px;
  height: 72px;
  border-radius: 26px 26px 18px 18px;
  background: linear-gradient(180deg, #f6e5dc, #dcae95);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.36) inset,
    8px -8px 0 -2px #6e4f52,
    -8px -8px 0 -2px #6e4f52;
}

.avatar-tod .avatar-hair {
  top: 14px;
  left: 40px;
  width: 110px;
  height: 170px;
  background: linear-gradient(180deg, #1b1a21, #2d2833);
  clip-path: polygon(50% 0%, 96% 28%, 82% 100%, 18% 100%, 4% 28%);
}

.avatar-tod .avatar-head {
  top: 56px;
  left: 72px;
  width: 44px;
  height: 48px;
  background: #e3d7c8;
}

.avatar-tod .avatar-body {
  top: 88px;
  left: 44px;
  width: 102px;
  height: 108px;
  background: linear-gradient(180deg, #211f26, #3a3032);
  clip-path: polygon(14% 0%, 86% 0%, 100% 100%, 0% 100%);
}

.avatar-tod .avatar-prop {
  right: 12px;
  top: 106px;
  width: 18px;
  height: 86px;
  border-radius: 16px;
  background: linear-gradient(180deg, #72563b, #3d2d21);
}

.avatar-daisy .avatar-hair {
  top: 22px;
  left: 56px;
  width: 78px;
  height: 48px;
  background: #5f403a;
  border-radius: 36px 36px 20px 20px;
}

.avatar-daisy .avatar-body {
  background: linear-gradient(180deg, #c9c27d, #8c9151);
}

.avatar-daisy .avatar-prop {
  left: 18px;
  top: 116px;
  width: 46px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff7e8, #e5d3a4);
  box-shadow: inset 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.spotlight-copy {
  display: grid;
  align-content: center;
}

.case-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-card {
  padding: 26px;
  background: rgba(255, 255, 255, 0.74);
}

.case-card h3 {
  font-size: clamp(1.8rem, 3.5vw, 2.7rem);
  margin-bottom: 12px;
}

.case-quote {
  font-size: 1.08rem;
}

.case-elys {
  background: linear-gradient(180deg, rgba(253, 246, 237, 0.95), rgba(255, 252, 248, 0.82));
}

.case-tod {
  background: linear-gradient(180deg, rgba(33, 28, 37, 0.96), rgba(63, 41, 42, 0.92));
  color: #f7ede4;
  border-color: rgba(239, 201, 119, 0.16);
}

.case-tod p,
.case-tod ul {
  color: rgba(247, 237, 228, 0.8);
}

.case-tod .case-tag {
  color: rgba(239, 201, 119, 0.78);
}

.dialogue-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(239, 201, 119, 0.18);
}

.dialogue-title {
  margin: 0 0 8px;
  color: #efc977;
  font-weight: 700;
}

.protocol-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.protocol-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.66);
  min-height: 180px;
}

.constitution-board {
  display: grid;
  gap: 22px;
  padding: 26px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(30, 35, 48, 0.95), rgba(46, 31, 24, 0.95)),
    radial-gradient(circle at top right, rgba(239, 201, 119, 0.2), transparent 30%);
  color: #f5eee4;
}

.constitution-line {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.7;
  color: rgba(245, 238, 228, 0.9);
}

.constitution-copy {
  display: grid;
  gap: 12px;
}

.constitution-block {
  display: grid;
  gap: 8px;
}

.constitution-label {
  margin: 0;
  color: #efc977;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.82rem;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

.constitution-note {
  margin: 0;
  color: rgba(245, 238, 228, 0.68);
  line-height: 1.7;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.principle-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.principle-card h3 {
  margin: 0 0 8px;
  color: #f5eee4;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.principle-card p {
  margin: 0;
  color: rgba(245, 238, 228, 0.74);
  line-height: 1.7;
  font-family: "Helvetica Neue", "PingFang SC", sans-serif;
}

@media (max-width: 980px) {
  .stage-curtain {
    width: 12vw;
    min-width: 50px;
  }

  .hero-panel,
  .cast-layout,
  .split-grid,
  .case-grid,
  .protocol-grid {
    grid-template-columns: 1fr;
  }

  .cast-spotlight,
  .principle-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .stage-curtain,
  .stage-light,
  .stage-floor {
    display: none;
  }

  .page-shell {
    width: min(100% - 20px, 100%);
    padding: 16px 0 48px;
  }

  .hero-panel,
  .section {
    padding: 24px 20px;
    border-radius: 26px;
  }

  .section {
    margin-top: 16px;
  }

  .hero-copy h1,
  .section-head h2,
  .cast-spotlight h3 {
    letter-spacing: -0.05em;
  }

  .hero-copy h1 {
    font-size: 3rem;
  }

  .section-head h2 {
    font-size: 2.4rem;
  }

  .hero-lede,
  .hero-points span,
  .split-card ul,
  .case-card p,
  .protocol-card p,
  .constitution-line,
  .constitution-note,
  .principle-card p {
    font-size: 0.98rem;
  }

  .hero-points {
    gap: 8px;
    margin-top: 18px;
  }

  .hero-points span,
  .spotlight-tags span {
    min-height: 34px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .hero-compact-grid {
    margin-top: 18px;
  }

  .split-card,
  .case-card,
  .protocol-card {
    padding: 18px;
  }

  .cast-layout {
    gap: 12px;
  }

  .cast-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(148px, 1fr);
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cast-list::-webkit-scrollbar {
    display: none;
  }

  .cast-button {
    min-height: 84px;
    padding: 14px 14px 12px;
    border-radius: 20px;
    scroll-snap-align: start;
  }

  .cast-button:hover,
  .cast-button.is-active {
    transform: none;
  }

  .cast-name {
    font-size: 1.05rem;
  }

  .cast-role {
    margin-top: 4px;
    font-size: 0.86rem;
    line-height: 1.45;
  }

  .cast-spotlight {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
    padding: 18px;
  }

  .cast-spotlight h3 {
    font-size: 2.3rem;
  }

  .spotlight-copy {
    align-content: start;
  }

  .spotlight-kicker {
    margin-bottom: 10px;
    font-size: 0.72rem;
  }

  .spotlight-line {
    margin: 8px 0 8px;
    font-size: 1rem;
    line-height: 1.5;
  }

  .spotlight-body {
    font-size: 0.97rem;
    line-height: 1.74;
  }

  .spotlight-tags {
    gap: 8px;
    margin-top: 14px;
  }

  .spotlight-visual {
    align-self: start;
    justify-self: center;
    width: 132px;
    height: 148px;
    overflow: hidden;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.34);
  }

  .avatar {
    width: 190px;
    height: 220px;
    transform: scale(0.66);
    transform-origin: top center;
    margin-top: 2px;
  }

  .case-card h3,
  .split-card h3,
  .protocol-card h3,
  .principle-card h3 {
    font-size: 1.35rem;
  }

  .dialogue-card {
    margin-top: 14px;
    padding: 14px;
  }

  .constitution-board {
    gap: 16px;
    padding: 18px;
  }

  .principle-grid {
    gap: 10px;
  }
}

@media (max-width: 420px) {
  .hero-panel,
  .section {
    padding: 20px 16px;
  }

  .hero-copy h1 {
    font-size: 2.56rem;
  }

  .section-head h2 {
    font-size: 2.05rem;
  }

  .cast-list {
    grid-auto-columns: minmax(138px, 1fr);
  }

  .cast-button {
    min-height: auto;
  }

  .spotlight-visual {
    width: 120px;
    height: 138px;
  }

  .avatar {
    transform: scale(0.6);
  }
}
