/* =========================================================
   Saurabh Kumar — Portfolio
   3D scene: js/scene.js (Three.js) · Interactions: js/ui.js
   ========================================================= */

:root {
  --bg: #05060f;
  --bg-2: #0a0d22;
  --card: rgba(14, 18, 42, 0.72);
  --card-strong: rgba(18, 23, 54, 0.9);
  --border: rgba(148, 163, 255, 0.14);
  --border-strong: rgba(148, 163, 255, 0.32);
  --text: #eef1ff;
  --muted: #a1a9c9;
  --dim: #6f789c;
  --cyan: #22d3ee;
  --indigo: #818cf8;
  --violet: #a855f7;
  --pink: #f472b6;
  --gradient: linear-gradient(120deg, #22d3ee 0%, #818cf8 50%, #f472b6 100%);
  --radius: 22px;
  --shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --script: system-ui;
  --font-display: "Space Grotesk", var(--script), system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", var(--script), system-ui, sans-serif;
  --font-mono: "JetBrains Mono", var(--script), ui-monospace, monospace;
  --nav-h: 72px;
  --nav-bg: rgba(8, 10, 26, 0.72);
  --glass: rgba(14, 18, 42, 0.6);
  --panel: rgba(8, 10, 26, 0.97);
  --tape: #0a0d22;
  --text-halo: rgba(5, 6, 15, 0.9);
  --chip-ink: #c7cdf0;
  --contact-bg: linear-gradient(135deg, rgba(20, 25, 60, 0.85), rgba(10, 12, 32, 0.85));
  --inset: rgba(5, 6, 15, 0.45);
  --on-accent: #05060f;
  --step-num: rgba(238, 241, 255, 0.35);
  --grain: 0.05;
  color-scheme: dark;
}

/* ---------- Light theme ---------- */
:root[data-theme="light"] {
  --bg: #f4f6fc;
  --bg-2: #e6eaf7;
  --card: rgba(255, 255, 255, 0.8);
  --card-strong: rgba(255, 255, 255, 0.96);
  --border: rgba(55, 65, 140, 0.14);
  --border-strong: rgba(55, 65, 140, 0.28);
  --text: #0d1226;
  --muted: #4a5375;
  --dim: #6b7394;
  --cyan: #0e7490;
  --indigo: #4f46e5;
  --violet: #7c3aed;
  --pink: #db2777;
  --gradient: linear-gradient(120deg, #0891b2 0%, #6366f1 50%, #db2777 100%);
  --shadow: 0 24px 50px -24px rgba(30, 40, 100, 0.28);
  --nav-bg: rgba(255, 255, 255, 0.78);
  --glass: rgba(255, 255, 255, 0.72);
  --panel: rgba(255, 255, 255, 0.98);
  --tape: #ffffff;
  --text-halo: rgba(244, 246, 252, 0.95);
  --chip-ink: #39406b;
  --contact-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 236, 250, 0.92));
  --inset: rgba(255, 255, 255, 0.75);
  --on-accent: #ffffff;
  --step-num: rgba(13, 18, 38, 0.3);
  --grain: 0.03;
  color-scheme: light;
}

html {
  transition: background-color 0.4s;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

strong {
  color: var(--text);
  font-weight: 700;
}

::selection {
  background: rgba(129, 140, 248, 0.45);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  width: min(1200px, 100% - 32px);
  margin-inline: auto;
}

section {
  position: relative;
  padding: clamp(80px, 12vw, 140px) 0 clamp(30px, 4vw, 50px);
}

.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

/* ---------- Background layers ---------- */
#webgl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.bg-fallback {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 75% 30%, rgba(129, 140, 248, 0.18), transparent 70%),
    radial-gradient(50% 45% at 15% 80%, rgba(34, 211, 238, 0.12), transparent 70%),
    radial-gradient(40% 40% at 90% 90%, rgba(244, 114, 182, 0.1), transparent 70%),
    var(--bg);
}

[data-theme="light"] .bg-fallback {
  background:
    radial-gradient(60% 50% at 75% 30%, rgba(99, 102, 241, 0.14), transparent 70%),
    radial-gradient(50% 45% at 15% 80%, rgba(8, 145, 178, 0.1), transparent 70%),
    radial-gradient(40% 40% at 90% 90%, rgba(219, 39, 119, 0.08), transparent 70%),
    var(--bg);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: var(--grain);
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main,
.footer {
  position: relative;
  z-index: 1;
}

/* 3D depth (translateZ) can poke past the screen edge; never let it widen the page */
main {
  overflow-x: clip;
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.13), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
  will-change: transform;
}

.cursor-glow.on {
  opacity: 1;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: var(--gradient);
  z-index: 1001;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.8);
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 34px;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
  animation: loaderFallback 0.6s 3.5s forwards;
}

body.loaded .loader {
  opacity: 0;
  visibility: hidden;
}

@keyframes loaderFallback {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.cube {
  --s: 64px;
  width: var(--s);
  height: var(--s);
  position: relative;
  transform-style: preserve-3d;
  animation: cubeSpin 2.4s var(--ease) infinite;
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 20px var(--font-display);
  color: var(--text);
  border: 1px solid rgba(129, 140, 248, 0.7);
  background: rgba(129, 140, 248, 0.12);
  box-shadow: inset 0 0 20px rgba(34, 211, 238, 0.35);
}

.f1 { transform: translateZ(calc(var(--s) / 2)); }
.f2 { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); }
.f3 { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); }
.f4 { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); }
.f5 { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); }
.f6 { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); }

@keyframes cubeSpin {
  0% { transform: rotateX(-25deg) rotateY(0deg); }
  50% { transform: rotateX(25deg) rotateY(180deg); }
  100% { transform: rotateX(-25deg) rotateY(360deg); }
}

.loader-text {
  font: 500 12px var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Nav ---------- */
.site-nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1200px, 100% - 24px);
  height: 60px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 16px;
  border-radius: 18px;
  border: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.site-nav.scrolled {
  background: var(--nav-bg);
  border-color: var(--border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 19px var(--font-display);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 14px;
  background: var(--gradient);
  color: var(--on-accent);
  transition: transform 0.6s var(--ease);
}

.brand:hover .brand-mark {
  transform: perspective(200px) rotateY(180deg);
}

.brand-name span {
  color: var(--pink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
}

.nav-links a {
  position: relative;
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s, background 0.25s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(129, 140, 248, 0.1);
}

.nav-links a.nav-cta {
  margin-left: 6px;
  color: var(--on-accent);
  background: var(--gradient);
}

.nav-links a.nav-cta:hover {
  filter: brightness(1.1);
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: 10px;
}

.theme-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--glass);
  color: var(--text);
  transition: border-color 0.25s, background 0.25s, transform 0.5s var(--ease);
}

.theme-btn:hover {
  border-color: var(--indigo);
  background: rgba(129, 140, 248, 0.14);
}

.theme-btn:active {
  transform: rotate(90deg) scale(0.92);
}

.theme-btn svg {
  width: 20px;
  height: 20px;
}

.theme-btn .moon,
[data-theme="light"] .theme-btn .sun {
  display: none;
}

[data-theme="light"] .theme-btn .moon {
  display: block;
}

[data-theme="light"] .step-block::after {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.35), rgba(99, 102, 241, 0.1));
}

[data-theme="light"] .marquee-row:not(.alt) .marquee-track span {
  color: var(--text);
}

.lang {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--glass);
  font: 700 13.5px var(--font-body);
  letter-spacing: 0.04em;
  transition: border-color 0.25s, background 0.25s;
}

.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  border-color: var(--indigo);
  background: rgba(129, 140, 248, 0.14);
}

.lang-btn svg {
  width: 19px;
  height: 19px;
}

.lang-panel {
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  width: min(440px, calc(100vw - 24px));
  max-height: min(70vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  transform-origin: 90% 0;
  animation: panelIn 0.35s var(--ease);
}

.lang-panel[hidden] {
  display: none;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: perspective(800px) rotateX(-18deg) translateY(-8px);
  }
}

.lang-head {
  padding: 2px 6px 10px;
  font: 500 11.5px var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}

.lang-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.lang-list button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-align: start;
  transition: background 0.2s, border-color 0.2s;
}

.lang-list button:hover,
.lang-list button:focus-visible {
  background: rgba(129, 140, 248, 0.12);
  border-color: var(--border);
}

.lang-list button[aria-current="true"] {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.45);
}

.lang-list .ln {
  font-family: var(--font-body), "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Telugu", "Noto Sans Tamil",
    "Noto Sans Gujarati", "Noto Sans Kannada", "Noto Sans Oriya", "Noto Sans Malayalam", "Noto Sans Gurmukhi",
    "Noto Sans Ol Chiki", "Noto Sans Meetei Mayek", "Noto Naskh Arabic";
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
}

.lang-list .le {
  font-size: 12px;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.35s var(--ease), opacity 0.2s;
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, border-color 0.3s;
  will-change: transform;
}

.btn-primary {
  color: var(--on-accent);
  background: var(--gradient);
  background-size: 160% auto;
  box-shadow: 0 10px 30px -8px rgba(129, 140, 248, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  background-position: right center;
  box-shadow: 0 16px 40px -8px rgba(244, 114, 182, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary i {
  transition: transform 0.3s var(--ease);
}

.btn-primary:hover i {
  transform: translateX(4px);
}

.btn-ghost {
  border: 1px solid var(--border-strong);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--indigo);
  background: rgba(129, 140, 248, 0.14);
}

/* ---------- Reveal (3D) ---------- */
.js .reveal {
  opacity: 0;
  transform: perspective(1200px) translate3d(0, 50px, -60px) rotateX(16deg);
  transition: opacity 1s var(--ease), transform 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}

.js .reveal.in-view {
  opacity: 1;
  transform: none;
}

/* Split headings: each word flips up in 3D */
.split .w {
  display: inline-block;
  perspective: 700px;
  white-space: nowrap;
}

.split .w > span {
  display: inline-block;
  transform-origin: 50% 100%;
  transition: transform 1s var(--ease), opacity 0.8s var(--ease);
  transition-delay: calc(var(--i) * 55ms + 0.1s);
}

.js .split .w > span {
  opacity: 0;
  transform: translateY(60%) rotateX(-85deg);
}

.js .split.in-view .w > span {
  opacity: 1;
  transform: none;
}

/* gradient words share one continuous gradient (positions set in ui.js) */
.split .gradient-text {
  animation: none;
  background-size: var(--gw, 100%) 100%;
  background-position: var(--gx0, 0) 0;
}

/* split headings themselves shouldn't also tilt */
.js .split.reveal {
  transform: none;
  opacity: 1;
}

/* ---------- Section heads ---------- */
.section-head {
  margin-bottom: clamp(40px, 6vw, 64px);
  max-width: 760px;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 12.5px var(--font-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}

.section-tag::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.2vw, 56px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.section-sub {
  margin-top: 14px;
  color: var(--muted);
}

.lead {
  color: var(--muted);
  font-size: clamp(15.5px, 1.4vw, 17px);
  margin-top: 18px;
  max-width: 62ch;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 40px);
  padding-bottom: 90px;
}

.hero-inner {
  position: relative;
  z-index: 2;
}

.hero-text {
  max-width: 640px;
}

.hero-role,
.hero-summary {
  text-shadow: 0 2px 18px var(--text-halo);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #34d399;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34d399;
  animation: ping 1.8s ease-out infinite;
}

@keyframes ping {
  to {
    transform: scale(2.8);
    opacity: 0;
  }
}

.hero-title {
  margin: 22px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(50px, min(10.5vw, 17vh), 132px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-weight: 700;
}

.hero-title .line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.06em;
  perspective: 800px;
}

.hero-title .line-inner {
  display: inline-block;
  transform-origin: 50% 100%;
  transition: transform 1.4s var(--ease), opacity 1s var(--ease);
}

.js .hero-title .line-inner {
  transform: translateY(105%) rotateX(-70deg);
  opacity: 0;
}

.loaded .hero-title .line-inner {
  transform: none;
  opacity: 1;
}

.loaded .hero-title .line:nth-child(2) .line-inner {
  transition-delay: 0.12s;
}

.hero-role {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.2vw, 24px);
  font-weight: 500;
  color: var(--muted);
  min-height: 2.6em;
}

.typed {
  color: var(--text);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 3px;
  vertical-align: -0.15em;
  background: var(--cyan);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.br-sm {
  display: none;
}

.hero-summary {
  margin-top: 14px;
  color: var(--muted);
  font-size: clamp(15.5px, 1.4vw, 17.5px);
  max-width: 56ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.hero-social {
  display: flex;
  gap: 10px;
  margin-top: 28px;
}

.hero-social a,
.footer-social a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--muted);
  transition: transform 0.35s var(--ease), color 0.25s, border-color 0.25s, background 0.25s;
}

.hero-social a:hover,
.footer-social a:hover {
  color: var(--text);
  border-color: var(--indigo);
  background: rgba(129, 140, 248, 0.15);
  transform: translateY(-4px) perspective(200px) rotateX(12deg);
}

/* Orbiting labels projected from the 3D scene */
.orbit-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.orbit-labels span {
  position: absolute;
  left: 0;
  top: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font: 500 12.5px var(--font-mono);
  color: var(--text);
  background: var(--glass);
  border: 1px solid var(--border-strong);
  white-space: nowrap;
  opacity: 0;
  will-change: transform, opacity;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  z-index: 2;
}

.mouse {
  width: 24px;
  height: 38px;
  border-radius: 14px;
  border: 2px solid var(--dim);
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.mouse span {
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--cyan);
  animation: wheel 1.6s ease-in-out infinite;
}

@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ---------- Tilt (3D hover cards) ---------- */
.tilt-wrap {
  perspective: 1100px;
}

.tilt {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.7s var(--ease), border-color 0.3s, box-shadow 0.4s;
  will-change: transform;
}

.tilt.tilting {
  transition: transform 0.12s linear, border-color 0.3s, box-shadow 0.4s;
}

.glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.13), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
  transform: translateZ(1px);
}

.tilt:hover .glare {
  opacity: 1;
}

/* ---------- Stats ---------- */
/* ---------- Tech marquee (crossed 3D tapes) ---------- */
.marquee {
  position: relative;
  z-index: 1;
  height: 170px;
  margin: -20px 0 10px;
  overflow: hidden;
  perspective: 900px;
}

.marquee-row {
  position: absolute;
  left: -10%;
  width: 120%;
  top: 62%;
  padding: 13px 0;
  overflow: hidden;
  border-block: 1px solid var(--border-strong);
  background: var(--tape);
  transform: translateY(-50%) rotate(-3deg) rotateX(12deg);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.8);
}

.marquee-row.alt {
  top: 36%;
  background: var(--gradient);
  border: 0;
  transform: translateY(-50%) rotate(2.5deg) rotateX(-12deg);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.marquee-row.alt .marquee-track {
  animation-direction: reverse;
  animation-duration: 44s;
}

.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  font: 600 17px var(--font-display);
  white-space: nowrap;
  color: var(--text);
}

.marquee-track span i {
  font-size: 18px;
  color: var(--cyan);
}

.marquee-row.alt .marquee-track span,
.marquee-row.alt .marquee-track span i {
  color: var(--on-accent);
}

.marquee-track span::after {
  content: "✦";
  margin-left: 22px;
  font-size: 12px;
  opacity: 0.6;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.stats-band {
  padding: 10px 0 20px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-inner {
  height: 100%;
  padding: 26px 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-inner:hover {
  border-color: var(--border-strong);
}

.stat h3 {
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  transform: translateZ(40px);
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat h3 small {
  font-size: 0.5em;
  margin-left: 2px;
}

.stat p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  transform: translateZ(22px);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(40px, 7vw, 90px);
  align-items: center;
}

.portrait-wrap {
  perspective: 1200px;
  display: flex;
  justify-content: center;
}

.portrait {
  position: relative;
  width: min(380px, 80%);
  aspect-ratio: 413 / 531;
  border-radius: 28px;
}

.portrait-frame {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: 0 40px 80px -30px rgba(129, 140, 248, 0.55), var(--shadow);
  background: var(--bg-2);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(5, 6, 15, 0.6));
}

.portrait-ring {
  position: absolute;
  inset: -18px;
  border-radius: 38px;
  border: 1px dashed rgba(129, 140, 248, 0.45);
  transform: translateZ(-50px);
  pointer-events: none;
}

.portrait-ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 2px;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--cyan), var(--pink), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinAng 5s linear infinite;
}

@property --ang {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

@keyframes spinAng {
  to {
    --ang: 360deg;
  }
}

.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--card-strong);
  border: 1px solid var(--border-strong);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  animation: bob 5s ease-in-out infinite;
}

.float-chip i {
  color: var(--cyan);
}

.chip-a { top: 8%; left: -18%; --z: 70px; }
.chip-b { top: 30%; right: -20%; --z: 90px; animation-delay: -1.2s; }
.chip-c { bottom: 22%; left: -22%; --z: 60px; animation-delay: -2.4s; }
.chip-d { bottom: 6%; right: -14%; --z: 80px; animation-delay: -3.6s; }

@keyframes bob {
  0%, 100% { transform: translateZ(var(--z)) translateY(0); }
  50% { transform: translateZ(var(--z)) translateY(-10px); }
}

.facts {
  display: grid;
  gap: 12px;
  margin-top: 30px;
}

.facts li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.3s;
}

.facts li:hover {
  transform: translateX(6px);
  border-color: var(--border-strong);
}

.facts i {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.facts h4 {
  font-size: 15.5px;
}

.facts p {
  font-size: 14px;
  color: var(--muted);
}

.pipeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.pipeline span {
  position: relative;
  padding: 7px 14px;
  border-radius: 999px;
  font: 500 12.5px var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--glass);
  animation: pipeGlow 7s ease-in-out infinite;
}

.pipeline span:nth-child(2) { animation-delay: 1s; }
.pipeline span:nth-child(3) { animation-delay: 2s; }
.pipeline span:nth-child(4) { animation-delay: 3s; }
.pipeline span:nth-child(5) { animation-delay: 4s; }
.pipeline span:nth-child(6) { animation-delay: 5s; }
.pipeline span:nth-child(7) { animation-delay: 6s; }

@keyframes pipeGlow {
  0%, 18%, 100% { color: var(--muted); border-color: var(--border); box-shadow: none; }
  6%, 12% { color: var(--text); border-color: var(--cyan); box-shadow: 0 0 18px rgba(34, 211, 238, 0.35); }
}

/* ---------- Career stairs (CSS 3D blocks) ---------- */
.stairs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(12px, 2vw, 22px);
  align-items: end;
  padding-top: 20px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.step-label h4 {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.25;
}

.step-label h4 small {
  font-weight: 500;
  color: var(--muted);
}

.step-label p {
  margin-top: 4px;
  font: 500 12.5px var(--font-mono);
  color: var(--muted);
}

.now-tag {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-accent);
  background: var(--gradient);
}

.step-block {
  --depth: 18px;
  position: relative;
  height: calc(var(--h) * 54px + 30px);
  margin-right: var(--depth);
  margin-top: var(--depth);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.28), rgba(129, 140, 248, 0.05));
  border: 1px solid var(--border-strong);
  border-bottom: 0;
  display: flex;
  align-items: flex-end;
  padding: 14px 16px;
  transform-origin: 50% 100%;
}

.js .step .step-block {
  transform: scaleY(0.05);
  transition: transform 1.2s var(--ease);
  transition-delay: calc(var(--d, 0s) + 0.2s);
}

.js .step.in-view .step-block {
  transform: none;
}

/* top face */
.step-block::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  bottom: 100%;
  height: var(--depth);
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.35), rgba(129, 140, 248, 0.45));
  transform-origin: 0 100%;
  transform: skewX(-45deg);
  border: 1px solid rgba(129, 140, 248, 0.5);
}

/* side face */
.step-block::after {
  content: "";
  position: absolute;
  top: -1px;
  bottom: 0;
  left: 100%;
  width: var(--depth);
  background: linear-gradient(180deg, rgba(76, 29, 149, 0.6), rgba(30, 27, 75, 0.2));
  transform-origin: 0 0;
  transform: skewY(-45deg);
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.step-block span {
  font: 700 clamp(24px, 3vw, 38px) var(--font-display);
  color: var(--step-num);
}

.step.current .step-block {
  background: linear-gradient(180deg, rgba(244, 114, 182, 0.4), rgba(129, 140, 248, 0.12));
  box-shadow: 0 0 60px -10px rgba(244, 114, 182, 0.55);
}

.step.current .step-block::before {
  background: linear-gradient(90deg, rgba(244, 114, 182, 0.6), rgba(129, 140, 248, 0.6));
}

.step.current .step-block span {
  color: var(--text);
}

.lead-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.lead-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  height: 100%;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
}

.lead-card i {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  font-size: 18px;
  color: var(--on-accent);
  background: var(--gradient);
  transform: translateZ(40px);
}

.lead-card p {
  color: var(--muted);
  transform: translateZ(20px);
}

/* ---------- Work ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.span-2 {
  grid-column: span 2;
}

.work-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.work-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 40px 80px -30px rgba(129, 140, 248, 0.45);
}

.work-card.featured {
  flex-direction: row;
}

.work-art {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  overflow: hidden;
  transform: translateZ(20px);
}

.work-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1s var(--ease);
}

.work-card:hover .work-art img {
  transform: scale(1.06);
}

.featured .work-art {
  flex: 0 0 44%;
  aspect-ratio: auto;
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
}

.work-body {
  padding: 24px 26px 26px;
  transform: translateZ(36px);
}

.featured .work-body {
  padding: 32px 34px;
}

.work-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 500 12.5px var(--font-mono);
  color: var(--cyan);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
}

.work-body h3 {
  margin: 8px 0 12px;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.2vw, 26px);
  line-height: 1.2;
}

.featured .work-body h3 {
  font-size: clamp(24px, 3vw, 34px);
}

.work-body ul {
  display: grid;
  gap: 8px;
}

.work-body li {
  position: relative;
  padding-inline-start: 20px;
  color: var(--muted);
  font-size: 14.5px;
}

.work-body li::before {
  content: "";
  position: absolute;
  inset-inline-start: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--gradient);
  transform: rotate(45deg);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.chips span {
  padding: 4px 11px;
  border-radius: 999px;
  font: 500 12px var(--font-mono);
  color: var(--chip-ink);
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.2);
}

/* ---------- Skills ---------- */
.skills-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(30px, 5vw, 60px);
  align-items: center;
}

.sphere-wrap {
  display: flex;
  justify-content: center;
}

.tag-sphere {
  position: relative;
  width: min(480px, 100%);
  aspect-ratio: 1;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.tag-sphere:active {
  cursor: grabbing;
}

.tag-sphere::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(129, 140, 248, 0.22), rgba(34, 211, 238, 0.04) 60%, transparent 70%);
  border: 1px solid rgba(129, 140, 248, 0.12);
}

.tag-sphere span {
  position: absolute;
  left: 50%;
  top: 50%;
  padding: 4px 10px;
  border-radius: 999px;
  font: 600 clamp(12px, 1.4vw, 15px) var(--font-body);
  white-space: nowrap;
  color: var(--chip-ink);
  will-change: transform, opacity;
  transition: color 0.2s, background 0.2s;
}

.tag-sphere span.hot {
  color: var(--text);
  background: rgba(129, 140, 248, 0.16);
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.tag-sphere span:hover {
  color: var(--on-accent);
  background: var(--cyan);
}

.skill-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.skill-cat {
  padding: 18px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  transition: border-color 0.3s, transform 0.4s var(--ease), background 0.3s;
}

.skill-cat:hover {
  border-color: var(--border-strong);
  background: var(--card-strong);
}

.skill-cat h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  margin-bottom: 6px;
}

.skill-cat h3 i {
  color: var(--cyan);
  width: 18px;
  text-align: center;
}

.skill-cat p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------- Contact ---------- */
.contact-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding: clamp(28px, 5vw, 60px);
  border-radius: 30px;
  background: var(--contact-bg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.contact-card::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -140px;
  top: -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.25), transparent 65%);
  pointer-events: none;
}

.contact-list {
  position: relative;
  display: grid;
  gap: 10px;
}

.contact-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--inset);
  border: 1px solid var(--border);
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}

.contact-list a:hover {
  transform: translateX(6px);
}

[dir="rtl"] .contact-list a:hover,
[dir="rtl"] .facts li:hover {
  transform: translateX(-6px);
  border-color: var(--indigo);
  background: rgba(129, 140, 248, 0.1);
}

.contact-list i {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.1);
}

.contact-list span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-weight: 600;
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.contact-list small {
  font: 500 11px var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ---------- Footer & misc ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: min(1200px, 100% - 32px);
  margin: 60px auto 0;
  padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  color: var(--dim);
  font-size: 14px;
}

.footer-link {
  color: var(--text);
  font-weight: 600;
  background: linear-gradient(var(--cyan), var(--cyan)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.35s var(--ease), color 0.25s;
}

.footer-link:hover {
  color: var(--cyan);
  background-size: 100% 1px;
}

.footer-social {
  display: flex;
  gap: 8px;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 900;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  color: var(--on-accent);
  background: var(--gradient);
  box-shadow: 0 10px 30px rgba(129, 140, 248, 0.5);
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  transition: opacity 0.4s, transform 0.4s var(--ease);
}

.back-to-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1500;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  background: var(--card-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 20px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Non-English scripts ---------- */
html:not([lang="en"]) .section-title {
  line-height: 1.32;
  letter-spacing: -0.01em;
}

html:not([lang="en"]) .section-tag,
html:not([lang="en"]) .loader-text,
html:not([lang="en"]) .scroll-cue,
html:not([lang="en"]) .now-tag,
html:not([lang="en"]) .contact-list small {
  letter-spacing: 0.02em;
}

html:not([lang="en"]) .hero-role,
html:not([lang="en"]) .hero-summary,
html:not([lang="en"]) .lead,
html:not([lang="en"]) .work-body li {
  line-height: 1.85;
}

[dir="rtl"] .section-tag,
[dir="rtl"] .loader-text,
[dir="rtl"] .scroll-cue,
[dir="rtl"] .now-tag,
[dir="rtl"] .contact-list small,
[dir="rtl"] .lang-head {
  letter-spacing: 0;
}

/* Latin-only pieces stay left-to-right inside RTL pages */
[dir="rtl"] .hero-title,
[dir="rtl"] .chips,
[dir="rtl"] .skill-cat p,
[dir="rtl"] .marquee,
[dir="rtl"] .stat h3 {
  direction: ltr;
}

[dir="rtl"] .hero-title,
[dir="rtl"] .stat h3 {
  text-align: right;
}

[dir="rtl"] .btn-primary:hover .fa-arrow-right {
  transform: scaleX(-1) translateX(4px);
}

[dir="rtl"] .fa-arrow-right {
  transform: scaleX(-1);
}

/* ======================= Responsive ======================= */
@media (max-width: 1080px) {
  .chip-a { left: -8%; }
  .chip-b { right: -10%; }
  .chip-c { left: -10%; }
  .chip-d { right: -6%; }

  .skills-layout {
    grid-template-columns: 1fr;
  }

  .work-card.featured {
    flex-direction: column;
  }

  .featured .work-art {
    flex: none;
    aspect-ratio: 16 / 7;
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border-radius: 18px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    transform-origin: 50% 0;
    transform: perspective(800px) rotateX(-20deg) translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.45s var(--ease), opacity 0.3s, visibility 0.45s;
  }

  .nav-links.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav-links a {
    padding: 14px 16px;
    font-size: 16px;
  }

  .nav-links a.nav-cta {
    margin: 6px 0 0;
    text-align: center;
  }

  .nav-tools {
    margin-inline-start: auto;
  }

  .lang-panel {
    position: fixed;
    top: 84px;
    inset-inline: 12px;
    width: auto;
  }

  /* Keep nav readable when the menu is open at the top of the page */
  .site-nav:has(.nav-links.open) {
    background: var(--panel);
    border-color: var(--border);
  }

  .orbit-labels {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .portrait {
    width: min(320px, 72%);
  }

  .stairs {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .step {
    flex-direction: row-reverse;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
  }

  .step-block {
    flex: none;
    height: 64px;
    width: calc(var(--h) * 14px + 50px);
    padding: 10px 12px;
    align-items: center;
    border-radius: 6px 0 0 6px;
    transform-origin: 0 50%;
  }

  .js .step .step-block {
    transform: scaleX(0.1);
  }

  .step-block span {
    font-size: 22px;
  }

  .lead-cards,
  .work-grid,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .featured .work-art {
    aspect-ratio: 16 / 9;
  }

  .contact-list span {
    font-size: 13.5px;
  }
}

@media (max-width: 560px) {
  .hero {
    align-items: flex-end;
    padding-bottom: 110px;
  }

  .br-sm {
    display: inline;
  }

  .hero-cta .btn {
    flex: 1 1 100%;
  }

  .stats {
    gap: 10px;
  }

  .stat-inner {
    padding: 20px 16px;
  }

  .skill-cats {
    grid-template-columns: 1fr;
  }

  .lang-btn {
    padding: 0 11px;
  }

  .float-chip {
    font-size: 11.5px;
    padding: 7px 10px;
  }

  .chip-a { left: -14%; }
  .chip-b { right: -16%; }
  .chip-c { left: -16%; }
  .chip-d { right: -12%; }

  .work-body,
  .featured .work-body {
    padding: 20px;
  }

  .marquee {
    height: 140px;
  }

  .scroll-cue {
    display: none;
  }

  .marquee-track span {
    font-size: 14.5px;
    padding: 0 16px;
  }

  .marquee-track span::after {
    margin-left: 16px;
  }

  .footer {
    justify-content: center;
    text-align: center;
  }
}

/* Touch devices: no hover tilt, keep things snappy */
@media (hover: none) {
  .cursor-glow {
    display: none;
  }

  .tilt-wrap {
    perspective: none;
  }

  .work-art,
  .work-body,
  .stat h3,
  .stat p,
  .lead-card i,
  .lead-card p {
    transform: none;
  }
}

/* Short landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-h) + 30px);
  }

  .scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .loader {
    display: none;
  }
}
