/* ─────────────────────────────────────────────────────────────
   Homepage layer over site.css: midnight, electric blue and one
   warm orange, the 3D glasses stage, and real people. Scoped to
   body.home so the other pages keep site.css as it is.
───────────────────────────────────────────────────────────── */
body.home {
    --ink: #02070a;
    --ink-raised: #0b1115;
    --ctrl: #151d22;
    --blue: #0297de;
    --orange: #fc734d;
    --paper: #f3f1ed;
    --muted: rgba(243,241,237,0.68);
    --dim: rgba(243,241,237,0.54);
    --line: rgba(243,241,237,0.10);
    --line-strong: rgba(243,241,237,0.18);
    /* site.css names, pointed at the new palette */
    --teal-ink: #03101a;
    --teal-deep: #013f60;
    --teal: #0297de;
    --horizon: #015c8c;
    --sky: #0297de;
    --cyan: #5cbcec;
    --aqua: #a5d8f3;
    --steel: #9aa9b3;
    --glow-a: rgba(2,151,222,0.30);
    --glow-b: rgba(2,151,222,0.08);
    --radius: 8px;
    --radius-lg: 10px;
    color: var(--paper);
    scrollbar-color: rgba(243,241,237,0.25) var(--ink);
    caret-color: var(--blue);
}
body.home :focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
body.home ::selection { background: rgba(2,151,222,0.4); color: #fff; }

/* Titles sit tight, below 1.0 */
body.home h1, body.home h2, body.home h3 { line-height: 0.94; text-wrap: balance; color: var(--paper); }
body.home p { text-wrap: pretty; }
body.home .lede { line-height: 1.42; color: var(--muted); }
html[lang="ja"] body.home h1, html[lang="ja"] body.home h2, html[lang="ja"] body.home h3 { line-height: 1.08; }

/* ── Buttons: one solid, the rest are words ──────────────── */
body.home .btn { border-radius: 12px; height: 52px; padding: 0 24px; }
body.home .btn-solid { background: var(--paper); color: var(--ink); box-shadow: none; }
body.home .btn-solid:hover { background: #fff; }
.btn-link {
    display: inline-flex; align-items: center; height: 52px; padding: 0 4px;
    font-family: var(--head); font-weight: 500; font-size: 16px; color: var(--paper);
    text-decoration: underline; text-decoration-color: rgba(243,241,237,0.35); text-underline-offset: 6px; text-decoration-thickness: 1px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.btn-link:hover { color: var(--blue); text-decoration-color: currentColor; }

/* ── Nav: a plain bar, no capsule ─────────────────────────── */
body.home .nav-wrap { padding: 0; }
body.home nav#nav {
    max-width: none; height: 68px; padding: 0 var(--gutter); border-radius: 0;
    background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    transition: background 0.3s, box-shadow 0.3s;
}
body.home nav#nav.scrolled { background: rgba(2,7,10,0.94); box-shadow: inset 0 -1px 0 var(--line); }
body.home .nav-links > a { border-radius: 8px; color: var(--muted); }
body.home .nav-links > a:hover { background: none; color: var(--paper); }
body.home .lang-switch { background: none; box-shadow: none; padding: 0; margin: 0 8px; }
body.home .lang-switch a { border-radius: 6px; padding: 5px 8px; }
body.home .lang-switch a[aria-current="true"] { background: none; color: var(--paper); text-decoration: underline; text-underline-offset: 5px; }
body.home .nav-cta { border-radius: 10px; height: 40px; background: var(--paper); }
body.home .nav-cta:hover { background: #fff !important; }

/* ── Brand lockup: the spark, in the one warm color ──────── */
.nav-brand, .f-lock { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); }
.nav-brand .spark, .f-lock .spark { width: 26px; height: 26px; color: var(--orange); flex: none; transition: transform 0.8s var(--ease); }
.nav-brand:hover .spark { transform: rotate(72deg); }
.brand-word { font-family: var(--head); font-weight: 600; font-size: 20px; letter-spacing: -0.03em; }
.f-lock .spark { width: 30px; height: 30px; }
.f-lock .brand-word { font-size: 23px; }

/* ── Light rays: a column of blue light with a warm foot, cut into fine
   vertical stripes. Used sparingly: behind the glasses and the demo phone. */
.rays {
    position: absolute; pointer-events: none;
    background:
        repeating-linear-gradient(90deg, rgba(2,7,10,0.62) 0 2px, rgba(2,7,10,0) 2px 5px),
        repeating-linear-gradient(90deg, rgba(2,7,10,0) 0 9px, rgba(2,7,10,0.38) 9px 13px),
        radial-gradient(44% 30% at 50% 86%, rgba(252,115,77,0.8), rgba(252,115,77,0) 100%),
        radial-gradient(32% 60% at 50% 44%, rgba(2,151,222,0.78), rgba(2,151,222,0) 100%);
    -webkit-mask-image: radial-gradient(50% 50% at 50% 50%, #000 35%, transparent 100%);
    mask-image: radial-gradient(50% 50% at 50% 50%, #000 35%, transparent 100%);
}

/* ── The stage ────────────────────────────────────────────── */
main { position: relative; z-index: 1; }
.stage { position: fixed; inset: 0; z-index: 0; pointer-events: none; --ax: 70%; --ay: 45%; --glow: 0; --sil: 1; --sil-y: 0px; }
/* the light follows the glasses */
.rays-stage { left: var(--ax); top: calc(var(--ay) + 12vh); width: min(64vw, 860px); height: 120vh; transform: translate(-50%, -50%); opacity: calc(var(--glow) * 0.6); }
/* the hero photo fades as the hero scrolls away, then the glasses arrive */
.stage-photo { position: absolute; inset: 0 0 0 34%; display: block; opacity: var(--sil); transform: translate3d(0, var(--sil-y), 0); }
.hero-fallback { left: 34%; }
/* he sits in the right of the frame, clear of the copy; the left edge melts into the night */
.stage-photo img, .hero-fallback img {
    width: 100%; height: 100%; object-fit: cover; object-position: 34% 30%;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 64%, transparent 98%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(90deg, transparent, #000 30%), linear-gradient(180deg, #000 64%, transparent 98%);
    mask-composite: intersect;
}
.stage-photo::after, .hero-fallback::after {
    /* shade so the copy reads over the photo */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(2,7,10,0.45) 0%, rgba(2,7,10,0) 24%, rgba(2,7,10,0) 60%, rgba(2,7,10,0.85) 100%);
}
html:not(.gl-wait):not(.gl-on) .stage { display: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.2s var(--ease); }
.gl-on .stage canvas { opacity: 1; }
.gl-fallback { display: block; }
.gl-wait .gl-fallback, .gl-on .gl-fallback { display: none; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { min-height: 100svh; display: flex; align-items: flex-end; position: relative; }
.hero-fallback { position: absolute; inset: 0; z-index: -1; }
.hero-inner { padding: 160px 0 clamp(56px, 10vh, 112px); }
.hero-title { font-size: clamp(52px, 8.2vw, 124px); font-weight: 600; letter-spacing: -0.045em; max-width: 6.4em; }
.hero-title span { display: inline-block; }
.hero-lede { margin-top: 24px; font-size: clamp(18px, 1.6vw, 22px); color: var(--muted); max-width: 22em; line-height: 1.38; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 36px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--dim); }

/* load: the words arrive one by one */
@keyframes wordIn { from { opacity: 0; transform: translateY(0.3em); } }
.hero-title span { animation: wordIn 0.9s var(--ease) both; }
.hero-title span:nth-child(2) { animation-delay: 0.1s; }
.hero-title span:nth-child(3) { animation-delay: 0.2s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.hero-lede, .hero-actions, .hero-note { animation: fadeUp 0.8s var(--ease) both; }
.hero-lede { animation-delay: 0.32s; } .hero-actions { animation-delay: 0.42s; } .hero-note { animation-delay: 0.5s; }

.k-mark { height: 1px; }

/* ── Glasses chapter ──────────────────────────────────────── */
.glasses-ch { position: relative; }
.ch { min-height: 100svh; display: flex; align-items: center; }
.ch-copy { max-width: 24rem; }
.ch-copy h2 { font-size: clamp(38px, 4.8vw, 68px); letter-spacing: -0.04em; }
.ch-copy p { margin-top: 16px; color: var(--muted); font-size: clamp(17px, 1.3vw, 19px); line-height: 1.42; }
.ch-buy .price { margin: 0 0 18px; color: var(--muted); font-size: 16px; }
.ch-buy .price strong { font-family: var(--head); font-weight: 500; font-size: clamp(34px, 3.4vw, 46px); letter-spacing: -0.03em; color: var(--paper); margin-right: 6px; }
.ch-buy .glasses-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.glasses-ch > .gl-fallback { width: min(1240px, 100% - 2 * var(--gutter)); margin: 0 auto; border-radius: var(--radius); }
html:not(.gl-wait):not(.gl-on) .ch { min-height: 0; padding: 56px 0; }

/* copy in each stop rises in as its pose arrives */
.ch-copy > * { transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
.gl-on .ch:not(.on):not(:focus-within) .ch-copy > * { opacity: 0; transform: translateY(20px); }
.ch-copy > :nth-child(2) { transition-delay: 0.05s; }
.ch-copy > :nth-child(3) { transition-delay: 0.1s; }
.ch-copy > :nth-child(4) { transition-delay: 0.15s; }

/* ── The demo and the people ──────────────────────────────── */
.demo { background: var(--ink); overflow-x: clip; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 8vw, 120px); align-items: center; }
.demo-copy .title { max-width: 9em; letter-spacing: -0.04em; }
.demo-copy .lede { margin-top: 22px; max-width: 20em; }
.demo-phone { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 20px; position: relative; isolation: isolate; }
.rays-phone { inset: -22% -70% -30%; z-index: -1; opacity: 0.6; }
body.home .demo-phone .phone { height: auto; width: clamp(230px, 22vw, 300px); background: #05090c; box-shadow: inset 0 0 0 1px rgba(243,241,237,0.2), 0 30px 80px rgba(0,0,0,0.55); }
/* a spoken question, set as words someone said */
.said { font-family: var(--head); font-size: clamp(17px, 1.4vw, 20px); font-weight: 500; letter-spacing: -0.01em; color: var(--paper); }
.moments { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: clamp(96px, 12vw, 168px); }
.moment { margin: 0; }
.moment img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); background: var(--ink-raised); }
.moment .said { margin-top: 16px; }

/* ── Closing ──────────────────────────────────────────────── */
body.home .closing { align-items: flex-end; justify-content: flex-start; text-align: left; min-height: 92svh; }
body.home .closing::before { background: linear-gradient(180deg, var(--ink) 0%, rgba(2,7,10,0.2) 30%, rgba(2,7,10,0.2) 55%, rgba(2,7,10,0.92) 100%); }
body.home .closing-media img { object-position: 60% 40%; }
body.home .closing-inner { padding: 0 0 clamp(64px, 10vh, 120px); }
body.home .closing h2 { margin: 0 0 30px; max-width: 9em; letter-spacing: -0.04em; }

/* ── Phone bar ────────────────────────────────────────────── */
body.home .sticky-bar { border-radius: 14px; background: rgba(2,7,10,0.94); box-shadow: inset 0 0 0 1px var(--line-strong), 0 16px 40px rgba(0,0,0,0.5); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.home .bar-main { border-radius: 10px; background: var(--paper); }
body.home .bar-glasses { border-radius: 10px; }
.bar-main, .bar-glasses { white-space: nowrap; }

/* ── One scroll pattern: the people rise at three speeds ─── */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) and (min-width: 40rem) {
        @keyframes heroOut { to { opacity: 0; transform: translateY(-40px); } }
        .hero-inner { animation: heroOut linear both; animation-timeline: view(); animation-range: exit 10% exit 80%; }
        @keyframes rise { from { transform: translateY(var(--rise, 80px)); } }
        .moment { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
        .moment:nth-child(2) { --rise: 150px; }
        .moment:nth-child(3) { --rise: 220px; }
    }
}

@media (max-width: 900px), (max-aspect-ratio: 9/10) {
    .hero-inner { padding-top: 58svh; }
    .stage-photo, .hero-fallback { left: 0; bottom: 30%; }
    .stage-photo img, .hero-fallback img { object-position: 50% 24%; -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent); mask-image: linear-gradient(180deg, #000 62%, transparent); }
    .stage-photo::after, .hero-fallback::after { background: linear-gradient(180deg, rgba(2,7,10,0.45) 0%, rgba(2,7,10,0) 22%, rgba(2,7,10,0) 60%, rgba(2,7,10,0.85) 100%); }
    .rays-stage { width: 120vw; height: 90vh; }
    .hero-actions .btn { flex: 1 1 100%; }
    .hero-actions .btn-link { margin-inline: auto; }
    .ch { align-items: flex-end; padding-bottom: 12svh; position: relative; isolation: isolate; }
    .ch-copy { max-width: none; padding: 20px 0 0; }
    .ch-copy::before {
        /* a soft floor under the copy so it reads over the glasses */
        content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46svh; z-index: -1; pointer-events: none;
        background: linear-gradient(180deg, transparent, rgba(2,7,10,0.9) 45%);
    }
    .demo-grid { grid-template-columns: 1fr; }
    .demo-phone { justify-self: center; }
    .moments { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin-inline: calc(-1 * var(--gutter)); padding: 0 var(--gutter) 8px; scrollbar-width: none; }
    .moments::-webkit-scrollbar { display: none; }
    .moment { flex: 0 0 78%; scroll-snap-align: start; scroll-margin-left: var(--gutter); }
    body.home .closing-media img { object-position: 72% 40%; }
}
@media (max-width: 760px) {
    .brand-word { font-size: 19px; }
}
/* Japanese headings break at phrase boundaries, a size down so short ones hold one line */
html[lang="ja"] body.home h1, html[lang="ja"] body.home h2, html[lang="ja"] body.home h3 { word-break: auto-phrase; }
html[lang="ja"] .hero-title { font-size: clamp(40px, 7vw, 100px); }
html[lang="ja"] .ch-copy h2 { font-size: clamp(30px, 3.8vw, 54px); }
html[lang="ja"] .demo-copy .title, html[lang="ja"] .closing h2 { font-size: clamp(30px, 4vw, 56px); max-width: 12em; }
@media (prefers-reduced-motion: reduce) {
    .nav-brand .spark, .stage canvas { transition: none; }
    .hero-title span, .hero-lede, .hero-actions, .hero-note { animation: none; }
    .ch-copy > * { transition: none; }
}
