:root {
  --paper: #FFFFFF;
  --tint: #F9F8F6;
  --tint-2: #F4F2EE;
  --ink: #1A1A1A;
  --ink-soft: #6B6A66;
  --ink-faint: #B8B6B0;
  --rule: rgba(26,26,26,0.16);
  --rule-soft: rgba(26,26,26,0.08);
  --green: #3B6D11;
  --green-deep: #2E5510;
  --terra: #E8621A;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --serif: 'Zen Old Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
/* Tweaks-driven palette overrides */
body[data-palette="forest"] { --green: #3B6D11; --green-deep: #2E5510; --terra: #E8621A; }
body[data-palette="indigo"] { --green: #1E3A5F; --green-deep: #16294A; --terra: #C45A2A; }
body[data-palette="sumi"]   { --green: #1A1A1A; --green-deep: #000000; --terra: #B85A1F; }
body[data-typo="kaku"] { --hd: var(--sans); --hd-w: 800; --hd-ls: 0.04em; }
body[data-typo="mincho"] { --hd: var(--serif); --hd-w: 700; --hd-ls: 0.06em; }
body[data-typo="mixed"] { --hd: var(--sans); --hd-w: 800; --hd-ls: 0.04em; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  cursor: none;
}
/* On touch devices, restore native cursor */
@media (hover: none) { html, body, * { cursor: auto !important; } #cursor { display: none; } }

/* Custom cursor */
#cursor {
  position: fixed; top: 0; left: 0; width: 14px; height: 14px;
  border: 0.5px solid var(--ink); border-radius: 999px;
  transform: translate(-50%,-50%); pointer-events: none; z-index: 9999;
  transition: width .25s cubic-bezier(.3,.7,.4,1), height .25s, background .25s, border-color .25s, opacity .25s;
  mix-blend-mode: difference;
}
#cursor.hover { width: 56px; height: 56px; background: rgba(255,255,255,0.06); }
#cursor.cta   { width: 72px; height: 72px; border-color: var(--green); background: rgba(59,109,17,0.1); mix-blend-mode: normal; }
a, button, .hot { cursor: none; }

/* Header */
.site-hd {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 40px;
  background: rgba(255,255,255,0.0);
  transition: background .3s, backdrop-filter .3s, border-color .3s, padding .3s;
  border-bottom: 0.5px solid transparent;
}
.site-hd.stuck {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom-color: var(--rule-soft);
  padding: 16px 40px;
}
.site-hd .logo img { height: 22px; display: block; }
.site-hd nav { display: flex; gap: 28px; align-items: center; }
.site-hd nav a {
  text-decoration: none; color: var(--ink-soft);
  font-size: 13px; letter-spacing: 0.04em; font-weight: 500;
  position: relative; padding: 4px 0;
}
.site-hd nav a:hover { color: var(--ink); }
.site-hd nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 0.5px; background: var(--ink);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s cubic-bezier(.3,.7,.4,1);
}
.site-hd nav a:hover::after { transform: scaleX(1); }
.site-hd .lang {
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  letter-spacing: 0.06em;
}

/* Section base */
section.s {
  position: relative; padding: 160px 40px;
  max-width: 1440px; margin: 0 auto;
}
section.s.tint { background: var(--tint); max-width: 100%; padding-left: 40px; padding-right: 40px; }
section.s.tint .inner { max-width: 1440px; margin: 0 auto; }

/* Section index marker */
.sect-mark {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  letter-spacing: 0.16em; text-transform: uppercase;
}
.sect-mark .bar { width: 32px; height: 0.5px; background: var(--ink-soft); }

/* Headings */
.hd {
  font-family: var(--hd, var(--sans));
  font-weight: var(--hd-w, 900);
  letter-spacing: var(--hd-ls, 0.04em);
  line-height: 1.18;
  color: var(--ink);
}
.hd.serif { font-family: var(--serif); font-weight: 700; }

/* CTA */
.cta {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 32px;
  border-radius: 999px; border: 0.5px solid var(--green);
  background: var(--green); color: #fff;
  font-family: var(--sans); font-size: 14px; font-weight: 700; letter-spacing: 0.06em;
  text-decoration: none;
  transition: background .25s, transform .25s, padding .35s cubic-bezier(.3,.7,.4,1);
  position: relative; overflow: hidden;
}
.cta:hover { background: var(--green-deep); padding-right: 44px; }
.cta::after {
  content: ""; width: 18px; height: 0.5px; background: #fff; position: relative;
  transition: width .35s cubic-bezier(.3,.7,.4,1);
}
.cta:hover::after { width: 28px; }
.cta.ghost {
  background: transparent; color: var(--green); border-color: var(--green);
}
.cta.ghost:hover { background: var(--green); color: #fff; }
.cta.ghost::after { background: var(--green); }
.cta.ghost:hover::after { background: #fff; }

/* Scroll-reveal: starts hidden, .in fades up */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s cubic-bezier(.2,.7,.3,1), transform 1s cubic-bezier(.2,.7,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.35s; }
.reveal.delay-4 { transition-delay: 0.5s; }

/* Tategaki char-by-char build */
.tate-build { writing-mode: vertical-rl; font-family: var(--serif); }
.tate-build .c {
  display: inline-block; opacity: 0; transform: translateY(-12px);
  transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
.tate-build.in .c { opacity: 1; transform: none; }

/* Image placeholder — soft tonal */
.img-ph {
  position: relative; overflow: hidden; border-radius: 24px;
  background: linear-gradient(135deg, #E8E4DC 0%, #D4CFC4 50%, #B8B0A0 100%);
}
.img-ph::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.5), transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,0,0,0.18), transparent 60%);
}
.img-ph::after {
  content: attr(data-label);
  position: absolute; bottom: 16px; left: 16px;
  font-family: var(--mono); font-size: 10px;
  color: rgba(255,255,255,0.85); letter-spacing: 0.12em;
  text-transform: uppercase;
}
.img-ph.warm  { background: linear-gradient(135deg, #EDDFCE 0%, #C9A984 60%, #8C6A44 100%); }
.img-ph.cool  { background: linear-gradient(135deg, #DCDFE2 0%, #93A0AC 60%, #4F5E70 100%); }
.img-ph.green { background: linear-gradient(135deg, #DDE5D2 0%, #8FA376 50%, #4D6234 100%); }
.img-ph.dark  { background: linear-gradient(135deg, #6B6A66 0%, #3A3A38 100%); }

/* Footer */
footer.site-ft {
  border-top: 0.5px solid var(--rule-soft);
  padding: 80px 40px 48px;
  margin-top: 80px;
}
footer.site-ft .inner { max-width: 1440px; margin: 0 auto; }

/* Buttons reset */
button { font-family: inherit; }

/* Sub-page reading-trim — wider line-height for /concept etc. */
.read-prose p { font-size: 16px; line-height: 2.1; color: var(--ink); margin: 0 0 1.4em; }
.read-prose .lede { font-size: 17px; color: var(--ink); }
