/* ============================================================
   BUNKROS HOME — seven viewport scenes (2026-09-28)
   Hero → Manifesto → Field Notes → Training → Prompt Lab → Play → Newsletter → footer
   Card media heights are expressed in viewport height (svh) so each scene
   fits its usable area on short phones as well as big desktops.
   ============================================================ */

/* ---------- 01 Hero: lighter overlay, true viewport ---------- */
.home .hero { min-height: 100vh; min-height: 100dvh; scroll-snap-align: start; }
[data-theme="dark"] .home .hero-overlay {
    background: linear-gradient(180deg, rgba(10,10,15,.72) 0%, rgba(10,10,15,.44) 42%, rgba(10,10,15,.7) 100%) !important;
}
.home .hero-content { padding-top: var(--sh-top-h); padding-bottom: var(--sh-bot-h); }

/* shared tag + meta */
.hm-tag { display: inline-flex; align-items: center; padding: 6px 9px; border-radius: 8px; font: 800 .68rem/1 var(--font-accent); letter-spacing: .14em; text-transform: uppercase; background: rgba(10,10,15,.72); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hm-tag--core { background: #22c3ff; color: #06131c; }
.hm-tag--applied { background: #2ee59d; color: #06190f; }
.hm-tag--ethics { background: #ffe14d; color: #1d1800; }
.hm-tag--generative { background: #ff4fd8; color: #22001b; }
.hm-meta { font: 600 .78rem/1 var(--font-accent); color: var(--text-secondary); letter-spacing: .04em; }
.hm-go { margin-top: auto; display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; font: 800 .76rem/1 var(--font-accent); letter-spacing: .14em; text-transform: uppercase; color: var(--sh-accent); }
.hm-foot { display: flex; justify-content: flex-start; }

/* card base used by notes / training / tools */
.hm-note, .hm-train, .hm-tool {
    display: flex; flex-direction: column; height: 100%; border-radius: 22px; overflow: hidden;
    background: var(--bg-surface); border: 1px solid var(--sh-border); color: var(--sh-text) !important; text-decoration: none;
    transition: transform .5s var(--sh-spring), border-color .3s, box-shadow .4s;
}
.hm-note:hover, .hm-train:hover, .hm-tool:hover { transform: translateY(-5px); border-color: rgba(var(--sh-accent-rgb), .45); box-shadow: 0 30px 60px -36px rgba(var(--sh-accent-rgb), .9); }
.hm-note:active, .hm-train:active, .hm-tool:active { transform: scale(.98); }
.hm-note-media, .hm-train-media, .hm-tool-media { position: relative; display: block; height: clamp(120px, 27svh, 300px); overflow: hidden; background: #111; flex: none; }
.hm-note-media img, .hm-train-media img, .hm-tool-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--sh-ease); }
.hm-note:hover img, .hm-train:hover img, .hm-tool:hover img { transform: scale(1.06); }
.hm-note-media .hm-tag { position: absolute; left: 12px; top: 12px; }
.hm-note-body, .hm-train-body, .hm-tool-body { display: flex; flex-direction: column; gap: 8px; padding: clamp(14px, 1.6vw, 20px); flex: 1; min-height: 0; }
.hm-note strong, .hm-train strong, .hm-tool strong { font: 800 clamp(1.02rem, .95rem + .35vw, 1.25rem)/1.2 var(--font-heading); }
.hm-note-ex, .hm-train-desc, .hm-tool-desc { color: var(--text-secondary); font-size: .93rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 02 Manifesto ---------- */
.hm-manifesto { background: radial-gradient(70% 60% at 85% 20%, rgba(157,0,255,.12), transparent 70%), radial-gradient(60% 60% at 10% 90%, rgba(255,0,90,.1), transparent 70%); }
.hm-principles { --per: 3; }
.hm-principle { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 2.2vw, 30px); border-radius: 22px; background: color-mix(in srgb, var(--bg-surface) 88%, transparent); border: 1px solid var(--sh-border); height: 100%; box-sizing: border-box; }
.hm-principle-no { font: 900 clamp(1.8rem, 1.3rem + 1.4vw, 2.8rem)/1 var(--font-heading); background: var(--sh-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-principle h3 { font: 800 clamp(1.05rem, .98rem + .4vw, 1.35rem)/1.2 var(--font-heading); margin: 0; }
.hm-principle p { color: var(--text-secondary); margin: 0; line-height: 1.55; font-size: .96rem; }
@media (min-width: 768px) {
    /* two tidy rows of three — a composition, not a slider */
    .hm-principles .bk-car-track { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-columns: unset; overflow: visible; scroll-snap-type: none; }
}

/* ---------- 03 Notes · 04 Training · 05 Lab ---------- */
.hm-car { --per: 3; }
.hm-training .hm-car { --per: 4; }
.hm-train-top { display: flex; align-items: center; justify-content: space-between; }
.hm-train-no { font: 900 1.5rem/1 var(--font-heading); color: var(--sh-accent); }
.hm-tool { border-top: 3px solid var(--c); }
.hm-tool-id { font: 700 .74rem/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--c); text-transform: uppercase; }

/* ---------- 06 Play: one cinematic card at a time ---------- */
.hm-stage { --per: 1; }
.hm-game {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); height: 100%;
    border-radius: 28px; overflow: hidden; text-decoration: none; color: var(--sh-text) !important;
    background: var(--bg-surface); border: 1px solid var(--sh-border);
}
.hm-game-media { position: relative; min-height: clamp(220px, 52svh, 560px); overflow: hidden; }
.hm-game-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 7s linear; }
.bk-car-track > .is-current .hm-game-media img, .hm-game.is-current .hm-game-media img { transform: scale(1.12); }
.hm-game-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 55%, var(--bg-surface) 100%); }
.hm-game-body { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 14px; padding: clamp(20px, 3.4vw, 56px); }
.hm-game-no { font: 900 clamp(2.6rem, 1.8rem + 3vw, 5rem)/.9 var(--font-heading); background: var(--sh-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hm-game-no small { font-size: .35em; -webkit-text-fill-color: var(--text-secondary); color: var(--text-secondary); }
.hm-game strong { font: 900 clamp(1.5rem, 1.1rem + 1.6vw, 2.6rem)/1.02 var(--font-heading); text-transform: uppercase; }
.hm-game-desc { color: var(--text-secondary); font-size: clamp(.98rem, .94rem + .2vw, 1.1rem); line-height: 1.55; max-width: 38ch; }
.hm-game-go { pointer-events: none; margin-top: 6px; }

/* ---------- 07 Newsletter ---------- */
.hm-news { background: radial-gradient(60% 70% at 50% 40%, rgba(255,0,90,.14), transparent 70%), radial-gradient(40% 50% at 80% 80%, rgba(0,238,255,.08), transparent 70%); }
.hm-news-card { width: min(760px, 100%); text-align: center; display: flex; flex-direction: column; align-items: center; gap: clamp(14px, 2.6vh, 24px); }
.hm-news-card .vp-lead { margin: 0 auto; }
.hm-form { width: 100%; display: flex; flex-direction: column; gap: 14px; max-width: 600px; }
.hm-form-row { display: flex; gap: 10px; }
.hm-form .form-input { flex: 1; min-width: 0; min-height: 56px; border-radius: 16px; padding: 0 18px; font-size: 16px; background: var(--sh-surface); border: 1.5px solid var(--sh-border-2); color: var(--sh-text); }
.hm-form .form-input:focus { outline: none; border-color: var(--sh-accent); }
.hm-form .submit-btn { min-height: 56px; width: auto; margin: 0; white-space: nowrap; }
.hm-check { display: flex; gap: 12px; align-items: flex-start; text-align: left; font-size: .9rem; color: var(--text-secondary); line-height: 1.45; cursor: pointer; }
.hm-check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--sh-accent); }
.hm-check a { color: var(--sh-accent) !important; }
.hm-news-status { margin: 0; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.hm-news-status.is-ok { background: rgba(46,229,157,.12); color: #2ee59d; }
.hm-news-status.is-err { background: rgba(255,80,100,.12); color: #ff6b7d; }

/* ============ iPad landscape / small laptops ============ */
@media (min-width: 1024px) and (max-width: 1279px) {
    .hm-training .hm-car { --per: 3; }
}
/* ============ iPad portrait ============ */
@media (min-width: 768px) and (max-width: 1023px) {
    .hm-car, .hm-training .hm-car { --per: 2; }
    .hm-principles .bk-car-track { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-principle { padding: 18px 20px; gap: 6px; }
    .hm-note-media, .hm-train-media, .hm-tool-media { height: clamp(170px, 27svh, 360px); }
    .hm-game { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .hm-game-media { min-height: clamp(240px, 38svh, 460px); }
    .hm-game-media::after { background: linear-gradient(0deg, var(--bg-surface) 0%, transparent 45%); }
}
/* ============ phone ============ */
@media (max-width: 767px) {
    .hm-car, .hm-training .hm-car, .hm-principles { --per: 1.12; --gap: 12px; }
    .home .bk-car-track { grid-auto-columns: 86%; }
    .hm-principle { gap: 8px; padding: 20px; }
    .hm-principle p { font-size: .95rem; }
    .hm-note-media, .hm-train-media, .hm-tool-media { height: clamp(110px, 24svh, 230px); }
    .hm-note-body, .hm-train-body, .hm-tool-body { padding: 14px 16px 16px; gap: 6px; }
    .home .hm-stage .bk-car-track { grid-auto-columns: 100%; }
    .hm-game { grid-template-columns: 1fr; grid-template-rows: auto 1fr; border-radius: 22px; }
    .hm-game-media { min-height: clamp(150px, 28svh, 300px); }
    .hm-game-media::after { background: linear-gradient(0deg, var(--bg-surface) 0%, transparent 50%); }
    .hm-game-body { gap: 8px; padding: 4px 18px 20px; }
    .hm-game-no { font-size: 2.4rem; }
    .hm-game-desc { font-size: .95rem; }
    .hm-form-row { flex-direction: column; }
    .hm-form .submit-btn { width: 100%; }
    .home .hero-content { padding-bottom: calc(var(--sh-bot-h) + 40px); }
}
/* very short phones (iPhone SE class): tighten type so each scene still fits */
@media (max-width: 767px) and (max-height: 700px) {
    .vp-title { font-size: 1.75rem; }
    .vp-head .bk-eyebrow { margin-bottom: 6px; }
    .hm-note-ex, .hm-train-desc, .hm-tool-desc { -webkit-line-clamp: 2; font-size: .88rem; }
    .hm-game-desc { display: none; }
    .bk-car-ui { margin-top: 6px; }
}
/* landscape phones: scenes may grow — keep media modest */
@media (max-height: 500px) and (orientation: landscape) {
    .hm-note-media, .hm-train-media, .hm-tool-media { height: 38svh; }
    .hm-game { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
    .hm-game-media { min-height: 60svh; }
    .hm-car, .hm-training .hm-car { --per: 2.2; }
}

/* ============ height-aware tuning (short laptops, SE-class phones) ============ */
@media (min-width: 768px) and (max-height: 860px) {
    .vp-title { font-size: clamp(1.8rem, 1.1rem + 2.4vw, 3.2rem); }
    .hm-principle { padding: 18px 22px; gap: 6px; }
    .hm-principle-no { font-size: 2rem; }
    .hm-note-media, .hm-train-media, .hm-tool-media { height: clamp(120px, 23svh, 230px); }
    .hm-game-media { min-height: clamp(200px, 46svh, 420px); }
    .hm-game-body { gap: 10px; padding: clamp(18px, 2.6vw, 40px); }
    .hm-game-no { font-size: 3rem; }
    .hm-game strong { font-size: clamp(1.4rem, 1rem + 1.3vw, 2.1rem); }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .hm-game-body { padding: 8px 28px 26px; gap: 10px; }
    .hm-game-no { font-size: 2.8rem; }
    .hm-game-media { min-height: clamp(220px, 32svh, 420px); }
}
@media (max-width: 767px) {
    .hm-game-media { min-height: clamp(140px, 24svh, 260px); }
    .hm-game-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .hm-game-go { min-height: 48px; }
}
@media (max-width: 767px) and (max-height: 700px) {
    .home .hero-headline, .home .hero-headline-word { font-size: 2.2rem !important; }
    .home .hero-cta { flex-direction: row !important; gap: 10px; }
    .home .hero-cta .cta-btn { flex: 1 1 0; padding: 0 .8rem; min-height: 50px; }
    .home .hero-subtitle { font-size: .95rem !important; line-height: 1.5 !important; margin-bottom: 18px !important; }
    .home .hero-content { padding-bottom: calc(var(--sh-bot-h) + 20px); }
    .home .hero-scroll-indicator { display: none; }
    .hm-note-media, .hm-train-media, .hm-tool-media { height: 20svh; }
    .hm-note-ex, .hm-train-desc, .hm-tool-desc { display: none; }
    .hm-game-media { min-height: 20svh; }
    .hm-game-no { font-size: 2rem; }
    .hm-game strong { font-size: 1.3rem; }
    .vp { gap: 12px; }
}

@media (max-width: 767px) {
    .home .hero-cta { flex-direction: row !important; flex-wrap: nowrap; gap: 10px; width: 100%; max-width: 420px; margin-inline: auto; }
    .home .hero-cta .cta-btn { flex: 1 1 0; min-width: 0; padding: 0 .7rem; white-space: nowrap; font-size: .76rem; }
    .vp-head > .vp-link { top: -10px; font-size: .7rem; letter-spacing: .1em; }
}
@media (max-width: 767px) and (max-height: 700px) {
    .hm-game-body .hm-tag { display: none; }
    .hm-game-body { gap: 6px; padding-bottom: 14px; }
    .hm-game-go { min-height: 44px; margin-top: 2px; }
}
