:root{
  --paper: #EFF1EE; --paper-raised: #FFFFFF; --paper-sunken: #E4E7E1;
  --ink: #14181B; --ink-soft: #565C63; --ink-faint: #878D92;
  --line: rgba(20,24,27,0.12); --line-strong: rgba(20,24,27,0.24);
  --accent: #1E4A47; --accent-bright: #2C6864; --accent-ink: #EAF3F1;
  --shadow-c: 20,24,27; --grain-opacity: 0.045;
  --teal: #17968A; --teal-deep:#0B4A44;
  --ochre: #E08A2E; --ochre-deep:#A85A16;
  --burgundy: #D43D63; --burgundy-deep:#84203C;
  --slate: #3457C4; --slate-deep:#1E3480;
  --moss: #4FA33F; --moss-deep:#265420;
  --violet: #8B4FD9; --violet-deep:#4B2170;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --paper: #121517; --paper-raised: #191D20; --paper-sunken: #0E1112;
    --ink: #F1EEE7; --ink-soft: #A6ACB2; --ink-faint: #6E747A;
    --line: rgba(241,238,231,0.12); --line-strong: rgba(241,238,231,0.24);
    --accent: #4E9A93; --accent-bright: #63B0A8; --accent-ink: #0D1817;
    --shadow-c: 0,0,0; --grain-opacity: 0.07;
    --teal: #2CC4B4; --teal-deep:#0B4A44; --ochre: #F5A64B; --ochre-deep:#A85A16;
    --burgundy: #F0648A; --burgundy-deep:#84203C; --slate: #6E8CF0; --slate-deep:#1E3480;
    --moss: #78D164; --moss-deep:#265420; --violet: #B587F5; --violet-deep:#4B2170;
  }
}
:root[data-theme="dark"]{
  --paper: #121517; --paper-raised: #191D20; --paper-sunken: #0E1112;
  --ink: #F1EEE7; --ink-soft: #A6ACB2; --ink-faint: #6E747A;
  --line: rgba(241,238,231,0.12); --line-strong: rgba(241,238,231,0.24);
  --accent: #4E9A93; --accent-bright: #63B0A8; --accent-ink: #0D1817;
  --shadow-c: 0,0,0; --grain-opacity: 0.07;
  --teal: #2CC4B4; --teal-deep:#0B4A44; --ochre: #F5A64B; --ochre-deep:#A85A16;
  --burgundy: #F0648A; --burgundy-deep:#84203C; --slate: #6E8CF0; --slate-deep:#1E3480;
  --moss: #78D164; --moss-deep:#265420; --violet: #B587F5; --violet-deep:#4B2170;
}

.app-shell *{ box-sizing:border-box; }
.app-shell{
  container-type:inline-size; container-name:shell; position:relative;
  background:var(--paper); color:var(--ink); font-family:'IBM Plex Sans', system-ui, sans-serif;
  -webkit-font-smoothing:antialiased; min-height:100vh; overflow-x:hidden;
}
@media (prefers-reduced-motion: reduce){
  .app-shell *{ animation-duration:0.001ms !important; transition-duration:0.001ms !important; }
}
.app-shell a{ color:inherit; text-decoration:none; }
.app-shell h1, .app-shell h2, .app-shell h3{ font-family:'Fraunces', Georgia, serif; text-wrap:balance; margin:0; }
.app-shell em{ font-style:italic; }
.app-shell .mono{ font-family:'IBM Plex Mono', ui-monospace, monospace; }
.app-shell .wrap{ max-width:1220px; margin:0 auto; padding:0 24px; position:relative; }
.app-shell button{ font-family:inherit; cursor:pointer; }
.app-shell :focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.grain{ position:fixed; inset:0; z-index:300; pointer-events:none; opacity:var(--grain-opacity); mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.site-header{ position:sticky; top:0; z-index:50; background:color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
.bar{ display:flex; align-items:center; gap:20px; height:64px; }
.logo{ display:flex; align-items:center; gap:10px; font-family:'Fraunces',serif; font-weight:600; font-size:21px; letter-spacing:-0.01em; flex-shrink:0; }
.logo .mark{ width:26px; height:26px; border-radius:3px; background:var(--accent); position:relative; flex-shrink:0; }
.logo .mark::before{ content:''; position:absolute; left:6px; top:5px; width:9px; height:2px; background:var(--accent-ink); box-shadow:0 4px 0 var(--accent-ink), 0 8px 0 var(--accent-ink); }
.search{ flex:1; max-width:320px; display:flex; align-items:center; gap:8px; background:var(--paper-sunken); border:1px solid var(--line); border-radius:8px; padding:8px 12px; }
.search input{ background:none; border:none; outline:none; color:var(--ink); font-family:inherit; font-size:14px; width:100%; }
.search svg{ flex-shrink:0; opacity:0.55; }
.header-spacer{ flex:1; }
.theme-note{ font-size:12px; color:var(--ink-faint); display:none; white-space:nowrap; }
@container shell (min-width:720px){ .theme-note{ display:block; } }

.lang-switch{ display:flex; gap:2px; background:var(--paper-sunken); border:1px solid var(--line); border-radius:20px; padding:3px; flex-shrink:0; order:2; }
.lang-btn{ font-family:'IBM Plex Mono',monospace; font-size:11px; font-weight:500; letter-spacing:.03em; padding:5px 10px; border-radius:16px; border:none; background:none; color:var(--ink-faint); transition:background .15s, color .15s; }
.lang-btn:hover{ color:var(--ink); }
.lang-btn.active{ background:var(--ink); color:var(--paper); }
@container shell (max-width:560px){
  .bar{ flex-wrap:wrap; height:auto; padding:12px 0; row-gap:10px; }
  .search{ order:3; max-width:100%; flex:1 1 100%; }
  .header-spacer{ display:none; }
}

.hero{ position:relative; padding:64px 0 40px; overflow:hidden; }
@container shell (min-width:900px){ .hero{ padding:88px 0 60px; min-height:560px; } }
.hero-glow{ position:absolute; inset:-10%; z-index:0; opacity:0.55; filter:blur(60px); pointer-events:none;
  background:
    radial-gradient(38% 42% at 78% 18%, color-mix(in srgb, var(--ochre) 65%, transparent), transparent),
    radial-gradient(34% 38% at 92% 62%, color-mix(in srgb, var(--burgundy) 55%, transparent), transparent),
    radial-gradient(40% 46% at 58% 78%, color-mix(in srgb, var(--violet) 45%, transparent), transparent),
    radial-gradient(34% 40% at 30% 30%, color-mix(in srgb, var(--teal) 50%, transparent), transparent); }
.hero-grid{ display:grid; grid-template-columns:1fr; gap:36px; position:relative; z-index:2; }
@container shell (min-width:900px){ .hero-grid{ grid-template-columns:1.05fr 0.95fr; align-items:center; gap:12px; } }
.eyebrow{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; letter-spacing:.12em; text-transform:uppercase; color:var(--accent); display:flex; align-items:center; gap:9px; margin-bottom:18px; }
.eyebrow::before{ content:''; width:15px; height:1px; background:var(--accent); }
.hero h1{ font-size:clamp(34px,6.5vw,68px); font-weight:600; line-height:1; letter-spacing:-0.015em; max-width:11.5ch; }
.hero h1 em{ color:var(--accent); font-weight:500; }
.hero p{ margin:22px 0 0; color:var(--ink-soft); font-size:17px; max-width:42ch; line-height:1.6; }

.steps{ display:grid; grid-template-columns:repeat(3,1fr); gap:1px; background:var(--line); border:1px solid var(--line); border-radius:12px; overflow:hidden; margin:32px 0 0; }
.step{ background:var(--paper-raised); padding:16px 18px; display:flex; gap:11px; align-items:flex-start; }
.step b{ font-family:'IBM Plex Mono',monospace; font-size:12px; color:var(--accent); border:1px solid var(--line-strong); width:21px; height:21px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:1px; }
.step span{ font-size:13px; color:var(--ink-soft); line-height:1.42; }
.step strong{ color:var(--ink); font-weight:600; }
@container shell (max-width:720px){ .steps{ grid-template-columns:1fr; } }

.stage{ position:relative; height:400px; }
@container shell (max-width:899px){ .stage{ height:280px; margin-top:-8px; } }
.waveform{ position:absolute; inset:-10% -5%; width:110%; height:120%; opacity:0.55; z-index:0; }
.waveform path{ fill:none; stroke:var(--accent); stroke-width:1.4; opacity:0.5; }
.waveform path.p2{ stroke:var(--ochre); opacity:0.32; }

.fcover{ position:absolute; border-radius:9px; box-shadow:0 22px 44px -18px rgba(var(--shadow-c),0.45), 0 2px 6px rgba(var(--shadow-c),0.12); overflow:hidden; will-change:transform; animation:bob 7s ease-in-out infinite;
  transform: translateY(calc(-1 * var(--sy,0px))) rotate(var(--rot,0deg)); }
.fcover .cover-top{ position:relative; z-index:2; padding:10px; }
.fcover .cv-series{ font-family:'IBM Plex Mono',monospace; font-size:8px; letter-spacing:.09em; text-transform:uppercase; color:rgba(255,255,255,0.85); text-shadow:0 1px 3px rgba(0,0,0,0.5); }
@keyframes bob{ 0%,100%{ transform:translateY(calc(-1 * var(--sy,0px))) rotate(var(--rot,0deg)); } 50%{ transform:translateY(calc(-1 * var(--sy,0px) - 10px)) rotate(var(--rot,0deg)); } }
.f1{ width:150px; aspect-ratio:5/6.6; left:6%; top:6%; --rot:-9deg; transform:rotate(-9deg); z-index:3; animation-delay:.2s; }
.f2{ width:172px; aspect-ratio:5/6.6; left:38%; top:0%; --rot:4deg; transform:rotate(4deg); z-index:4; animation-delay:1.1s; }
.f3{ width:140px; aspect-ratio:5/6.6; left:66%; top:14%; --rot:-4deg; transform:rotate(-4deg); z-index:2; animation-delay:.6s; }
.f4{ width:128px; aspect-ratio:5/6.6; left:20%; top:52%; --rot:7deg; transform:rotate(7deg); z-index:2; animation-delay:1.7s; }
.f5{ width:132px; aspect-ratio:5/6.6; left:58%; top:56%; --rot:-11deg; transform:rotate(-11deg); z-index:3; animation-delay:.9s; }
@container shell (max-width:899px){
  .f1{ width:104px; left:2%; top:14%; } .f2{ width:120px; left:34%; top:2%; } .f3{ width:98px; left:64%; top:20%; }
  .f4{ width:90px; left:14%; top:60%; } .f5{ width:92px; left:56%; top:62%; }
}

.filters{ display:flex; gap:8px; overflow-x:auto; padding-bottom:20px; scrollbar-width:none; }
.filters::-webkit-scrollbar{ display:none; }
.chip{ font-family:'IBM Plex Mono',monospace; font-size:12.5px; padding:8px 14px; border-radius:20px; border:1px solid var(--line-strong); background:var(--paper-raised); color:var(--ink-soft); white-space:nowrap; transition:background .15s, color .15s, border-color .15s; }
.chip:hover{ border-color:var(--accent); color:var(--ink); }
.chip.active{ background:var(--ink); border-color:var(--ink); color:var(--paper); }

.section-head{ display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin:8px 0 26px; flex-wrap:wrap; }
.section-head h2{ font-size:clamp(26px,3.4vw,38px); font-weight:600; }
.section-head p{ margin:6px 0 0; color:var(--ink-soft); font-size:14.5px; max-width:46ch; }

main{ padding-bottom:90px; }
.grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:20px; }
@container shell (max-width:980px){ .grid{ grid-template-columns:repeat(3,1fr); } }
@container shell (max-width:680px){ .grid{ grid-template-columns:repeat(2,1fr); gap:14px; } }

.card{ display:block; }
.card.pre-reveal{ opacity:0; transform:translateX(56px); }
.card.pre-reveal.revealed{ animation:reveal .6s cubic-bezier(.16,.8,.3,1) forwards; }
@keyframes reveal{ to{ opacity:1; transform:translateX(0); } }

.cover{
  position:relative; aspect-ratio:5/6.6; border-radius:8px; overflow:hidden;
  display:flex; flex-direction:column; justify-content:space-between; padding:16px;
  box-shadow:0 1px 2px rgba(var(--shadow-c),0.08);
  transition:transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s;
}
.card:hover .cover, .detail-cover:hover .cover{ transform:translateY(-5px) rotate(-0.6deg); box-shadow:0 18px 34px -14px rgba(var(--shadow-c),0.4); }
.cover-photo{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0; }
.cover-top{ position:relative; z-index:2; display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.stamp{ font-family:'IBM Plex Mono',monospace; font-size:10.5px; letter-spacing:.03em; padding:3px 8px; border-radius:20px; border:1px solid rgba(255,255,255,0.55); color:#fff; background:rgba(0,0,0,0.45); flex-shrink:0; }
.series-mark{ font-family:'IBM Plex Mono',monospace; font-size:9.5px; text-transform:uppercase; letter-spacing:.1em; color:#fff; background:rgba(0,0,0,0.45); padding:3px 8px; border-radius:20px; }
.series-mark:empty{ display:none; }
.cover-title{ position:relative; z-index:2; font-family:'Fraunces',serif; font-weight:600; font-size:19px; line-height:1.14; color:#fff; text-wrap:balance; }
.cover-rule{ position:relative; z-index:2; width:26px; height:2px; background:rgba(255,255,255,0.55); margin-top:10px; }

.tint-teal{ background:var(--teal-deep); }
.tint-ochre{ background:var(--ochre-deep); }
.tint-burgundy{ background:var(--burgundy-deep); }
.tint-slate{ background:var(--slate-deep); }
.tint-moss{ background:var(--moss-deep); }
.tint-violet{ background:var(--violet-deep); }

.empty{ text-align:center; padding:60px 20px; color:var(--ink-faint); font-size:14px; display:none; }

.site-footer{ border-top:1px solid var(--line); padding:26px 0; }
.site-footer p{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; color:var(--ink-faint); margin:0; }

/* ---- book detail page ---- */
.detail-top{ padding:22px 0 0; }
.back{ display:inline-flex; align-items:center; gap:6px; font-size:13.5px; color:var(--ink-soft); }
.back:hover{ color:var(--ink); }
.qr-note{ display:flex; align-items:center; gap:8px; background:var(--accent-ink); border:1px solid var(--line); color:var(--accent); font-size:12.5px; padding:8px 12px; border-radius:8px; margin:14px 0 0; width:fit-content; font-family:'IBM Plex Mono',monospace; }

.detail-layout{ display:grid; grid-template-columns:280px 1fr; gap:44px; padding:26px 0 60px; align-items:start; }
@container shell (max-width:760px){ .detail-layout{ grid-template-columns:1fr; gap:22px; padding-top:16px; } }
.detail-cover{ position:sticky; top:88px; }
@container shell (max-width:760px){ .detail-cover{ position:static; max-width:220px; margin:0 auto; } }
.detail-cover .cover{ aspect-ratio:5/6.6; box-shadow:0 30px 54px -20px rgba(var(--shadow-c),0.45); transform:rotate(-2deg); transition:transform .4s cubic-bezier(.2,.8,.2,1); }
.detail-cover:hover .cover{ transform:rotate(0deg) scale(1.015); }

.detail-body{ opacity:0; transform:translateY(8px); animation:reveal-up .4s cubic-bezier(.2,.7,.2,1) .05s forwards; }
@keyframes reveal-up{ to{ opacity:1; transform:translateY(0); } }
.badges{ display:flex; gap:8px; flex-wrap:wrap; }
.badge{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; padding:5px 10px; border-radius:20px; border:1px solid var(--line-strong); color:var(--ink-soft); }
.detail-body h1{ font-size:clamp(26px,3.8vw,38px); font-weight:600; margin:14px 0 0; line-height:1.06; }
.detail-sub{ color:var(--ink-soft); font-size:14.5px; margin:9px 0 0; max-width:52ch; }

.listen-card{ margin-top:26px; background:var(--paper-raised); border:1px solid var(--line); border-radius:12px; padding:22px; }
.listen-head{ display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.listen-head .dot{ width:8px; height:8px; border-radius:50%; background:var(--accent); }
.listen-head span{ font-family:'IBM Plex Mono',monospace; font-size:11.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-soft); }
.btn-primary-wrap{ position:relative; }
.btn-primary{
  width:100%; display:flex; align-items:center; justify-content:center; gap:10px;
  background:var(--accent); color:var(--accent-ink); border:none; border-radius:9px;
  padding:16px 20px; font-size:16px; font-weight:600; font-family:'IBM Plex Sans',sans-serif;
  transition:background .15s, transform .12s cubic-bezier(.2,.8,.2,1);
}
.btn-primary:hover{ background:var(--accent-bright); }
.btn-primary:active{ transform:scale(0.98); }
.btn-caption{ text-align:center; font-size:12px; color:var(--ink-faint); margin:10px 0 0; }

.howto{ margin-top:20px; }
.howto summary{ cursor:pointer; font-size:13.5px; color:var(--accent); font-weight:500; list-style:none; display:flex; align-items:center; gap:6px; }
.howto summary::-webkit-details-marker{ display:none; }
.howto summary .chev{ transition:transform .18s; }
.howto[open] summary .chev{ transform:rotate(90deg); }
.howto ol{ margin:12px 0 0; padding-left:20px; font-size:13.5px; color:var(--ink-soft); line-height:1.9; }

.more-series{ margin-top:44px; }
.more-series h3{ font-size:15px; font-weight:600; font-family:'IBM Plex Sans',sans-serif; margin-bottom:14px; color:var(--ink-soft); }
.more-row{ display:flex; gap:12px; overflow-x:auto; padding-bottom:6px; }
.mini{ flex-shrink:0; width:108px; display:block; }
.mini .cover{ aspect-ratio:5/6.6; border-radius:6px; padding:9px; }
.mini .cover-title{ font-size:12px; }
.mini .stamp{ font-size:9px; padding:2px 6px; }
.mini .series-mark{ font-size:8px; }
.mini-label{ font-size:11px; color:var(--ink-faint); margin-top:6px; font-family:'IBM Plex Mono',monospace; }
