@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap");

:root {
  --page: #ece9e3;
  --box: #f6f4f0;
  --ink: #1a1a18;
  --text: #1a1a18;
  --muted: #6b6862;
  --line: #d9d5cd;
  --empty: #d4d0c8;
  --accent: #ff4d1a;
  --on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #121211;
    --box: #1d1c1a;
    --ink: #f2efe9;
    --text: #f2efe9;
    --muted: #9a968e;
    --line: #2c2b28;
    --empty: #34322e;
    --accent: #ff5a2a;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--page);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }
::selection { background: var(--accent); color: var(--on-accent); }

.top, .foot {
  position: fixed; left: 80px; right: 80px; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
}
.top { top: 48px; height: 44px; }
.foot { bottom: 40px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.foot nav { display: flex; gap: 24px; }
.foot a { transition: color .3s ease; }
.icon { width: 44px; height: 44px; display: block; }
.note-top { font-size: 15px; line-height: 1.4; color: var(--muted); }

.chapters { width: 640px; margin-left: 80px; padding: max(0px, calc(50vh - 320px)) 0; position: relative; z-index: 1; }
.chapter {
  height: 640px; display: flex; flex-direction: column; justify-content: center; gap: 40px;
  will-change: opacity, transform;
}
.chapter h2, .chapter h1 {
  font-weight: 400; font-size: 52px; line-height: 1.08; letter-spacing: -0.03em;
}
.cta { display: flex; align-items: center; gap: 20px; }
.btn {
  height: 56px; padding: 0 28px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: 16px; line-height: 1;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), filter .3s ease;
}
.btn:hover { filter: brightness(1.04); color: var(--on-accent); }
.btn:active { transform: scale(.97); }
.cta-note p:first-child { font-size: 15px; line-height: 1.4; }
.cta-note p:last-child { font-size: 12px; line-height: 1.3; color: var(--muted); }

.fade { position: fixed; left: 0; right: 0; z-index: 2; pointer-events: none; }
.fade.t { top: 0; height: 300px; background: linear-gradient(to bottom, var(--page) 0%, color-mix(in srgb, var(--page) 85%, transparent) 55%, transparent 100%); }
.fade.b { bottom: 0; height: 320px; background: linear-gradient(to top, var(--page) 0%, color-mix(in srgb, var(--page) 85%, transparent) 55%, transparent 100%); }

.figure { position: fixed; z-index: 3; width: 384px; height: 384px; right: 80px; top: calc(50% - 192px); pointer-events: none; }
.figure canvas { width: 100%; height: 100%; display: block; }

.doc { max-width: 640px; margin: 0 auto; padding: 160px 24px 160px; }
.doc .eyebrow { font-size: 15px; color: var(--muted); margin-bottom: 8px; }
.doc h1 { font-weight: 400; font-size: 52px; line-height: 1.08; letter-spacing: -0.03em; margin-bottom: 16px; }
.doc .lead { font-size: 20px; line-height: 1.5; color: var(--muted); margin-bottom: 56px; }
.doc h2 { font-weight: 400; font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; margin: 48px 0 12px; }
.doc p, .doc li { font-size: 17px; line-height: 1.6; }
.doc p + p { margin-top: 12px; }
.doc ul { margin: 12px 0 0 20px; }
.doc li + li { margin-top: 6px; }
.doc a.link { color: var(--accent); }
.doc .box { background: var(--box); border-radius: 24px; padding: 24px; margin-top: 16px; }
.doc .box p { font-size: 15px; }
.doc-top { position: absolute; }
.doc-foot { position: static; margin: 0 80px 40px; }

@media (max-width: 900px) {
  .top { left: 24px; right: 24px; top: 24px; }
  .foot { left: 24px; right: 24px; bottom: 24px; }
  .foot nav { gap: 16px; }
  .foot > span { display: none; }
  .chapters { width: auto; margin: 0 24px; padding: calc(66vh - 200px) 0 max(24px, calc(34vh - 200px)); }
  .chapter { height: 400px; gap: 28px; }
  .chapter h2, .chapter h1 { font-size: 28px; line-height: 1.2; letter-spacing: -0.02em; }
  .cta { flex-direction: column; align-items: flex-start; gap: 14px; }
  .fade.t { height: 360px; }
  .fade.b { height: 230px; }
  .figure { width: 200px; height: 200px; right: auto; left: calc(50% - 100px); top: 100px; }
  .doc { padding: 120px 24px 120px; }
  .doc h1 { font-size: 36px; }
  .doc-foot { margin: 0 24px 24px; flex-wrap: wrap; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .chapter { transition: none !important; }
}
