/* ============================================================
   FoxDim — «Маршрут»: стартовый экран, 3D-оверлей, HUD, карточки
   Built on FoxDim tokens (tokens.css). Night canvas, one orange accent.
   ============================================================ */

/* ============================================================ START SCREEN */
.start {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: flex-end; overflow: hidden; isolation: isolate;
  background: var(--bg-0);
}
.start-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
  background: var(--bg-0) url("../media/hero-world.webp") center / cover no-repeat;
}
/* live 3D world behind the hero (desktop); the video/poster stays underneath until it is ready */
.start-world { position: absolute; inset: 0; z-index: -2; opacity: 0; transition: opacity 1.4s var(--ease-brand); pointer-events: none; }
.start-world canvas { display: block; width: 100% !important; height: 100% !important; }
.start.is-live .start-world { opacity: 1; }
.start-video { transition: opacity 1.4s var(--ease-brand); }
.start.is-live .start-video { opacity: 0; }
.start-shade {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,5,5,.92) 0%, rgba(5,5,5,.72) 34%, rgba(5,5,5,.18) 68%, rgba(5,5,5,.05) 100%),
    linear-gradient(0deg, rgba(5,5,5,.95) 0%, rgba(5,5,5,0) 46%),
    linear-gradient(180deg, rgba(5,5,5,.7) 0%, rgba(5,5,5,0) 22%);
}
.start-body { width: 100%; padding-top: 140px; padding-bottom: clamp(88px, 13vh, 150px); }
.start-body .eyebrow { margin-bottom: 22px; animation: fadeUp .9s var(--ease-brand) both .1s; }
.start-name {
  margin: 0; font-size: clamp(3.2rem, 8.2vw, 8.4rem); line-height: .9; font-weight: var(--w-extralight);
  letter-spacing: -.03em; color: var(--white); max-width: 10ch;
}
.start-name span { display: inline-block; animation: fadeUp 1s var(--ease-brand) both; }
.start-name span:nth-child(2) { animation-delay: .12s; color: var(--fg-2); }
.start-lead {
  margin: 28px 0 36px; max-width: 46ch; font-size: 19px; line-height: 1.65;
  font-weight: var(--w-light); color: var(--fg-2); animation: fadeUp 1s var(--ease-brand) both .3s;
}
.start-ctas { display: flex; flex-wrap: wrap; gap: 14px; animation: fadeUp 1s var(--ease-brand) both .42s; }
.start-note { margin: 20px 0 0; font-size: 13px; font-weight: var(--w-light); color: var(--fg-4); letter-spacing: .02em; animation: fadeUp 1s var(--ease-brand) both .52s; }

.start-go { position: relative; overflow: hidden; min-width: 290px; justify-content: center; }
.start-go .go-ico { width: 22px; height: 22px; display: inline-flex; }
.start-go .go-ico svg { width: 100%; height: 100%; }
.start-go.is-loading { background: rgba(var(--accent-rgb), .16); color: var(--fg-1); border-color: var(--accent-line); }
.start-go.is-loading::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(var(--accent-rgb), .35) 50%, transparent 80%);
  transform: translateX(-100%); animation: goShimmer 1.4s ease-in-out infinite;
}
@keyframes goShimmer { to { transform: translateX(100%); } }

.start-sound {
  position: absolute; right: 32px; bottom: 32px; z-index: 3;
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 16px; border-radius: var(--r-cta); font: inherit; font-size: 13px; font-weight: var(--w-light);
  color: var(--fg-2); background: rgba(12,12,12,.5); border: 1px solid var(--line-white); backdrop-filter: blur(10px);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.start-sound:hover, .start-sound.on { border-color: var(--accent); color: var(--fg-1); }
.start-sound .eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.start-sound .eq i { width: 2px; height: 3px; background: currentColor; border-radius: 1px; }
.start-sound.on .eq i { background: var(--accent); animation: eq .9s ease-in-out infinite; }
.start-sound.on .eq i:nth-child(2) { animation-delay: -.3s; }
.start-sound.on .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

.start-scroll {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-4); font-weight: var(--w-light);
}
.start-scroll .line { width: 1px; height: 36px; background: linear-gradient(var(--accent), transparent); animation: scrollLine 2.2s ease-in-out infinite; }

@media (max-width: 768px) {
  .start { align-items: flex-end; }
  .start-shade { background: linear-gradient(0deg, rgba(5,5,5,.98) 0%, rgba(5,5,5,.9) 55%, rgba(5,5,5,.62) 100%); }
  .start-body .eyebrow { letter-spacing: .12em; }
  .start-lead { font-size: 16px; margin: 20px 0 28px; }
  .start-go { min-width: 0; width: 100%; }
  .start-ctas .btn { width: 100%; justify-content: center; }
  .start-sound, .start-scroll { display: none; }
}

/* ============================================================ ROUTE OVERLAY */
body.route-open { overflow: hidden; }
.route {
  position: fixed; inset: 0; z-index: 9000; background: #08090c; color: var(--fg-1);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .6s var(--ease-brand), visibility .6s;
}
.route.open { opacity: 1; visibility: visible; pointer-events: auto; }
.rw-stage { position: absolute; inset: 0; }
.rw-canvas { display: block; touch-action: none; cursor: grab; }
.rw-canvas:active { cursor: grabbing; }

.rw-wait {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 14px;
  font-size: clamp(1.4rem, 3vw, 2.2rem); font-weight: var(--w-light); color: var(--fg-2);
}
.route.is-waiting .rw-wait { display: flex; }
.route.is-waiting .rw-top, .route.is-waiting .rw-bottom { opacity: 0; }

/* glass surface shared by HUD pieces */
.rw-glass, .rw-card, .rw-hint, .rw-toast, .rw-label, .rw-chip, .rw-list {
  background: rgba(14, 14, 16, .72);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid rgba(255,255,255,.09);
}

/* ---------- top bar */
.rw-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 24px; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,9,12,.85), rgba(8,9,12,0));
  transition: opacity .4s;
}
.rw-top > * { pointer-events: auto; }
.rw-brand { display: flex; align-items: baseline; gap: 10px; font-size: 15px; letter-spacing: .04em; }
.rw-brand b { font-weight: var(--w-regular); color: var(--white); }
.rw-brand span:not(.rw-brand-mark) { font-weight: var(--w-extralight); color: var(--fg-3); }
.rw-brand-mark { align-self: center; width: 26px; height: 26px; background: url("../favicon.svg") center / contain no-repeat; border-radius: 6px; }
.rw-top-right { display: flex; align-items: center; gap: 10px; }
.rw-top-right .btn { padding: 10px 20px; }

.rw-chip {
  width: 40px; height: 40px; border-radius: 50%; flex: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 17px; color: var(--fg-2);
  transition: border-color var(--dur-fast), color var(--dur-fast), transform var(--dur-fast) var(--ease-brand);
}
.rw-chip:hover { border-color: var(--accent); color: var(--accent); }
.rw-chip:active { transform: scale(.94); }
.rw-close { font-size: 22px; }

/* ---------- station card */
.rw-card {
  position: absolute; z-index: 5; right: 24px; top: 84px; bottom: 92px; width: min(410px, 36vw);
  border-radius: var(--r-xl); padding: 28px 28px 26px; overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateX(28px); pointer-events: none;
  transition: opacity .45s var(--ease-brand), transform .55s var(--ease-brand);
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.rw-card.open { opacity: 1; transform: none; pointer-events: auto; }
.rw-card-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-right: 64px; }
.rw-card-kicker span { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: var(--w-regular); }
.rw-draft {
  font-style: normal; font-size: 11px; letter-spacing: .02em; color: #f5b46a; white-space: nowrap;
  padding: 3px 9px; border: 1px dashed rgba(245,180,106,.55); border-radius: var(--r-pill);
}
.rw-card-title { margin: 14px 0 14px; font-size: clamp(1.9rem, 2.6vw, 2.4rem); line-height: 1.05; font-weight: var(--w-light); letter-spacing: -.02em; color: var(--white); }
.rw-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rw-card-tags span { font-size: 12px; color: var(--fg-2); padding: 5px 12px; border: 1px solid var(--line-white); border-radius: var(--r-pill); font-weight: var(--w-light); }
.rw-card-line { margin: 0 0 18px; font-size: 16px; line-height: 1.6; color: var(--fg-1); font-weight: var(--w-light); }
.rw-card-hint { margin: 0 0 22px; font-size: 14px; line-height: 1.6; color: var(--fg-3); font-weight: var(--w-light); }
.rw-card-ps { margin: 0 0 18px; display: grid; gap: 14px; }
.rw-card-ps div { padding-left: 14px; border-left: 2px solid var(--line-2); }
.rw-card-ps div:last-child { border-left-color: var(--accent); }
.rw-card-ps dt { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); margin-bottom: 5px; }
.rw-card-ps dd { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); font-weight: var(--w-light); }
.rw-card-metric { display: flex; align-items: baseline; gap: 12px; padding: 14px 0 18px; border-top: 1px solid var(--line-1); }
.rw-card-metric b { white-space: nowrap; font-size: 30px; line-height: 1; font-weight: var(--w-bold); color: var(--accent); letter-spacing: -.02em; }
.rw-card-metric span { font-size: 13px; line-height: 1.45; color: var(--fg-3); }
.rw-card-metric .rw-muted { color: var(--fg-4); font-style: italic; }
.rw-card-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rw-card-actions .btn { padding: 12px 22px; }
.rw-soon { font-size: 13px; color: var(--fg-4); padding: 0 6px; }

.rw-stamp {
  position: absolute; top: 18px; right: 18px; width: 66px; height: 66px; border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), .8); color: var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  transform: rotate(-14deg); opacity: .9;
  box-shadow: inset 0 0 0 4px rgba(var(--accent-rgb), .12);
}
.rw-stamp span { font-size: 20px; font-weight: var(--w-bold); }
.rw-stamp small { font-size: 9px; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
.rw-stamp.is-new { animation: stampIn .7s cubic-bezier(.2, 1.6, .4, 1) .35s both; }
@keyframes stampIn { from { opacity: 0; transform: rotate(-30deg) scale(2.2); } to { opacity: .9; transform: rotate(-14deg) scale(1); } }

/* ---------- bottom bar: route track + путевой лист */
.rw-bottom {
  position: absolute; left: 24px; right: 24px; bottom: 22px; z-index: 4;
  display: flex; align-items: center; gap: 14px; transition: opacity .4s;
}
.rw-track { position: relative; flex: 1; height: 2px; margin: 0 14px; background: rgba(255,255,255,.14); border-radius: 2px; }
.rw-node {
  position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; padding: 0; border-radius: 50%;
  background: #18191d; border: 1.5px solid var(--line-3); cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast) var(--ease-brand);
}
.rw-node::before { content: ""; position: absolute; inset: -10px; }
.rw-node.is-home { border-radius: 3px; }
.rw-node:hover { transform: scale(1.3); border-color: var(--accent); }
.rw-node.is-visited { background: var(--accent); border-color: var(--accent); }
.rw-node.is-current { box-shadow: 0 0 0 5px rgba(var(--accent-rgb), .22); border-color: var(--accent); }
.rw-node-tip {
  position: absolute; bottom: 22px; left: 50%; transform: translate(-50%, 4px);
  font-size: 12px; white-space: nowrap; color: var(--fg-1); padding: 5px 10px; border-radius: 8px;
  background: rgba(14,14,16,.9); border: 1px solid var(--line-2);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.rw-node:hover .rw-node-tip, .rw-node:focus-visible .rw-node-tip { opacity: 1; transform: translate(-50%, 0); }
.rw-truck {
  position: absolute; top: 50%; left: 0; width: 18px; height: 10px; margin: -5px 0 0 -9px; border-radius: 3px;
  background: var(--accent); box-shadow: 0 0 14px rgba(var(--accent-rgb), .8); pointer-events: none; z-index: 2;
}
.rw-list {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; flex: none;
  padding: 10px 16px; border-radius: var(--r-cta); font: inherit; font-size: 13px; color: var(--fg-2);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), color var(--dur-fast);
}
.rw-list b { color: var(--fg-1); font-weight: var(--w-medium); }
.rw-list:hover { border-color: var(--accent); color: var(--fg-1); }
.rw-list.is-ready { border-color: var(--accent); color: var(--fg-1); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.rw-list.is-ready b { color: var(--accent); }

/* ---------- controls hint */
.rw-hint {
  position: absolute; left: 24px; bottom: 76px; z-index: 4; border-radius: var(--r-lg);
  padding: 14px 16px; display: grid; gap: 8px; font-size: 13px; color: var(--fg-3); font-weight: var(--w-light);
  opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .4s, transform .4s var(--ease-brand);
}
.rw-hint.open { opacity: 1; transform: none; }
.rw-hint kbd {
  display: inline-block; min-width: 22px; padding: 2px 7px; margin-right: 4px; border-radius: 6px; text-align: center;
  font: inherit; font-size: 12px; color: var(--fg-1); background: rgba(255,255,255,.06); border: 1px solid var(--line-2);
}

/* ---------- toast */
.rw-toast {
  position: absolute; left: 50%; bottom: 80px; z-index: 6; max-width: min(620px, calc(100% - 32px));
  display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 20px; border-radius: var(--r-lg);
  font-size: 14px; line-height: 1.5; color: var(--fg-1); font-weight: var(--w-light);
  border-color: var(--accent-line);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .45s, transform .5s var(--ease-brand);
}
.rw-toast.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rw-toast .btn { padding: 10px 18px; flex: none; }
.rw-x { flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--fg-3); font-size: 22px; cursor: pointer; }
.rw-x:hover { color: var(--accent); }

/* ---------- station labels in the 3D scene */
.rw-labels { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.rw-label {
  position: absolute; left: 0; top: 0; display: flex; align-items: baseline; gap: 8px; cursor: pointer;
  padding: 7px 12px; border-radius: 10px; white-space: nowrap; font: inherit; font-size: 13px; color: var(--fg-1);
  transition: opacity .3s, border-color .3s, background .3s; will-change: transform;
}
.rw-label::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 18px;
  background: linear-gradient(rgba(var(--accent-rgb), .7), transparent);
}
.rw-label b { color: var(--accent); font-weight: var(--w-semibold); font-size: 12px; letter-spacing: .04em; }
.rw-label span { font-weight: var(--w-regular); }
.rw-label em { font-style: normal; color: var(--fg-3); font-weight: var(--w-light); }
.rw-label:hover, .rw-label.is-current { border-color: var(--accent); background: rgba(24, 14, 8, .82); }

/* ---------- showreel lightbox */
.rw-reel {
  position: fixed; inset: 0; z-index: 100001; display: flex; align-items: center; justify-content: center;
  background: rgba(3,3,4,.9); opacity: 0; transition: opacity .35s;
}
.rw-reel.open { opacity: 1; }
.rw-reel-in { position: relative; width: min(1280px, 92vw); }
.rw-reel video { display: block; width: 100%; border-radius: 14px; background: #000; box-shadow: 0 40px 120px rgba(0,0,0,.6); }
.rw-reel .rw-x { position: absolute; top: -44px; right: -6px; color: var(--fg-1); font-size: 28px; }

/* ---------- route on phones: card becomes a bottom sheet */
@media (max-width: 768px) {
  .rw-top { padding: 12px 12px; }
  .rw-top-right .btn { display: none; }
  .rw-brand span:not(.rw-brand-mark) { display: none; }
  .rw-card {
    left: 10px; right: 10px; top: auto; bottom: 70px; width: auto; max-height: 50vh;
    padding: 22px 20px 20px; border-radius: 18px; transform: translateY(24px);
  }
  .rw-card-title { font-size: 1.7rem; margin: 10px 0; }
  .rw-card-ps dd { font-size: 14px; }
  .rw-stamp { width: 52px; height: 52px; top: 14px; right: 14px; }
  .rw-stamp span { font-size: 16px; }
  .rw-bottom { left: 10px; right: 10px; bottom: 14px; gap: 8px; }
  .rw-track { margin: 0 8px; }
  .rw-node { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
  .rw-node-tip { display: none; }
  .rw-list span { display: none; }
  .rw-hint { left: 10px; right: 10px; bottom: 70px; }
  .rw-label em { display: none; }
  .rw-label { font-size: 12px; padding: 5px 9px; }
  .rw-toast { bottom: 70px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .route, .rw-card, .rw-toast, .rw-hint { transition: opacity .2s; transform: none !important; }
  .rw-stamp.is-new { animation: none; }
}

/* ============================================================ QUICK VIEW additions */
.proj-card .cover-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(var(--accent-rgb), .14), transparent 60%),
    repeating-linear-gradient(135deg, #0d0e10 0 14px, #101114 14px 28px);
}
.proj-card .cover-soon span { font-size: 26px; font-weight: var(--w-light); color: var(--fg-1); margin-top: -18%; }
.proj-card .cover-soon small { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.proj-card.contain .cover { background: #0b0c0e; }
.proj-card.contain .cover img { object-fit: contain; object-position: center 22%; padding: 18px 18px 40%; }
@media (max-width: 640px) { .proj-card.contain .cover img { padding: 12px; object-position: center; } .proj-card .cover-soon span { margin-top: 0; } }
.projects .proj-card:nth-child(n+10)::before { content: counter(proj); }

.contact .ic img { width: 20px; height: 20px; }
.socials a img { width: 18px; height: 18px; opacity: .75; transition: opacity var(--dur-fast); }
.socials a:hover img { opacity: 1; }
.tool img { flex: none; }

/* ============================================================ DRIVING HUD (v3) */
.rw-speed {
  display: flex; align-items: baseline; gap: 5px; flex: none; min-width: 74px;
  font-variant-numeric: tabular-nums; color: var(--fg-3); font-size: 11px; letter-spacing: .08em;
}
.rw-speed b { font-size: 26px; line-height: 1; font-weight: var(--w-light); color: var(--fg-1); letter-spacing: -.02em; }

/* parking chip — appears when the truck stops at a station */
.rw-park {
  position: absolute; left: 50%; bottom: 84px; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: var(--r-cta);
  font-size: 14px; color: var(--fg-1); cursor: pointer; white-space: nowrap;
  background: rgba(20, 14, 10, .82); border: 1px solid var(--accent-line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 40px rgba(0,0,0,.45);
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none;
  transition: opacity .3s, transform .4s var(--ease-brand);
}
.rw-park.open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.rw-park span { font-weight: var(--w-regular); }
.rw-park em { font-style: normal; color: var(--fg-3); font-weight: var(--w-light); }
.rw-park kbd {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--bg-1); background: var(--accent); animation: kbdNudge 1.6s ease-in-out infinite;
}
.rw-park.is-left kbd { animation-name: kbdNudgeL; }
@keyframes kbdNudge { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes kbdNudgeL { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-4px); } }
.rw-park .btn { padding: 8px 18px; }

/* touch pedals (phones / tablets only) */
.rw-pedals { display: none; }
@media (pointer: coarse) {
  .rw-pedals {
    position: absolute; right: 12px; bottom: 74px; z-index: 5; display: flex; gap: 10px; align-items: flex-end;
  }
  .rw-pedal {
    width: 58px; height: 58px; border-radius: 16px; font: inherit; font-size: 18px; color: var(--fg-1);
    background: rgba(14,14,16,.78); border: 1px solid var(--line-2); touch-action: none; user-select: none; -webkit-user-select: none;
  }
  .rw-pedal.is-gas { height: 84px; font-size: 14px; background: rgba(var(--accent-rgb), .22); border-color: var(--accent); }
  .rw-pedal.on { background: var(--accent); color: var(--bg-1); }
  .route .rw-card.open ~ .rw-pedals { opacity: .0; pointer-events: none; }
  .rw-park { bottom: 168px; }
}
@media (max-width: 768px) {
  .rw-speed { display: none; }
}

/* ============================================================ GALLERY (screens + story) */
.rg {
  position: fixed; inset: 0; z-index: 100001; display: grid; grid-template-columns: minmax(0, 1fr) 420px;
  background: rgba(6, 6, 8, .96); color: var(--fg-1);
  opacity: 0; transition: opacity .25s ease;
}
.rg.open { opacity: 1; }
.rg-stage { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 28px 28px 18px; gap: 16px; }
.rg-view { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.rg-view img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; display: block;
  box-shadow: 0 30px 90px rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.06);
  animation: rgIn .35s var(--ease-brand);
}
.rg-view img.is-tall { border-radius: 22px; }
@keyframes rgIn { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
.rg-empty { color: var(--fg-4); font-size: 15px; padding: 40px; border: 1px dashed var(--line-2); border-radius: 14px; }
.rg-nav {
  position: absolute; top: calc(50% - 40px); width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  font: inherit; font-size: 20px; color: var(--fg-1); background: rgba(14,14,16,.8); border: 1px solid var(--line-2);
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.rg-nav:hover { border-color: var(--accent); color: var(--accent); }
.rg-prev { left: 14px; } .rg-next { right: 14px; }
.rg-thumbs { display: flex; gap: 10px; justify-content: center; overflow-x: auto; flex: none; padding: 2px; }
.rg-thumb {
  flex: none; width: 92px; height: 58px; padding: 0; border-radius: 8px; overflow: hidden; cursor: pointer;
  background: #111; border: 1px solid var(--line-2); opacity: .55; transition: opacity .2s, border-color .2s;
}
.rg-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.rg-thumb:hover { opacity: .85; }
.rg-thumb.on { opacity: 1; border-color: var(--accent); }

.rg-side {
  min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 30px 30px 26px;
  background: #0d0d0f; border-left: 1px solid var(--line-1);
  display: flex; flex-direction: column; gap: 22px;
  scrollbar-width: thin; scrollbar-color: var(--line-3) transparent;
}
.rg-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rg-head h3 { margin: 10px 0 12px; font-size: 2.1rem; line-height: 1.05; font-weight: var(--w-light); letter-spacing: -.02em; color: var(--white); text-wrap: balance; }
.rg-shot { padding: 18px 18px 16px; border-radius: 14px; background: rgba(var(--accent-rgb), .07); border: 1px solid var(--accent-line); }
.rg-count { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.rg-shot h4 { margin: 0 0 8px; font-size: 18px; font-weight: var(--w-medium); color: var(--fg-1); }
.rg-shot p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--fg-2); font-weight: var(--w-light); }
.rg-story { display: grid; gap: 16px; }
.rg-story h4 { margin: 0 0 5px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-4); font-weight: var(--w-regular); }
.rg-story p { margin: 0; font-size: 14.5px; line-height: 1.65; color: var(--fg-2); font-weight: var(--w-light); max-width: 60ch; }
.rg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.rg-actions .btn { padding: 12px 22px; }
.rg-x {
  position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 50%; z-index: 2; cursor: pointer;
  font: inherit; font-size: 22px; color: var(--fg-2); background: rgba(14,14,16,.85); border: 1px solid var(--line-2);
}
.rg-x:hover { border-color: var(--accent); color: var(--accent); }
.rg :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 960px) {
  .rg { grid-template-columns: 1fr; grid-template-rows: minmax(0, 56vh) minmax(0, 1fr); }
  .rg-stage { padding: 56px 12px 10px; }
  .rg-side { border-left: 0; border-top: 1px solid var(--line-1); padding: 20px 16px 22px; }
  .rg-nav { top: calc(50% - 24px); width: 40px; height: 40px; }
  .rg-thumbs { justify-content: flex-start; }
  .rg-thumb { width: 64px; height: 42px; }
  .rg-head h3 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) { .rg-view img { animation: none; } .rw-park kbd { animation: none; } }

/* phones: compact station card — details live in the gallery */
@media (max-width: 768px) {
  .rw-card { max-height: 44vh; }
  .rw-card-ps, .rw-card .rw-card-metric:has(.rw-muted) { display: none; }
  .rw-card-line { font-size: 15px; margin-bottom: 14px; }
  .rw-card-tags { margin-bottom: 12px; }
}
/* quick view: no index numbers on project cards */
.projects .proj-card::before { content: none !important; }

/* ============================================================ v6 · project stack (variant B) */
#projects { overflow-x: clip; }
.pstack { position: relative; margin-top: 48px; }
.pstack-bar { display: flex; align-items: center; gap: 24px; margin-bottom: 26px; }
.pstack-hint {
  display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--accent-line); background: rgba(var(--accent-rgb), .06); color: var(--fg-1);
  font-size: 14px; font-weight: var(--w-regular); cursor: pointer; white-space: nowrap; transition: opacity .4s, border-color .3s;
}
.pstack-hint:hover { border-color: rgba(var(--accent-rgb), .6); }
.pstack-hint .ph-ico { position: relative; width: 34px; height: 18px; border-radius: 9px; border: 1.5px solid rgba(var(--accent-rgb), .7); }
.pstack-hint .ph-ico i { position: absolute; top: 3px; left: 4px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: phDot 1.8s var(--ease-brand) infinite; }
.pstack-hint .ph-arr { color: var(--accent); display: inline-block; animation: phArr 1.8s var(--ease-brand) infinite; }
.pstack-hint.used { opacity: .55; }
.pstack-hint.used .ph-ico i, .pstack-hint.used .ph-arr { animation: none; }
@keyframes phDot { 0%, 15% { transform: translateX(0); } 60%, 100% { transform: translateX(13px); opacity: .2; } }
@keyframes phArr { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }
.pstack-prog { flex: 1; height: 2px; background: var(--line-1); border-radius: 2px; overflow: hidden; min-width: 40px; }
.pstack-prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.pstack-count { display: inline-flex; align-items: baseline; gap: 6px; color: var(--fg-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.pstack-count b { color: var(--accent); font-size: 22px; font-weight: var(--w-regular); }
.pstack-nav { display: flex; gap: 10px; }
.ps-btn { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--fg-1); background: var(--surface-1); border: 1px solid var(--line-1); cursor: pointer; transition: border-color .25s, color .25s, opacity .25s; }
.ps-btn svg { width: 20px; height: 20px; }
.ps-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ps-btn:disabled { opacity: .3; cursor: default; }

.pstack-track {
  --cw: clamp(280px, 27vw, 372px); --gap: 22px;
  position: relative; display: flex; gap: var(--gap); overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin-inline: calc(50% - 50vw); padding: 8px max(var(--space-page), calc(50vw - 50% + 0px)) 36px;
  padding-inline: max(var(--space-page), calc((100vw - var(--maxw)) / 2 + var(--space-page)));
  outline: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.pstack-track::-webkit-scrollbar { display: none; }
.pstack-track.dragging { cursor: grabbing; }
.pstack-track.dragging .pcard { pointer-events: none; }
.pstack-track:focus-visible { box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), .35); border-radius: var(--r-xl); }

.pcard {
  position: relative; flex: 0 0 var(--cw); aspect-ratio: 4 / 5; border-radius: var(--r-xl); overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end; background: var(--bg-0); border: 1px solid var(--line-1);
  transform-origin: 0 50%; will-change: transform; color: inherit; text-decoration: none;
  box-shadow: -18px 0 40px -18px rgba(0, 0, 0, .9); transition: border-color var(--dur-mid);
  --dim: 0;
}
.pcard::after { content: ""; position: absolute; inset: 0; z-index: 4; background: #050505; opacity: var(--dim); pointer-events: none; }
.pcard .cover { position: absolute; inset: 0; z-index: 0; }
.pcard .cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transition: transform .7s var(--ease-brand); -webkit-user-drag: none; }
.pcard .scrim { position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(5,5,5,0) 0%, rgba(5,5,5,0) 40%, rgba(5,5,5,.6) 64%, rgba(5,5,5,.97) 100%); }
.pcard .spot { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity var(--dur-mid); background: radial-gradient(320px circle at var(--mx,50%) var(--my,50%), rgba(var(--accent-rgb),.18), transparent 60%); }
.pcard .body { position: relative; z-index: 3; padding: 26px; }
.pcard .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pcard .tag { font-size: 12px; font-weight: var(--w-light); letter-spacing: .04em; color: var(--fg-1); padding: 5px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: var(--r-pill); background: rgba(8,8,10,.72); backdrop-filter: blur(6px); }
.pcard h3 { margin: 0; font-size: var(--t-card); font-weight: var(--w-medium); color: var(--accent); }
.pcard p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--fg-2); font-weight: var(--w-light); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .go { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--fg-1); transition: gap var(--dur-fast), color var(--dur-fast); }
.pcard:hover { border-color: var(--accent-line); }
.pcard:hover .cover img { transform: scale(1.06); }
.pcard:hover .spot { opacity: 1; }
.pcard:hover .go { gap: 16px; color: var(--accent); }
.pcard.stacked .spot { opacity: 0; }

.pcard-end { background: radial-gradient(120% 80% at 20% 0%, rgba(var(--accent-rgb), .22), transparent 60%), var(--surface-1); border-color: var(--accent-line); cursor: default; }
.pcard-end .body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.pcard-end .eyebrow { margin-bottom: 8px; }
.pcard-end h3 { font-size: 28px; line-height: 1.2; color: var(--fg-1); font-weight: var(--w-light); }
.pcard-end p { -webkit-line-clamp: unset; margin-bottom: 16px; }
.pcard-end .btn { cursor: pointer; }
.ps-restart { margin-top: 10px; background: none; border: 0; padding: 6px 0; color: var(--fg-3); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.ps-restart:hover { color: var(--accent); }

@media (max-width: 768px) {
  .pstack { margin-top: 28px; }
  .pstack-bar { gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
  .pstack-prog { order: 5; flex-basis: 100%; }
  .pstack-nav { display: none; }
  .pstack-count { margin-left: auto; }
  .pstack-track { --cw: min(78vw, 340px); --gap: 14px; padding-inline: 16px; padding-bottom: 24px; }
  .pcard .body { padding: 20px; }
  .pcard p { font-size: 14px; }
}
/* dragging the view must not select page text */
#route { -webkit-user-select: none; user-select: none; }
#route .rw-card, #route .rg-story { -webkit-user-select: text; user-select: text; }
.start.is-live .start-sound { display: none; }
.start-world .rw-labels { display: none; }

/* phones: a still frame of the 3D world instead of the showreel */
@media (max-width: 768px) { .start-video { background-image: url("../media/hero-world-m.webp"); object-position: center top; } }
.rw-proto svg { margin-left: 4px; vertical-align: -2px; }
