/* 紙页 Kamipage — tokens are shared with the 3-D scenes via token('--name'). See DIRECTION.md. */
:root {
  --paper: #F7F1E6; --paper-2: #EEE4D2; --dot: #D6C8B2;
  --ink: #2A2521; --ink-2: #5B4130; --muted: #6E645C;   /* 5.13:1 on paper, 4.58:1 on kinari (AA) */
  --accent: #9E3B3B; --night: #1D1916; --dusk: #3A3048;
  --sakura: #EFC7C2; --wakakusa: #B8C48A; --fuji: #B3A9CF; --yamabuki: #E3B04B; --asagi: #86B2B0; --shu: #C8553D;
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', system-ui, sans-serif;
  --hand: 'LXGW WenKai', 'Kaiti SC', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --jp: 'Shippori Mincho', serif;
  --gutter: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font: 400 16px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p, blockquote, figure, ul, ol { margin: 0; }

/* the shared canvas is the page ground */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
html:not(.gl) [data-bg] { background: var(--paper); }
html:not(.gl) .dark[data-bg] { background: var(--night); }
/* the 5 mm dot grid lives in the WebGL ground (js/main.js) so scenes sit on top of it */
section { position: relative; isolation: isolate; }
html.bare body *:not(#gl):not(main):not(section):not(footer):not([data-scene]):not(.how-track):not(.wrap):not(.how-grid) { visibility: hidden !important; }
html.bare .nav, html.bare section::before, html.bare section::after { visibility: hidden !important; opacity: 0 !important; }
/* first paint: a pre-rendered poster sits in the scene host until the live scene is ready; phones get stills */
.scene-poster, .scene-still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.scene-poster { transition: opacity .9s var(--ease); }
[data-scene].is-ready .scene-poster { opacity: 0; }
[data-scene] { position: relative; }
.scene-fill[data-scene] { position: absolute; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.mono { font: 400 12px/1.5 var(--mono); letter-spacing: .02em; color: var(--muted); }
.eyebrow { display: flex; align-items: baseline; gap: 10px; font: 400 12px/1.5 var(--mono); letter-spacing: .08em; color: var(--muted); margin-bottom: 18px; }
.eyebrow .jp { font: 700 15px/1 var(--jp); color: var(--accent); letter-spacing: 0; }
.display { font: 500 clamp(44px, 6.2vw, 92px)/1.12 var(--serif); letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.h2 { font: 500 clamp(34px, 4.4vw, 64px)/1.18 var(--serif); letter-spacing: -.01em; color: var(--ink-2); margin-bottom: 36px; text-wrap: balance; }
section { scroll-margin-top: 96px; }
em { font-style: normal; color: var(--accent); }
.dark em { color: #C9716B; }   /* enji lifted for dark grounds (≥4.5:1 on #1D1916) */
.lead { font: 400 clamp(16px, 1.25vw, 18px)/1.8 var(--sans); color: var(--ink); max-width: 34em; }
.hand { font-family: var(--hand); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font: 500 15px/1 var(--sans); text-decoration: none; white-space: nowrap; transition: transform .3s var(--ease), background .3s; }
.btn:hover { transform: translateY(-1px); }
.btn i { width: 18px; height: 18px; display: inline-flex; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-line { border: 1px solid var(--ink); color: var(--ink); }
.btn-paper { background: var(--paper); color: var(--ink); }

/* floating menu, with the ribbon as the hover mark */
.nav { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 24px;
  width: min(820px, calc(100% - 2 * var(--gutter))); padding: 7px 7px 7px 18px; border-radius: 999px;
  background: var(--paper); border: 1px solid rgb(42 37 33 / .08); transition: background .4s var(--ease), color .4s var(--ease), border-color .4s; }
.nav.on-dark { background: var(--night); border-color: rgb(247 241 230 / .1); color: var(--paper); }
.nav.on-dark .brand-kanji { color: var(--paper); }
.nav.on-dark .btn-ink { background: var(--paper); color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.brand-mark { width: 22px; height: 22px; flex: none; }
.brand .mk-dark, .nav.on-dark .brand .mk-light, .footer .brand .mk-light { display: none; }
.nav.on-dark .brand .mk-dark, .footer .brand .mk-dark { display: block; }
.brand-kanji { font: 700 20px/1 var(--serif); color: var(--ink); letter-spacing: .02em; }   /* 页 is simplified: Noto Serif SC, not Shippori */
.brand-word { font: 600 15px/1 'Instrument Sans', var(--sans); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 22px; font: 500 14px/1 var(--sans); }
.nav-links a { position: relative; text-decoration: none; opacity: .78; padding: 6px 0; }
.nav-links a::after { content: ""; position: absolute; left: 50%; top: 100%; width: 3px; height: 0; margin-left: -1.5px; background: var(--accent); transition: height .35s var(--ease); }
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after, .nav-links a.current::after { height: 10px; }
.nav-links a.current { opacity: 1; }
.nav-links a.current::after { clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 75%, 0 100%); }   /* swallowtail, like the ribbon */

/* 01 hero */
.scene-fill { position: absolute; inset: 0; }
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 110px 0 0; }
.hero > .wrap { width: 100%; }   /* auto margins in a flex column would otherwise shrink-wrap */
.hero-copy { position: relative; }
.hero .eyebrow { color: var(--ink-2); }
/* the desk fades into paper so the stats strip reads and the next section continues seamlessly */
.hero::after { content: ""; position: absolute; inset: auto 0 0; height: 26%; pointer-events: none; z-index: 0; background: linear-gradient(to top, var(--paper) 18%, rgb(247 241 230 / 0)); }
.hero-stats { z-index: 1; }
.hero-copy > * { max-width: 560px; }
.hero .lead { margin: 22px 0 28px; }
.prompt-card { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; max-width: 560px; border-radius: 16px; background: rgb(255 252 246 / .86); border: 1px solid rgb(42 37 33 / .1); box-shadow: 0 18px 40px -24px rgb(60 40 20 / .35); }
.prompt-card label { flex: none; }
.prompt-hint { flex: 1; min-width: 0; font: 400 16px/1.4 var(--sans); color: var(--ink-2); }
.hero-stats { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: auto; padding-top: 64px; padding-bottom: 28px; }
.hero-stats > div { padding: 18px 20px 0 0; border-top: 1px solid rgb(42 37 33 / .14); }
.stamp-num { display: inline-block; font: 500 clamp(22px, 2vw, 30px)/1.1 var(--serif); color: var(--ink-2); border: 1.5px solid rgb(200 85 61 / .75); border-radius: 6px; padding: 3px 10px 4px; margin-bottom: 8px; transform: rotate(-1.5deg); }
.hero-stats > div:nth-child(2n) .stamp-num { transform: rotate(1deg); }
.hero-stats span { display: block; }
.hero-stats span { font: 400 13px/1.6 var(--sans); color: var(--muted); }

/* 02 proof */
.proof { padding: 120px 0 40px; }
.proof-inner { max-width: 900px; text-align: center; }
.proof blockquote { font-size: clamp(22px, 2.3vw, 32px); line-height: 1.6; color: var(--ink-2); margin-bottom: 18px; }

/* 03 how */
.how { padding: 40px 0 80px; }
.how-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.how-copy { position: sticky; top: 120px; }
.steps { list-style: none; padding: 0 0 0 18px; border-top: 1px solid var(--dot); position: relative; }
.steps::before { content: ""; position: absolute; left: 0; top: 0; width: 3px; height: calc(var(--p, 0) * 100%); background: var(--accent); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 5px), 0 100%); transition: height .15s linear; }
.step { transition: opacity .5s var(--ease); }
.steps[data-live] .step:not(.active) { opacity: .42; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 24px 0; border-bottom: 1px solid var(--dot); }
.step h3 { font: 500 20px/1.4 var(--sans); color: var(--ink); margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }
.num { font: 400 12px/2.2 var(--mono); color: var(--accent); }
.how-track { height: 220vh; }                         /* scroll distance for the assembly */
.how-scene { position: sticky; top: 0; height: 100vh; }   /* the scene reads progress from .how-track */

/* 04 formats */
.formats { padding: 140px 0; }
.formats-scene { height: min(52vw, 560px); margin: 0 calc(-1 * var(--gutter)); }
.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid rgb(42 37 33 / .14); }
.cell { padding: 22px 22px 8px 0; }
.cell h3 { font: 500 22px/1.3 var(--serif); color: var(--ink-2); margin: 4px 0 6px; }
.cell p { color: var(--muted); font-size: 15px; }

/* 05 materials (night) */
.dark { color: var(--paper); }
.dark .eyebrow, .dark .mono { color: rgb(247 241 230 / .6); }
.dark .h2 { color: var(--paper); }
.dark .lead { color: rgb(247 241 230 / .82); }
.materials { min-height: 100svh; display: flex; align-items: center; padding: 200px 0 140px; }
.materials::before, .cta::before, .gallery::before { content: ""; position: absolute; inset: -2px 0 auto; pointer-events: none; z-index: 0; }   /* -2px: no seam on fractional section edges */
.materials::before { height: 260px; background: linear-gradient(#EEE4D2, rgb(138 122 106 / .85) 40%, rgb(29 25 22 / 0)); }
.materials-copy, .cta-inner { z-index: 1; }
.materials-copy { position: relative; width: 100%; }
.materials-copy > * { max-width: 480px; }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.chips li { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid rgb(247 241 230 / .18); font: 400 14px/1 var(--sans); }
.chips i { width: 18px; height: 18px; display: inline-flex; color: #C9716B; }

/* 06 gallery */
.gallery { padding: 230px 0 60px; }
.gallery::before { height: 220px; background: linear-gradient(#1D1916, rgb(110 98 88 / .9) 50%, rgb(247 241 230 / 0)); }
.gallery > .wrap { position: relative; z-index: 1; }
.gallery-scene { height: min(62vw, 760px); }

/* 07 voices */
.voices { padding: 40px 0 60px; }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.postcard { position: relative; display: grid; grid-template-columns: 38% 1fr; grid-template-rows: 1fr auto; gap: 0 16px; background: #FFFCF6; padding: 14px; border-radius: 4px; aspect-ratio: 3 / 2; box-shadow: 0 1px 0 rgb(42 37 33 / .06), 0 22px 40px -28px rgb(60 40 20 / .45); transform: rotate(var(--r, 0deg)); }
.postcard:nth-child(1) { --r: -1.2deg; } .postcard:nth-child(2) { --r: .8deg; margin-top: 24px; } .postcard:nth-child(3) { --r: -.5deg; }
.cards3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.postcard img { grid-row: 1 / 3; width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; border-radius: 2px; }
.postcard::after { content: ""; position: absolute; top: 12px; right: 12px; width: 64px; height: 64px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23C8553D' stroke-width='1.6' opacity='.85'%3E%3Ccircle cx='32' cy='32' r='22'/%3E%3Ccircle cx='32' cy='32' r='17'/%3E%3Cpath d='M0 26h8M0 32h8M0 38h8M56 26h8M56 32h8M56 38h8'/%3E%3C/g%3E%3Ctext x='32' y='30' text-anchor='middle' font-family='monospace' font-size='7' fill='%23C8553D'%3E2026.09%3C/text%3E%3Ctext x='32' y='40' text-anchor='middle' font-family='serif' font-size='9' fill='%23C8553D'%3E%E6%A0%9E%3C/text%3E%3C/svg%3E") center / contain no-repeat; transform: rotate(-12deg); pointer-events: none; }
.postcard blockquote { align-self: center; font-size: 19px; line-height: 1.8; color: var(--ink); margin: 56px 4px 12px 0;
  background-image: linear-gradient(transparent calc(1.75em - 1px), rgb(122 104 84 / .25) 1px); background-size: 100% 1.75em; }
.postcard figcaption { display: flex; flex-direction: column; gap: 2px; padding: 0 4px 2px 0; border-top: 1px dashed var(--dot); padding-top: 8px; }
.postcard b { font: 500 15px var(--sans); }

/* 08 pricing */
.pricing { padding: 140px 0; }
.tiers-scene { height: min(34vw, 380px); margin: -20px calc(-1 * var(--gutter)) 0; }
.pricing-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 30px; font-size: 15px; color: var(--ink); }
.pricing-intro a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pricing-period { display: flex; gap: 4px; width: fit-content; padding: 4px; margin-bottom: 20px; border-radius: 999px; background: var(--paper-2); }
.pricing-period button { border: 0; background: transparent; border-radius: 999px; color: var(--muted); cursor: pointer; padding: 10px 18px; font: 500 14px var(--sans); }
.pricing-period button[aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgb(42 37 33 / .1); }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgb(42 37 33 / .14); }
.tier { padding: 28px 28px 34px 0; display: flex; flex-direction: column; gap: 10px; }
.tier + .tier { padding-left: 28px; border-left: 1px solid var(--dot); }
.tier.chosen { background: var(--paper-2); padding-right: 28px; }
.tier h3 { font: 500 26px/1.3 var(--serif); color: var(--ink-2); }
.price b { font: 500 44px/1 var(--serif); color: var(--ink); }
.price span { color: var(--muted); margin-left: 6px; }
.tier ul { list-style: none; padding: 8px 0 18px; color: var(--ink); font-size: 15px; flex: 1; }
.tier li { padding: 6px 0; border-bottom: 1px dashed var(--dot); }
.tier .btn { align-self: flex-start; }
.tier .btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.pricing-note { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* 09 faq */
.faq { padding: 24px 0 100px; }
.faq-grid { display: grid; grid-template-columns: 4fr 8fr; gap: 48px; }
details { border-top: 1px solid var(--dot); padding: 22px 0; }
details:last-child { border-bottom: 1px solid var(--dot); }
summary { cursor: pointer; list-style: none; font: 500 19px/1.5 var(--sans); display: flex; justify-content: space-between; gap: 16px; }
summary::after { content: "+"; font: 400 20px var(--mono); color: var(--accent); transition: transform .3s var(--ease); }
details[open] summary::after { transform: rotate(45deg); }
details p { color: var(--muted); margin-top: 10px; max-width: 40em; }

/* 10 closing */
.cta { min-height: 100svh; display: flex; align-items: center; padding: 220px 0 140px; text-align: left; }
@media (min-width: 821px) {   /* copy on the left half so the closing journal can own the right half at full size */
  .cta-inner { align-items: flex-start !important; }
  .cta-inner > * { max-width: 520px; }
  .cta .eyebrow { justify-content: flex-start !important; }
}
.cta::before { height: 300px; background: linear-gradient(#F7F1E6, rgb(122 108 146 / .9) 38%, rgb(58 48 72 / 0)); }   /* paper → violet dusk, the sky over the closing desk */
.cta-inner { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.cta .eyebrow { justify-content: center; }
.cta .lead { margin: 10px 0 30px; }
.cta .display { color: var(--paper); }
.cta em { color: var(--paper); text-decoration: underline 2px var(--accent); text-underline-offset: 12px; }   /* the ribbon stays the only warm accent */

/* footer */
.footer { padding: 80px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer .brand-kanji, .footer .brand-word { color: var(--paper); }
.footer p { color: rgb(247 241 230 / .6); margin-top: 12px; }
.footer h4 { font: 400 12px var(--mono); color: rgb(247 241 230 / .5); margin-bottom: 12px; letter-spacing: .08em; }
.footer-grid a:not(.brand) { display: block; text-decoration: none; opacity: .82; padding: 4px 0; }
.footer-legal { margin-top: 60px; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .hero { justify-content: flex-end; padding-top: 52svh; }   /* the journal owns the top half on phones */
  .prompt-card input { font-size: 15px; }
  .display { font-size: clamp(36px, 10vw, 46px); }
  .h2 { font-size: clamp(30px, 8.6vw, 40px); }
  .how-grid { display: flex; flex-direction: column-reverse; align-items: stretch; gap: 8px; }   /* stretch: the empty host would collapse to 0 width */
  .how-track { height: auto; }
  .how-scene { position: relative; top: 0; height: 60svh; }   /* not sticky: DOM text can't be occluded by the canvas, so the scene sits above the steps and assembles as it scrolls past */
  .how-copy { position: relative; }
  .formats-scene { height: 78vw; }
  .tiers-scene { height: 64vw; margin-top: 0; }
  .pricing { padding-bottom: 40px; }
  .materials { display: block; padding: 0 0 80px; min-height: 0; }
  .materials::before { height: 140px; }
  .materials .scene-fill { position: relative; inset: auto; height: 56svh; }
  .materials-copy { margin-top: -24px; }
  .cta::before { height: 160px; }
  .cta { text-align: center; }
  .gallery-scene { height: 70svh; }
  .cards3 { grid-template-columns: minmax(0, 1fr); }            /* 1fr alone lets min-content widen the page */
  .postcard { grid-template-columns: 40% minmax(0, 1fr); aspect-ratio: auto; min-height: 220px; }
  .postcard blockquote { margin-top: 64px; font-size: 17px; }
  .hero::after { height: 62%; background: linear-gradient(to top, var(--paper) 62%, rgb(247 241 230 / 0)); }
  .hero-copy, .hero-stats { z-index: 1; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 0 16px; padding-top: 36px; }
  .how-grid, .faq-grid { grid-template-columns: 1fr; }
  .how-copy { position: static; }
  .cols4, .cards3, .tiers, .footer-grid { grid-template-columns: 1fr 1fr; }
  .cards3, .tiers { grid-template-columns: 1fr; }
  .tier + .tier { padding-left: 0; border-left: 0; border-top: 1px solid var(--dot); }
  .tier.chosen { padding-left: 20px; }
  .postcard:nth-child(2) { margin-top: 0; }
  .prompt-card { flex-wrap: wrap; }
  .prompt-card input { flex-basis: 100%; order: 2; }
  .prompt-card .btn { order: 3; }
}
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
