/* ==========================================================================
   enginyurtseven.com — journey.css
   Scroll-driven "computer build" journey (built by journey.js):
   sticky stage, background, data wires, flying parts, monitor + screen
   panels, HUD, part animation hooks (EY.parts), responsive & reduced motion.
   z-index inside the stage: bg 0 · wires 1 · parts 2 · monitor 3 ·
   front parts / HUD 4.
   ========================================================================== */

@property --scene-c {
  syntax: '<color>';
  inherits: true;
  initial-value: #22d3ee;
}

/* ---------- Section & scene markers ---------- */
.journey { position: relative; }

.journey.is-mounted {
  --jr-n: 6;
  height: calc(var(--jr-n) * 100vh);
}
@supports (height: 100svh) {
  .journey.is-mounted { height: calc(var(--jr-n) * 100svh); }
}

.scene-marker {
  position: absolute;
  left: 0;
  top: calc(var(--i, 0) * 100vh);
  width: 1px;
  height: 1px;
  pointer-events: none;
  visibility: hidden;
}
@supports (height: 100svh) {
  .scene-marker { top: calc(var(--i, 0) * 100svh); }
}

/* ---------- Sticky stage ---------- */
.journey-stage {
  --p: 0;
  --sp: 0;
  --scene-c: #22d3ee;
  --scr-h: min(560px, 60vh);
  --mon-w: min(900px, 62vw, calc(var(--scr-h) * 1.8));
  --scr-fs: clamp(12px, calc(.55vw + .7vh), 15px);
  --band-b: 0px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
  transition: --scene-c .9s ease;
}
@supports (overflow: clip) {
  .journey-stage { overflow: clip; }
}
@supports (height: 100svh) {
  .journey-stage {
    --scr-h: min(560px, 60svh);
    --scr-fs: clamp(12px, calc(.55vw + .7svh), 15px);
    height: 100svh;
  }
}

.journey-stage[data-glow="cyan"] { --scene-c: #22d3ee; }
.journey-stage[data-glow="violet"] { --scene-c: #a78bfa; }
.journey-stage[data-glow="green"] { --scene-c: #34d399; }
.journey-stage[data-glow="amber"] { --scene-c: #fbbf24; }
.journey-stage[data-glow="pink"] { --scene-c: #f472b6; }

/* ---------- Background: circuit board, glow, floating code ---------- */
.jr-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.jr-bg__grid {
  position: absolute;
  left: 0;
  top: -140px;
  width: 100%;
  max-width: none;
  height: calc(100% + 280px);
  transform: translate3d(0, calc(var(--p) * -140px), 0);
  -webkit-mask-image: radial-gradient(ellipse 72% 64% at 50% 52%, #000 22%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 64% at 50% 52%, #000 22%, transparent 78%);
}
.jr-bg__glow {
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(1200px, 130vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--scene-c), transparent 72%);
  opacity: .13;
  transform: translate3d(-50%, -50%, 0);
}
.jr-bg__glow--2 {
  left: 82%;
  top: 18%;
  width: min(700px, 80vw);
  background: radial-gradient(closest-side, #a78bfa, transparent 70%);
  opacity: .08;
  transform: translate3d(-50%, calc(-50% + var(--p) * 160px), 0);
}
.jr-bg__code { position: absolute; inset: 0; }
.jr-snippet {
  position: absolute;
  font: 500 12px/1 var(--font-mono);
  color: rgba(139, 152, 179, .3);
  white-space: nowrap;
  transform: translate3d(0, calc(var(--p) * var(--z, 1) * -220px), 0);
}
.jr-snippet:nth-child(odd) { color: rgba(34, 211, 238, .22); }
.jr-snippet:nth-child(3n) { color: rgba(167, 139, 250, .24); }

/* ---------- Data wires ---------- */
.jr-wires {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.jr-wires.is-on { opacity: 1; }
.jr-wire {
  fill: none;
  stroke: rgba(120, 160, 255, .26);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 1s var(--ease-out);
}
.jr-wires.is-on .jr-wire { stroke-dashoffset: 0; }
.jr-wire__pulse {
  fill: none;
  stroke: var(--scene-c);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 7 93;
  stroke-dashoffset: 100;
  opacity: 0;
}
.jr-wires.is-on .jr-wire__pulse {
  opacity: .95;
  animation: jr-wire-pulse 2.4s linear infinite;
  animation-delay: var(--d, 0s);
}
.jr-wire__pulse--alt { stroke: #a78bfa; }
.jr-wires.is-on .jr-wire__pulse--alt { animation-duration: 3.2s; }
.jr-wire__node {
  fill: #05070d;
  stroke: var(--scene-c);
  stroke-width: 1.6;
}
@keyframes jr-wire-pulse {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

/* ---------- Parts layer ---------- */
.jr-parts,
.scene-parts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.part {
  --fx: 0px;
  --fy: 70vh;
  --fr: 12deg;
  position: absolute;
  z-index: 2;
  left: var(--x, 50%);
  top: var(--y, 50%);
  width: var(--w, 20vw);
  transform: translate(-50%, -50%);
  transition:
    transform 1.05s var(--ease-out),
    opacity .55s ease,
    visibility 0s linear 0s;
  transition-delay: calc(var(--i, 0) * 80ms);
  will-change: transform, opacity;
}
.part--front { z-index: 4; }

/* slot fly vectors (where a part comes from / returns to) */
.part--left { --fx: -58vw; --fy: 6vh; --fr: -38deg; }
.part--right { --fx: 58vw; --fy: 6vh; --fr: 38deg; }
.part--top { --fx: 0px; --fy: -75vh; --fr: -14deg; }
.part--bottom { --fx: 0px; --fy: 72vh; --fr: 9deg; }
.part--top-left { --fx: -52vw; --fy: -48vh; --fr: -52deg; }
.part--top-right { --fx: 52vw; --fy: -48vh; --fr: 52deg; }
.part--bottom-left { --fx: -46vw; --fy: 58vh; --fr: -30deg; }
.part--bottom-right { --fx: 46vw; --fy: 58vh; --fr: 30deg; }

/* not reached yet → waits off-screen at its slot */
.scene-parts.is-before .part,
.journey-stage.is-waiting .part {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) translate3d(var(--fx), var(--fy), 0) rotate(var(--fr)) scale(.55);
  transition:
    transform .85s cubic-bezier(.55, 0, .75, .3),
    opacity .5s ease .2s,
    visibility 0s linear .9s;
}
/* already passed → flies out the other way (upwards) */
.scene-parts.is-after .part {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%) translate3d(calc(var(--fx) * -.3), -80vh, 0) rotate(calc(var(--fr) * -1)) scale(.7);
  transition:
    transform .85s cubic-bezier(.55, 0, .75, .3),
    opacity .5s ease .2s,
    visibility 0s linear .9s;
}

/* .part__drift: scroll parallax transform is written by journey.js */
.part__float {
  animation: jr-float 6.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -1.9s);
}
.part__svg {
  position: relative;
  transform: rotate(var(--rot, 0deg));
}
.part__svg::before {
  content: "";
  position: absolute;
  inset: 8% 4% -10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .6), transparent);
}
.part__svg::after {
  content: "";
  position: absolute;
  inset: -12%;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--scene-c), transparent);
  opacity: .12;
}
.part__svg > svg,
.part-svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  overflow: visible;
}

@keyframes jr-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, -10px, 0) rotate(.8deg); }
}

/* ---------- Monitor ---------- */
.jr-monitor-wrap {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: calc(var(--header-h) + (100% - var(--header-h) - var(--band-b)) * .5);
  width: var(--mon-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
}
.jr-monitor {
  position: relative;
  width: 100%;
  padding: 10px 10px 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #1b2440 0%, #111829 55%, #0c1220 100%);
  box-shadow:
    0 0 0 1px rgba(120, 160, 255, .16),
    inset 0 1px 0 rgba(255, 255, 255, .09),
    0 50px 100px -40px rgba(0, 0, 0, .95);
}
.jr-monitor::before {
  content: "";
  position: absolute;
  inset: -10% -8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--scene-c), transparent);
  opacity: .14;
  pointer-events: none;
}
.jr-bezel {
  position: relative;
  padding: 2px;
  border-radius: 10px;
  background: #020409;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .8);
}

/* ---------- Screen ---------- */
.jr-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--scr-h);
  overflow: hidden;
  border-radius: 8px;
  background:
    radial-gradient(120% 90% at 50% 0%, #0c1528 0%, #070b16 58%, #04060c 100%);
}
.jr-titlebar {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 34px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(19, 27, 48, .96), rgba(14, 20, 36, .96));
  font: 500 12px/1 var(--font-mono);
  color: var(--text-mute);
}
.jr-titlebar .term__dots i { width: 10px; height: 10px; }
.jr-titlebar__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jr-titlebar__clock {
  flex: none;
  min-width: 5ch;
  text-align: right;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.jr-screen__body {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* screen overlays: scanlines + flicker, glare/vignette, power line */
.jr-screen__fx,
.jr-screen__glare,
.jr-screen__power {
  position: absolute;
  pointer-events: none;
}
.jr-screen__fx {
  inset: 0;
  z-index: 2;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .028) 0 1px, transparent 1px 3px);
  animation: jr-flicker 7s linear infinite;
}
.jr-screen__glare {
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, .065) 0%, rgba(255, 255, 255, .018) 26%, transparent 40%),
    radial-gradient(110% 70% at 50% -12%, rgba(34, 211, 238, .07), transparent 62%);
  box-shadow: inset 0 0 90px rgba(0, 0, 0, .55);
}
.jr-screen__power {
  left: 0;
  right: 0;
  top: 50%;
  z-index: 4;
  height: 2px;
  margin-top: -1px;
  background: #e8fbff;
  box-shadow: 0 0 18px 2px rgba(34, 211, 238, .9);
  opacity: 0;
  transform: scaleX(0);
}

@keyframes jr-flicker {
  0%, 100% { opacity: .85; }
  4% { opacity: 1; }
  6% { opacity: .8; }
  50% { opacity: .92; }
  52% { opacity: .78; }
  54% { opacity: .95; }
}

/* off → power on (thin horizontal line expands to the full screen) */
.jr-screen.is-off { clip-path: inset(50% 0 50% 0); }
.jr-screen.is-off .jr-screen__body,
.jr-screen.is-off .jr-titlebar { opacity: 0; }
.jr-screen.is-powering { animation: jr-power-on .76s var(--ease-out) both; }
.jr-screen.is-powering .jr-screen__power { animation: jr-power-line .76s ease-out both; }
@keyframes jr-power-on {
  0% { clip-path: inset(50% 50% 50% 50%); filter: brightness(2.6); }
  30% { clip-path: inset(49.5% 0 49.5% 0); filter: brightness(2.6); }
  100% { clip-path: inset(0 0 0 0); filter: brightness(1); }
}
@keyframes jr-power-line {
  0% { opacity: 1; transform: scaleX(0); }
  30% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

/* scene switch: short CRT glitch (RGB split + slices) */
.jr-screen.is-glitch .screen-panel.is-active { animation: jr-glitch .32s steps(1, end) both; }
.jr-screen.is-glitch .jr-screen__fx { animation: jr-glitch-fx .32s steps(1, end) both; }
@keyframes jr-glitch {
  0% {
    clip-path: inset(8% 0 64% 0);
    transform: translate3d(-7px, 0, 0);
    text-shadow: 2px 0 rgba(244, 114, 182, .8), -2px 0 rgba(34, 211, 238, .8);
  }
  20% { clip-path: inset(46% 0 24% 0); transform: translate3d(6px, 0, 0); }
  40% { clip-path: inset(72% 0 6% 0); transform: translate3d(-4px, 0, 0); }
  60% {
    clip-path: inset(0 0 76% 0);
    transform: translate3d(5px, 0, 0);
    text-shadow: -2px 0 rgba(244, 114, 182, .8), 2px 0 rgba(34, 211, 238, .8);
  }
  80% { clip-path: inset(28% 0 38% 0); transform: translate3d(-2px, 0, 0); }
  100% { clip-path: inset(0 0 0 0); transform: none; text-shadow: none; }
}
@keyframes jr-glitch-fx {
  0% { opacity: 1; background-color: rgba(34, 211, 238, .06); }
  50% { opacity: .6; background-color: rgba(244, 114, 182, .05); }
  100% { opacity: .85; background-color: transparent; }
}

/* ---------- Chin & stand ---------- */
.jr-chin {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 30px;
}
.jr-chin__brand {
  font: 700 10px/1 var(--font-display);
  letter-spacing: .55em;
  padding-left: .55em;
  color: rgba(139, 152, 179, .6);
}
.jr-chin__led {
  position: absolute;
  right: 20px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  transition: background-color .4s ease, box-shadow .4s ease;
}
.journey-stage.is-waiting .jr-chin__led {
  background: #fbbf24;
  box-shadow: 0 0 8px #fbbf24;
}
.jr-stand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.jr-stand__neck {
  display: block;
  width: 13%;
  height: clamp(22px, 5vh, 54px);
  background: linear-gradient(90deg, #0b101c 0%, #1c2540 50%, #0b101c 100%);
  clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%);
}
.jr-stand__base {
  display: block;
  width: 32%;
  height: 10px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #222c48, #0c111e);
  box-shadow: 0 16px 30px -8px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .08);
}

/* ---------- Screen panels (shared) ---------- */
.screen-panel {
  position: absolute;
  inset: 0;
  padding: clamp(12px, 2.4vh, 26px) clamp(14px, 2.2vw, 30px);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #26324f transparent;
  font: 400 var(--scr-fs)/1.6 var(--font-mono);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 14px, 0);
  transition: opacity .3s ease, transform .5s var(--ease-out), visibility 0s linear .5s;
}
.screen-panel.is-after { transform: translate3d(0, -14px, 0); }
.screen-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .4s ease .12s, transform .6s var(--ease-out) .12s, visibility 0s linear 0s;
}
.screen-panel:focus { outline: none; }
.screen-panel p,
.screen-panel h1,
.screen-panel h2,
.screen-panel h3,
.screen-panel ul,
.screen-panel ol,
.screen-panel pre { margin: 0; }
.screen-panel ul,
.screen-panel ol { padding: 0; list-style: none; }
.screen-panel .btn { font-size: .82rem; }

.sp-prompt {
  margin-bottom: .75em !important;
  overflow: hidden;
  color: var(--text-dim);
  font-size: .92em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sp-prompt .prompt-cmd { color: var(--text); }
.sp-title {
  margin-bottom: .55em !important;
  font: 700 1.2em/1.3 var(--font-display);
  color: var(--text);
}
.sp-empty { color: var(--text-mute); }

/* syntax tokens */
.tk-kw { color: var(--accent-2); }
.tk-str { color: var(--accent-3); }
.tk-prop { color: var(--accent); }
.tk-num { color: var(--warn); }
.tk-com { color: var(--text-mute); }
.tk-pun { color: var(--text-dim); }
.tk-var { color: var(--text); }

/* ---------- boot: BIOS POST + hero ---------- */
.screen-panel--boot {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bt-post {
  position: absolute;
  inset: 0;
  padding: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.screen-panel--boot.is-posting .bt-post { opacity: 1; }
.bt-post__log {
  font: inherit;
  font-size: .95em;
  line-height: 1.7;
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
}
.bt-post__line { display: block; }
.bt-post__line.is-title { margin-bottom: .6em; color: var(--accent); font-weight: 700; }
.bt-post__line:last-child::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-left: .15em;
  vertical-align: -.15em;
  background: var(--accent);
  animation: jr-caret 1s steps(1) infinite;
}
.bt-ok { color: var(--accent-3); font-weight: 700; }

.bt-hero {
  transition: opacity .6s ease .1s, transform .8s var(--ease-out) .1s;
}
.screen-panel--boot:not(.is-booted) .bt-hero {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  pointer-events: none;
}
.bt-name {
  margin: .05em 0 .22em !important;
  font: 700 clamp(1.7rem, .9rem + 2.4vw + 1.2vh, 3.7rem)/1.04 var(--font-display);
  letter-spacing: -.02em;
  color: #fff;
  background: linear-gradient(100deg, #ffffff 8%, #a5f3fc 52%, #c4b5fd 96%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bt-caret {
  display: inline-block;
  width: .42em;
  height: .82em;
  margin-left: .1em;
  vertical-align: -.04em;
  border-radius: 2px;
  background: var(--accent);
  -webkit-text-fill-color: initial;
  animation: jr-caret 1.1s steps(1) infinite;
}
.bt-role {
  margin-bottom: .5em !important;
  color: var(--accent);
  font-size: 1.08em;
  font-weight: 500;
}
.bt-tagline {
  max-width: 48ch;
  margin-bottom: .95em !important;
  font: 400 1.04em/1.55 var(--font-sans);
  color: var(--text-dim);
}
.bt-status {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  width: -moz-fit-content;
  width: fit-content;
  margin-bottom: 1.15em !important;
  padding: .32em .85em;
  border: 1px solid rgba(52, 211, 153, .36);
  border-radius: 999px;
  background: rgba(52, 211, 153, .08);
  color: var(--accent-3);
  font-size: .84em;
}
.bt-status.is-busy {
  border-color: rgba(251, 191, 36, .36);
  background: rgba(251, 191, 36, .08);
  color: var(--warn);
}
.bt-status__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.bt-status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: jr-ping 2.2s ease-out infinite;
}
.bt-cta { display: flex; flex-wrap: wrap; gap: 10px; }

@keyframes jr-caret { 50% { opacity: 0; } }
@keyframes jr-ping {
  0% { opacity: 1; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(3); }
}

/* ---------- cpu: about.ts ---------- */
.cp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(14px, 2.4vw, 34px);
  align-items: start;
}
.code {
  overflow: hidden;
  font: inherit;
  font-size: .94em;
  line-height: 1.68;
  white-space: pre;
  counter-reset: ln;
}
.code code { font: inherit; }
.code-line {
  position: relative;
  display: block;
  padding-left: 2.7em;
}
.code-line::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute;
  left: 0;
  width: 1.8em;
  text-align: right;
  color: var(--text-mute);
  opacity: .6;
}
.cp-para {
  margin-bottom: .7em !important;
  font: 400 .97em/1.62 var(--font-sans);
  color: var(--text-dim);
}
.cp-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(6px, 1vw, 12px);
  margin-top: clamp(10px, 2.2vh, 24px) !important;
}
.cp-stat {
  min-width: 0;
  padding: .55em .8em;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(14, 20, 36, .62);
}
.cp-stat__v {
  display: block;
  font: 700 1.5em/1.15 var(--font-display);
  color: var(--scene-c);
}
.cp-stat__l {
  display: block;
  overflow: hidden;
  font-size: .76em;
  line-height: 1.35;
  color: var(--text-dim);
  text-overflow: ellipsis;
}

/* ---------- ram: services ---------- */
.sv-total {
  margin: -.35em 0 .7em !important;
  color: var(--text-mute);
  font-size: .85em;
}
.sv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.4vh, 14px);
}
.sv-card {
  display: flex;
  align-items: flex-start;
  gap: .75em;
  min-width: 0;
  padding: .85em .9em;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(19, 27, 48, .72), rgba(10, 15, 28, .72));
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity .4s ease, transform .5s var(--ease-out), border-color .25s ease;
  transition-delay: calc(var(--i, 0) * 60ms + .15s);
}
.screen-panel.is-active .sv-card { opacity: 1; transform: none; }
.sv-card:hover { border-color: rgba(167, 139, 250, .4); }
.sv-card__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border: 1px solid rgba(167, 139, 250, .28);
  border-radius: 9px;
  background: rgba(167, 139, 250, .12);
  color: var(--accent-2);
}
.sv-icon { width: 1.3em; height: 1.3em; }
.sv-card__body { min-width: 0; }
.sv-card__title {
  margin-bottom: .25em !important;
  font: 600 .98em/1.3 var(--font-sans);
  color: var(--text);
}
.sv-card__text {
  display: -webkit-box;
  overflow: hidden;
  font: 400 .84em/1.5 var(--font-sans);
  color: var(--text-dim);
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ---------- gpu: skills.json ---------- */
.sk-cols {
  column-count: 2;
  column-gap: clamp(16px, 3vw, 42px);
}
.sk-group {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin-bottom: .55em;
}
.sk-group__title { margin-bottom: .1em !important; }
.sk-list { padding-left: 1.2em !important; }
.sk-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 3.3em;
  align-items: center;
  gap: .6em;
  line-height: 1.6;
  white-space: nowrap;
}
.sk-name { overflow: hidden; text-overflow: ellipsis; }
.sk-bar { letter-spacing: 0; }
.sk-bar__on { color: var(--scene-c); }
.sk-bar__off { color: rgba(91, 103, 130, .55); }
.sk-pct {
  text-align: right;
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

/* ---------- storage: git log ---------- */
.gl-list {
  position: relative;
  padding-left: 1.7em !important;
}
.gl-list::before {
  content: "";
  position: absolute;
  left: .5em;
  top: .55em;
  bottom: .8em;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--scene-c), rgba(120, 160, 255, .14));
}
.gl-commit {
  position: relative;
  padding-bottom: clamp(7px, 1.6vh, 16px);
  opacity: 0;
  transform: translate3d(-8px, 0, 0);
  transition: opacity .4s ease, transform .5s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 80ms + .15s);
}
.screen-panel.is-active .gl-commit { opacity: 1; transform: none; }
.gl-node {
  position: absolute;
  left: calc(-1.2em - 5px);
  top: .45em;
  width: 12px;
  height: 12px;
  border: 2px solid var(--scene-c);
  border-radius: 50%;
  background: #05070d;
}
.gl-commit.is-head .gl-node {
  background: var(--scene-c);
  box-shadow: 0 0 12px var(--scene-c);
}
.gl-head { font-size: .9em; }
.gl-hash { color: var(--warn); }
.gl-ref { color: var(--accent); font-weight: 700; }
.gl-date { color: var(--text-mute); }
.gl-title {
  margin: .08em 0 .14em !important;
  font: 600 1em/1.4 var(--font-sans);
  color: var(--text);
}
.gl-at { color: var(--accent-2); font-weight: 500; }
.gl-text {
  display: -webkit-box;
  overflow: hidden;
  font: 400 .86em/1.5 var(--font-sans);
  color: var(--text-dim);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ---------- network: git clone ---------- */
.gc-log p {
  overflow: hidden;
  color: var(--text-dim);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gc-log .gc-recv { color: var(--text); }
.gc-pct { color: var(--warn); font-variant-numeric: tabular-nums; }
.gc-bar { color: var(--scene-c); }
.gc-ok,
.gc-late { opacity: 0; transition: opacity .3s ease; }
.screen-panel.is-done .gc-ok,
.screen-panel.is-done .gc-late { opacity: 1; }
.gc-result { margin-top: 1em; }
.gc-done,
.gc-list {
  opacity: 0;
  transform: translate3d(0, 8px, 0);
  transition: opacity .45s ease, transform .55s var(--ease-out);
}
.screen-panel.is-done .gc-done,
.screen-panel.is-done .gc-list { opacity: 1; transform: none; }
.gc-done {
  margin-bottom: .45em !important;
  color: var(--accent-3);
  font-size: 1.08em;
  font-weight: 700;
}
.gc-list { margin-bottom: 1em !important; }
.gc-list li {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.gc-cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- HUD: desktop stepper ---------- */
.jr-stepper {
  position: absolute;
  z-index: 4;
  left: clamp(12px, 1.8vw, 30px);
  top: 50%;
  display: none;
  transform: translateY(-50%);
}
.jr-stepper__track {
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(120, 160, 255, .16);
}
.jr-stepper__fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  transform: scaleY(var(--p));
  transform-origin: 50% 0;
}
.jr-stepper__list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2.2vh, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.jr-step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  padding: 2px 6px 2px 0;
  border-radius: 8px;
  font: 500 11px/1 var(--font-mono);
  color: var(--text-mute);
  transition: color .25s ease;
}
.jr-step:hover { color: var(--text-dim); }
.jr-step:focus-visible { outline-offset: 2px; }
.jr-step__dot {
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(120, 160, 255, .38);
  border-radius: 50%;
  background: #05070d;
  transition: border-color .3s ease, background-color .3s ease, box-shadow .3s ease, transform .3s var(--ease-out);
}
.jr-step.is-done .jr-step__dot {
  border-color: rgba(34, 211, 238, .7);
  background: rgba(34, 211, 238, .3);
}
.jr-step.is-active { color: var(--text); }
.jr-step.is-active .jr-step__dot {
  border-color: var(--scene-c);
  background: var(--scene-c);
  box-shadow: 0 0 0 4px rgba(120, 160, 255, .12), 0 0 14px var(--scene-c);
  transform: scale(1.1);
}
.jr-step__idx { min-width: 2ch; }
.jr-step__text {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(5, 7, 13, .82);
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(-6px, 0, 0);
  transition: opacity .25s ease, transform .3s var(--ease-out);
}
.jr-step.is-active .jr-step__text,
.jr-step:hover .jr-step__text,
.jr-step:focus-visible .jr-step__text { opacity: 1; transform: none; }
.jr-step__code { color: var(--scene-c); font-weight: 700; }
.jr-step:not(.is-active) .jr-step__code { color: var(--accent); }
.jr-step__label { color: var(--text); }

/* ---------- HUD: phone / tablet progress + scene chip ---------- */
.jr-mhud {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: var(--header-h);
  pointer-events: none;
}
.jr-mhud__bar {
  display: block;
  height: 2px;
  overflow: hidden;
  background: rgba(120, 160, 255, .12);
}
.jr-mhud__fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(var(--p));
  transform-origin: 0 50%;
}
.jr-mhud__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 2 * var(--gutter));
  margin: 10px var(--gutter) 0;
  padding: 6px 11px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(5, 7, 13, .8);
  font: 500 11px/1 var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
}
.jr-mhud__code { color: var(--scene-c); font-weight: 700; }
.jr-mhud__label { overflow: hidden; color: var(--text); text-overflow: ellipsis; }

/* ---------- Scroll hint ---------- */
.jr-hint {
  position: absolute;
  z-index: 4;
  left: clamp(16px, 2.4vw, 36px);
  bottom: clamp(16px, 3vh, 32px);
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 11px/1 var(--font-mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--text-mute);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.journey-stage.is-start:not(.is-waiting) .jr-hint { opacity: 1; }
.jr-hint__mouse {
  position: relative;
  width: 18px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 10px;
}
.jr-hint__mouse i {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--accent);
  animation: jr-scroll-dot 1.6s ease-in-out infinite;
}
@keyframes jr-scroll-dot {
  0% { opacity: 0; transform: translate3d(0, -2px, 0); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(0, 9px, 0); }
}

/* ==========================================================================
   Part animation hooks (markup from parts.js; keyframes live here)
   ========================================================================== */
.part-svg .fan-blades {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: jr-spin var(--speed, 1.2s) linear infinite;
}
.part-svg .platter-sheen {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: jr-spin 9s linear infinite;
}
.part-svg .arm {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: jr-arm 2.6s ease-in-out infinite alternate;
}
.part-svg .key .key-glow {
  opacity: 0;
  animation: jr-key 2.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.part-svg .led {
  animation: jr-led 1.8s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.part-svg .signal {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: jr-signal 2.4s ease-out infinite;
  animation-delay: var(--d, 0s);
}
.part-svg .trace {
  stroke-dasharray: 10 90;
  animation: jr-trace 2.8s linear infinite;
  animation-delay: var(--d, 0s);
}
.part-svg .wheel { animation: jr-wheel 2s ease-in-out infinite; }
.part-svg .chip-glint {
  transform-box: view-box;
  animation: jr-glint 5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes jr-spin { to { transform: rotate(360deg); } }
@keyframes jr-arm {
  from { transform: rotate(-6deg); }
  to { transform: rotate(12deg); }
}
@keyframes jr-key {
  0%, 52%, 100% { opacity: 0; }
  16% { opacity: .9; }
}
@keyframes jr-led {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}
@keyframes jr-signal {
  0% { opacity: 0; transform: scale(.55); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.15); }
}
@keyframes jr-trace {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
@keyframes jr-wheel {
  0%, 55%, 100% { transform: translate(0, 0); }
  25% { transform: translate(0, 5px); }
}
@keyframes jr-glint {
  0% { opacity: 0; transform: translate(-70%, 0); }
  12% { opacity: 1; }
  40% { opacity: 0; transform: translate(90%, 0); }
  100% { opacity: 0; transform: translate(90%, 0); }
}

/* ---------- Pause everything that is not on screen ---------- */
.scene-parts:not(.is-active) *,
.journey-stage.is-waiting .scene-parts *,
.journey.is-offscreen *,
.journey.is-offscreen *::before,
.journey.is-offscreen *::after { animation-play-state: paused !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 1024px) {
  .jr-stepper { display: block; }
  .jr-mhud { display: none; }

  /* tmux-style status bar under the header — keeps the side bands free for parts */
  .jr-stepper {
    left: 50%;
    top: calc(var(--header-h) + 12px);
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(5, 7, 13, .72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transform: translateX(-50%);
  }
  .jr-stepper__track {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: -1px;
    width: auto;
    height: 2px;
  }
  .jr-stepper__fill {
    transform: scaleX(var(--p));
    transform-origin: 0 50%;
  }
  .jr-stepper__list { flex-direction: row; gap: 2px; }
  .jr-step {
    gap: 7px;
    min-height: 28px;
    padding: 4px 12px 4px 10px;
    border-radius: 999px;
    transition: color .25s ease, background-color .25s ease;
  }
  .jr-step.is-active { background: rgba(120, 160, 255, .1); }
  .jr-step__dot { width: 8px; height: 8px; border-width: 1.5px; }
  .jr-step.is-active .jr-step__dot { box-shadow: 0 0 10px var(--scene-c); transform: none; }
  .jr-step__idx { display: none; }
  .jr-step__text {
    padding: 0;
    border: 0;
    background: none;
    opacity: 1;
    transform: none;
  }
  .jr-step__sep,
  .jr-step__label { display: none; }
  .jr-step.is-active .jr-step__sep,
  .jr-step.is-active .jr-step__label { display: inline; }
}

/* short desktop screens: trim secondary text */
@media (min-width: 768px) and (max-height: 700px) {
  .cp-para.is-extra { display: none; }
  .gl-text { -webkit-line-clamp: 1; }
  .sv-card__text { -webkit-line-clamp: 2; }
}

/* tablet & phone: parts sit in bands above / below the monitor */
@media (max-width: 1023px) {
  .journey-stage {
    --scr-h: min(600px, 56vh);
    --mon-w: min(860px, 86vw, calc(var(--scr-h) * 1.75));
    --band-b: 12vh;
  }
  @supports (height: 100svh) {
    .journey-stage {
      --scr-h: min(600px, 56svh);
      --band-b: 12svh;
    }
  }
  .jr-monitor-wrap {
    top: calc(var(--header-h) + 40px + (100% - var(--header-h) - 40px - var(--band-b)) * .5);
  }
  .part {
    left: var(--mx, var(--x));
    top: var(--my, var(--y));
    width: calc(var(--mw, var(--w)) * .78);
  }
  .part__svg { transform: rotate(var(--mrot, var(--rot, 0deg))); }
  .part--hide-m { display: none; }
  .part--front { z-index: 2; }
  .jr-snippet--wide { display: none; }
  .jr-hint {
    left: auto;
    right: var(--gutter);
    top: calc(var(--header-h) + 14px);
    bottom: auto;
  }
}

/* phone */
@media (max-width: 767px) {
  .journey-stage {
    --scr-h: 54vh;
    --mon-w: min(94vw, calc(var(--scr-h) * 1.9));
    --band-b: 13vh;
    --scr-fs: clamp(11px, 1.6vh, 12px);
  }
  @supports (height: 100svh) {
    .journey-stage {
      --scr-h: 54svh;
      --band-b: 13svh;
      --scr-fs: clamp(11px, 1.6svh, 12px);
    }
  }
  .part { width: var(--mw, var(--w)); }
  .jr-monitor { padding: 6px 6px 0; border-radius: 14px; }
  .jr-bezel { border-radius: 9px; }
  .jr-chin { height: 22px; }
  .jr-chin__brand { font-size: 8px; }
  .jr-chin__led { right: 12px; width: 5px; height: 5px; margin-top: -2.5px; }
  .jr-stand__neck { width: 16%; height: 12px; }
  .jr-stand__base { width: 36%; height: 6px; }
  .jr-titlebar { height: 28px; gap: 8px; padding: 0 10px; font-size: 10px; }
  .jr-titlebar .term__dots { gap: 5px; }
  .jr-titlebar .term__dots i { width: 8px; height: 8px; }
  .jr-snippet { font-size: 10px; }
  .jr-hint__text { display: none; }

  .screen-panel { padding: 10px 12px; line-height: 1.5; }
  .screen-panel .btn { min-height: 38px; padding: .5em .85em; font-size: .74rem; }
  .sp-prompt { margin-bottom: .5em !important; }
  .sp-title { margin-bottom: .3em !important; font-size: 1.05em; }
  .bt-name { font-size: clamp(1.45rem, 7.4vw, 2rem); }
  .bt-tagline { font-size: .98em; line-height: 1.45; }
  .bt-status { margin-bottom: .9em !important; }
  .bt-cta,
  .gc-cta { gap: 8px; }

  .cp-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cp-code .sp-prompt,
  .code-line.is-extra,
  .cp-para.is-extra { display: none; }
  .code { line-height: 1.5; }
  .cp-para {
    display: -webkit-box;
    overflow: hidden;
    font-size: .95em;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }
  .cp-stats { gap: 5px; margin-top: 8px !important; }
  .cp-stat { padding: .4em .45em; border-radius: 8px; }
  .cp-stat__v { font-size: 1.15em; }
  .cp-stat__l {
    display: -webkit-box;
    font-size: .72em;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .sv-total { display: none; }
  .sv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .sv-card { align-items: center; gap: .5em; padding: .5em .55em; border-radius: 9px; }
  .sv-card__icon { width: 1.9em; height: 1.9em; border-radius: 7px; }
  .sv-card__title { margin: 0 !important; font-size: .92em; }
  .sv-card__text { display: none; }

  .sk-cols { column-count: 1; }
  .sk-group { margin-bottom: .3em; }
  .sk-row { line-height: 1.45; gap: .45em; }

  .gl-commit { padding-bottom: 6px; }
  .gl-text { -webkit-line-clamp: 1; }

  .gc-log .gc-recv { white-space: normal; }
  .gc-list { display: none; }
}

@media (max-width: 380px) {
  .jr-mhud__label { display: none; }
}

/* ==========================================================================
   Lite mode (html.lite: phones, tablets, low-power devices — set by core.js)
   Same scenes and part fly-ins; paint-heavy loops are switched off.
   ========================================================================== */
html.lite .journey-stage { transition: none; }
html.lite .part-svg *,
html.lite .jr-wire__pulse,
html.lite .jr-screen__fx { animation: none !important; }
html.lite .jr-wire__pulse { display: none; }
html.lite .jr-screen__fx { opacity: .85; }
html.lite .scene-parts:not(.is-active) .part { will-change: auto; }

/* ==========================================================================
   Reduced motion: crossfades only, no animations
   ========================================================================== */
html.reduced-motion .journey *,
html.reduced-motion .journey *::before,
html.reduced-motion .journey *::after { animation: none !important; }

html.reduced-motion .part,
html.reduced-motion .scene-parts.is-before .part,
html.reduced-motion .scene-parts.is-after .part,
html.reduced-motion .journey-stage.is-waiting .part {
  transform: translate(-50%, -50%) !important;
  transition: opacity .45s ease, visibility 0s linear .45s !important;
}
html.reduced-motion .scene-parts.is-active .part {
  transition: opacity .45s ease, visibility 0s linear 0s !important;
}
html.reduced-motion .part__drift,
html.reduced-motion .jr-bg__grid,
html.reduced-motion .jr-snippet { transform: none !important; }
html.reduced-motion .jr-bg__glow--2 { transform: translate3d(-50%, -50%, 0); }
html.reduced-motion .screen-panel,
html.reduced-motion .screen-panel.is-after {
  transform: none;
  transition: opacity .3s ease, visibility 0s linear .3s;
}
html.reduced-motion .screen-panel.is-active { transition: opacity .3s ease, visibility 0s linear 0s; }
html.reduced-motion .sv-card,
html.reduced-motion .gl-commit,
html.reduced-motion .bt-hero,
html.reduced-motion .gc-done,
html.reduced-motion .gc-list {
  transform: none !important;
  transition: opacity .3s ease !important;
}
html.reduced-motion .jr-screen.is-off { clip-path: none; }
html.reduced-motion .jr-wire { transition: none; stroke-dashoffset: 0; }
html.reduced-motion .jr-wire__pulse { display: none; }
html.reduced-motion .jr-step__text,
html.reduced-motion .jr-step__dot { transition: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .journey *,
  .journey *::before,
  .journey *::after { animation: none !important; }
  .jr-wire__pulse { display: none; }
}

/* ==========================================================================
   Print: show every screen panel as plain content
   ========================================================================== */
@media print {
  .journey.is-mounted { height: auto; }
  .journey-stage { position: static; height: auto; overflow: visible; }
  .jr-bg,
  .jr-wires,
  .jr-parts,
  .jr-stepper,
  .jr-mhud,
  .jr-hint,
  .jr-chin,
  .jr-stand,
  .jr-titlebar,
  .jr-screen__fx,
  .jr-screen__glare,
  .jr-screen__power,
  .bt-post { display: none !important; }
  .jr-monitor-wrap { position: static; width: auto; transform: none; }
  .jr-monitor,
  .jr-bezel,
  .jr-screen { padding: 0; background: none; box-shadow: none; height: auto; clip-path: none; }
  .screen-panel {
    position: static;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    overflow: visible;
    margin-bottom: 24px;
  }
  .bt-hero,
  .sv-card,
  .gl-commit,
  .gc-done { opacity: 1 !important; transform: none !important; }
}
