/* NovelKit launch page. Colour, radius, shadow and motion values are the app's tokens
   (src/styles/tokens.css, contract: DESIGN-SYSTEM.md); the display type scale is the site's own. */

@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("media/harmonyos-sans-sc-medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --surface-desk: #eeebe4;
  --surface-side: #f5f2ec;
  --surface-page: #fbfaf7;
  --surface-raised: #fffdf9;
  --line-subtle: #ece6dc;
  --line: #ddd5c9;
  --line-strong: #cfc6b8;
  --text: #2f2b26;
  --text-secondary: #5a534b;
  --text-tertiary: #6e655b;
  --text-on-accent: #fffdf9;
  --accent-100: #f3e6da;
  --accent-300: #d2a585;
  --accent: #a45e38;
  --accent-hover: #8f4e2e;
  --accent-active: #77452d;
  --accent-ink: #8b4d2d;
  --fill-hover: rgba(47, 43, 38, .06);
  --fill-active: rgba(47, 43, 38, .11);

  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-display: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", Consolas, monospace;

  /* Site type scale */
  --text-caption: 13px;
  --text-body: 17px;
  --text-lede: clamp(18px, 1.6vw, 21px);
  --text-h3: 20px;
  --text-h2: clamp(30px, 4.2vw, 52px);
  --text-h1: clamp(28px, 8.6vw, 104px);

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-section: clamp(72px, 11vw, 152px);
  --gutter: clamp(20px, 5vw, 56px);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-reveal: 640ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --focus-ring: 0 0 0 3px rgba(164, 94, 56, .28);
  --shadow-1: 0 1px 2px rgba(53, 42, 28, .06);
  --shadow-pop: 0 12px 32px rgba(53, 42, 28, .16), 0 2px 6px rgba(53, 42, 28, .06);
  --shadow-film: 0 40px 100px rgba(53, 42, 28, .18), 0 4px 14px rgba(53, 42, 28, .08);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text);
  font: 400 var(--text-body)/1.75 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, dl, dd, figure { margin: 0; }
ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

.wrap { width: min(1240px, 100%); margin-inline: auto; padding-inline: var(--gutter); }

.skip {
  position: absolute; left: var(--space-4); top: -60px; z-index: 20;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  background: var(--text); color: var(--surface-page);
}
.skip:focus { top: var(--space-4); }

/* Top bar */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--surface-page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-subtle);
}
.top-row { display: flex; align-items: center; gap: var(--space-8); height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 500 18px/1 var(--font-display); letter-spacing: .01em; }
.top-nav { display: flex; gap: var(--space-6); margin-left: auto; font-size: 14px; color: var(--text-secondary); }
.top-nav a { padding: 6px 2px; transition: color var(--dur) var(--ease); }
.top-nav a:hover { color: var(--accent-ink); }
.top-meta { font: 12px/1 var(--font-mono); color: var(--text-tertiary); padding-left: var(--space-6); border-left: 1px solid var(--line); }

/* Shared type */
h1, h2, h3, .outro-line, .sheet-title { font-family: var(--font-display); font-weight: 500; }
h2 { font-size: var(--text-h2); line-height: 1.22; letter-spacing: -.01em; text-wrap: balance; }

.button {
  display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 22px;
  border: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--text-on-accent);
  font-size: 16px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-1);
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.button:hover { background: var(--accent-hover); }
.button:active { background: var(--accent-active); transform: scale(.98); }
.button:focus-visible { border-radius: var(--radius-pill); }
.link { color: var(--accent-ink); font-size: 16px; padding: 10px 4px; border-bottom: 1px solid var(--accent-300); transition: border-color var(--dur) var(--ease); }
.link:hover { border-color: var(--accent); }

/* Hero */
.hero { padding-top: clamp(56px, 9vw, 128px); }
.hero h1 { font-size: var(--text-h1); line-height: 1.12; letter-spacing: -.02em; }
.h1-second { color: var(--text-tertiary); }
.lede { margin-top: var(--space-8); max-width: 34em; font-size: var(--text-lede); line-height: 1.8; color: var(--text-secondary); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); margin-top: var(--space-8); }

.film {
  margin-top: clamp(48px, 7vw, 96px); overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-xl);
  background: var(--surface-desk); box-shadow: var(--shadow-film);
}
.film video { width: 100%; aspect-ratio: 16 / 9; }

/* 01 ghost text */
.feature {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center;
  gap: clamp(32px, 6vw, 96px); padding-block: var(--space-section);
}
.feature-copy p, .band-head p { margin-top: var(--space-6); max-width: 26em; color: var(--text-secondary); }
.feature-copy .note { margin-top: var(--space-4); font-size: 15px; color: var(--text-tertiary); }

.sheet {
  padding: clamp(24px, 4vw, 56px); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-raised); box-shadow: var(--shadow-pop);
}
.sheet-chapter { font-size: 13px; color: var(--text-tertiary); }
.sheet-title { margin-top: 4px; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; }
.sheet-prose { margin-top: var(--space-6); font: 500 clamp(17px, 1.5vw, 20px)/2 var(--font-display); }
.ghost { color: var(--text-tertiary); transition: opacity var(--dur-reveal) var(--ease), color var(--dur-reveal) var(--ease); }
.caret {
  display: inline-block; width: 2px; height: 1.15em; margin-inline: 1px; vertical-align: -.2em;
  background: var(--accent); animation: caret 1.1s steps(1) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
[data-state="writing"] .ghost { opacity: 0; transition-duration: 0s; }
[data-state="accepted"] .ghost { color: var(--text); }
[data-state="accepted"] .caret { display: none; }
.sheet-foot { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-6); min-height: 36px; }
.keycap {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px 0 6px;
  border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-page);
  font-size: 14px; color: var(--text-secondary); cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), opacity var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.keycap:hover { background: var(--accent-100); border-color: var(--accent-300); }
.keycap:active { transform: translateY(1px); }
.keycap kbd {
  padding: 3px 9px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius-sm);
  background: var(--surface-raised); font: 12px/1.4 var(--font-mono); color: var(--text);
}
[data-state="writing"] .keycap { opacity: 0; pointer-events: none; }
.sheet-status { font-size: 14px; color: var(--text-tertiary); }

/* 02 reference panel */
.band { padding-block: var(--space-section); background: var(--surface-desk); border-block: 1px solid var(--line-subtle); }
.panels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); margin-top: clamp(40px, 6vw, 80px); }
.panel img {
  width: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface-side); box-shadow: var(--shadow-1);
}
.panel h3 { margin-top: var(--space-6); font-size: var(--text-h3); line-height: 1.4; }
.panel p { margin-top: 6px; font-size: 15px; line-height: 1.7; color: var(--text-secondary); }

/* 03 the desk */
.desk { padding-block: var(--space-section); }
.screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); margin-top: clamp(40px, 6vw, 80px); }
.screen img { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.screen figcaption { margin-top: var(--space-4); font-size: 15px; color: var(--text-secondary); }
.screen strong { margin-right: var(--space-3); font: 500 16px/1.4 var(--font-display); color: var(--text); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.facts > div { padding: var(--space-8) var(--space-8) 0 0; }
.facts > div + div { padding-left: var(--space-8); border-left: 1px solid var(--line-subtle); }
.facts dt { font: 500 var(--text-h3)/1.4 var(--font-display); }
.facts dd { margin-top: var(--space-2); font-size: 15px; color: var(--text-secondary); }

/* Outro and footer */
.outro { padding-block: var(--space-section); background: var(--surface-desk); border-top: 1px solid var(--line-subtle); text-align: center; }
.outro-line { font-size: var(--text-h1); line-height: 1.12; letter-spacing: -.02em; }
.outro-sub { margin-top: var(--space-4); font-size: var(--text-lede); color: var(--text-secondary); }
.outro .button { margin-top: var(--space-12); }
.foot { background: var(--surface-desk); border-top: 1px solid var(--line); font-size: 13px; color: var(--text-tertiary); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding-block: var(--space-6); }
.foot .brand { font-size: 15px; color: var(--text); }

/* Reveal on scroll (only when JS has run) */
.js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity var(--dur-reveal) var(--ease), transform var(--dur-reveal) var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.panels > :nth-child(2), .screens > :nth-child(2) { transition-delay: 70ms; }
.panels > :nth-child(3) { transition-delay: 140ms; }
.panels > :nth-child(4) { transition-delay: 210ms; }

@media (max-width: 1040px) {
  .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-12); }
}
@media (max-width: 860px) {
  .feature { grid-template-columns: minmax(0, 1fr); }
  .top-nav { display: none; }
  .top-meta { margin-left: auto; padding-left: 0; border-left: 0; }
}
@media (max-width: 640px) {
  .screens, .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > div, .facts > div + div { padding: var(--space-6) 0; border-left: 0; }
  .facts > div + div { border-top: 1px solid var(--line-subtle); }
  .film { border-radius: var(--radius-lg); }
  .screen strong { display: block; margin: 0 0 2px; }
}
@media (max-width: 460px) {
  .panels { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* Downloads */
.button-quiet { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-300); }
.button-quiet:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.downloads { margin: var(--space-12) auto 0; max-width: 640px; }
.downloads-title { font: 500 var(--text-h3)/1.4 var(--font-display); }
.downloads-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-6); padding: 0; list-style: none; }
.download { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-page); font-size: 15px; transition: border-color var(--dur) var(--ease); }
.download:hover { border-color: var(--accent); }
.download.is-yours { border-color: var(--accent); box-shadow: var(--shadow-1); }
.downloads-note { margin-top: var(--space-4); font-size: 13px; color: var(--text-tertiary); }
.downloads-note a, .foot a { color: var(--accent-ink); }
@media (max-width: 460px) { .downloads-list { grid-template-columns: minmax(0, 1fr); } }
