:root {
  --bg: #ebe8e4; --surface: #f4f2ef; --surface-2: #fbfaf8; --line: #dcd8d2; --ink: #373934; --muted: #6f664f;
  --accent: #fad24c; --accent-hover: #f7cd3f; --gold: #a48027; --gold-text: #85671d; --on-accent: #373934;
  --shadow: rgba(55,57,52,.10); --glow: rgba(250,210,76,.35);
  --serif: "Playfair Display", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --cjk: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --mono: "JetBrains Mono", Consolas, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(20px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2c2e2a; --surface: #363834; --surface-2: #3d3f3b; --line: #494b46; --ink: #e8e5df; --muted: #b0a68e;
    --gold: #d9b04a; --gold-text: #d9b04a; --on-accent: #2c2e2a; --shadow: rgba(0,0,0,.35); --glow: rgba(250,210,76,.18);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2c2e2a; --surface: #363834; --surface-2: #3d3f3b; --line: #494b46; --ink: #e8e5df; --muted: #b0a68e;
  --gold: #d9b04a; --gold-text: #d9b04a; --on-accent: #2c2e2a; --shadow: rgba(0,0,0,.35); --glow: rgba(250,210,76,.18);
  color-scheme: dark;
}
:root[lang="en"] body { font-family: var(--serif); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--cjk); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(ellipse 90% 55% at 12% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 8%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 50%);
  background-attachment: fixed;
  min-height: 100dvh;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* cursor glow (desktop pointer only) */
.cursor-glow { position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%; pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(circle, var(--glow), transparent 62%); transition: opacity .6s var(--ease); will-change: transform; }
@media (hover: hover) and (pointer: fine) { body.has-pointer .cursor-glow { opacity: 1; } }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter);
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: -.01em; text-decoration: none; }
.wordmark em { font-style: italic; color: var(--muted); }
.bar-right { display: flex; gap: 8px; }
.pill { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px; transition: border-color .2s, background .2s, transform .2s var(--ease); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.pill:hover { border-color: var(--ink); transform: translateY(-1px); }
.pill.icon { width: 32px; padding: 0; justify-content: center; }

.page { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter) 80px; }

/* ---------- home ---------- */
.masthead { padding: clamp(40px, 9vw, 96px) 0 clamp(36px, 6vw, 64px); display: grid; gap: 14px; }
.meta { font-family: var(--mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.masthead h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(56px, 12vw, 148px); line-height: .96; letter-spacing: -.03em; text-wrap: balance; }
.masthead h1 em { font-style: italic; font-weight: 400; color: var(--muted); }
.masthead .tagline { margin: 4px 0 0; font-size: clamp(18px, 2.2vw, 24px); letter-spacing: .06em; }
.masthead .intro { margin: 0; max-width: 34em; color: var(--muted); font-size: clamp(16px, 1.5vw, 17px); text-wrap: pretty; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.section-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tile { position: relative; display: grid; grid-template-rows: auto 1fr auto; min-height: clamp(280px, 30vw, 380px); padding: 26px 28px 24px; border-radius: 18px; text-decoration: none;
  background: color-mix(in srgb, var(--surface) 78%, transparent); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: transform .6s var(--ease), border-color .3s, box-shadow .6s var(--ease); animation: rise .8s var(--ease) both; }
.tile::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .6s var(--ease);
  background: radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 60%); }
.tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.tile:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); box-shadow: 0 30px 60px -30px var(--shadow); }
.tile:hover::before, .tile:hover::after { opacity: 1; transform: none; }
.tile-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tile-top .idx { color: var(--gold-text); }
.tile h3 { margin: 18px 0 0; font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 6.4vw, 84px); line-height: .95; letter-spacing: -.03em; align-self: end; }
.tile-bottom { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-top: 22px; }
.tile-bottom p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 30em; text-wrap: pretty; }
.tile .arrow { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: background .3s, transform .6s var(--ease), border-color .3s; }
.tile:hover .arrow { background: var(--accent); color: var(--on-accent); border-color: transparent; transform: rotate(-45deg); }
.tile .badge { position: absolute; right: 28px; top: 62px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--muted); }

.notice { margin: 40px 0 0; max-width: 46em; padding: 16px 20px; border-left: 2px solid var(--gold); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--ink); font-size: 14px; line-height: 1.7; }

/* ---------- detail ---------- */
.detail { padding: clamp(24px, 4vw, 40px) 0 0; animation: rise .7s var(--ease) both; }
.back { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-decoration: none; transition: color .2s, transform .3s var(--ease); }
.back:hover { color: var(--ink); transform: translateX(-3px); }
.d-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 24px 56px; align-items: end; padding: clamp(28px, 5vw, 56px) 0 36px; border-bottom: 1px solid var(--line); }
.d-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: clamp(64px, 11vw, 150px); line-height: .92; letter-spacing: -.035em; }
.d-head .tag { margin: 14px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
.d-head .free { display: inline-block; margin-top: 10px; font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 15px; }
.d-head .lede { margin: 0; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.7; max-width: 30em; text-wrap: pretty; }
.formats { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.formats li { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.formats li:not(:last-child)::after { content: "·"; margin-left: 8px; color: var(--gold); }

.pledges { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.pledges li { padding: 20px 20px 20px 0; font-size: 14px; border-right: 1px solid var(--line); margin-right: 20px; }
.pledges li:last-child { border-right: 0; }
.pledges strong { display: block; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 4px; }

.d-body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 24px 56px; padding-top: 36px; }
.d-body h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.d-body .sub { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.downloads { display: grid; gap: 2px; }
.dl { display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 6px 22px; align-items: start; padding: 20px 0; border-top: 1px solid var(--line); }
.dl:first-child { border-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 0 18px; border-radius: 12px; background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 600; font-size: 15px;
  box-shadow: 0 1px 2px var(--shadow), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .3s var(--ease), box-shadow .3s, background .2s; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 12px 24px -10px rgba(164,128,39,.55); }
.btn.quiet { background: transparent; color: var(--ink); box-shadow: none; border: 1px solid var(--line); font-weight: 400; }
.btn.quiet:hover { border-color: var(--ink); background: var(--surface); transform: none; box-shadow: none; }
.btn .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.btn .v { font-family: var(--mono); font-size: 11px; opacity: .6; }
.dl .how { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; align-self: center; }

.colophon { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 32px var(--gutter) 56px; border-top: 1px solid var(--line); display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.colophon a { color: var(--gold-text); text-decoration: none; }
.colophon a:hover { text-decoration: underline; text-underline-offset: 4px; }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.masthead > * { animation: rise .8s var(--ease) both; }
.masthead > :nth-child(2) { animation-delay: .06s; } .masthead > :nth-child(3) { animation-delay: .12s; } .masthead > :nth-child(4) { animation-delay: .18s; }
.tile:nth-child(1) { animation-delay: .2s; } .tile:nth-child(2) { animation-delay: .28s; } .tile:nth-child(3) { animation-delay: .36s; } .tile:nth-child(4) { animation-delay: .44s; }

@media (max-width: 820px) {
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { min-height: 0; padding: 22px 20px 20px; }
  .tile h3 { font-size: clamp(44px, 14vw, 72px); margin-top: 34px; }
  .tile .badge { top: 54px; right: 20px; }
  .d-head, .d-body { grid-template-columns: 1fr; gap: 18px; }
  .pledges { grid-template-columns: 1fr; }
  .pledges li { border-right: 0; margin-right: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .pledges li:last-child { border-bottom: 0; }
  .dl { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cursor-glow { display: none; }
}
