:root {
  color-scheme: dark;
  --ivory: #f7ebd2;
  --gold: #d6a64e;
  --ember: #d66232;
  --jade: #77b49d;
  --teal: #123f3e;
  --ink: #050706;
  --mist: rgba(247, 235, 210, 0.72);
  --line: rgba(247, 235, 210, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--ink);
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ivory);
  font-family:
    "Yu Mincho",
    "Hiragino Mincho ProN",
    "Noto Serif JP",
    Georgia,
    serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(52, 120, 103, 0.22), transparent 34rem),
    radial-gradient(circle at 78% 12%, rgba(214, 98, 50, 0.18), transparent 30rem),
    linear-gradient(180deg, #07100e 0%, #050706 52%, #0d1511 100%);
  overflow-x: hidden;
}

.forest-backdrop {
  position: fixed;
  inset: -5vh -5vw;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5, 7, 6, 0.34), rgba(5, 7, 6, 0.08) 42%, rgba(5, 7, 6, 0.5)),
    linear-gradient(180deg, rgba(5, 7, 6, 0.04), rgba(5, 7, 6, 0.46) 72%, #050706),
    url("./assets/okinawa-forest.jpg") center / cover no-repeat;
  filter: saturate(0.98) contrast(1.06) brightness(0.94);
  transform: translate3d(0, 0, 0) scale(1.04);
  transform-origin: center;
  will-change: transform, opacity;
}

.forest-light {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 34% 9%, rgba(236, 211, 142, 0.34), transparent 34%),
    radial-gradient(ellipse at 72% 28%, rgba(119, 180, 157, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(5, 7, 6, 0.02), rgba(5, 7, 6, 0.36) 82%);
  mix-blend-mode: screen;
  opacity: 0.74;
}

#ritual-canvas {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  background: transparent;
  opacity: 0.58;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle at center, #000 0%, transparent 76%);
}

.page-shell {
  position: relative;
  z-index: 4;
}

.hero,
.copy-section,
.courses,
.final-section {
  min-height: 100svh;
  display: grid;
  align-items: center;
  padding: clamp(4rem, 8vw, 8rem) clamp(1.25rem, 5vw, 5rem);
}

.hero {
  align-items: end;
  padding-bottom: clamp(4rem, 11vh, 7rem);
}

.hero-copy,
.copy-block,
.section-heading,
.final-panel {
  max-width: 980px;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.72),
    0 0 42px rgba(0, 0, 0, 0.55);
}

.kicker {
  margin: 0 0 1rem;
  color: var(--gold);
  font-family:
    Inter,
    system-ui,
    sans-serif;
  font-size: clamp(0.68rem, 1.2vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.18em;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  width: fit-content;
  max-width: 100%;
  font-size: clamp(3.4rem, 8.7vw, 7.9rem);
  line-height: 0.9;
  font-weight: 500;
  letter-spacing: 0;
}

h1 span {
  display: block;
  white-space: nowrap;
}

.lead {
  width: min(45rem, 100%);
  margin: clamp(1.5rem, 4vw, 2.8rem) 0 0;
  color: var(--mist);
  font-size: clamp(1rem, 2vw, 1.5rem);
  line-height: 1.95;
}

.answer {
  margin: 1.4rem 0 0;
  color: #fff7e5;
  font-size: clamp(1.7rem, 4vw, 3.7rem);
  line-height: 1.25;
}

.hero-action {
  display: inline-flex;
  width: min(100%, 36rem);
  margin-top: clamp(1.25rem, 3vw, 2rem);
  padding: 0.9rem 1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(214, 166, 78, 0.46);
  color: var(--ivory);
  background: rgba(9, 23, 20, 0.62);
  text-decoration: none;
  font-size: clamp(0.88rem, 1.45vw, 1.05rem);
  line-height: 1.55;
  backdrop-filter: blur(14px);
}

.scroll-cue {
  position: absolute;
  right: clamp(1.4rem, 5vw, 5rem);
  bottom: clamp(1.5rem, 5vh, 3rem);
  width: 2px;
  height: 5.4rem;
  background: rgba(247, 235, 210, 0.18);
  overflow: hidden;
}

.scroll-cue span {
  display: block;
  width: 100%;
  height: 45%;
  background: linear-gradient(180deg, transparent, var(--gold), transparent);
  animation: cue 1.8s ease-in-out infinite;
}

.copy-section {
  justify-items: center;
  align-content: center;
  gap: clamp(1.6rem, 4vw, 3rem);
}

.copy-block {
  width: min(54rem, 100%);
  padding: clamp(1.4rem, 4vw, 2.8rem);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(7, 24, 18, 0.68), rgba(5, 7, 6, 0.46)),
    radial-gradient(circle at 10% 0%, rgba(119, 180, 157, 0.12), transparent 42%);
  backdrop-filter: blur(12px);
}

.copy-block.large {
  width: min(68rem, 100%);
}

.copy-block p,
.final-panel p {
  margin: 0;
  color: var(--mist);
  font-size: clamp(1.15rem, 2.25vw, 2.25rem);
  line-height: 2.05;
}

.copy-block p + p {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.courses {
  align-content: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.section-heading.compact {
  width: min(68rem, 100%);
  justify-self: center;
}

.section-heading h2,
.final-panel h2 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5.6rem);
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
}

.course-grid {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.course-grid article {
  min-height: 20rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.1rem, 3vw, 2rem);
  background:
    linear-gradient(180deg, rgba(16, 54, 41, 0.64), rgba(7, 16, 12, 0.55)),
    radial-gradient(circle at 50% 0%, rgba(214, 166, 78, 0.16), transparent 72%);
  backdrop-filter: blur(14px);
}

.course-grid span {
  color: var(--gold);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
}

.course-grid h3 {
  margin: 0;
  font-size: clamp(1.55rem, 3.6vw, 3.1rem);
  line-height: 1.12;
  font-weight: 500;
}

.ceremony {
  align-items: center;
}

.teacher {
  align-items: center;
}

.reveal-card {
  opacity: 0;
  transform: translateY(2rem) scale(0.985);
  transition:
    opacity 800ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.final-section {
  min-height: 92svh;
  align-items: center;
  justify-items: center;
}

.final-panel {
  width: min(62rem, 100%);
  padding: clamp(1.5rem, 4vw, 3rem);
  border: 1px solid rgba(214, 166, 78, 0.32);
  background:
    linear-gradient(180deg, rgba(11, 33, 25, 0.7), rgba(5, 7, 6, 0.76)),
    radial-gradient(circle at 25% 0%, rgba(214, 166, 78, 0.14), transparent 52%);
  backdrop-filter: blur(18px);
}

.final-panel p {
  margin-top: clamp(1.4rem, 3vw, 2.3rem);
}

@keyframes cue {
  0% {
    transform: translateY(-110%);
  }
  100% {
    transform: translateY(240%);
  }
}

@media (max-width: 760px) {
  .hero,
  .copy-section,
  .courses,
  .final-section {
    padding-inline: 1rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.35rem, 12vw, 4.15rem);
    line-height: 0.96;
  }

  .lead {
    width: 100%;
    font-size: 1rem;
    line-height: 1.85;
  }

  .answer {
    font-size: clamp(1.65rem, 8vw, 2.5rem);
  }

  .course-grid {
    grid-template-columns: 1fr;
  }

  .course-grid article {
    min-height: 12rem;
  }

  .copy-block {
    padding-inline: 1rem;
  }

  .copy-block p,
  .final-panel p {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
    line-height: 1.9;
  }

  .section-heading h2,
  .final-panel h2 {
    font-size: clamp(2.1rem, 11vw, 3.45rem);
    line-height: 1.05;
  }

  .final-panel h2 {
    font-size: clamp(1.65rem, 7.8vw, 2.35rem);
    line-height: 1.24;
  }

  .scroll-cue {
    height: 4.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .scroll-cue span {
    animation: none;
  }

  .reveal-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
