/* 进化学院方案 A「一日长卷」：两张样张共用的唯一样式来源。数值理由见设计规格。 */

@font-face {
  font-family: 'XA Hero';
  src: url('./fonts/xa-hero.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'XA Serif';
  src: url('./fonts/xa-serif.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --c-paper: #ffffff;      /* 纸：页面底 */
  --c-wash: #f2f2f2;       /* 淡墨：练一练等成片的底 */
  --c-haze: #c8c8c8;       /* 未到达的笔线、渗墨起点、分隔 */
  --c-ink: #000000;        /* 墨：标题、正文、主按钮 */
  --c-ink-2: #3d3d3d;      /* 次文字，白底 11.3:1 */
  --c-ink-3: #666666;      /* 注释，白底 5.7:1、淡墨底 5.2:1；最浅的文字 */
  --c-accent: #ff2d7a;     /* 胭脂：只表示「你的判断」——朱批圈、验收、首屏那一条线；白底 3.5:1，只给图形与大字 */
  --c-accent-text: #d1005a;/* 胭脂小字，白底 5.4:1 */
  --c-night: #000000;      /* 夜 */
  --c-moon: #f2f2f2;       /* 夜里的文字 */
  --c-surface: #ffffff;

  --f-serif: 'XA Serif', 'Songti SC', 'STSong', 'Noto Serif CJK SC', serif;
  --f-hero: 'XA Hero', var(--f-serif);
  --f-sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  --fs-hero: clamp(5rem, 11vw, 11rem);
  --fs-giant: clamp(3rem, 6.4vw, 6.5rem);
  --fs-title: clamp(2.25rem, 4vw, 3.5rem);
  --fs-heading: clamp(1.5rem, 2.2vw, 2rem);
  --fs-lead: clamp(1.0625rem, 1.3vw, 1.25rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  --measure: 34em;
  --page-x: clamp(20px, 5vw, 80px);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drift: cubic-bezier(0.45, 0, 0.55, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; background: var(--c-paper); }
body { margin: 0; color: var(--c-ink); font: 400 var(--fs-body) / 1.8 var(--f-sans); overflow-x: clip; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--c-ink); outline-offset: 3px; border-radius: 2px; }
.serif { font-family: var(--f-serif); font-weight: 700; letter-spacing: -0.01em; text-wrap: balance; }
.giant { font: 800 var(--fs-giant) / 1.06 var(--f-serif); letter-spacing: -0.03em; text-wrap: balance; }
.lead { font-size: var(--fs-lead); line-height: 1.75; color: var(--c-ink-2); max-width: 26em; text-wrap: pretty; }
.small { font-size: var(--fs-small); line-height: 1.6; color: var(--c-ink-3); }
.ph { display: inline-block; }

/* 页头：站名是一行宋体字标 */
.top {
  position: absolute; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--page-x);
}
.brand { font: 800 20px / 1 var(--f-serif); letter-spacing: 0.06em; text-decoration: none; padding: 12px 0; }
.nav { display: flex; gap: clamp(16px, 2.4vw, 32px); font-size: 15px; }
.nav a { text-decoration: none; color: var(--c-ink-2); padding: 12px 0; transition: color 150ms ease; }
.nav a[aria-current] { color: var(--c-ink); font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--c-ink); } }

/* 按钮：主按钮只有这一种，黑底白字 */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 24px;
  border-radius: 0; background: var(--c-ink); color: #fff;
  font-weight: 700; font-size: 16px; text-decoration: none; border: 0; cursor: pointer;
  transition: background-color 150ms ease, scale 160ms var(--ease-out);
  touch-action: manipulation; user-select: none;
}
.btn:active { scale: 0.97; transition-duration: 90ms; }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: #2b2b2b; } }
.btn.moon { background: var(--c-moon); color: var(--c-ink); }
@media (hover: hover) and (pointer: fine) { .btn.moon:hover { background: #fff; } }
.link { font-weight: 700; color: var(--c-ink); text-decoration: underline 1.5px; text-underline-offset: 5px; text-decoration-color: rgb(0 0 0 / 0.3); transition: text-decoration-color 150ms ease; cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration-color: currentColor; } }

/* 云断：长卷里用云气隔开两段景，这里同样用来接上下两节 */
.cloud { position: relative; height: var(--h, 22vh); margin-block: calc(var(--h, 22vh) / -2); z-index: 2; pointer-events: none; overflow: hidden; }
.cloud i {
  position: absolute; inset: 0 -40%;
  background:
    radial-gradient(28% 46% at 20% 50%, var(--cloud, var(--c-paper)) 30%, transparent 72%),
    radial-gradient(22% 40% at 52% 44%, var(--cloud, var(--c-paper)) 25%, transparent 70%),
    radial-gradient(30% 50% at 82% 56%, var(--cloud, var(--c-paper)) 30%, transparent 72%);
  animation: drift var(--d, 46s) var(--ease-drift) infinite alternate;
}
.cloud i:nth-child(2) { --d: 61s; opacity: 0.8; translate: 12% 8%; animation-direction: alternate-reverse; }
@keyframes drift { to { transform: translateX(-18%); } }

/* 首屏：水绕石（两页共用；课程页只改高度与字号） */
.dawn { position: relative; height: 100svh; min-height: 640px; overflow: hidden; background: var(--c-paper); }
.dawn .still, .dawn canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: left top; }
.dawn canvas { opacity: 0; transition: opacity 900ms ease; }
.dawn canvas.on { opacity: 1; }
.hero-type {
  position: absolute; z-index: 3; left: var(--page-x); top: 19vh;
  font: 800 var(--fs-hero) / 1.02 var(--f-hero); letter-spacing: -0.04em;
}
.hero-type > span { display: block; width: max-content; }
.hero-type i { font-style: normal; }
.hero-type.ink i { animation: ink 1100ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
@keyframes ink { from { font-weight: 120; color: var(--c-haze); } }
.hero-foot {
  position: absolute; z-index: 3; left: var(--page-x); bottom: clamp(40px, 9vh, 88px);
  display: grid; gap: 22px; justify-items: start; width: min(27rem, 100% - 2 * var(--page-x));
}
.hero-foot .lead { font-size: 17px; color: var(--c-ink-2); }

/* 夜：惠斯勒《夜曲》作页尾 */
.night { position: relative; min-height: 100svh; color: var(--c-moon); background: var(--c-night); overflow: hidden; display: grid; align-content: end; }
.night picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: tide 60s var(--ease-drift) infinite alternate; }
@keyframes tide { from { transform: scale(1.06) translateX(1.5%); } to { transform: scale(1.06) translateX(-1.5%); } }
.night::before { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(#000 0%, rgb(0 0 0 / 0.15) 30%, rgb(0 0 0 / 0.1) 55%, rgb(0 0 0 / 0.85) 100%); }
.night-body { position: relative; z-index: 2; display: grid; gap: 36px; padding: 30vh var(--page-x) 48px; }
.night .giant { color: var(--c-moon); max-width: 12em; }
.night-act { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.night-act .small { color: #bdbdbd; }
.night footer { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-top: 14vh; }
.night footer .small { color: #a8a8a8; text-align: right; }
.night .brand { color: var(--c-moon); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
