/* ================= global motion & brand accents ================= */
:root {
  --accent: #ffd23f;
  --accent-ink: #1a1400;
  --paper-warm: #f4f1ea;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #fff; }

/* intro: greetings, then curtain */
.intro-on, .intro-on body { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; cursor: pointer; }
.intro-half { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--brand); transition: transform 1s cubic-bezier(.76,0,.24,1); }
.intro-top { top: 0; }
.intro-bottom { bottom: 0; }
.intro.open .intro-top { transform: translateY(-100%); }
.intro.open .intro-bottom { transform: translateY(100%); }
.intro-words { position: relative; z-index: 2; height: 1.3em; width: 100%; font-size: clamp(56px, 12vw, 180px); font-weight: 900; color: #fff; letter-spacing: .02em; transition: opacity .3s; }
.intro.open .intro-words, .intro.open .intro-skip { opacity: 0; }
.intro-word { position: absolute; left: 50%; top: 0; white-space: nowrap; transform: translate(60vw, 0); transition: transform .5s cubic-bezier(.7,0,.2,1); line-height: 1.2; }
.intro-word.on { transform: translate(-50%, 0); }
.intro-word.off { transform: translate(-160vw, 0); }
.intro-brand { color: var(--accent); text-align: center; font-size: .6em; top: .2em; }
.intro-brand small { display: block; font-size: .2em; letter-spacing: .5em; color: rgba(255,255,255,.75); margin-top: .5em; font-weight: 700; }
.intro-skip { position: absolute; z-index: 2; bottom: 32px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: .3em; color: rgba(255,255,255,.6); transition: opacity .3s; }

/* page transition */
.pt { position: fixed; inset: 0; z-index: 150; pointer-events: none; background: var(--brand); transform: translateY(100%); display: grid; place-items: center; }
.pt-line { position: absolute; left: 0; right: 0; top: 0; height: 10px; background: var(--accent); }
.pt-mark { color: #fff; font-size: 20px; letter-spacing: .4em; font-weight: 900; opacity: 0; transition: opacity .3s .15s; }
.pt-in .pt { transform: translateY(0); transition: none; }
.pt-in .pt .pt-mark { opacity: 1; transition: none; }
.pt-in.pt-out .pt { transform: translateY(-100%); transition: transform .8s cubic-bezier(.76,0,.24,1); }
.pt-in.pt-out .pt .pt-mark { opacity: 0; transition: opacity .2s; }
.pt-leave .pt { transform: translateY(0); transition: transform .5s cubic-bezier(.76,0,.24,1); pointer-events: auto; }
.pt-leave .pt .pt-mark { opacity: 1; }

/* header hide */
.site-header { transition: background .3s, box-shadow .3s, color .3s, transform .45s cubic-bezier(.2,.7,.2,1); }
.site-header.hide { transform: translateY(-100%); }

/* progress rail */
.rail { position: fixed; z-index: 40; right: 22px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.rail button { position: relative; width: 4px; height: 34px; padding: 0; border: 0; background: rgba(0,74,173,.16); overflow: visible; }
.rail-fill { position: absolute; inset: 0; background: var(--brand); transform-origin: top; transform: scaleY(0); }
.rail em { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--brand); opacity: 0; transition: opacity .25s; pointer-events: none; }
.rail button:hover em, .rail button.on em { opacity: 1; }
.rail button::before { content: ""; position: absolute; inset: -4px -10px; }
.rail-pct { font-size: 11px; font-weight: 700; color: var(--brand); margin-top: 6px; font-variant-numeric: tabular-nums; }
.rail.on-dark button { background: rgba(255,255,255,.22); }
.rail.on-dark .rail-fill { background: var(--accent); }
.rail.on-dark em, .rail.on-dark .rail-pct { color: var(--accent); }
@media (max-width: 900px) { .rail { display: none; } }

/* headings: characters rise from a baseline mask */
.split .ch { display: inline-block; overflow: hidden; vertical-align: bottom; padding-top: .12em; margin-top: -.12em; }
.split .ch > i { display: inline-block; font-style: inherit; transform: translateY(105%); transition: transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: calc(var(--i) * 22ms); }
.split.in .ch > i { transform: none; }
@media (prefers-reduced-motion: reduce) { .split .ch > i { transform: none; transition: none; } }

/* image reveal: clip opens from the bottom */
.img-reveal { clip-path: inset(100% 0 0 0); transition: clip-path 1.1s cubic-bezier(.7,0,.2,1); }
.img-reveal.in { clip-path: inset(0 0 0 0); }
.img-reveal img { transform: scale(1.18); transition: transform 1.6s cubic-bezier(.2,.7,.2,1); }
.img-reveal.in img { transform: scale(1); }
@media (prefers-reduced-motion: reduce) { .img-reveal, .img-reveal img { clip-path: none; transform: none; transition: none; } }

/* 「」 bracket frame motif */
.bracket { position: relative; }
.bracket::before, .bracket::after { content: ""; position: absolute; width: 22%; height: 22%; border: 0 solid var(--brand); z-index: 2; pointer-events: none; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.bracket::before { left: -14px; top: -14px; border-left-width: 6px; border-top-width: 6px; }
.bracket::after { right: -14px; bottom: -14px; border-right-width: 6px; border-bottom-width: 6px; }
.bracket:hover::before { transform: translate(-6px, -6px); }
.bracket:hover::after { transform: translate(6px, 6px); }

.magnetic { transition: transform .3s cubic-bezier(.2,.7,.2,1), background .2s; will-change: transform; }

/* smooth page change: native cross-document view transition (no blank flash) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s cubic-bezier(.4,0,.2,1) both; }
::view-transition-new(root) { animation: vt-in .55s cubic-bezier(.2,.8,.2,1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-24px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(32px); } }
@media (prefers-reduced-motion: reduce) { ::view-transition-old(root), ::view-transition-new(root) { animation: none; } }
