/* ==========================================================================
   KasunRocz Softwares — futuristic 3D portfolio
   ========================================================================== */
:root {
  --bg: #04050a;
  --bg-2: #0a0d18;
  --ink: #eef1fb;
  --ink-2: #aab2c8;
  --ink-3: #8089a3;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --glass: rgba(10, 14, 26, .46);

  --teal: #3cf2c8;
  --amber: #ffb547;
  --sky: #5cc8ff;
  --violet: #b197fc;

  --accent: var(--teal);
  --accent-rgb: 60, 242, 200;
  --live: #3cf2c8;

  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 16px;

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;

  --gutter: clamp(16px, 4.5vw, 64px);
  --max: 1240px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
.rm { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
::selection { background: var(--teal); color: #03110d; }
:focus-visible { outline: 2px solid var(--live); outline-offset: 3px; border-radius: 10px; }

.skip {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 999px; background: var(--teal); color: #03110d; font-weight: 700;
}
.skip:focus { top: 16px; }

/* ---------- Atmosphere layers ---------- */
#universe {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
  opacity: 0; transition: opacity 1.8s var(--ease-out);
}
.scene-ready #universe { opacity: 1; }
.no-webgl body {
  background:
    radial-gradient(60% 50% at 75% 30%, rgba(60, 242, 200, .14), transparent 70%),
    radial-gradient(50% 50% at 15% 80%, rgba(177, 151, 252, .14), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(2, 3, 8, .78) 100%);
}
.grain {
  position: fixed; inset: 0; z-index: 2; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none;
  width: 560px; height: 560px; margin: -280px 0 0 -280px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--live) 13%, transparent), transparent 62%);
  transform: translate3d(var(--cx, -999px), var(--cy, -999px), 0);
  transition: background .6s;
}
@media (pointer: coarse) { .cursor-glow { display: none; } }

.progress {
  position: fixed; top: 0; left: 0; z-index: 60; height: 2px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--teal), var(--sky), var(--violet));
  box-shadow: 0 0 12px var(--live);
}

.spark {
  position: fixed; z-index: 150; pointer-events: none;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 10px var(--live), 0 0 2px #fff;
}

/* ---------- Loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 300; display: none;
  place-items: center; align-content: center; gap: 22px;
  background: var(--bg);
  transition: opacity .9s var(--ease-out), visibility .9s;
}
.js #loader { display: grid; animation: loader-failsafe 0s 9s forwards; }
.loaded #loader { opacity: 0; visibility: hidden; }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
.loader-core { position: relative; width: 120px; height: 120px; display: grid; place-items: center; }
.loader-ring { position: absolute; inset: 0; animation: spin 2.4s linear infinite; }
.loader-ring circle { fill: none; stroke: var(--line-2); stroke-width: 1; }
.loader-ring .arc {
  stroke: var(--teal); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 80 260; filter: drop-shadow(0 0 6px var(--teal));
}
.loader-pct { font-family: var(--f-mono); font-size: 15px; letter-spacing: .12em; color: var(--ink); }
.loader-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .32em; text-transform: uppercase; color: var(--ink-3); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 14px; left: 50%; z-index: 50;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 8px 8px 18px; border-radius: 999px;
  background: rgba(8, 11, 22, .52);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px -20px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 500; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.brand-dim { color: var(--ink-3); }
.brand-mark {
  position: relative; width: 26px; height: 26px; border-radius: 8px;
  background: conic-gradient(from 200deg, var(--teal), var(--sky), var(--violet), var(--teal));
  box-shadow: 0 0 18px -2px rgba(60, 242, 200, .6);
}
.brand-mark i { position: absolute; inset: 5px; border-radius: 4px; background: var(--bg); }
.brand-mark i::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2); padding: 10px 14px; border-radius: 999px; transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }
.nav-end { display: flex; align-items: center; gap: 8px; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease-out); }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 23px; }
.nav.open .menu-btn span:first-child { transform: translateY(3px) rotate(45deg); }
.nav.open .menu-btn span:last-child { transform: translateY(-3px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 48px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; letter-spacing: .005em; white-space: nowrap;
  transition: background .3s, border-color .3s, box-shadow .4s, color .3s, transform .5s var(--ease-out);
  will-change: transform;
}
.btn-sm { height: 40px; padding: 0 16px; font-size: 13.5px; }
.btn-lg { height: 58px; padding: 0 30px; font-size: 16px; }
.btn-primary {
  background: var(--accent); color: #050810;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 12px 40px -12px rgba(var(--accent-rgb), .9);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 16px 56px -10px rgba(var(--accent-rgb), 1); }
.btn-ghost { background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .28); }
.btn:active { transform: scale(.97); }

/* ---------- Shared type ---------- */
main { position: relative; z-index: 3; }
.display {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(38px, 6.6vw, 96px); line-height: 1.02; letter-spacing: -.04em;
  text-wrap: balance;
}
.h2 { font-family: var(--f-display); font-weight: 500; font-size: clamp(30px, 4.4vw, 60px); line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }
.kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--live); margin-bottom: 18px; transition: color .6s; }
.mono { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.grad, .display em .w > span {
  background: linear-gradient(100deg, var(--teal) 0%, var(--sky) 45%, var(--violet) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.display em { font-style: normal; }

/* word-split reveal */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .1em; margin-bottom: -.1em; }
.w > span { display: inline-block; }
.js .w > span { transform: translateY(110%); transition: transform 1.2s var(--ease-out) calc(var(--i) * 55ms + .15s); }
.hero-in .w > span { transform: none; }
.js:not(.hero-in) .w > span { animation: failsafe-show 0s 10s forwards; }
@keyframes failsafe-show { to { transform: none; opacity: 1; translate: none; filter: none; visibility: visible; } }

/* scroll reveal */
.js .reveal {
  opacity: 0; translate: 0 32px; filter: blur(8px);
  transition: opacity 1s var(--ease-out) var(--d, 0s), translate 1.2s var(--ease-out) var(--d, 0s), filter 1s var(--ease-out) var(--d, 0s);
}
.js .reveal.in { opacity: 1; translate: none; filter: none; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: var(--max); margin: 0 auto;
  padding: 130px var(--gutter) 110px;
  position: relative;
}
.hero .display { max-width: 12ch; text-shadow: 0 0 60px rgba(4, 5, 10, .6); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; align-self: flex-start;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2);
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: rgba(10, 14, 26, .5);
  margin-bottom: 28px;
}
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(60, 242, 200, .6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(60, 242, 200, 0); } 100% { box-shadow: 0 0 0 0 rgba(60, 242, 200, 0); } }
.lede { max-width: 46ch; margin-top: 28px; font-size: clamp(16.5px, 1.35vw, 19px); color: var(--ink-2); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.cta-row.center { justify-content: center; }
.stats { display: flex; gap: clamp(28px, 5vw, 64px); margin-top: 56px; }
.stats dt { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.stats dd { font-family: var(--f-display); font-size: clamp(26px, 2.6vw, 36px); font-weight: 500; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; translate: -50% 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3);
}
.scroll-cue span { position: relative; width: 1px; height: 36px; background: var(--line-2); overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--teal); animation: drip 2s var(--ease-out) infinite; }
@keyframes drip { to { top: 110%; } }

/* ---------- Intro ---------- */
.intro {
  max-width: 980px; margin: 0 auto; text-align: center;
  padding: 26vh var(--gutter) 18vh;
}
.intro .h2 { margin-bottom: 22px; }
.intro-copy { color: var(--ink-2); max-width: 48ch; margin: 0 auto; font-size: 17px; }

/* ---------- Worlds ---------- */
.world {
  min-height: 145vh; min-height: 145svh;
  display: flex; align-items: center;
  max-width: var(--max); margin: 0 auto; padding: 10vh var(--gutter);
}
.world.right { justify-content: flex-end; }
.world-panel, .card {
  position: relative; isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform-style: preserve-3d;
  transition: transform .6s var(--ease-out), border-color .4s;
}
.world-panel::before, .card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -20%), rgba(var(--accent-rgb), .16), transparent 60%);
  opacity: .9; transition: opacity .4s;
}
.world-panel::after, .card::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(140deg, rgba(var(--accent-rgb), .7), transparent 32%, transparent 70%, rgba(var(--accent-rgb), .35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.world-panel { width: min(540px, 100%); border-radius: var(--r-xl); padding: clamp(22px, 2.6vw, 34px); }
.world-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.world-head .mono { color: rgb(var(--accent-rgb)); }
.chip {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; padding: 5px 11px; border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), .35); color: rgb(var(--accent-rgb)); background: rgba(var(--accent-rgb), .08);
  white-space: nowrap;
}
a.chip:hover { background: rgba(var(--accent-rgb), .16); }
.world-media {
  position: relative; border-radius: var(--r-md); overflow: hidden; margin-bottom: 22px;
  aspect-ratio: 21 / 8; background: #0b0f1c; border: 1px solid var(--line);
}
@media (max-height: 820px) { .world-media { display: none; } }
.world-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease-out); }
.world-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, transparent 50%, rgba(4, 5, 10, .55));
}
.world-panel:hover .world-media img { transform: scale(1.04); }
.world-title { display: flex; align-items: center; gap: 14px; }
.world-title h3 { font-family: var(--f-display); font-weight: 500; font-size: clamp(24px, 2.4vw, 32px); letter-spacing: -.03em; line-height: 1.1; }
.world-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; box-shadow: 0 0 24px -4px rgba(var(--accent-rgb), .6); }
.world-icon.letter {
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 600; font-size: 20px; color: #0b0718;
  background: linear-gradient(140deg, #d9cbff, var(--violet) 55%, #9478f6);
}
.world-tagline { font-size: 18px; font-weight: 600; margin-top: 16px; color: var(--ink); }
.world-copy { color: var(--ink-2); margin-top: 8px; font-size: 15.5px; }
.readouts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.readouts li {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .02em; color: var(--ink-2);
  padding: 6px 10px 6px 22px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  position: relative;
}
.readouts li::before { content: ""; position: absolute; left: 9px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: rgb(var(--accent-rgb)); box-shadow: 0 0 6px rgb(var(--accent-rgb)); }
.listed { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.listed img { height: 34px; width: auto; }
.world-foot { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 16px; }
.platforms { display: flex; flex-wrap: wrap; gap: 6px; }
.platforms li { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Constellation ---------- */
.stack {
  min-height: 140vh; min-height: 140svh;
  max-width: var(--max); margin: 0 auto; padding: 14vh var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: center; gap: 40px;
}
.stack-copy p:not(.kicker) { color: var(--ink-2); margin-top: 20px; max-width: 40ch; font-size: 17px; }
.sphere {
  position: relative; width: min(580px, 100%); aspect-ratio: 1; justify-self: center;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.sphere.dragging { cursor: grabbing; }
.sphere::before {
  content: ""; position: absolute; inset: 12%; border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, .08);
  background: radial-gradient(circle, rgba(60, 242, 200, .06), transparent 65%);
}

/* ---------- Principles ---------- */
.principles { max-width: var(--max); margin: 0 auto; padding: 20vh var(--gutter) 22vh; }
.section-head { margin-bottom: 48px; max-width: 760px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; perspective: 1200px; }
.card { border-radius: var(--r-lg); padding: 30px 28px 32px; min-height: 280px; display: flex; flex-direction: column; }
.card-num {
  font-family: var(--f-display); font-size: 54px; font-weight: 500; letter-spacing: -.05em; line-height: 1;
  color: transparent; -webkit-text-stroke: 1px rgba(var(--accent-rgb), .7);
  margin-bottom: auto; padding-bottom: 40px;
}
.card h3 { font-family: var(--f-display); font-weight: 500; font-size: 20px; letter-spacing: -.02em; margin-bottom: 10px; }
.card p { color: var(--ink-2); font-size: 15.5px; }

/* ---------- Vision ---------- */
.vision { height: 240vh; height: 240svh; position: relative; }
.vision-sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter);
}
.vision-text {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(24px, 3.7vw, 50px); line-height: 1.2; letter-spacing: -.03em;
  text-wrap: pretty;
}
.sw { opacity: .14; transition: opacity .5s var(--ease-out), text-shadow .5s; }
.sw.lit { opacity: 1; text-shadow: 0 0 30px rgba(60, 242, 200, .25); }
.no-js .sw, html:not(.js) .sw { opacity: 1; }
.vectors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 56px; }
.vectors li { border-top: 1px solid var(--line-2); padding-top: 14px; font-weight: 600; font-size: 15px; display: grid; gap: 4px; }
.vectors .mono { color: var(--live); }

/* ---------- Contact ---------- */
.contact {
  min-height: 110vh; min-height: 110svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  max-width: 1000px; margin: 0 auto; padding: 16vh var(--gutter);
}
.contact-title { font-size: clamp(36px, 6vw, 84px); max-width: 14ch; }
.contact p:not(.kicker) { color: var(--ink-2); margin-top: 22px; max-width: 44ch; font-size: 17px; }

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 3;
  max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; color: var(--ink-3);
  border-top: 1px solid var(--line);
}
.footer a:hover { color: var(--ink); }

/* ---------- HUD ---------- */
.hud {
  position: fixed; right: 22px; top: 50%; z-index: 40; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 4px;
}
.hud a {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: 24px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
.hud a span { opacity: 0; translate: 6px 0; transition: opacity .35s, translate .35s var(--ease-out), color .3s; }
.hud a i { width: 6px; height: 6px; border-radius: 3px; background: var(--ink-3); transition: width .5s var(--ease-out), background .3s, box-shadow .3s; }
.hud:hover a span, .hud a.active span { opacity: 1; translate: none; }
.hud a.active { color: var(--ink); }
.hud a.active i { width: 26px; background: var(--live); box-shadow: 0 0 10px var(--live); }
.hud a:hover i { background: var(--ink); }
.readout {
  position: fixed; left: 22px; bottom: 18px; z-index: 40; pointer-events: none;
  display: grid; gap: 2px;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.readout [data-readout-sector] { color: var(--live); transition: color .6s; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .hud { display: none; }
}
@media (max-width: 960px) {
  .stack { grid-template-columns: 1fr; text-align: left; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .card-num { padding-bottom: 24px; }
  .vectors { grid-template-columns: 1fr; gap: 10px; margin-top: 36px; }
}
@media (max-width: 760px) {
  .nav { padding-left: 14px; }
  .brand-dim { display: none; }
  .menu-btn { display: block; }
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 10px;
    border-radius: 24px; border: 1px solid var(--line);
    background: rgba(8, 11, 22, .9);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden; translate: 0 -8px;
    transition: opacity .3s, visibility .3s, translate .4s var(--ease-out);
  }
  .nav.open .nav-links { opacity: 1; visibility: visible; translate: none; }
  .nav-links a { padding: 14px 16px; font-size: 13px; }
  .readout { display: none; }
  .hero { justify-content: flex-end; padding-bottom: 96px; }
  .hero .display { max-width: none; }
  .stats { gap: 24px; margin-top: 40px; }
  .scroll-cue { display: none; }
  .intro { padding: 18vh var(--gutter) 10vh; text-align: left; }
  .intro-copy { margin: 0; }
  .world, .world.right { justify-content: center; align-items: flex-end; min-height: 135svh; padding-bottom: 6vh; }
  .world-media { display: none; }
  .world-copy { font-size: 15px; }
  .actions .btn { flex: 1 1 auto; }
  .stack { padding-top: 10vh; }
  .sphere { width: 100%; }
  .tag { font-size: 11px; padding: 6px 10px; }
  .principles { padding: 14vh var(--gutter); }
  .vision-text { font-size: clamp(22px, 6.6vw, 30px); }
}

/* Reduced motion: set from the OS setting or the Motion toggle (html.rm) */
.rm .js .reveal, .js.rm .reveal { filter: none; translate: none; transition: opacity .6s; }
.js.rm .w > span { transform: none; transition: none; }
.rm .pulse-dot, .rm .scroll-cue span::after, .rm .loader-ring { animation: none; }
.rm .cine-bar { display: none; }
.rm .cursor-glow { display: none; }

/* ---------- Data-driven additions ---------- */
.chip[hidden], .tag-star[hidden] { display: none; }
.platforms .tag-star { color: var(--ink-2); }
.world-error { margin: 0 auto; }
.world-error a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.listed a.text {
  font-family: var(--f-mono); font-size: 12px; padding: 7px 12px; border-radius: 8px;
  border: 1px solid var(--line-2); color: var(--ink-2);
}
.listed a.text:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.workshop { max-width: var(--max); margin: 0 auto; padding: 4vh var(--gutter) 14vh; }
.workshop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mini {
  display: grid; gap: 6px; padding: 20px 22px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  transition: border-color .3s, translate .5s var(--ease-out);
}
.mini:hover { border-color: rgba(60, 242, 200, .45); translate: 0 -3px; }
.mini b { font-family: var(--f-display); font-weight: 500; font-size: 16px; letter-spacing: -.02em; }
.mini span { color: var(--ink-2); font-size: 14.5px; }
.noscript { position: relative; z-index: 3; text-align: center; padding: 24px var(--gutter); color: var(--ink-2); }
.noscript a { color: var(--teal); }

/* ---------- Cinematic intro ---------- */
.cine-bar {
  position: fixed; left: 0; right: 0; z-index: 70; height: 11vh; background: #000; pointer-events: none;
  transition: transform 1.6s var(--ease-out);
}
.cine-bar.top { top: 0; transform-origin: top; }
.cine-bar.bottom { bottom: 0; transform-origin: bottom; }
html:not(.js) .cine-bar, .intro-done .cine-bar { transform: scaleY(0); }
.js:not(.intro-done) .cine-bar { animation: failsafe-hide 0s 10s forwards; }
@keyframes failsafe-hide { to { transform: scaleY(0); } }
.js .nav, .js .hud, .js .readout, .js .scroll-cue {
  opacity: 0; translate: 0 -10px;
  transition: opacity 1s var(--ease-out), translate 1.2s var(--ease-out);
}
.js .scroll-cue { translate: -50% 10px; }
.intro-done .nav, .intro-done .hud, .intro-done .readout { opacity: 1; translate: none; }
.intro-done .scroll-cue { opacity: 1; translate: -50% 0; }
.js:not(.intro-done) .nav, .js:not(.intro-done) .hud, .js:not(.intro-done) .readout { animation: failsafe-show 0s 10s forwards; }
.loader-track { width: 160px; height: 2px; border-radius: 2px; background: var(--line-2); overflow: hidden; }
.loader-track i { display: block; height: 100%; width: 100%; background: var(--teal); box-shadow: 0 0 8px var(--teal); transform-origin: left; transform: scaleX(var(--lp, 0)); }

/* ---------- Motion toggle ---------- */
.motion-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04);
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  transition: color .25s, border-color .25s, background .25s;
}
.motion-btn:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.motion-icon { position: relative; width: 22px; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .14); transition: background .3s; }
.motion-icon::after { content: ""; position: absolute; top: 2px; left: 2px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); transition: translate .35s var(--ease-out), background .3s; }
.motion-btn[aria-pressed="true"] .motion-icon { background: rgba(60, 242, 200, .3); }
.motion-btn[aria-pressed="true"] .motion-icon::after { translate: 10px 0; background: var(--teal); }
@media (max-width: 760px) { .motion-label { display: none; } .motion-btn { padding: 0 10px; } }

/* ---------- Constellation ---------- */
.sphere-links, .sphere-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.sphere-links { overflow: visible; pointer-events: none; }
.sphere-links line { stroke-width: 1; stroke-linecap: round; transition: stroke-width .3s; }
.sphere-links line.hot { stroke-width: 1.6; }
.node {
  position: absolute; left: 50%; top: 50%;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .02em; white-space: nowrap;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(8, 12, 24, .72); border: 1px solid var(--line-2); color: var(--ink);
  transform: translate(-50%, -50%); will-change: transform, opacity;
  transition: border-color .25s, color .25s, box-shadow .3s, background .25s;
  cursor: pointer;
}
.node:hover, .node:focus-visible { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 20px -4px var(--teal); }
.node.hub {
  font-family: var(--f-display); font-size: 13.5px; font-weight: 500; letter-spacing: -.01em;
  padding: 10px 16px 10px 30px;
  border-color: rgba(var(--hub-rgb), .55); background: rgba(var(--hub-rgb), .12);
  box-shadow: 0 0 28px -8px rgba(var(--hub-rgb), .9);
}
.node.hub::before {
  content: ""; position: absolute; left: 13px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: rgb(var(--hub-rgb)); box-shadow: 0 0 10px rgb(var(--hub-rgb));
}
.node.hub:hover, .node.hub:focus-visible { color: var(--ink); border-color: rgb(var(--hub-rgb)); box-shadow: 0 0 34px -4px rgba(var(--hub-rgb), 1); }
.node.is-active { border-color: var(--live); color: var(--ink); background: rgba(10, 16, 30, .92); box-shadow: 0 0 0 3px rgba(255, 255, 255, .06), 0 0 30px -4px var(--live); }
.node.is-related:not(.hub) { border-color: rgba(255, 255, 255, .45); }
.node-info {
  margin-top: 28px; max-width: 440px; padding: 20px 22px; border-radius: var(--r-md);
  background: var(--glass); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  min-height: 112px;
}
.node-info .mono { color: var(--live); margin-bottom: 6px; }
.node-info-title { font-family: var(--f-display); font-weight: 500; font-size: 19px; letter-spacing: -.02em; line-height: 1.25; }
.node-info-sub { color: var(--ink-2); font-size: 15px; margin-top: 6px; }
.node-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.node-links button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(var(--hub-rgb, 60, 242, 200), .45); background: rgba(var(--hub-rgb, 60, 242, 200), .1);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  transition: background .25s, border-color .25s;
}
.node-links button:hover { background: rgba(var(--hub-rgb, 60, 242, 200), .22); border-color: rgb(var(--hub-rgb, 60, 242, 200)); }
.node-links button i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--hub-rgb, 60, 242, 200)); }
@media (max-width: 760px) { .node { font-size: 11px; padding: 6px 10px; } .node.hub { font-size: 12px; padding: 8px 12px 8px 26px; } .node.hub::before { left: 11px; } }

/* ---------- Project worlds: panels fade with the camera, not on a one-off trigger ---------- */
.world-panel { will-change: opacity, translate; }
@media (max-width: 760px) { .world, .world.right { align-items: center; min-height: 150svh; } }
