:root {
  --night: #061f1a;
  --ink: #092b24;
  --pine: #0c382e;
  --jade: #78a294;
  --paper: #f4eddf;
  --paper-deep: #e9dcc4;
  --gold: #d9b976;
  --gold-muted: #aa8852;
  --cinnabar: #b85143;
  --mist: #dce7dc;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang TC", "Microsoft JhengHei", sans-serif;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", "Times New Roman",
    serif;
  --line: rgb(217 185 118 / 38%);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 90% 8%, rgb(120 162 148 / 15%), transparent 23rem),
    var(--paper);
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

.skip {
  position: fixed;
  z-index: 20;
  top: -5rem;
  left: 1rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gold);
  background: var(--paper);
  color: var(--ink);
}

.skip:focus {
  top: 1rem;
}

.site-header {
  position: absolute;
  z-index: 5;
  inset: 0 0 auto;
  display: flex;
  width: 100%;
  max-width: 1440px;
  margin: auto;
  padding: 1.5rem clamp(1.25rem, 5vw, 5.25rem);
  align-items: center;
  justify-content: space-between;
  color: var(--paper);
}

.brand {
  display: grid;
  color: inherit;
  line-height: 1;
  text-decoration: none;
}

.brand-zh {
  font: 700 clamp(1.25rem, 2vw, 1.8rem) / 1 var(--serif);
  letter-spacing: 0.13em;
}

.brand-en {
  margin-top: 0.42rem;
  color: var(--gold);
  font-size: 0.58rem;
  letter-spacing: 0.23em;
}

.top-controls {
  display: flex;
  gap: 0.55rem;
}

.locale-toggle,
.logout,
.print-controls button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.locale-toggle {
  min-width: 52px;
  border-radius: 999px;
  color: var(--paper);
  letter-spacing: 0.09em;
}

.logout {
  padding: 0.55rem 0.9rem;
  color: var(--paper);
}

.hero {
  position: relative;
  min-height: max(760px, 100svh);
  overflow: hidden;
  background:
    radial-gradient(
      ellipse 67% 76% at 85% 49%,
      rgb(47 105 85 / 62%),
      transparent 59%
    ),
    radial-gradient(
      circle at 18% 12%,
      rgb(216 185 118 / 14%),
      transparent 25rem
    ),
    linear-gradient(126deg, #061d18 0%, #092d25 53%, #0d4034 100%);
  color: var(--paper);
}

.hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(115deg, rgb(255 255 255 / 2.5%) 1px, transparent 1px),
    linear-gradient(25deg, rgb(255 255 255 / 1.8%) 1px, transparent 1px);
  background-size: 5px 5px, 8px 8px;
  content: "";
  mix-blend-mode: soft-light;
  opacity: 0.42;
  pointer-events: none;
}

.hero::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 140px;
  background: linear-gradient(transparent, var(--paper));
  content: "";
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: max(760px, 100svh);
  max-width: 1440px;
  margin: auto;
  padding: 8.5rem clamp(1.25rem, 7.4vw, 8.5rem) 8rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(370px, 0.9fr);
  gap: clamp(2rem, 7vw, 8rem);
  align-items: center;
}

.hero-copy,
.hero-ritual,
.opening-card {
  min-width: 0;
}

.hero-copy {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1.2rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 9.6em;
  margin: 0;
  font: 400 clamp(3.15rem, 6.1vw, 6.7rem) / 1.12 var(--serif);
  letter-spacing: 0.025em;
  text-wrap: balance;
}

.lead {
  max-width: 34rem;
  margin: 2.2rem 0 2rem;
  color: #e9efe4;
  font-size: clamp(1.04rem, 1.45vw, 1.25rem);
  letter-spacing: 0.03em;
}

.trust-row {
  display: flex;
  max-width: 41rem;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
  gap: 0.55rem 1.35rem;
  list-style: none;
}

.trust-row li {
  position: relative;
  padding-left: 1.05rem;
  color: #d8e4d7;
  font-size: 0.86rem;
}

.trust-row li::before {
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 99px;
  background: var(--gold);
  content: "";
}

.scroll-invitation {
  display: inline-flex;
  margin-top: 3rem;
  align-items: center;
  gap: 0.8rem;
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.13em;
  text-decoration: none;
}

.scroll-invitation span:first-child {
  display: grid;
  width: 1.95rem;
  height: 1.95rem;
  border: 1px solid var(--gold);
  border-radius: 50%;
  font-size: 1rem;
  place-items: center;
  transition: transform 0.25s ease;
}

.scroll-invitation:hover span:first-child {
  transform: translateY(4px);
}

.hero-ritual {
  position: relative;
  display: grid;
  min-height: 560px;
  place-items: center;
}

.chart-motif {
  position: absolute;
  inset: 0;
  display: grid;
  color: var(--gold);
  opacity: 0.9;
  place-items: center;
}

.chart-motif svg {
  width: min(600px, 100%);
  height: auto;
  overflow: visible;
}

.chart-motif text {
  fill: var(--gold);
  font: 46px var(--serif);
}

.motif-marks {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-width: 3;
  opacity: 0.9;
}

.opening-card {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  margin-left: auto;
  padding: 1.75rem 1.75rem 1.45rem;
  border: 1px solid rgb(216 185 118 / 70%);
  background:
    linear-gradient(145deg, rgb(11 48 39 / 92%), rgb(10 34 29 / 95%));
  box-shadow: 0 30px 80px rgb(0 0 0 / 28%);
}

.opening-card::before {
  position: absolute;
  top: 2.2rem;
  bottom: 2.2rem;
  left: -1px;
  width: 4px;
  background: var(--cinnabar);
  content: "";
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 0.17em;
}

.card-seal {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0;
  place-items: center;
}

.opening-card h2 {
  max-width: 11em;
  margin: 1.2rem 0 0.6rem;
  font: 400 clamp(1.9rem, 3vw, 2.7rem) / 1.24 var(--serif);
}

.card-intro {
  margin: 0;
  color: #d5ded3;
  font-size: 0.96rem;
}

.opening-card label {
  display: grid;
  margin-top: 1.2rem;
  gap: 0.48rem;
  color: #f0eadb;
  font-size: 0.84rem;
}

.opening-card input,
.birth-chapter input,
.birth-chapter select {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgb(216 185 118 / 42%);
  border-radius: 0;
  outline: none;
  background: rgb(255 255 255 / 5%);
  color: inherit;
}

.opening-card input:focus,
.birth-chapter input:focus,
.birth-chapter select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgb(216 185 118 / 15%);
}

.actions {
  display: flex;
  margin-top: 1.35rem;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--gold);
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.primary-action {
  background: var(--gold);
  color: #102a23;
}

.secondary-action {
  background: transparent;
  color: inherit;
}

.primary-action:hover {
  background: #eed594;
}

.secondary-action:hover {
  background: rgb(255 255 255 / 8%);
}

.status {
  min-height: 1.6rem;
  margin: 0.75rem 0 0;
  color: #f4beb2;
  font-size: 0.88rem;
}

.access-panel {
  margin-top: 1.2rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgb(216 185 118 / 30%);
}

.access-panel h3 {
  margin: 0;
  color: var(--gold);
  font: 1.25rem / 1.45 var(--serif);
}

.access-panel > p {
  margin: 0.5rem 0 0;
  color: #d5ded3;
  font-size: 0.9rem;
}

.access-panel > button,
.access-panel form {
  margin-top: 1rem;
}

.pilot-note {
  display: flex;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgb(216 185 118 / 22%);
  align-items: flex-start;
  gap: 0.6rem;
  color: #b9cbbd;
  font-size: 0.76rem;
}

.pilot-dot {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.48rem;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--jade);
}

.journey {
  max-width: 1180px;
  margin: auto;
  padding: clamp(4rem, 9vw, 8rem) clamp(1.25rem, 5vw, 3.5rem) 6rem;
}

.journey-intro {
  max-width: 650px;
  margin: 0 0 3rem;
}

.journey h2,
.birth-chapter h2,
.ritual h2,
.report-shell h2,
.privacy h2 {
  margin: 0.25rem 0 1rem;
  font: 400 clamp(2rem, 4vw, 4rem) / 1.19 var(--serif);
  letter-spacing: 0.02em;
}

.journey-intro > p:last-child {
  max-width: 38rem;
  color: #496158;
  font-size: 1.05rem;
}

.panel,
.ritual,
.report-shell,
.next,
.privacy {
  position: relative;
  border: 1px solid #c8b99a;
  background: #fbf7ee;
  box-shadow: 0 20px 55px rgb(12 48 39 / 8%);
}

.birth-chapter {
  display: grid;
  padding: clamp(1.3rem, 4vw, 3.5rem);
  border-color: #bca670;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
}

.chapter-rail {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: var(--cinnabar);
}

.chapter-rail span {
  font: clamp(3.4rem, 7vw, 6rem) / 0.8 var(--serif);
}

.chapter-rail p {
  margin: 1rem 0;
  font-size: 0.73rem;
  letter-spacing: 0.15em;
  writing-mode: vertical-rl;
}

.chapter-content {
  max-width: 680px;
}

.two-col,
.three-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.birth-chapter label {
  display: grid;
  margin-top: 1rem;
  gap: 0.45rem;
  font-weight: 650;
}

.birth-chapter input,
.birth-chapter select {
  border-color: #bcae93;
  background: #fffdf8;
  color: var(--ink);
}

.birth-chapter .consent {
  display: grid;
  margin: 1.15rem 0 1.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid #cbbd9f;
  background: #fffaf0;
  color: #40564c;
  font-size: 0.88rem;
  font-weight: 500;
  grid-template-columns: auto 1fr;
  line-height: 1.65;
}

.birth-chapter .consent input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin: 0.35rem 0 0;
  accent-color: var(--jade);
}

.time-note {
  margin: 1.2rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--jade);
  background: #edf2e8;
  color: #3f594f;
}

.review-panel {
  margin-top: 1.3rem;
  padding: 1.3rem;
  border: 1px solid var(--gold);
  background: #f7edda;
}

.ritual {
  display: grid;
  margin-top: 3rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  overflow: hidden;
  background: linear-gradient(120deg, #092a23, #0e4135);
  color: #f7f1e4;
  grid-template-columns: minmax(240px, 0.74fr) minmax(0, 1.26fr);
  gap: 3rem;
}

.ritual::before {
  position: absolute;
  right: -8rem;
  bottom: -13rem;
  width: 32rem;
  height: 32rem;
  border: 1px solid rgb(216 185 118 / 36%);
  border-radius: 50%;
  content: "";
}

.ritual-heading,
.ritual ol,
.ritual-note {
  position: relative;
  z-index: 1;
}

.ritual ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: stages;
}

.ritual li {
  position: relative;
  display: flex;
  min-height: 56px;
  padding: 0.55rem 0 0.55rem 3.5rem;
  border-bottom: 1px solid rgb(255 255 255 / 16%);
  align-items: center;
  color: #d9e5d8;
}

.ritual li::before {
  position: absolute;
  left: 0;
  display: grid;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(216 185 118 / 70%);
  border-radius: 50%;
  place-items: center;
  color: var(--gold);
  content: counter(stages, decimal-leading-zero);
  counter-increment: stages;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.ritual li[data-state="unfolding"]::before {
  background: var(--gold);
  box-shadow: 0 0 0 6px rgb(216 185 118 / 12%);
  color: var(--night);
}

.ritual li[data-state="completed"]::before {
  border-color: var(--jade);
  background: var(--jade);
  color: var(--night);
}

.ritual-note {
  margin: 0;
  grid-column: 1 / -1;
  color: #c3d2c4;
  font-size: 0.88rem;
}

.chapter-nav {
  position: sticky;
  z-index: 3;
  top: 0.7rem;
  display: flex;
  margin: 2rem 0;
  padding: 0.7rem;
  overflow: auto;
  border-block: 1px solid #ccb990;
  background: rgb(244 237 223 / 86%);
  backdrop-filter: blur(8px);
  gap: 0.5rem;
}

.chapter-nav a {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 0.78rem;
  text-decoration: none;
}

.report-shell {
  min-height: 330px;
  margin-top: 3rem;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  overflow: hidden;
}

.closed-book {
  position: absolute;
  top: 2.6rem;
  right: clamp(1rem, 6vw, 6rem);
  width: 145px;
  height: 195px;
  transform: rotate(8deg);
  opacity: 0.76;
}

.closed-book span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold);
  background: linear-gradient(110deg, #19493d, #10362d);
}

.closed-book span:last-child {
  inset: 7px -7px -7px 7px;
  border-color: #b24d40;
  background: transparent;
}

.closed-book i {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  color: var(--gold);
  font: 2.6rem var(--serif);
  font-style: normal;
  place-items: center;
}

.report-shell > h2,
.report-shell > p:not(.section-kicker) {
  position: relative;
  z-index: 1;
  max-width: 34rem;
}

.report-shell > p:not(.section-kicker) {
  color: #587066;
}

.print-controls {
  display: flex;
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border: 1px solid #c8b99a;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #fcf8ef;
}

.print-controls p {
  margin: 0;
  color: #5b6d64;
  font-size: 0.82rem;
}

.print-controls div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.print-controls button {
  padding: 0.55rem 0.75rem;
  border-color: #bca670;
  color: var(--ink);
}

.next {
  margin-top: 3rem;
  padding: clamp(1.35rem, 4vw, 3.4rem);
}

.commitments {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.commitments article {
  position: relative;
  min-height: 9rem;
  padding: 1rem;
  overflow: hidden;
  border: 1px solid #d4bf8e;
  background: linear-gradient(150deg, #fffaf0, #eae4d5);
}

.commitments article::after {
  position: absolute;
  right: -1.4rem;
  bottom: -2rem;
  color: var(--cinnabar);
  content: "✦";
  font: 5rem var(--serif);
  opacity: 0.15;
}

.commitments h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font: 1.25rem var(--serif);
}

.commitments p {
  position: relative;
  z-index: 1;
  margin: 0.7rem 0 0;
  color: #586b61;
  font-size: 0.83rem;
}

.privacy {
  margin-top: 3rem;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-top: 4px solid var(--jade);
}

.privacy p:last-child {
  max-width: 45rem;
  color: #53665d;
}

.report-opening {
  margin-bottom: 1.5rem;
}

.semantic-block {
  margin-top: 1.1rem;
}

.report-language + .report-language {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #ccbfa2;
}

.personal-status {
  max-width: 48rem;
  margin: 1rem 0;
  padding: 1.1rem;
  border-left: 4px solid var(--cinnabar);
  background: #fbf1df;
  font: 1.25rem / 1.5 var(--serif);
}

.teaser-grid,
.pillar-grid {
  display: grid;
  margin-block: 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.teaser-card,
.pillar,
.palace,
.action-card {
  border: 1px solid #cabd9c;
  background: #fffdf7;
}

.teaser-card {
  min-height: 180px;
  padding: 1.25rem;
}

.teaser-card:nth-child(1) {
  border-top: 4px solid var(--gold);
}

.teaser-card:nth-child(2) {
  border-top: 4px solid var(--cinnabar);
}

.teaser-card:nth-child(3) {
  border-top: 4px solid var(--jade);
}

.teaser-card h3,
.pillar h3,
.palace h3 {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
}

.report-section {
  margin-top: 3.5rem;
}

.palace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.palace {
  min-height: 150px;
  padding: 1rem;
}

.palace p {
  margin: 0.42rem 0;
  color: #51655b;
  font-size: 0.85rem;
}

.chapter-number {
  margin: 0 0 0.6rem;
  color: var(--cinnabar);
  font-size: 1.2rem;
  letter-spacing: 0.14em;
}

.pull-quote {
  max-width: 46rem;
  font: clamp(1.3rem, 2.5vw, 2rem) / 1.6 var(--serif);
}

.action-card {
  margin-top: 2rem;
  padding: 1.35rem;
  border-left: 5px solid var(--jade);
}

.method-note {
  color: #52665d;
  font-size: 0.92rem;
}

.empty-book {
  display: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--cinnabar);
  outline-offset: 4px;
}

@media (max-width: 820px) {
  .hero {
    min-height: auto;
  }

  .site-header {
    padding-top: 1.1rem;
  }

  .hero-grid {
    min-height: auto;
    padding-top: 8.2rem;
    padding-bottom: 6rem;
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-copy {
    max-width: 680px;
  }

  .hero-ritual {
    min-height: 460px;
  }

  .opening-card {
    margin: auto;
  }

  .ritual {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
  }

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

@media (max-width: 540px) {
  .site-header {
    padding-inline: 1rem;
  }

  .brand-zh {
    font-size: 1.25rem;
  }

  .locale-toggle {
    min-width: 46px;
  }

  .hero-grid {
    width: 100%;
    padding: 7.5rem 1.1rem 4.5rem;
    gap: 1.2rem;
  }

  .hero h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 11.7vw, 2.85rem);
    line-height: 1.17;
    overflow-wrap: anywhere;
    text-wrap: wrap;
  }

  .lead {
    max-width: 100%;
    margin-top: 1.6rem;
    font-size: 1rem;
  }

  .trust-row {
    display: grid;
    width: 100%;
    gap: 0.55rem;
  }

  .scroll-invitation {
    margin-top: 2.1rem;
  }

  .hero-ritual {
    width: 100%;
    min-height: 390px;
  }

  .chart-motif {
    inset: -1rem;
    transform: none;
  }

  .opening-card {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 1.35rem 1.25rem;
  }

  .opening-card h2 {
    max-width: 100%;
    font-size: 2rem;
    overflow-wrap: anywhere;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .birth-chapter {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter-rail {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .chapter-rail p {
    margin: 0;
    writing-mode: initial;
  }

  .two-col,
  .three-col,
  .teaser-grid,
  .pillar-grid,
  .palace-grid,
  .commitments {
    grid-template-columns: minmax(0, 1fr);
  }

  .ritual {
    padding: 1.4rem;
  }

  .report-shell {
    padding: 1.5rem;
  }

  .closed-book {
    top: 1rem;
    right: 1rem;
    width: 94px;
    height: 130px;
  }

  .report-shell h2 {
    max-width: 8em;
  }

  .print-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .print-controls div {
    width: 100%;
  }

  .print-controls button {
    flex: 1;
  }

  .chapter-nav {
    margin-inline: -1.1rem;
    padding-inline: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

@media (forced-colors: active) {
  .hero,
  .ritual,
  .opening-card,
  .report-shell,
  .panel,
  .privacy {
    background: Canvas !important;
    color: CanvasText !important;
  }

  .brand,
  .lead,
  .trust-row li,
  .opening-card label,
  .pilot-note,
  .ritual li,
  .ritual-note {
    color: CanvasText !important;
  }

  .chart-motif {
    display: none;
  }

  .primary-action,
  .secondary-action,
  .locale-toggle {
    border-color: CanvasText !important;
    background: Canvas !important;
    color: CanvasText !important;
  }
}
