/* MiraiToki LP v3
   昼の紙（月白）から始まり、日没の帯を抜けて、夜と月で終わる。
   縦書きは右から左へ進む。文字盤の「未来は右から、過去は左へ」と同じ向き。
   黄色（--now）は「いま」だけに使う。 */

:root {
  --paper: #EAF0F2;
  --ink: #121C2B;
  --ink-2: #4A586C;
  --ink-line: rgba(18, 28, 43, .16);
  --night: #0B1220;
  --moon: #E8EDF5;
  --moon-2: rgba(232, 237, 245, .7);
  --moon-line: rgba(232, 237, 245, .18);
  --now: #FFD500;
  --serif: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: "IBM Plex Sans JP", "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--paper); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.95; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; }
ul { list-style: none; }

.day { background: var(--paper); color: var(--ink); --fg2: var(--ink-2); --line: var(--ink-line); --focus: var(--ink); }
.night { background: var(--night); color: var(--moon); --fg2: var(--moon-2); --line: var(--moon-line); --focus: var(--now); }
:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
/* 日本語の改行: 文節で折る。見出しは <wbr> の位置でだけ折る */
.lead, .note, .cap p, .feats p, figcaption, .keys span, .today-moon, footer p { word-break: auto-phrase; line-break: strict; }
.cap h3, .feats h3 { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.5; letter-spacing: .05em; }
h2 { font-size: clamp(27px, 3.4vw, 44px); text-wrap: balance; }
.lead { color: var(--fg2); max-width: 32em; font-size: clamp(15px, 1.5vw, 17px); }
/* サブコピー: 縦書きの見出しの下に、横書きで静かに添える（黄色は「いま」だけに使うので、色は付けない） */
.tagline { font-family: var(--serif); font-weight: 700; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.8; letter-spacing: .05em; color: var(--ink); text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; line-break: strict; }
/* 導入文: 意味のまとまりごとに段を分ける */
.lead.lines span { display: block; }
.lead.lines span + span { margin-top: .7em; }
.note { font-size: 13px; line-height: 1.8; color: var(--fg2); }
.note.center { text-align: center; margin-top: 18px; }
h2 + .lead, h2 + .clock { margin-top: 20px; }

.sec { padding: clamp(80px, 12vw, 150px) 0; }
.two.flip > .dialbox { order: 0; }
@media (min-width: 861px) { .two.flip > .dialbox { order: 2; } }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }

/* ---- App Store ボタン ---- */
.store { display: inline-flex; align-items: center; gap: 12px; background: #000; color: #fff; border: 1px solid #8f8f8f; border-radius: 12px; padding: 8px 22px 8px 16px; text-decoration: none; line-height: 1; min-height: 56px; font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif; transition: transform .2s; }
.store:hover { transform: translateY(-1px); }
.store svg { width: 28px; height: 34px; flex: none; fill: #fff; }
.store span { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.store small { font-size: 11px; white-space: nowrap; }
.store b { font-size: 24px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.store.soon { cursor: default; pointer-events: none; }
.store.sm { min-height: 42px; padding: 5px 14px 5px 11px; gap: 8px; border-radius: 9px; }
.store.sm svg { width: 20px; height: 24px; }
.store.sm small { font-size: 8.5px; }
.store.sm b { font-size: 17px; }
.night .store { border-color: #a6a6a6; }

/* ---- ヘッダー ---- */
.top { position: absolute; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 21px; letter-spacing: .06em; color: var(--ink); }
.brand img { border-radius: 22%; }
footer .brand { color: var(--moon); font-size: 17px; }

/* ---- 縦書き。3列が、階段のように左へ下がる ---- */
.vt { writing-mode: vertical-rl; font-size: var(--vf); line-height: 1.55; letter-spacing: .08em; align-self: flex-end; }
.vt span { display: block; }
.vt span:nth-child(2) { margin-inline-start: 1.1em; }
.vt span:nth-child(3) { margin-inline-start: 2.2em; }

/* 左に絵（盤面・月）、右に縦書きと本文 */
.split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 5vw, 88px); align-items: center; }
.split > .visual { order: 1; }
.split > .side { order: 2; width: max(calc(var(--vf) * 4.7), 25em); display: flex; flex-direction: column; gap: clamp(18px, 3svh, 30px); }
.split .lead, .split .cta { align-self: stretch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cta .note { flex: 1 1 11em; max-width: 16em; }
.cue { position: absolute; left: 50%; bottom: clamp(6px, 1.8svh, 18px); width: 44px; height: 44px; margin-left: -22px; display: grid; place-items: center; }
.cue i { display: block; width: 1px; height: 30px; background: linear-gradient(var(--ink-2), transparent); opacity: .5; transform-origin: top; }
.cue:hover i { opacity: .85; }

/* ---- ヒーロー ---- */
.hero { --vf: clamp(38px, min(5.2vw, 5.1svh), 76px); position: relative; min-height: 100svh; display: grid; align-items: center; padding: clamp(84px, 12svh, 116px) 0 clamp(36px, 6svh, 64px); }
.hero .wrap { max-width: 1440px; width: 100%; }
/* 右の列: サブコピーと段分けで縦に伸びるので、横を広げて1画面に収める */
.hero .split > .side { width: max(calc(var(--vf) * 4.7), 34em); }
.hero .lead { font-size: 16px; max-width: none; }
.hero .split > .side { gap: clamp(14px, 2.2svh, 24px); }
@media (max-width: 1180px) { .hero .split > .side { width: max(calc(var(--vf) * 4.7), 27em); } }
.hero { grid-template-columns: minmax(0, 1fr); overflow-x: clip; /* 入場アニメーションの間、横にはみ出させない */ }
.dialbox { position: relative; width: min(100%, 560px); justify-self: center; }
/* 影: canvas に CSS の filter を掛けると、描き直すたびに影も計算し直す（iPhone で重い）。静的な円に置き換える。
   box-shadow のぼかしは drop-shadow の半分の柔らかさになるので、数値は倍にして見た目を合わせている。
   文字盤の直径は canvas の 350/404（約 86.6%）。 */
.dialbox::before { content: ""; position: absolute; left: 6.7%; top: 0; margin-top: 6.7%; /* margin の % は幅が基準。注記が下に付いて枠が縦に伸びても、正円のまま */ width: 86.6%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 26px 68px rgba(18, 28, 43, .3); pointer-events: none; }
.dialbox canvas { position: relative; }
.night .dialbox::before { box-shadow: 0 30px 100px rgba(0, 0, 0, .55); }
.hero .dialbox { width: min(100%, 780px, calc(100svh - 190px)); }
.hero .dialbox canvas { touch-action: pan-y; cursor: ns-resize; }
.hint { position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); font-size: 12.5px; color: var(--ink-2); white-space: nowrap; transition: opacity .6s; }
.hint.gone { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  /* 1列ずつ、ゆっくり現れる（以前は1.3秒・間隔0.3秒で速かった） */
  .hero .vt span { animation: arrive 2.6s cubic-bezier(.22, .61, .36, 1) both; animation-delay: .2s; }
  .hero .vt span:nth-child(2) { animation-delay: 1.1s; }
  .hero .vt span:nth-child(3) { animation-delay: 2s; }
  .hero .tagline { animation: fadein 1.8s ease 2.4s both; }
}
@media (prefers-reduced-motion: no-preference) {
  .cue i { animation: cue 2.8s ease-in-out infinite; }
}
@keyframes cue { 0%, 100% { transform: scaleY(.5); opacity: .25; } 50% { transform: scaleY(1); opacity: .6; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes arrive { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }

/* ---- 一日が巡る（スクロール連動） ---- */
.travel { height: 340vh; position: relative; }
.stick { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; overflow: hidden; }
.stick > .wrap { width: 100%; }
.travel-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 6vw, 96px); align-items: center; }
.travel-grid .dialbox { width: min(100%, 580px, 80svh); }
.marked::after { content: "いま"; position: absolute; left: 50%; top: -26px; transform: translateX(-50%); font-size: 12px; letter-spacing: .14em; color: var(--ink-2); }
.clock { font-family: var(--serif); font-weight: 700; font-size: clamp(52px, 7vw, 92px); line-height: 1; letter-spacing: .04em; font-variant-numeric: tabular-nums; margin-bottom: 18px; }
.caps { position: relative; min-height: 9em; }
.cap { position: absolute; inset: 0 auto auto 0; opacity: 0; transform: translateX(14px); transition: opacity .5s, transform .5s; pointer-events: none; }
.cap.on { opacity: 1; transform: none; }
.cap h3 { font-size: clamp(19px, 2.3vw, 27px); margin-bottom: 8px; text-wrap: balance; }
.cap p { color: var(--fg2); max-width: 30em; }

/* 空の帯が右から左へ流れ、黄色い印は動かない */
.strip { position: relative; max-width: 460px; margin: 18px 0 0; }
.strip-win { height: 38px; overflow: hidden; border-radius: 3px; background: #05060f; }
.strip-sky { width: 300%; height: 100%; will-change: transform; background: linear-gradient(90deg, rgba(255, 255, 255, .26) 1px, transparent 1px) 0 0 / calc(100% / 36) 100% repeat-x, var(--sky); }
.strip-now { position: absolute; left: 50%; top: -8px; bottom: 22px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--now); box-shadow: 0 0 0 1px rgba(18, 28, 43, .55), 0 0 14px rgba(255, 213, 0, .75); }
.strip-dir { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.travel .note { margin-top: 14px; }

/* ---- 読みかた ---- */
.keys { margin: 26px 0 18px; border-bottom: 1px solid var(--line); }
.keys button { display: grid; grid-template-columns: 14em minmax(0, 1fr); gap: 4px 18px; width: 100%; min-height: 56px; text-align: left; padding: 15px 14px; background: none; border: 0; border-top: 1px solid var(--line); box-shadow: inset 3px 0 0 transparent; color: inherit; font: inherit; font-size: 14.5px; line-height: 1.7; cursor: pointer; transition: background .25s, box-shadow .25s; }
.keys button:focus-visible { outline-offset: -3px; }
.keys b { font-family: var(--serif); font-weight: 700; font-size: 16px; letter-spacing: .04em; justify-self: start; align-self: start; /* 説明文が2行でも、下線の帯を文字の高さに留める */ background: linear-gradient(transparent 62%, transparent 62%); transition: background .2s; }
.keys span { color: var(--fg2); }
.keys button[aria-pressed="true"] { background: linear-gradient(90deg, rgba(255, 213, 0, .2), rgba(255, 213, 0, 0) 78%); box-shadow: inset 3px 0 0 var(--now); }
.keys button[aria-pressed="true"] b { background: linear-gradient(transparent 62%, var(--now) 62%); }

/* ---- 日没の帯: 盤面の外周の空を、縦に引き伸ばしたもの ---- */
.dusk { position: relative; height: clamp(260px, 38vw, 460px); background: linear-gradient(180deg, var(--paper) 0%, #F4DCC4 16%, #F2AC72 36%, #CF6A66 54%, #6B3558 72%, #1D1A3A 88%, var(--night) 100%); color: var(--ink); }
.dusk .wrap { position: absolute; inset: 24% 0 auto 0; left: 50%; transform: translateX(-50%); width: 100%; }
.dusk p { font-family: var(--serif); font-weight: 700; font-size: clamp(18px, 2.2vw, 26px); letter-spacing: .06em; }

/* ---- 空と月 ---- */
.solstice { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 3vw, 40px); margin-top: clamp(40px, 6vw, 72px); }
.solstice figure { text-align: center; }
.solstice canvas { max-width: 360px; margin: 0 auto; filter: drop-shadow(0 30px 50px rgba(0, 0, 0, .55)); }
figcaption { margin-top: 16px; font-size: 14px; color: var(--fg2); }
figcaption b { display: block; font-family: var(--serif); font-weight: 700; color: var(--moon); font-size: 20px; letter-spacing: .08em; }
figcaption span { display: block; }
.daybars { max-width: 720px; margin: clamp(28px, 4vw, 44px) auto 0; display: grid; gap: 12px; }
.daybar, .axis { display: grid; grid-template-columns: 3em minmax(0, 1fr) 6.5em; align-items: center; gap: 12px; font-size: 13px; color: var(--fg2); }
.daybar b { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: .08em; color: var(--moon); }
.daybar span { text-align: right; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 14px; border-radius: 7px; background: #060a1a; border: 1px solid var(--line); overflow: hidden; }
.track i { position: absolute; top: 0; bottom: 0; border-radius: 7px; background: linear-gradient(90deg, #2a86dc, #62beff 50%, #2a86dc); }
.axis { margin-top: -4px; font-size: 11px; }
.axis .ticks { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.moon-intro { margin-top: clamp(72px, 10vw, 128px); }
.moon-intro .dialbox { width: min(100%, 420px); }
.moons { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; margin-top: 40px; min-height: 132px; }
.moons div { text-align: center; font-size: 12px; color: var(--fg2); padding: 14px 4px 10px; border: 1px solid transparent; border-radius: 14px; }
.moons div.now { border-color: var(--now); color: var(--moon); }
.moons canvas { width: 100%; max-width: 64px; margin: 0 auto 8px; }
.today-moon { margin-top: 18px; color: var(--fg2); font-size: 14.5px; min-height: 1.95em; }

/* ---- 予定・テーマ ---- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 18px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; border: 1px solid var(--line); background: transparent; color: var(--fg2); padding: 8px 18px; border-radius: 999px; font: inherit; font-size: 13.5px; line-height: 1.6; cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.chip:hover { border-color: var(--moon); color: var(--moon); }
.chip[aria-pressed="true"] { background: var(--now); color: #1a1408; border-color: var(--now); }
.chip .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
#theme-chips { margin-top: 34px; }

.scene { max-width: 860px; margin: 40px auto 0; }
.bgc { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; pointer-events: none; }
.phone { position: relative; overflow: hidden; background: #05070c; border: 1px solid rgba(255, 255, 255, .11); border-radius: 36px; padding: clamp(16px, 2.4vw, 30px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 28px); align-items: center; box-shadow: 0 40px 90px rgba(0, 0, 0, .6), inset 0 0 0 6px #0b0f19; aspect-ratio: 2.05 / 1; }
.phone > canvas:not(.bgc), .sched { position: relative; }
.sched { font-size: clamp(11px, 1.3vw, 14px); line-height: 1.5; color: var(--fg2); }
.sched-h { font-family: var(--serif); font-weight: 700; font-size: clamp(13px, 1.5vw, 17px); letter-spacing: .1em; margin-bottom: .9em; color: var(--moon); }
.sched li { display: flex; gap: .7em; padding: .55em 0; border-top: 1px solid var(--line); align-items: baseline; }
.sched li i { width: .6em; height: .6em; border-radius: 50%; flex: none; transform: translateY(-.05em); }
.sched li span { color: var(--moon-2); font-variant-numeric: tabular-nums; font-size: .9em; margin-left: auto; white-space: nowrap; }
.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: clamp(56px, 8vw, 96px); }
.feats h3 { font-size: 19px; margin-bottom: 8px; }
.feats p { font-size: 14.5px; color: var(--fg2); }
.feats.quiet h3 { font-size: 16px; }
.feats.quiet p { font-size: 13.5px; }

/* ---- 締め ---- */
.closing { --vf: clamp(32px, min(4.6vw, 6svh), 64px); position: relative; overflow: hidden; padding-block: clamp(96px, 13vw, 170px); background: radial-gradient(80% 60% at 28% 45%, #16244a 0%, #0c1226 55%, var(--night) 100%); }
.closing > .stars { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; pointer-events: none; }
.closing .wrap { position: relative; }
.moon { position: relative; width: min(100%, 440px); aspect-ratio: 1; justify-self: center; }
.moon .halo { position: absolute; inset: -34%; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(205, 220, 255, .30) 34%, rgba(120, 150, 255, .13) 58%, transparent 100%); filter: blur(30px); }
.moon .disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.moon .disc img { position: absolute; width: 120%; height: auto; max-width: none; left: -10%; top: -11.4%; }
.moon .glow { filter: blur(22px); opacity: .7; transform: scale(1.06); }
.moon .sharp { -webkit-mask-image: radial-gradient(circle closest-side, #000 86%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 86%, transparent 100%); }
.moon .sharp img { filter: brightness(1.06) contrast(1.04); }
.moon .sharp::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 34% 30%, transparent 50%, rgba(6, 10, 24, .42) 100%); }

footer { padding: 34px 0 48px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg2); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: space-between; align-items: center; }
footer p { max-width: 46em; line-height: 1.8; font-size: 12px; }
.legal { display: flex; gap: 6px 22px; flex-wrap: wrap; font-size: 13px; }
.legal a { color: var(--moon); text-decoration: underline; text-underline-offset: 3px; }

/* ---- 狭い画面 ---- */
@media (max-width: 860px) {
  .two, .travel-grid { grid-template-columns: 1fr; }
  /* 縦書き → 絵 → 本文 → ボタン の順に積む */
  .split { display: flex; flex-direction: column; align-items: stretch; gap: 28px; }
  .split > .side { display: contents; }
  .split .vt { order: 0; }
  .split .visual { order: 1; }
  .split .lead { order: 2; }
  .split .cta { order: 3; }
  .hero { --vf: clamp(34px, 9.6vw, 52px); padding-top: 84px; }
  .closing { --vf: clamp(30px, 8vw, 46px); }
  .hero .dialbox { width: min(88vw, 460px); }
  .hint { position: static; transform: none; text-align: center; margin-top: 10px; }
  .travel-grid { gap: 6px; align-content: center; }
  .travel-grid .dialbox { width: min(70vw, 38svh); }
  .travel h2 { font-size: 23px; }
  .clock { font-size: 44px; margin-bottom: 8px; }
  .caps { min-height: 8.6em; }
  .cap p { font-size: 14px; line-height: 1.7; }
  .strip { margin-top: 6px; }
  .travel .note { display: none; }
  .feats { grid-template-columns: 1fr; }
  .phone { aspect-ratio: auto; }
  .moon { width: min(78vw, 360px); }
  .keys button { grid-template-columns: 1fr; }
  .cue { display: none; }
  .cta .note { max-width: none; flex-basis: 100%; }
  .moon-intro .dialbox { width: min(72vw, 320px); }
  .moons { grid-template-columns: repeat(4, 1fr); min-height: 252px; }
}
@media (max-width: 380px) {
  .top { gap: 8px; }
  .top .brand { font-size: 17px; gap: 8px; }
  .top .brand img { width: 30px; height: 30px; }
}
@media (max-width: 520px) {
  .solstice { grid-template-columns: 1fr; }
  /* 置き時計は横向きのまま、画面幅いっぱいに小さく収める */
  .phone { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); border-radius: 24px; padding: 12px; gap: 8px; box-shadow: 0 30px 60px rgba(0, 0, 0, .55), inset 0 0 0 4px #0b0f19; }
  .sched { font-size: 10.5px; }
  .sched-h { font-size: 12px; margin-bottom: .6em; }
  .sched li { flex-wrap: wrap; column-gap: .5em; padding: .4em 0; }
  .sched li span { margin-left: 1.1em; width: 100%; font-size: .92em; }
  .daybar, .axis { grid-template-columns: 2.6em minmax(0, 1fr) 5.6em; gap: 8px; }
  .top .store.sm { padding: 4px 10px 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cap, .chip, .store, .hint, .keys button { transition: none; }
}
