:root {
  color-scheme: dark;
  --text: rgba(245, 247, 242, 0.94);
  --muted: rgba(222, 226, 218, 0.68);
  --line: rgba(255, 255, 255, 0.16);
  --warm: #f2b66d;
  --cold: #a6cad9;
}

* {
  box-sizing: border-box;
}

html {
  background: #030507;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 660vh;
  color: var(--text);
  overflow-x: hidden;
}

canvas#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  background: #030507;
  z-index: 0;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 4px 4px;
}

.story {
  position: relative;
  z-index: 2;
}

.panel {
  min-height: 128vh;
  display: grid;
  align-items: center;
  padding: clamp(48px, 8vw, 120px);
}

.intro {
  align-items: end;
  padding-bottom: 16vh;
}

.intro-copy,
.profile-grid,
.crossing-copy,
.blog,
.blessing-copy {
  width: min(1120px, 100%);
}

.intro-copy {
  max-width: 780px;
  opacity: var(--intro-opacity, 0);
  transform: translate3d(0, calc(22px - var(--intro-rise, 0) * 30px), 0);
  filter: blur(calc((1 - var(--intro-rise, 0)) * 1.5px));
}

.kicker {
  margin: 0 0 18px;
  color: var(--cold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 13ch;
  margin-bottom: 24px;
  font-size: clamp(3.8rem, 10vw, 9.5rem);
  line-height: 0.92;
  font-weight: 800;
  text-wrap: balance;
  text-shadow: 0 8px 32px rgba(0, 0, 0, 0.52);
}

h2 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 5vw, 5.4rem);
  line-height: 1;
  font-weight: 760;
  text-wrap: balance;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.lead,
.profile-main p,
.crossing-copy p,
.blessing-copy p,
.post p {
  max-width: 680px;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.8;
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.65);
}

.profile {
  min-height: 110vh;
  align-items: center;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: clamp(32px, 8vw, 96px);
  opacity: var(--profile-opacity, 0);
  transform: translate3d(0, calc(24px - var(--profile-rise, 0) * 34px), 0);
  filter: blur(calc((1 - var(--profile-rise, 0)) * 1.2px));
}

.profile-facts {
  align-self: end;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.profile-facts li {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.72);
}

.profile-facts span {
  color: rgba(210, 218, 214, 0.58);
}

.profile-facts strong {
  font-weight: 650;
}

.profile-facts a,
.post a {
  color: inherit;
  text-decoration: none;
}

.profile-facts a:hover,
.post a:hover {
  color: rgba(255, 221, 174, 0.96);
}

.crossing {
  min-height: 120vh;
  align-items: center;
}

.crossing-copy {
  max-width: 760px;
  margin-left: auto;
  opacity: var(--bridge-opacity, 0);
  transform: translate3d(0, calc(26px - var(--bridge-rise, 0) * 36px), 0);
  filter: blur(calc((1 - var(--bridge-rise, 0)) * 1.2px));
}

.crossing .kicker,
.blog .kicker {
  color: var(--warm);
}

.blog {
  min-height: 205vh;
  align-content: center;
  gap: clamp(28px, 5vw, 56px);
  opacity: var(--blog-opacity, 0);
  transform: translate3d(0, calc(26px - var(--blog-rise, 0) * 38px), 0);
}

.blog-head {
  max-width: 760px;
}

.posts {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

.post {
  min-height: 176px;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(180deg, rgba(20, 14, 10, 0.48), rgba(7, 8, 8, 0.62)),
    rgba(10, 8, 7, 0.58);
}

.post time {
  display: block;
  margin-bottom: 24px;
  color: rgba(242, 182, 109, 0.82);
  font-size: 0.85rem;
}

.post h3 {
  margin-bottom: 18px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.18;
}

.post p {
  font-size: 1rem;
  line-height: 1.7;
}

.blessing {
  min-height: 138vh;
  align-items: center;
}

.blessing-copy {
  max-width: 860px;
  margin-inline: auto;
  padding-top: 12vh;
  text-align: center;
  opacity: var(--blessing-opacity, 0);
  transform: translate3d(0, calc(24px - var(--blessing-rise, 0) * 34px), 0);
  filter: blur(calc((1 - var(--blessing-rise, 0)) * 1.2px));
}

.blessing .kicker {
  color: rgba(255, 219, 170, 0.9);
}

.blessing h2 {
  max-width: 12ch;
  margin-inline: auto;
  color: rgba(255, 249, 235, 0.96);
}

.blessing-copy p {
  margin-inline: auto;
  color: rgba(255, 242, 220, 0.74);
}

.scroll-meter {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 3;
  width: 2px;
  height: 34vh;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.scroll-meter span {
  display: block;
  width: 100%;
  height: calc(var(--scroll, 0) * 100%);
  background: linear-gradient(var(--cold), var(--warm));
}

.audio-toggle {
  position: fixed;
  right: 42px;
  bottom: 34px;
  z-index: 4;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: rgba(255, 247, 232, 0.9);
  background: rgba(6, 7, 8, 0.42);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.audio-toggle span {
  display: block;
  font-size: 1.3rem;
  line-height: 1;
  transform: translateY(-1px);
}

.audio-toggle:hover {
  border-color: rgba(255, 224, 176, 0.46);
  color: rgba(255, 224, 176, 0.98);
  background: rgba(18, 12, 9, 0.52);
  transform: translateY(-1px);
}

.audio-toggle.is-playing {
  border-color: rgba(242, 182, 109, 0.7);
  color: rgba(255, 229, 186, 1);
  background: rgba(64, 30, 12, 0.46);
}

@media (max-width: 820px) {
  .panel {
    min-height: 118vh;
    padding: 36px 22px;
  }

  .intro {
    padding-bottom: 12vh;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5.8rem);
  }

  .profile-grid,
  .posts {
    grid-template-columns: 1fr;
  }

  .crossing-copy {
    margin-left: 0;
  }

  .post {
    min-height: 210px;
  }

  .scroll-meter {
    right: 12px;
    height: 28vh;
  }

  .audio-toggle {
    right: 22px;
    bottom: 22px;
    width: 40px;
    height: 40px;
  }
}
