/* ==========================================================================================
 * Shiori site · 凪 Nagi: an anime ending sequence. Sky-white, ink navy, one cobalt accent.
 * Radius system: 20px surfaces, full-pill buttons. Motion lives in nagi.js (GSAP), gated by reduced motion.
 * ======================================================================================== */
:root {
    --bg: #f6f8fb;
    --paper: #ffffff;
    --haze: #e7eefb;
    --ink: #141a26;
    --ink-2: #3a4356;
    --muted: #6a7386;
    --line: rgb(20 26 38 / 0.09);
    --accent: #245cff;
    --accent-ink: #ffffff;
    --r: 20px;
    --ease: cubic-bezier(0.23, 1, 0.32, 1);
    --display: "Zen Maru Gothic", "M PLUS 1", system-ui, sans-serif;
    --body: "M PLUS 1", system-ui, sans-serif;
    --shadow: 0 1px 2px rgb(20 26 38 / 0.06), 0 30px 60px -36px rgb(20 40 90 / 0.45);
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.85em; }
.small { font-size: 0.85rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; z-index: 100; background: var(--paper); padding: 0.5rem 1rem; border-radius: 999px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

section { padding: clamp(5rem, 11vw, 9rem) clamp(1.25rem, 5vw, 4.5rem); }

/* ------------------------------------------------------------------ buttons */
.btn {
    display: inline-flex; align-items: center; gap: 0.55rem; white-space: nowrap;
    height: 3.1rem; padding: 0 1.5rem; border-radius: 999px; font-weight: 700; font-size: 0.98rem;
    transition: transform 160ms var(--ease), background-color 200ms ease, box-shadow 200ms ease;
}
.btn i { font-size: 1.15rem; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 30px -14px rgb(36 92 255 / 0.8); }
.btn--ghost { background: rgb(255 255 255 / 0.72); color: var(--ink); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px var(--line); }
.link { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--accent); }
.link i { transition: transform 200ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
    .btn--primary:hover { box-shadow: 0 16px 36px -12px rgb(36 92 255 / 0.9); transform: translateY(-1px); }
    .btn--ghost:hover { background: #fff; }
    .link:hover i { transform: translateX(4px); }
}

/* ------------------------------------------------------------------ nav */
.nav {
    position: fixed; inset: 0 0 auto; z-index: 50; height: 68px;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 0 clamp(1.25rem, 4vw, 3rem);
    transition: background-color 250ms ease, box-shadow 250ms ease;
}
.nav.is-stuck { background: rgb(246 248 251 / 0.82); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--display); font-weight: 900; font-size: 1.25rem; }
.brand img { border-radius: 10px; }
.nav nav { display: flex; gap: 0.25rem; }
.nav nav a { padding: 0.45rem 0.85rem; border-radius: 999px; font-weight: 500; font-size: 0.95rem; color: var(--ink-2); transition: background-color 150ms ease; }
.nav__end { display: flex; align-items: center; gap: 0.5rem; }
.nav__world { padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 700; font-size: 0.88rem; box-shadow: inset 0 0 0 1px var(--line); background: rgb(255 255 255 / 0.6); }
.nav__icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 999px; font-size: 1.25rem; }
@media (hover: hover) and (pointer: fine) { .nav nav a:hover, .nav__icon:hover { background: rgb(20 26 38 / 0.05); } }
@media (max-width: 860px) { .nav nav { display: none; } }

/* ------------------------------------------------------------------ hero */
.hero { position: relative; min-height: 100dvh; padding: 0; display: grid; align-items: end; overflow: hidden; }
.hero__frame { position: absolute; inset: 0; clip-path: inset(0 0 0 0 round 0); will-change: clip-path; }
.hero__still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.6s ease; }
.hero__still.is-on { opacity: 1; }
/* Bottom mist carries the headline; a thin top mist keeps the nav readable over dark plates. */
.hero__veil { position: absolute; inset: 0; background:
    linear-gradient(to bottom, rgb(246 248 251 / 0.7), rgb(246 248 251 / 0) 14%),
    linear-gradient(to top, rgb(246 248 251 / 0.96) 6%, rgb(246 248 251 / 0.55) 38%, rgb(246 248 251 / 0) 70%); }
.hero__copy { position: relative; z-index: 2; display: grid; gap: 1.4rem; max-width: 62rem; padding: 0 clamp(1.25rem, 5vw, 4.5rem) clamp(3rem, 9vh, 6rem); }
.hero__title { font-size: clamp(2.4rem, 5.2vw, 4.6rem); font-weight: 900; line-height: 1.04; }
.hero__sub { font-size: clamp(1.02rem, 1.4vw, 1.2rem); color: var(--ink-2); max-width: 36rem; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.hero__jp {
    position: absolute; z-index: 2; right: clamp(1rem, 4vw, 3rem); top: 50%; translate: 0 -50%;
    writing-mode: vertical-rl; font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.35em; color: var(--ink);
}
@media (max-width: 700px) { .hero__jp { display: none; } }

/* ------------------------------------------------------------------ product reveal */
.reveal { display: grid; justify-items: center; gap: 2rem; perspective: 1400px; padding-top: 4rem; }
.reveal__device { margin: 0; width: min(1180px, 100%); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line); transform-origin: 50% 0; }
.reveal__line { color: var(--muted); font-size: 0.95rem; }

/* ------------------------------------------------------------------ sticky stack */
.stack { display: grid; gap: 2rem; padding-top: 2rem; }
.stack__card {
    position: sticky; top: 90px; min-height: calc(100dvh - 140px);
    display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center;
    padding: clamp(1.5rem, 4vw, 3.5rem); border-radius: var(--r);
    background: var(--paper); box-shadow: var(--shadow), 0 0 0 1px var(--line);
    transform-origin: 50% 0;
}
.stack__card:nth-child(2) { background: var(--haze); }
.stack__card:nth-child(3) { background: #eef3ff; }
.stack__card:nth-child(4) { background: var(--paper); }
.stack__text { display: grid; gap: 1rem; }
.stack__text h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.stack__text p { color: var(--ink-2); max-width: 30rem; }
.stack__card img { border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 24px 50px -30px rgb(20 40 90 / 0.5); }
@media (max-width: 860px) {
    .stack__card { position: relative; top: 0; min-height: 0; grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ horizontal pan */
/* Pinned at "top top", so the section is exactly one screen tall; the top padding clears the fixed nav. */
.pan { padding: 72px 0 0; overflow: hidden; height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.pan__head { display: grid; gap: 0.8rem; padding: 0 clamp(1.25rem, 5vw, 4.5rem) 2.5rem; }
.pan__head p { color: var(--ink-2); }
.pan__track { display: flex; gap: clamp(1rem, 2.5vw, 2rem); padding: 0 clamp(1.25rem, 5vw, 4.5rem); width: max-content; }
.pan__track figure { margin: 0; width: min(62vw, 880px); display: grid; gap: 0.8rem; }
.pan__track img { border-radius: var(--r); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.pan__track figcaption { font-size: 0.95rem; color: var(--ink-2); padding-left: 0.25rem; }
.pan__track img { max-height: 58dvh; width: 100%; object-fit: cover; object-position: top; }
@media (max-width: 860px) {
    .pan { height: auto; padding-block: 5rem; }
    .pan__track { width: auto; overflow-x: auto; scroll-snap-type: x mandatory; }
    .pan__track figure { flex: none; width: 85vw; scroll-snap-align: start; }
}

/* ------------------------------------------------------------------ two worlds wipe */
.worlds { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.worlds__copy { display: grid; gap: 1.2rem; }
.worlds__copy p { color: var(--ink-2); }
.worlds__copy b { font-family: var(--display); color: var(--accent); }
.worlds__stage { position: relative; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.worlds__top { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 100% 0 0); }
@media (max-width: 860px) { .worlds { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ bento */
.bento h2 { margin-bottom: 2.5rem; max-width: 18ch; }
.bento__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(15rem, auto); gap: 1rem; }
.cell { position: relative; overflow: hidden; display: grid; align-content: end; gap: 0.5rem; padding: 1.6rem; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.cell p { color: var(--ink-2); font-size: 0.95rem; }
.cell--big { grid-column: span 2; grid-row: span 2; }
.cell--tall { grid-row: span 2; }
.cell--img { background-size: cover; background-position: center; color: #fff; }
.cell--img::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(10 16 32 / 0.75), rgb(10 16 32 / 0) 60%); }
.cell--img > * { position: relative; }
.cell--img p { color: rgb(255 255 255 / 0.85); }
.cell--blue { background: var(--accent); color: #fff; }
.cell--blue p { color: rgb(255 255 255 / 0.85); }
.cell__mascot { position: absolute; top: -1.5rem; right: -1.5rem; width: 9rem; border-radius: 22px; rotate: 8deg; }
.cell--paper { background: var(--haze); }
.cell--phone { grid-column: span 2; grid-template-columns: 9rem 1fr; align-items: end; gap: 1.5rem; }
.cell--phone img { border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 960px) {
    .bento__grid { grid-template-columns: 1fr 1fr; }
    .cell--big, .cell--phone { grid-column: span 2; }
}
@media (max-width: 600px) {
    .bento__grid { grid-template-columns: 1fr; }
    .cell--big, .cell--phone, .cell--tall { grid-column: auto; grid-row: auto; min-height: 16rem; }
}

/* ------------------------------------------------------------------ cast marquee */
.cast { padding: 2rem 0 4rem; overflow: hidden; }
.cast__row { display: flex; gap: 1.5rem; width: max-content; }
.cast__row img { width: clamp(8rem, 13vw, 11rem); aspect-ratio: 1; object-fit: cover; border-radius: 24px; box-shadow: 0 18px 30px -20px rgb(20 40 90 / 0.55); }
.cast__row img:nth-child(odd) { rotate: -3deg; }
.cast__row img:nth-child(even) { rotate: 3deg; }

/* ------------------------------------------------------------------ demo page: thumbnail cards that turn into players */
.films { display: grid; gap: 1.5rem; justify-items: center; padding-top: 8rem; text-align: center; }
.films h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
.films__lead { color: var(--ink-2); margin-bottom: 1rem; }
.film { position: relative; width: min(1100px, 100%); aspect-ratio: 16 / 9; padding: 0; border: 0; border-radius: var(--r); overflow: hidden; cursor: pointer; background: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.film:not(.film--lead) { width: min(860px, 100%); }
.film img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 700ms var(--ease); }
.film::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgb(10 16 32 / 0.7), rgb(10 16 32 / 0) 55%); }
.film__play { position: absolute; z-index: 1; left: 50%; top: 50%; translate: -50% -50%; display: grid; place-items: center; width: 5.5rem; height: 5.5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 2rem; box-shadow: 0 0 0 12px rgb(36 92 255 / 0.25); transition: transform 250ms var(--ease); }
.film__meta { position: absolute; z-index: 1; left: 1.6rem; bottom: 1.3rem; display: grid; text-align: left; color: #fff; }
.film__meta b { font-family: var(--display); font-size: clamp(1.2rem, 2.4vw, 1.8rem); }
.film__meta span { color: rgb(255 255 255 / 0.8); font-size: 0.95rem; }
.film:active .film__play { transform: scale(0.96); }
@media (hover: hover) and (pointer: fine) { .film:hover img { transform: scale(1.03); } .film:hover .film__play { transform: scale(1.08); } }
.film--on { display: block; object-fit: contain; cursor: auto; }
.films__end { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { .film img, .film__play { transition: none; } }

/* ------------------------------------------------------------------ install */
.install { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.install__intro { position: sticky; top: 110px; display: grid; gap: 1.25rem; justify-items: start; }
.install__intro p { color: var(--ink-2); }
.install__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: s; }
.install__steps li { counter-increment: s; position: relative; display: grid; gap: 0.6rem; padding: 1.75rem 1.75rem 1.75rem 5rem; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.install__steps li::before { content: counter(s); position: absolute; left: 1.6rem; top: 1.55rem; font-family: var(--display); font-weight: 900; font-size: 2rem; color: var(--accent); line-height: 1; }
.install__steps p { color: var(--ink-2); }
.install__steps li > code { display: block; padding: 0.8rem 1rem; border-radius: 12px; background: var(--ink); color: #dfe6f3; overflow-x: auto; white-space: nowrap; }
@media (max-width: 860px) { .install { grid-template-columns: 1fr; } .install__intro { position: static; } }

/* ------------------------------------------------------------------ support */
.support { display: grid; justify-items: center; text-align: center; gap: clamp(2rem, 5vw, 5rem); align-items: center; background: linear-gradient(180deg, var(--bg), var(--haze)); }
.support__copy { display: grid; gap: 1.2rem; width: min(38rem, 100%); }
.support__copy p { color: var(--ink-2); }
.goal { display: grid; gap: 0.5rem; }
.goal__bar { height: 10px; border-radius: 999px; background: rgb(36 92 255 / 0.12); overflow: hidden; }
.goal__bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; }

/* ------------------------------------------------------------------ faq */
.faq { display: grid; gap: 0.8rem; max-width: 56rem; margin: 0 auto; }
.faq h2 { margin-bottom: 1.5rem; }
.faq details { border-radius: 16px; background: var(--paper); box-shadow: 0 0 0 1px var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 1.2rem 1.4rem; font-weight: 700; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-family: var(--display); font-size: 1.4rem; line-height: 1; color: var(--accent); transition: transform 200ms var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.4rem 1.3rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ footer */
.foot { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding: 3rem clamp(1.25rem, 5vw, 4.5rem) 6rem; border-top: 1px solid var(--line); }
.foot__brand { display: flex; gap: 1rem; align-items: center; color: var(--ink-2); font-size: 0.92rem; }
.foot__brand img { border-radius: 12px; }
.foot__brand a, .foot nav a { font-weight: 600; }
.foot nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.92rem; }
.foot__copy { grid-column: 1 / -1; font-size: 0.8rem; color: var(--muted); }
@media (max-width: 760px) { .foot { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ persistent download pill */
.pill {
    position: fixed; right: clamp(1rem, 3vw, 2rem); bottom: clamp(1rem, 3vw, 2rem); z-index: 60;
    display: inline-flex; align-items: center; gap: 0.5rem; height: 3.2rem; padding: 0 1.4rem; border-radius: 999px;
    background: var(--ink); color: #fff; font-weight: 700; box-shadow: 0 18px 40px -16px rgb(20 26 38 / 0.7);
    transform: translateY(160%); transition: transform 450ms var(--ease);
}
.pill.is-shown { transform: translateY(0); }
.pill i { font-size: 1.2rem; }
.pill:active { transform: scale(0.97); }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .hero__still, .pill, .btn, .link i { transition: none; }
    .pill { transform: translateY(160%); }
    .pill.is-shown { transform: none; }
}
