/* フジの紹介ページ（試作）。字は Noto Serif JP／Noto Sans JP の可変フォントから、この頁で使う字だけ切り出した woff2（fuji21.com に置く時に替えた＝2026-10-02。手元の Noto は代わり） */
@font-face {
    font-family: "Serif JP";
    src: url("assets/font/serif.woff2") format("woff2"), local("Noto Serif JP"), local("NotoSerifJP-VF"), local("Yu Mincho"), local("YuMincho");
    font-weight: 200 900;
    font-display: swap;
}
@font-face {
    font-family: "Sans JP";
    src: url("assets/font/sans.woff2") format("woff2"), local("Noto Sans JP"), local("NotoSansJP-VF"), local("Yu Gothic"), local("YuGothic");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --night: #0e0c0b;
    --night-2: #171311;
    --night-ink: #efe8df;
    --night-muted: #a0958b;
    --red: #c8412f;
    --red-deep: #6e1a12;
    --red-soft: #f1c7bb;
    --day: #f7f2ea;
    --day-2: #efe7dc;
    --day-ink: #231d19;
    --day-muted: #6e645b;
    --day-line: #ded3c5;
    --ink: #191513;
    --serif: "Serif JP", "Noto Serif JP", "Yu Mincho", "YuMincho", serif;
    --sans: "Sans JP", "Noto Sans JP", "Yu Gothic", "YuGothic", system-ui, sans-serif;
    --mono: "Cascadia Mono", "Consolas", ui-monospace, monospace;
    --gutter: clamp(16px, 5vw, 72px);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    background: var(--night);
    color: var(--night-ink);
    font-family: var(--sans);
    font-size: clamp(15px, 1.05vw, 17px);
    line-height: 1.9;
    letter-spacing: 0.04em;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
}
img,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
}
p {
    margin: 0;
}
/* display を書いた要素でも hidden は必ず隠す */
[hidden] {
    display: none !important;
}
.skip {
    position: absolute;
    left: -9999px;
}
.skip:focus {
    left: 16px;
    top: 16px;
    z-index: 100;
    background: var(--day);
    color: var(--day-ink);
    padding: 8px 12px;
}

/* 1字ずつに割った字（js/type.js） */
.ch {
    display: inline-block;
    white-space: pre;
}

/* ------------------------------------------------------------ 章の目盛り */
.rail {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    color: var(--rail-ink, var(--night-ink));
    transition: color 0.6s;
}
.rail ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
    justify-items: end;
}
.rail a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.12em;
    line-height: 1;
}
.rail a::after {
    content: "";
    width: 14px;
    height: 1px;
    background: currentColor;
    opacity: 0.45;
    transition: width 0.4s var(--ease), opacity 0.4s;
}
.rail a span,
.rail a {
    color: inherit;
}
.rail a {
    color: transparent !important;
    transition: color 0.3s;
}
.rail a:not(.on)::after {
    background: var(--rail-ink, var(--night-ink));
}
.rail:hover a,
.rail a:focus-visible {
    color: var(--rail-ink, var(--night-ink)) !important;
}
.rail:hover a:not(.on) {
    opacity: 0.6;
}
.rail a.on::after {
    width: 34px;
    opacity: 1;
    background: var(--red);
}
body[data-theme="day"] {
    --rail-ink: var(--day-ink);
}

/* ------------------------------------------------------------ はじめまして */
.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding: 0 var(--gutter);
    overflow: hidden;
    background:
        radial-gradient(60% 70% at 72% 50%, #2a1d17 0%, transparent 70%),
        var(--night);
}
.hero-gears {
    position: absolute;
    right: -6vw;
    top: 50%;
    width: min(92vw, 1100px);
    height: auto;
    transform: translateY(-50%);
    overflow: visible;
}
.gear path {
    fill: none;
    stroke: #6d5a4d;
    stroke-width: 1.1;
    vector-effect: non-scaling-stroke;
}
.gear-b path {
    stroke: var(--red);
    stroke-width: 1.4;
}
.gear .axle {
    fill: none;
    stroke: #6d5a4d;
}
.hero-text {
    position: relative;
    max-width: 44rem;
}
.kicker {
    font-family: var(--serif);
    font-size: clamp(16px, 1.6vw, 22px);
    color: var(--night-muted);
    letter-spacing: 0.3em;
}
.hero-name {
    margin: 0.2em 0 0.3em;
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    line-height: 1;
}
.hero-name-ja {
    font-family: var(--serif);
    font-weight: 300;
    font-size: clamp(88px, 16vw, 260px);
    letter-spacing: 0.02em;
}
.hero-name-en {
    font-family: var(--serif);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(18px, 2vw, 28px);
    color: var(--red);
}
.hero-lead {
    display: grid;
    font-family: var(--serif);
    font-size: clamp(20px, 2.4vw, 34px);
    line-height: 1.6;
}
.hero-meta {
    margin-top: 1.4em;
    color: var(--night-muted);
    font-size: 13px;
    letter-spacing: 0.3em;
}
.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--night-muted);
    display: grid;
    justify-items: center;
    gap: 10px;
}
.scroll-cue::after {
    content: "";
    width: 1px;
    height: 44px;
    background: linear-gradient(var(--night-muted), transparent);
    animation: cue 2.4s var(--ease) infinite;
    transform-origin: top;
}
@keyframes cue {
    0% {
        transform: scaleY(0);
    }
    60% {
        transform: scaleY(1);
        opacity: 1;
    }
    100% {
        transform: scaleY(1);
        opacity: 0;
    }
}
/* 入場（js が .ready を付ける） */
.hero [data-split] .ch {
    opacity: 0;
    transform: translateY(0.35em);
    filter: blur(6px);
}
.ready .hero [data-split] .ch {
    opacity: 1;
    transform: none;
    filter: none;
    transition:
        opacity 0.9s var(--ease),
        transform 0.9s var(--ease),
        filter 0.9s var(--ease);
    transition-delay: calc(var(--d, 0) * 1s);
}

/* ------------------------------------------------------------ 章の共通 */
.chapter {
    position: relative;
}
.scrub,
.decide,
.ai,
.dolly {
    height: var(--len, 400vh);
}
.sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}
.chapter-label {
    position: absolute;
    left: var(--gutter);
    top: 28px;
    z-index: 5;
    display: flex;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--night-muted);
}
.chapter-label span {
    font-family: var(--serif);
    font-size: 22px;
    letter-spacing: 0.05em;
    color: var(--red);
}
.chapter-label.dark {
    color: var(--day-muted);
}
.h-big {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(36px, 5.4vw, 84px);
    line-height: 1.3;
    letter-spacing: 0.04em;
}

/* スクロールで送る連番 */
canvas.seq {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.scrim-left {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(14 12 11 / 0.82) 0%, rgb(14 12 11 / 0.35) 38%, transparent 62%);
    pointer-events: none;
}
.captions {
    position: absolute;
    left: var(--gutter);
    bottom: 14vh;
    width: min(34rem, calc(100vw - 2 * var(--gutter)));
    min-height: 9em;
}
.cap {
    position: absolute;
    left: 0;
    bottom: 0;
    width: max-content;
    max-width: calc(100vw - 2 * var(--gutter));
    font-family: var(--serif);
    font-size: clamp(22px, 2.6vw, 40px);
    line-height: 1.6;
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.8s var(--ease),
        transform 0.8s var(--ease);
    text-shadow: 0 2px 24px rgb(0 0 0 / 0.5);
}
.cap.on {
    opacity: 1;
    transform: none;
}
.captions.dark {
    top: 16vh;
    bottom: auto;
}
.captions.dark .cap {
    top: 0;
    bottom: auto;
    text-shadow: none;
    color: var(--day-ink);
}
.num-14 {
    font-weight: 300;
    font-size: 2.2em;
    line-height: 1;
    margin: 0 0.06em;
    color: var(--red);
    font-variant-numeric: lining-nums;
}
.hud {
    position: absolute;
    right: calc(var(--gutter) + 40px);
    top: 24px;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, auto);
    gap: 4px 22px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: #cdb9a6;
    opacity: 0.85;
}
.hud div {
    display: grid;
    gap: 2px;
}
.hud dt {
    color: #7d6d61;
    font-size: 9px;
}
.hud dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ 02 決めた */
.decide .sticky {
    background: var(--decide-bg, var(--night));
    color: var(--decide-ink, var(--night-ink));
}
.decide .chapter-label,
.decide .chapter-label span {
    color: var(--decide-ink, var(--night-ink));
}
.decide-stage {
    position: absolute;
    inset: 0;
    padding: 18vh var(--gutter) 10vh;
    display: grid;
    align-content: center;
    gap: 2.2vh;
}
.d-line {
    font-family: var(--serif);
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.9s var(--ease),
        transform 0.9s var(--ease);
}
.d-line.on {
    opacity: 1;
    transform: none;
}
.d-age {
    font-size: clamp(22px, 2.4vw, 34px);
    color: var(--decide-muted, var(--night-muted));
}
.d-quit {
    font-size: min(7.2vw, 132px);
    line-height: 1.2;
    letter-spacing: 0.02em;
    margin: 2vh 0;
}
.d-quit .weight {
    white-space: nowrap;
}
.d-quit .weight .ch {
    font-variation-settings: "wght" var(--w, 200);
    font-weight: var(--w, 200);
}
.d-type {
    font-size: clamp(19px, 2vw, 28px);
    min-height: 1.6em;
}
.caret {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    margin-left: 4px;
    vertical-align: -0.15em;
    background: currentColor;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink {
    50% {
        opacity: 0;
    }
}
.d-after {
    font-family: var(--sans);
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 2;
    color: var(--decide-muted, var(--night-muted));
    margin-top: 3vh;
}

/* ------------------------------------------------------------ 03 相棒 */
.ai .sticky {
    background: var(--day);
    color: var(--day-ink);
}
.ai .chapter-label {
    color: var(--day-muted);
}
canvas.branches {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.ai-grid {
    position: absolute;
    inset: 0;
    padding: 16vh var(--gutter) 22vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    align-items: center;
    gap: 4vw;
}
.ai-copy .h-big {
    font-size: clamp(34px, 4.4vw, 72px);
    white-space: nowrap;
}
.ai-copy p {
    margin-top: 1.4em;
    color: var(--day-muted);
    line-height: 2.1;
}
.windows {
    position: relative;
    height: min(62vh, 520px);
}
.win {
    position: absolute;
    margin: 0;
    width: min(100%, 520px);
    background: #fffdf9;
    border-radius: 10px;
    box-shadow:
        0 1px 0 rgb(0 0 0 / 0.04),
        0 18px 50px -18px rgb(60 40 30 / 0.35);
    border: 1px solid var(--day-line);
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition:
        opacity 0.8s var(--ease),
        transform 0.8s var(--ease),
        filter 0.8s var(--ease);
}
.win.on {
    opacity: 1;
    transform: none;
}
.win figcaption {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    font-size: 11px;
    color: var(--day-muted);
    border-bottom: 1px solid var(--day-line);
    background: var(--day-2);
}
.win figcaption i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #d9cfc2;
}
.win figcaption span {
    margin-left: 8px;
}
.win pre {
    margin: 0;
    padding: 14px 16px 18px;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    color: #3b322c;
}
.win .k {
    color: var(--red);
}
.win .s {
    color: #6b7f3a;
}
.win .e {
    color: #a32f22;
}
.win .tag {
    position: absolute;
    right: 12px;
    top: 38px;
    font-family: var(--serif);
    font-size: 13px;
    color: #fff;
    background: var(--red);
    padding: 2px 10px;
    border-radius: 999px;
    transform: rotate(-4deg);
}
.win-ruby {
    top: 0;
    left: 0;
}
.win-py {
    top: 16%;
    left: 8%;
}
.win-term {
    top: 34%;
    left: 16%;
    background: #1b1714;
    border-color: #1b1714;
}
.win-term figcaption {
    background: #231e1a;
    border-color: #2e2722;
    color: #a0958b;
}
.win-term figcaption i {
    background: #3a322c;
}
.win-term pre {
    color: #e9e0d4;
    min-height: 13.6em;
}
.term .p {
    color: var(--red);
}
.term .o {
    color: #a0958b;
}
.windows.dim .win-ruby,
.windows.dim .win-py {
    filter: blur(1.5px) grayscale(0.6);
    opacity: 0.45;
}
.quote {
    margin: 0;
}
.quote p {
    font-family: var(--serif);
}
.quote cite {
    display: block;
    margin-top: 1em;
    font-style: normal;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--day-muted);
}
.quote-ai {
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 7vh;
    text-align: center;
    opacity: 0;
    transition: opacity 0.9s var(--ease);
}
.quote-ai.on {
    opacity: 1;
}
.quote-ai p {
    font-size: clamp(22px, 2.8vw, 42px);
}
.quote-ai .ch {
    transition:
        letter-spacing 1.4s var(--ease),
        transform 1.4s var(--ease);
}

/* ------------------------------------------------------------ 04 行動量 */
.data {
    background: var(--day);
    color: var(--day-ink);
}
.city .sticky {
    background: #f3ece2;
}
.city-hud {
    position: absolute;
    right: calc(var(--gutter) + 40px);
    top: 22px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.city-date {
    font-family: var(--serif);
    font-size: clamp(18px, 1.8vw, 26px);
    letter-spacing: 0.1em;
    color: var(--day-muted);
}
.city-total b {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(44px, 6vw, 96px);
    line-height: 1.1;
    color: var(--day-ink);
}
.city-total span,
.city-days {
    font-size: 13px;
    letter-spacing: 0.2em;
    color: var(--day-muted);
    margin-left: 0.6em;
}
.data-body {
    padding: 14vh var(--gutter) 16vh;
    max-width: 1180px;
    margin: 0 auto;
    display: grid;
    gap: 10vh;
}
.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    border-top: 1px solid var(--day-line);
    padding-top: 28px;
}
.stat-label {
    display: block;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--day-muted);
}
.stat-num {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(40px, 5vw, 76px);
    line-height: 1.2;
}
.stat-num small {
    font-size: 0.34em;
    color: var(--day-muted);
    letter-spacing: 0.1em;
}
.viz {
    margin: 0;
    min-width: 0; /* グラフの最小幅でグリッドを押し広げない（横にはみ出す） */
}
.data-body > * {
    min-width: 0;
}
.viz figcaption h3 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(20px, 1.8vw, 26px);
}
.viz figcaption p {
    color: var(--day-muted);
    font-size: 13px;
    margin-top: 0.3em;
}
.cal-wrap,
.bars-wrap {
    margin-top: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
svg.cal {
    min-width: 760px;
    width: 100%;
    height: auto;
}
svg.bars {
    min-width: 640px;
    width: 100%;
    height: auto;
}
.cal rect.day {
    rx: 2px;
}
.cal rect.day:hover,
.cal rect.day.hot {
    stroke: var(--day-ink);
    stroke-width: 1.5px;
}
.axis-label {
    font-size: 11px;
    fill: #8a7f75;
    letter-spacing: 0.05em;
}
.grid-line {
    stroke: #e6ddd1;
    stroke-width: 1;
}
.baseline {
    stroke: #c9bcab;
    stroke-width: 1;
}
.cal-legend {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 12px;
    font-size: 11px;
    color: var(--day-muted);
}
.cal-legend span {
    margin: 0 6px;
}
.cal-legend i {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}
.legend {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    font-size: 13px;
}
.legend li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.legend small {
    color: var(--day-muted);
    font-variant-numeric: tabular-nums;
}
.bars rect.seg:hover {
    opacity: 0.85;
}
.tip {
    position: fixed;
    z-index: 60;
    pointer-events: none;
    background: #fffdf9;
    color: var(--day-ink);
    border: 1px solid var(--day-line);
    border-radius: 8px;
    box-shadow: 0 10px 30px -12px rgb(40 30 20 / 0.35);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.6;
    min-width: 150px;
}
.tip b {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.tip .row {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}
.tip .row span:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}
.tip i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}
.tip .row span:last-child {
    font-variant-numeric: tabular-nums;
}
.table-view {
    margin-top: 16px;
    font-size: 13px;
}
.table-view summary {
    cursor: pointer;
    color: var(--day-muted);
}
.table-view table {
    margin-top: 10px;
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
    width: 100%;
}
.table-view th,
.table-view td {
    padding: 4px 10px;
    border-bottom: 1px solid var(--day-line);
    text-align: right;
    white-space: nowrap;
}
.table-view th:first-child,
.table-view td:first-child {
    text-align: left;
}
.quote-data {
    text-align: center;
}
.quote-data p {
    font-size: clamp(20px, 2.4vw, 34px);
    line-height: 1.8;
}
.note {
    font-size: 12px;
    color: var(--day-muted);
    max-width: 44rem;
    margin: 0 auto;
    text-align: center;
}

/* ------------------------------------------------------------ 05 作っているもの */
.apps {
    background: var(--day);
    color: var(--day-ink);
    padding-bottom: 18vh;
}
canvas.komorebi {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    margin-bottom: -100vh;
    margin-bottom: -100svh;
    pointer-events: none;
}
.apps-head {
    position: relative;
    padding: 22vh var(--gutter) 6vh;
    text-align: center;
}
.apps-head .chapter-label {
    position: static;
    justify-content: center;
    margin-bottom: 4vh;
}
.h-concept {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(34px, 5.6vw, 92px);
    letter-spacing: 0.06em;
}
.apps-sub {
    margin-top: 1.2em;
    color: var(--day-muted);
}
.dolly {
    position: relative;
}
.dolly .sticky {
    display: grid;
    place-items: center;
}
.dolly-room {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    perspective: 1400px;
}
.print {
    --p: 0;
    position: relative;
    margin: 0;
    width: min(88vw, 150vh);
    aspect-ratio: 3 / 2;
    /* p=0 画面いっぱい → p=1 壁に掛かった小さめの額 */
    transform: translateY(calc(var(--p) * -4vh)) scale(calc(1.18 - var(--p) * 0.62));
    padding: calc(var(--p) * 2.2%);
    background: #fffdf8;
    box-shadow:
        0 calc(var(--p) * 30px) calc(var(--p) * 60px) calc(var(--p) * -20px) rgb(60 40 25 / 0.45),
        0 0 0 calc(var(--p) * 1px) rgb(60 40 25 / 0.15);
    will-change: transform;
}
.print img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(calc(0.9 + var(--p) * 0.1));
}
.words {
    position: absolute;
    left: 6%;
    bottom: 7%;
    color: #fff;
    font-family: var(--serif);
    font-size: clamp(16px, 2vw, 30px);
    text-shadow: 0 1px 14px rgb(0 0 0 / 0.55);
    display: grid;
    gap: 0.2em;
}
.words-date {
    font-size: 0.55em;
    letter-spacing: 0.2em;
    opacity: var(--date-o, 0);
    transition: opacity 0.6s;
}
.dolly-line {
    position: absolute;
    left: 50%;
    bottom: 7vh;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100vw - 2 * var(--gutter));
    text-align: center;
    font-family: var(--serif);
    font-size: clamp(18px, 2vw, 28px);
    line-height: 1.7;
    opacity: var(--line-o, 0);
}
.app-card {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    background: rgb(255 253 248 / 0.9);
    backdrop-filter: blur(6px);
    border: 1px solid var(--day-line);
    border-radius: 16px;
    padding: 20px 22px;
    max-width: 26rem;
}
.app-card img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    flex: none;
    box-shadow: 0 6px 16px -8px rgb(40 30 20 / 0.4);
}
.app-card h3 {
    margin: 0;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 22px;
    line-height: 1.4;
}
.app-card p {
    color: var(--day-muted);
    font-size: 14px;
    line-height: 1.8;
    margin-top: 0.3em;
}
.app-card a {
    display: inline-block;
    margin-top: 0.8em;
    color: var(--red);
    text-decoration: none;
    font-size: 14px;
    border-bottom: 1px solid currentColor;
}
.app-card .hint {
    font-size: 12px;
}
.app-card-photo {
    position: absolute;
    right: calc(var(--gutter) + 30px);
    top: 12vh;
    opacity: var(--card-o, 0);
    transform: translateY(calc((1 - var(--card-o, 0)) * 16px));
}
.shiori {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 26rem);
    justify-content: center;
    align-items: center;
    gap: clamp(28px, 6vw, 96px);
    padding: 16vh var(--gutter) 10vh;
}
.shiori-phone {
    position: relative;
    width: min(300px, 70vw);
    aspect-ratio: 9 / 16;
    border-radius: 34px;
    padding: 10px;
    background: #1b1714;
    box-shadow: 0 30px 70px -30px rgb(40 25 15 / 0.6);
}
.shiori-phone video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 26px;
}
.shiori-bar {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 28px;
    height: 4px;
    border-radius: 2px;
    background: rgb(255 255 255 / 0.35);
}
.shiori-progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--t, 0) * 100%);
    background: #fff;
    border-radius: 2px;
}
.mark {
    position: absolute;
    left: calc(var(--at) * 100%);
    bottom: 10px;
    transform: translateX(-50%);
    border: 0;
    cursor: pointer;
    font-family: var(--serif);
    font-size: 11px;
    color: #fff;
    background: var(--red);
    width: 26px;
    height: 34px;
    padding: 4px 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
    transition: transform 0.3s var(--ease);
}
.mark:hover,
.mark:focus-visible {
    transform: translateX(-50%) translateY(-4px);
}
.mark.hit {
    animation: hit 0.6s var(--ease);
}
@keyframes hit {
    30% {
        transform: translateX(-50%) translateY(-10px) scale(1.15);
    }
}
.soon {
    list-style: none;
    margin: 6vh auto 0;
    padding: 0 var(--gutter);
    display: flex;
    justify-content: center;
    gap: 48px;
}
.soon li {
    display: grid;
    justify-items: center;
    gap: 6px;
    font-size: 14px;
}
.soon small {
    color: var(--day-muted);
    font-size: 11px;
    letter-spacing: 0.2em;
}
.soon-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    opacity: 0.8;
}
.soon-icon.blank {
    border: 1px dashed #c9bcab;
    background: repeating-linear-gradient(135deg, transparent 0 6px, rgb(200 65 47 / 0.08) 6px 7px);
}

/* ------------------------------------------------------------ 06 人となり */
.me {
    background: var(--ink);
    color: var(--night-ink);
    padding: 18vh var(--gutter);
}
.me .chapter-label {
    top: 6vh;
}
.focus {
    position: relative;
    height: min(78vh, 720px);
    max-width: 1200px;
    margin: 0 auto;
    cursor: none;
    outline: none;
    --mx: 50%;
    --my: 50%;
    --r: 150px;
}
.focus-words {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    inset: 0;
}
.focus-words li {
    position: absolute;
    left: var(--x);
    top: var(--y);
    color: rgb(239 232 223 / 0.9);
    font-family: var(--serif);
    font-size: clamp(22px, 3vw, 46px);
    line-height: 1.45;
}
.focus-blur {
    position: absolute;
    inset: -20px;
    backdrop-filter: blur(10px) saturate(0.6);
    -webkit-backdrop-filter: blur(10px) saturate(0.6);
    mask-image: radial-gradient(circle at calc(var(--mx) + 20px) calc(var(--my) + 20px), transparent 0 calc(var(--r) * 0.8), #000 var(--r));
    -webkit-mask-image: radial-gradient(circle at calc(var(--mx) + 20px) calc(var(--my) + 20px), transparent 0 calc(var(--r) * 0.8), #000 var(--r));
    pointer-events: none;
}
.focus::after {
    content: "";
    position: absolute;
    left: var(--mx);
    top: var(--my);
    width: calc(var(--r) * 1.8);
    height: calc(var(--r) * 1.8);
    border: 1px solid rgb(200 65 47 / 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.focus-hint {
    position: absolute;
    right: 0;
    bottom: -40px;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--night-muted);
}

/* ------------------------------------------------------------ 07 映像 */
.film {
    background: var(--night);
    padding: 18vh var(--gutter) 16vh;
    text-align: center;
}
.film .chapter-label {
    top: 6vh;
}
.film-title {
    margin: 0 0 6vh;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(28px, 3.6vw, 56px);
}
.screen {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow:
        0 0 0 1px #2a2420,
        0 40px 120px -40px rgb(200 65 47 / 0.35);
}
.film-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.film-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 1px solid rgb(255 255 255 / 0.5);
    background: rgb(0 0 0 / 0.35);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    transition:
        opacity 0.3s,
        transform 0.3s var(--ease);
}
.film-play:hover {
    transform: scale(1.06);
}
.playing .film-play {
    opacity: 0;
}
.playing:hover .film-play {
    opacity: 1;
}
.film-missing {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--night-muted);
    font-size: 13px;
}
.film-note {
    margin-top: 3vh;
    font-size: 12px;
    color: var(--night-muted);
    letter-spacing: 0.1em;
}

/* ------------------------------------------------------------ 08 またね */
.bye {
    background: var(--day);
    color: var(--day-ink);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 4vw;
    padding: 12vh var(--gutter);
    min-height: 100svh;
}
.turntable {
    position: relative;
    aspect-ratio: 1;
    width: min(100%, 620px);
    justify-self: center;
    cursor: grab;
    touch-action: pan-y;
    outline: none;
}
.turntable:active {
    cursor: grabbing;
}
.turntable canvas {
    width: 100%;
    height: 100%;
    mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
    -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}
.spin-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2%;
    text-align: center;
    font-size: 12px;
    letter-spacing: 0.2em;
    color: var(--day-muted);
}
.bye-text p {
    margin-top: 1em;
    color: var(--day-muted);
}
.links {
    list-style: none;
    margin: 4vh 0 0;
    padding: 0;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--day-line);
}
.links a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 14px 4px;
    border-bottom: 1px solid var(--day-line);
    text-decoration: none;
    transition:
        padding 0.3s var(--ease),
        color 0.3s;
}
.links a:hover,
.links a:focus-visible {
    padding-left: 14px;
    color: var(--red);
}
.links b {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 18px;
}
.links span {
    font-size: 13px;
    color: var(--day-muted);
}

/* エンドロール */
.credits {
    background: var(--night);
    color: var(--night-ink);
    height: 100svh;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 18%, #000 82%, transparent);
}
.roll {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    text-align: center;
    padding: 0 var(--gutter);
}
.credits.on .roll {
    animation: roll 26s linear forwards;
}
@keyframes roll {
    to {
        transform: translateY(calc(-100% - 60svh));
    }
}
.roll-title {
    font-family: var(--serif);
    font-size: clamp(22px, 2.4vw, 34px);
    margin-bottom: 8vh;
}
.roll dl {
    margin: 0;
    display: grid;
    gap: 4px;
}
.roll dt {
    margin-top: 5vh;
    font-size: 11px;
    letter-spacing: 0.3em;
    color: var(--night-muted);
}
.roll dd {
    margin: 0;
    font-family: var(--serif);
    font-size: clamp(18px, 1.8vw, 24px);
}
.roll-end {
    margin-top: 16vh;
    font-size: 12px;
    color: var(--night-muted);
    letter-spacing: 0.2em;
}

/* 動きを止める */
.motion-toggle {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 50;
    font: inherit;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid currentColor;
    background: transparent;
    color: var(--rail-ink, var(--night-ink));
    opacity: 0.55;
    cursor: pointer;
}
.motion-toggle:hover,
.motion-toggle:focus-visible {
    opacity: 1;
}

/* ------------------------------------------------------------ 狭い画面 */
@media (max-width: 820px) {
    .rail {
        display: none;
    }
    .hud {
        display: none;
    }
    .hero-gears {
        right: -40vw;
        width: 150vw;
        opacity: 0.55;
    }
    .captions {
        bottom: 10vh;
    }
    .scrim-left {
        background: linear-gradient(0deg, rgb(14 12 11 / 0.85) 0%, rgb(14 12 11 / 0.3) 45%, transparent 70%);
    }
    .ai-grid {
        grid-template-columns: 1fr;
        align-content: start;
        padding-top: 12vh;
        gap: 3vh;
    }
    .windows {
        height: 46vh;
    }
    .win {
        width: 92%;
    }
    .win pre {
        font-size: 11px;
    }
    .win-py {
        left: 4%;
        top: 14%;
    }
    .win-term {
        left: 8%;
        top: 28%;
    }
    .quote-ai {
        bottom: 5vh;
    }
    .windows {
        transition: opacity 0.6s;
    }
    .ai.quote-on .windows {
        opacity: 0.1;
    }
    .win-term pre {
        min-height: 0;
        font-size: 10px;
    }
    .captions.dark .cap {
        background: rgb(243 236 226 / 0.86);
        padding: 8px 14px;
        border-radius: 12px;
        margin-left: -14px;
    }
    .stats {
        grid-template-columns: 1fr;
    }
    .city-hud {
        right: var(--gutter);
        top: 64px;
    }
    .app-card-photo {
        left: var(--gutter);
        right: var(--gutter);
        top: 9vh;
    }
    .print {
        width: 94vw;
    }
    .shiori {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .focus {
        height: auto;
        cursor: auto;
    }
    .focus-words {
        position: static;
        display: grid;
        gap: 4vh;
    }
    .focus-words li {
        position: static;
    }
    .focus-blur,
    .focus::after,
    .focus-hint {
        display: none;
    }
    .bye {
        grid-template-columns: 1fr;
    }
}

/* 動きを減らす／止めた時 */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
.still *,
.still *::before,
.still *::after {
    animation-play-state: paused !important;
}
