/* SI RAILWAY — home v4: floating real product windows, scroll-driven line map, workshop wall */

/* ---------- hero stage: real UI floating on the right ---------- */
.hero-stage { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }
@media (min-width: 1100px) { .hero-stage { display: block; } }
.win { position: absolute; width: var(--w); transform: translate3d(calc(var(--px, 0) * var(--d, 10) * 1px), calc(var(--py, 0) * var(--d, 10) * 1px), 0); transition: transform .5s cubic-bezier(.2,.7,.2,1); opacity: 0; animation: winIn 1.4s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--delay, 1s); }
@keyframes winIn { from { opacity: 0; margin-top: 40px; filter: blur(8px); } to { opacity: 1; margin-top: 0; filter: none; } }
.win-in { border-radius: 22px; overflow: hidden; border: 1px solid rgba(243,244,242,.16); background: var(--ink-3);
  box-shadow: 0 50px 90px -30px rgba(0,0,0,.85), 0 0 60px -10px rgba(85,224,160,.12); animation: floaty 9s ease-in-out infinite alternate; animation-delay: var(--fd, 0s); }
@keyframes floaty { from { transform: translateY(-7px) rotate(var(--r0, -.4deg)); } to { transform: translateY(9px) rotate(var(--r1, .5deg)); } }
.win img { width: 100%; height: auto; display: block; }
.win .crop-mimi { width: 100%; aspect-ratio: 430 / 495; background: url("/assets/img/mimi-store.jpg") no-repeat; background-size: 297.7% auto; background-position: 91.8% 15.7%; }
.w1 { --w: min(21vw, 330px); right: 5.5vw; top: 13vh; --d: 16; --delay: 1.0s; }
.w2 { --w: min(22vw, 340px); right: 3vw; top: 56vh; --d: 26; --delay: 1.25s; --fd: -3s; --r0: .6deg; --r1: -.5deg; }
.w3 { --w: min(9.6vw, 150px); right: 27vw; top: 10vh; --d: 34; --delay: 1.5s; --fd: -5s; }
.win .tag { position: absolute; left: 10px; bottom: 8px; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,244,242,.7); background: rgba(7,8,10,.6); padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(6px); }

/* ---------- the line map (scroll story) ---------- */
.story { position: relative; padding-top: clamp(80px, 12vw, 160px); }
.story-intro { padding-bottom: clamp(40px, 6vw, 80px); }
.story-pin { position: relative; }
.st { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(24px, 5vw, 80px); align-items: center; padding-block: clamp(36px, 5vw, 72px); border-top: 1px solid var(--line); }
.st .num { font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; color: var(--text-3); margin-bottom: 18px; display: flex; gap: 14px; align-items: center; }
.st .num b { font-weight: 500; color: var(--text); }
.st h3 { font-family: var(--f-display); font-weight: 700; font-size: clamp(34px, 5vw, 72px); line-height: 1.12; letter-spacing: -.015em; margin: 14px 0 18px; }
.st .st-lead { color: var(--text-2); max-width: 28em; font-size: clamp(15px, 1.25vw, 17.5px); line-height: 1.95; }
.st .facts { margin-top: 26px; }
.st .links { margin-top: 26px; }
.st-visual { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); min-height: 280px; display: grid; place-items: center; padding: clamp(18px, 3vw, 44px); }
.st-visual::before { content: ""; position: absolute; inset: 0; background: var(--bg, radial-gradient(80% 90% at 50% 40%, #16222a, #0a0c0e)); }
.st-visual > * { position: relative; }
.st-visual .cap { position: absolute; left: 16px; bottom: 12px; z-index: 2; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(243,244,242,.65); }
.frame { border-radius: 12px; overflow: hidden; border: 1px solid rgba(243,244,242,.14); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); background: #0b0d10; width: 100%; }
.frame .chrome { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: #15181c; border-bottom: 1px solid rgba(243,244,242,.08); }
.frame .chrome i { width: 9px; height: 9px; border-radius: 50%; background: #3a3f45; }
.frame .chrome span { margin-left: 10px; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); letter-spacing: .04em; }
.frame img { width: 100%; height: auto; display: block; }
.v-mimi { --bg: radial-gradient(70% 90% at 30% 20%, #0f2a52, #060a14 70%); gap: clamp(16px, 3vw, 40px); display: flex; align-items: center; justify-content: center; }
.v-mimi .pop { width: 280px; max-width: 70%; flex: none; border-radius: 22px; overflow: hidden; box-shadow: 0 40px 80px -24px rgba(0,0,0,.9), 0 0 80px -10px rgba(60,140,255,.35); }
.v-mimi .pop .crop-mimi { width: 100%; aspect-ratio: 430 / 495; background: url("/assets/img/mimi-store.jpg") no-repeat; background-size: 297.7% auto; background-position: 91.8% 15.7%; }
.v-mimi .say { font-family: var(--f-display); font-weight: 700; font-size: clamp(22px, 3vw, 40px); line-height: 1.35; max-width: 7em; }
.v-mimi .say small { display: block; margin-top: 12px; font-family: var(--f-mono); font-weight: 400; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.v-nano { --bg: linear-gradient(160deg, #a9c4e6, #d9d2c5); }
.v-nano img { width: min(100%, 560px); border-radius: 14px; box-shadow: 0 30px 60px -20px rgba(20,30,50,.5); }
.v-yk { --bg: radial-gradient(80% 90% at 50% 20%, #1a2330, #0a0c0e); }
.v-hr { --bg: radial-gradient(80% 90% at 50% 20%, #2a2118, #0a0c0e); display: flex; gap: clamp(14px, 2.4vw, 30px); align-items: flex-end; justify-content: center; }
.v-hr .frame { flex: 1 1 62%; }
.v-hr .phone { flex: 0 0 22%; border-radius: 22px; overflow: hidden; border: 1px solid rgba(243,244,242,.2); box-shadow: 0 40px 80px -30px rgba(0,0,0,.8); }
.v-hr .phone img { width: 100%; height: auto; display: block; }
.v-fusen { --bg: radial-gradient(80% 90% at 40% 30%, #14201c, #080a0b); display: flex; gap: clamp(14px, 3vw, 36px); align-items: center; justify-content: center; }
.v-fusen .list { flex: 0 0 34%; border-radius: 14px; overflow: hidden; border: 1px solid rgba(243,244,242,.16); box-shadow: 0 40px 80px -30px rgba(0,0,0,.85); }
.v-fusen .list img { width: 100%; height: auto; display: block; }
.v-fusen .strip { flex: 1 1 56%; display: grid; gap: 14px; }
.v-fusen .strip .bar { border-radius: 10px; overflow: hidden; border: 1px solid rgba(243,244,242,.16); box-shadow: 0 24px 50px -20px rgba(0,0,0,.8); }
.v-fusen .strip .bar img { width: 100%; height: auto; display: block; }
.v-fusen .strip p { font-family: var(--f-display); font-weight: 700; font-size: clamp(18px, 2.2vw, 28px); line-height: 1.5; }

/* pinned (JS-enhanced) mode */
@media (min-width: 981px) {
  .story.live { height: calc(100svh + var(--n, 5) * 78svh); padding-top: 0; }
  .story.live .story-intro { position: absolute; top: 0; left: 0; right: 0; height: 0; padding: 0; overflow: visible; }
  .story.live .story-pin { position: sticky; top: 0; height: 100svh; display: grid; grid-template-rows: auto 1fr auto; padding: 96px 0 26px; }
  .story.live .story-title { display: flex; justify-content: space-between; align-items: end; gap: 24px; }
  .story.live .story-title .h-section { margin: 0; font-size: clamp(26px, 3.2vw, 46px); }
  .story.live .cards { position: relative; }
  .story.live .st { position: absolute; inset: 0; border: 0; padding: 0; opacity: 0; visibility: hidden; transform: translateY(26px) scale(.985); transition: opacity .7s ease, transform .9s cubic-bezier(.2,.7,.2,1), visibility 0s .7s; }
  .story.live .st.on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .story.live .st-visual { height: min(58svh, 560px); min-height: 0; }
  .story.live .st h3 { font-size: clamp(32px, 4.4vw, 64px); }
  .story.live .map { display: block; }
}
.map { display: none; position: relative; margin-top: 14px; padding-bottom: 6px; }
.map-line { position: relative; height: 26px; }
.map-line::before, .map-line::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line-2); }
.map-line::before { top: 9px; }
.map-line::after { top: 15px; }
.map-fill { position: absolute; left: 0; top: 9px; height: 7px; width: calc(var(--p, 0) * 100%); border-top: 1px solid var(--signal); border-bottom: 1px solid var(--signal); box-shadow: 0 0 14px rgba(85,224,160,.5); }
.map-head { position: absolute; top: 5px; left: calc(var(--p, 0) * 100%); width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 5px rgba(85,224,160,.18), 0 0 26px 4px rgba(85,224,160,.6); }
.stn { position: absolute; top: 0; left: calc(var(--i) / (var(--n) - 1) * 100%); transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; background: none; border: 0; padding: 0; color: var(--text-3); cursor: pointer; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.stn::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--ink); border: 1px solid var(--line-2); margin-top: 7px; transition: border-color .3s, background .3s; }
.stn span { margin-top: 20px; transition: color .3s; position: absolute; top: 12px; }
.stn.on, .stn.done { color: var(--text); }
.stn.done::before { border-color: var(--signal); background: var(--signal); }
.stn.on::before { border-color: var(--signal); background: var(--ink); }
.stn:first-child { transform: none; justify-items: start; }
.stn:last-child { transform: translateX(-100%); justify-items: end; }
.map { padding-bottom: 34px; }

/* ---------- workshop wall ---------- */
.wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(12px, 1.6vw, 22px); }
.tile2 { position: relative; display: grid; grid-template-rows: auto 1fr; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--ink-2); transition: border-color .3s, transform .5s cubic-bezier(.2,.7,.2,1); }
.tile2:hover { border-color: rgba(85,224,160,.55); transform: translateY(-5px); }
.tile2 .art { aspect-ratio: 5 / 3; display: grid; place-items: center; position: relative; overflow: hidden; background: radial-gradient(120% 120% at var(--x, 25%) var(--y, 15%), rgba(85,224,160,.16), transparent 55%), linear-gradient(160deg, #12171c, #090b0d); }
.tile2 .art img { width: 34%; height: auto; border-radius: 22%; box-shadow: 0 18px 40px -12px rgba(0,0,0,.8); transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile2:hover .art img { transform: scale(1.08) rotate(-3deg); }
.tile2 .art .g { font-family: var(--f-display); font-weight: 700; font-size: clamp(44px, 5.6vw, 76px); line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(243,244,242,.55); transition: color .5s, -webkit-text-stroke-color .5s; }
.tile2:hover .art .g { color: rgba(243,244,242,.92); }
.tile2 .art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(85,224,160,.16), transparent 60%); opacity: 0; transition: opacity .3s; }
.tile2:hover .art::after { opacity: 1; }
.tile2 .tb { padding: 16px 18px 20px; display: grid; gap: 8px; align-content: start; }
.tile2 h3 { font-family: var(--f-display); font-weight: 700; font-size: 19px; line-height: 1.4; margin: 0; }
.tile2 p { font-size: 13px; line-height: 1.75; color: var(--text-2); }
.tile2 .kind { font-family: var(--f-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }

/* ---------- manifesto band ---------- */
.band { overflow: hidden; padding-block: clamp(48px, 8vw, 110px); border-block: 1px solid var(--line); }
.band-row { display: flex; width: max-content; gap: .6em; font-family: var(--f-sans); font-weight: 600; font-size: clamp(64px, 13vw, 210px); line-height: 1; letter-spacing: -.03em; text-transform: uppercase; white-space: nowrap; transform: translateX(calc(var(--sy, 0px) * -.35)); }
.band-row + .band-row { margin-top: .08em; transform: translateX(calc(var(--sy, 0px) * .3 - 2400px)); }
.band-row span { color: transparent; -webkit-text-stroke: 1px rgba(243,244,242,.5); }
.band-row span:nth-child(3n+1) { color: var(--text); -webkit-text-stroke: 0; }
.band-row i { font-style: normal; color: var(--signal); -webkit-text-stroke: 0; }

/* ---------- open source chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 10px; padding: 11px 16px; border: 1px solid var(--line-2); border-radius: 99px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; color: var(--text-2); transition: border-color .25s, color .25s, background .25s; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transition: background .25s; }
.chip:hover { border-color: var(--signal); color: var(--text); background: rgba(85,224,160,.07); }
.chip:hover::before { background: var(--signal); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .wall { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 980px) {
  .st { grid-template-columns: 1fr; }
  .st-visual { order: -1; min-height: 240px; }
  .v-mimi { flex-direction: column; text-align: center; }
  .v-mimi .pop { width: min(260px, 70%); }
  .v-hr .frame { flex-basis: 66%; }
}
@media (max-width: 700px) { .wall { grid-template-columns: repeat(2, 1fr); } .tile2 .tb { padding: 12px 14px 16px; } .tile2 h3 { font-size: 16px; } .tile2 p { font-size: 12px; } }
@media (max-width: 420px) { .wall { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) {
  .win { opacity: 1 !important; animation: none !important; transition: none !important; }
  .win-in { animation: none !important; }
  .band-row, .band-row + .band-row { transform: none !important; }
  .story.live .st { transition: none !important; }
}

/* home: HUD collides with floating windows */
.hero .hud { display: none; }

/* the same visuals inside Work page features (beats .feature .visual { display: grid }) */
.feature .visual.v-mimi, .feature .visual.v-hr, .feature .visual.v-fusen { display: flex; padding: clamp(14px, 2.4vw, 32px); }
.feature .visual.v-mimi { background: radial-gradient(70% 90% at 30% 20%, #0f2a52, #060a14 70%); }
.feature .visual.v-yk { background: radial-gradient(80% 90% at 50% 20%, #1a2330, #0a0c0e); padding: clamp(14px, 2.4vw, 32px); }
.feature .visual.v-hr { background: radial-gradient(80% 90% at 50% 20%, #2a2118, #0a0c0e); }
.feature .visual.v-fusen { background: radial-gradient(80% 90% at 40% 30%, #14201c, #080a0b); }
.story-count { }
.story:not(.live) .story-count { display: none; }

.light .v-fusen .strip p, .light .v-mimi .say, .light .v-hr, .light .v-yk { color: var(--text); }
