/* ═══════════════════════════════════════════════════
   halerka.digital — Premium Futuristic Styles v2
   Color Palette: Electric Cyan + Warm Amber + Deep Indigo
   ═══════════════════════════════════════════════════ */

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-300-normal.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-300-italic.woff2') format('woff2');
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Kanit';
  src: url('public/fonts/kanit-latin-900-normal.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('public/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('public/fonts/jetbrains-mono-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('public/fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('public/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('public/fonts/jetbrains-mono-cyrillic-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('public/fonts/noto-sans-cyrillic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('public/fonts/noto-sans-cyrillic-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --bg-primary: #06080F;
  --bg-secondary: #0A0E1A;
  --bg-card: #0D1117;
  --text-primary: #E0E8F0;
  --text-secondary: #8B95A5;
  --accent-cyan: #00E5FF;
  --accent-cyan-dim: rgba(0, 229, 255, 0.15);
  --accent-gold: #FFB800;
  --accent-gold-dim: rgba(255, 184, 0, 0.15);
  --accent-indigo: #6366F1;
  --accent-indigo-dim: rgba(99, 102, 241, 0.15);
  --accent-rose: #F43F5E;
  --border-dim: rgba(224, 232, 240, 0.08);
  --border-glow: rgba(0, 229, 255, 0.2);
  --gradient-main: linear-gradient(135deg, #00E5FF 0%, #6366F1 50%, #FFB800 100%);
  --gradient-text: linear-gradient(180deg, #4A5568 0%, #CBD5E1 100%);
  --gradient-text-accent: linear-gradient(135deg, #00E5FF 0%, #6366F1 100%);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Global Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body:not(.policy-page),
body:not(.policy-page) *,
body:not(.policy-page) *::before,
body:not(.policy-page) *::after {
  cursor: none !important;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  background-color: var(--bg-primary);
  font-family: 'Kanit', 'Noto Sans', sans-serif;
  color: var(--text-primary);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body:not(.policy-page) {
  cursor: none;
}

/* ── Custom Cursor ── */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100040;
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-out-expo), width 0.2s ease, height 0.2s ease, background 0.3s ease;
  box-shadow: 0 0 20px var(--accent-cyan), 0 0 60px rgba(0, 229, 255, 0.3);
}

.cursor-dot.hovering {
  width: 14px;
  height: 14px;
  background: var(--accent-gold);
  box-shadow: 0 0 25px var(--accent-gold), 0 0 60px rgba(255, 184, 0, 0.4);
}

.cursor-ring {
  position: fixed;
  width: 40px;
  height: 40px;
  border: 1.5px solid rgba(0, 229, 255, 0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100039;
  transform: translate(-50%, -50%);
  transition: all 0.2s var(--ease-out-expo);
}

.cursor-ring.hovering {
  width: 64px;
  height: 64px;
  border-color: rgba(255, 184, 0, 0.5);
  background: rgba(255, 184, 0, 0.04);
  border-width: 2px;
}

/* Floating label for clickable elements */
.cursor-label {
  position: fixed;
  pointer-events: none;
  z-index: 100038;
  transform: translate(-50%, -50%) translateY(28px) scale(0.7);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out-expo);
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 184, 0, 0.5);
  white-space: nowrap;
}

.cursor-label.visible {
  opacity: 1;
  transform: translate(-50%, -50%) translateY(34px) scale(1);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-indigo));
  border-radius: 3px;
}

/* ── Noise Texture Overlay ── */
.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Main Wrapper ── */
.main-wrapper {
  position: relative;
  width: 100%;
}

/* ── Gradient Texts ── */
.hero-heading {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.accent-heading {
  background: var(--gradient-text-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gold-heading {
  background: linear-gradient(135deg, #FFB800 0%, #FF6B00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glow-heading {
  background: linear-gradient(90deg, #FFFFFF 0%, #CBD5E1 50%, #64748B 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Split Hero Titles ── */
.hero-title-part-1 {
  transform: translateX(-60%) scale(0.9);
  opacity: 0;
  filter: blur(15px);
  animation: titleSlideIn 1.4s var(--ease-out-expo) 0.1s forwards;
}

.hero-title-part-2 {
  transform: translateX(60%) scale(0.9);
  opacity: 0;
  filter: blur(15px);
  animation: titleSlideIn 1.4s var(--ease-out-expo) 0.3s forwards;
}

@keyframes titleSlideIn {
  to { transform: translateX(0) scale(1); opacity: 1; filter: blur(0); }
}

/* ── Floating Grid Background ── */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
  pointer-events: none;
}

/* ── Particle Canvas ── */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}

/* ── Animated Gradient Orbs ── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.12;
  pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform;
}

.orb-1 {
  width: 40vw;
  height: 40vw;
  background: var(--accent-cyan);
  animation: orbFloat1 20s ease-in-out infinite;
}

.orb-2 {
  width: 30vw;
  height: 30vw;
  background: var(--accent-indigo);
  animation: orbFloat2 25s ease-in-out infinite;
}

.orb-3 {
  width: 25vw;
  height: 25vw;
  background: var(--accent-gold);
  animation: orbFloat3 18s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(10vw, -8vh) scale(1.1); }
  66% { transform: translate(-5vw, 5vh) scale(0.9); }
}
@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-8vw, 6vh) scale(1.15); }
  66% { transform: translate(6vw, -10vh) scale(0.85); }
}
@keyframes orbFloat3 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(12vw, 4vh) scale(0.9); }
  66% { transform: translate(-8vw, -6vh) scale(1.1); }
}

/* ── Floating Geometric Shapes ── */
.geo-shape {
  position: absolute;
  pointer-events: none;
  opacity: 0.08;
  will-change: transform;
}

.geo-triangle {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 52px solid var(--accent-cyan);
  animation: geoSpin 30s linear infinite;
}

.geo-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  animation: geoSpin 20s linear infinite reverse;
}

.geo-diamond {
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-indigo);
  transform: rotate(45deg);
  animation: geoPulse 8s ease-in-out infinite;
}

.geo-cross {
  width: 20px;
  height: 20px;
  position: relative;
  animation: geoSpin 15s linear infinite;
}
.geo-cross::before, .geo-cross::after {
  content: '';
  position: absolute;
  background: var(--accent-cyan);
}
.geo-cross::before {
  width: 2px;
  height: 100%;
  left: 50%;
  transform: translateX(-50%);
}
.geo-cross::after {
  width: 100%;
  height: 2px;
  top: 50%;
  transform: translateY(-50%);
}

@keyframes geoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes geoPulse {
  0%, 100% { opacity: 0.08; transform: rotate(45deg) scale(1); }
  50% { opacity: 0.2; transform: rotate(45deg) scale(1.3); }
}

/* ── Horizontal Scan Line ── */
.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.15;
  z-index: 9998;
  pointer-events: none;
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% { top: -2px; }
  100% { top: 100vh; }
}

/* ── Glitch Text Effect ── */
.glitch-text {
  position: relative;
}

.glitch-text:hover {
  animation: glitchShake 0.3s ease-in-out;
}

@keyframes glitchShake {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-2px, 1px); }
  20% { transform: translate(2px, -1px); }
  30% { transform: translate(-1px, 2px); }
  40% { transform: translate(1px, -2px); }
  50% { transform: translate(-2px, 0); }
  60% { transform: translate(2px, 1px); }
  70% { transform: translate(0, -1px); }
  80% { transform: translate(-1px, 0); }
  90% { transform: translate(1px, 1px); }
}

/* ── Typing Cursor ── */
.typing-cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
  color: var(--accent-cyan);
  font-weight: 400;
  margin-left: 2px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Marquee ── */
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  position: relative;
  user-select: none;
}

.marquee-row {
  display: flex;
  gap: 12px;
  width: max-content;
  will-change: transform;
}

.marquee-tile {
  width: 420px;
  height: 270px;
  flex-shrink: 0;
  border-radius: 16px;
  object-fit: cover;
  transition: all 0.6s var(--ease-out-expo);
  filter: grayscale(50%) brightness(0.7) contrast(1.1);
  border: 1px solid var(--border-dim);
}

.marquee-tile:hover {
  transform: scale(1.04) translateY(-4px);
  filter: grayscale(0%) brightness(1) contrast(1.1);
  box-shadow: 0 20px 60px rgba(0, 229, 255, 0.2), 0 0 0 1px var(--border-glow);
  border-color: var(--accent-cyan);
}

/* ── Cyber Panel (Terminal) ── */
.cyber-panel {
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-dim);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  position: relative;
}

/* Animated gradient border */
.cyber-panel::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--border-angle, 0deg), transparent 30%, var(--accent-cyan) 50%, transparent 70%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateBorder 6s linear infinite;
  opacity: 0.5;
  pointer-events: none;
}

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

@keyframes rotateBorder {
  to { --border-angle: 360deg; }
}

/* ── Terminal Tab ── */
.terminal-tab {
  transition: all 0.3s var(--ease-out-expo);
  border-bottom: 2px solid transparent;
  position: relative;
}

.terminal-tab.active {
  border-color: var(--accent-cyan);
  color: #FFFFFF;
  background: var(--accent-cyan-dim);
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.15);
}

.terminal-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* ── Tech Corner Decorations ── */
.tech-corner-decor {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--accent-cyan);
  pointer-events: none;
  opacity: 0.5;
}

.tech-corner-tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.tech-corner-tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.tech-corner-bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.tech-corner-br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

/* ── Contact Button ── */
.contact-button {
  background: linear-gradient(135deg, #00354A 0%, #00B4D8 30%, #6366F1 65%, #FFB800 100%);
  background-size: 200% 200%;
  box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  outline: 2px solid rgba(255, 255, 255, 0.3);
  outline-offset: -3px;
  transition: all 0.5s var(--ease-out-expo);
  cursor: none;
  position: relative;
  overflow: hidden;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.contact-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: 0.6s;
}

.contact-button:hover::before {
  left: 100%;
}

.contact-button:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 10px 40px rgba(0, 229, 255, 0.4), 0 0 80px rgba(99, 102, 241, 0.2);
  outline-offset: -1px;
}

.contact-button:active {
  transform: translateY(1px) scale(0.98);
}

/* ── Project Cards ── */
.projects-container {
  position: relative;
  width: 100%;
  display: block;
  padding-bottom: clamp(48px, 8vw, 96px);
  isolation: isolate;
}

.project-card-wrapper {
  position: relative;
  width: 100%;
  margin-bottom: clamp(16px, 4vw, 28px);
  scroll-margin-top: 96px;
  perspective: 1000px;
}

.project-card-wrapper:last-child {
  margin-bottom: 0;
}

.project-card {
  --project-accent: var(--accent-cyan);
  --project-accent-rgb: 0, 229, 255;
  width: 100%;
  min-width: 0;
  background:
    linear-gradient(145deg, rgba(var(--project-accent-rgb), 0.055), transparent 34%),
    var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: clamp(24px, 4vw, 48px);
  padding: clamp(18px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 28px);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  transition: border-color 0.5s ease, box-shadow 0.6s var(--ease-out-expo), transform var(--project-transform-duration, 0.6s) var(--ease-out-expo), opacity 0.3s ease;
  will-change: transform, opacity;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
}

.project-card--gold {
  --project-accent: var(--accent-gold);
  --project-accent-rgb: 255, 184, 0;
}

.project-card--indigo {
  --project-accent: var(--accent-indigo);
  --project-accent-rgb: 99, 102, 241;
}

.project-card--rose {
  --project-accent: var(--accent-rose);
  --project-accent-rgb: 244, 63, 94;
}

/* Card shimmer overlay */
.project-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(var(--project-accent-rgb), 0.07) 0%, transparent 48%);
  pointer-events: none;
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 1;
}

.project-card__header,
.project-card__body {
  position: relative;
  z-index: 3;
}

.project-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.project-card__identity {
  display: flex;
  align-items: flex-end;
  gap: clamp(12px, 2.5vw, 24px);
  min-width: 0;
}

.project-card__number {
  flex: 0 0 auto;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.06em;
}

.project-card__heading {
  min-width: 0;
}

.project-card__eyebrow,
.project-card__sequence,
.project-card__stack-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6875rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
}

.project-card__eyebrow {
  margin-bottom: 3px;
}

.project-card__title {
  color: #fff;
  font-size: clamp(1.3rem, 3vw, 2.15rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.project-card__sequence {
  flex: 0 0 auto;
  padding-left: 20px;
  color: rgba(139, 149, 165, 0.55);
  white-space: nowrap;
}

.project-card__sequence::before {
  content: '';
  display: inline-block;
  width: clamp(24px, 5vw, 64px);
  height: 1px;
  margin-right: 14px;
  vertical-align: middle;
  background: linear-gradient(90deg, transparent, rgba(var(--project-accent-rgb), 0.55));
}

.project-card__sequence b {
  color: var(--project-accent);
  font-weight: 700;
}

.project-card__body {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(18px, 2.5vw, 24px);
}

.project-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(10px, 1.5vw, 14px);
  min-width: 0;
}

.project-gallery__hero {
  aspect-ratio: 16 / 9;
}

.project-gallery__rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 14px);
  min-width: 0;
}

.project-gallery__rail .project-img-container {
  aspect-ratio: 2 / 1;
}

.project-card__footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: clamp(14px, 2vw, 20px);
  border-top: 1px solid rgba(224, 232, 240, 0.07);
}

.project-card__stack-label {
  flex: 0 0 auto;
  color: rgba(139, 149, 165, 0.7);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
  list-style: none;
}

/* ── Project Image Hover Effects ── */
.project-img-container {
  overflow: hidden;
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #080b12;
  border: 1px solid rgba(224, 232, 240, 0.08);
  border-radius: clamp(14px, 2.5vw, 26px);
}

.project-img-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--project-accent-rgb), 0.12) 0%, transparent 58%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.project-img-container img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.8s var(--ease-out-expo), filter 0.5s ease;
}

@media (min-width: 640px) {
  .project-card__footer {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }
}

@media (min-width: 720px) {
  .project-gallery {
    grid-template-columns: minmax(0, 1.65fr) minmax(210px, 1fr);
  }

  .project-gallery__rail {
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }

  .project-gallery__rail .project-img-container {
    aspect-ratio: auto;
  }
}

@media (min-width: 1024px) and (min-height: 800px) and (hover: hover) and (pointer: fine) {
  .project-card-wrapper {
    position: sticky;
    top: var(--project-stack-top, 88px);
    height: clamp(540px, min(calc(100svh - 160px), 58vw), 620px);
    margin-bottom: 0;
    will-change: transform;
  }

  .project-card {
    height: 100%;
  }
}

@media (max-width: 479px) {
  .project-card__sequence {
    display: none;
  }
}

@media (hover: hover) and (pointer: fine) {
  .project-card:hover::after,
  .project-card:hover .tilt-highlight,
  .project-img-container:hover::before {
    opacity: 1;
  }

  .project-card:hover {
    border-color: rgba(var(--project-accent-rgb), 0.22);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(var(--project-accent-rgb), 0.14);
  }

  .project-img-container:hover img {
    transform: scale(1.025);
    filter: brightness(1.06) contrast(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card-wrapper {
    position: relative;
    top: auto;
    height: auto;
    margin-bottom: clamp(16px, 4vw, 28px);
  }

  .project-card-wrapper:last-child {
    margin-bottom: 0;
  }

  .project-card {
    height: auto;
    opacity: 1 !important;
    transform: none !important;
  }

  .project-card,
  .project-img-container img,
  .project-img-container::before,
  .tilt-highlight {
    transition: none !important;
  }
}

/* ── Character Reveal ── */
.char-reveal {
  opacity: 0.15;
  transition: opacity 0.2s ease, color 0.3s ease, text-shadow 0.3s ease;
  display: inline-block;
  white-space: pre-wrap;
}

.char-reveal.active {
  opacity: 1;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.1);
}

/* ── Navbar Cyber Shell ── */
.nav-cyber {
  isolation: isolate;
  background: transparent;
  border-bottom: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.nav-cyber.scrolled {
  background: rgba(6, 8, 15, 0.88);
  border-bottom-color: rgba(0, 229, 255, 0.12);
  box-shadow: 0 4px 30px rgba(0, 229, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.nav-cyber::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.04) 0%, transparent 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.nav-cyber.scrolled::before,
.nav-cyber:hover::before {
  opacity: 1;
}

.nav-logo {
  position: relative;
  transition: filter 0.3s ease;
}

.nav-logo:hover {
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.35));
}

.nav-prefix {
  font-size: 0.65em;
  letter-spacing: 0.18em;
  color: rgba(0, 229, 255, 0.45);
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.3);
  animation: prefixPulse 2.4s ease-in-out infinite;
}

@keyframes prefixPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.nav-brand-wrap {
  position: relative;
  padding: 2px 0;
}

.nav-brand-wrap::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  top: 50%;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.6), transparent);
  opacity: 0;
  transform: scaleX(0);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out-expo);
  pointer-events: none;
}

.nav-brand-wrap:has(#nav-brand.booting)::after {
  opacity: 0.5;
  transform: scaleX(1);
}

#nav-brand {
  position: relative;
  display: inline-block;
  overflow: hidden;
}

#nav-brand::before {
  content: '';
  position: absolute;
  inset: -4px -8px;
  background: linear-gradient(105deg, transparent 40%, rgba(0, 229, 255, 0.12) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: brandShimmer 4s ease-in-out infinite;
  pointer-events: none;
}

#nav-brand.online::before {
  animation: brandShimmer 3s ease-in-out infinite;
}

@keyframes brandShimmer {
  0%, 70% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.nav-char {
  display: inline-block;
  opacity: 0;
  color: rgba(100, 116, 139, 0.25);
  transform: translateY(6px);
  filter: blur(3px);
  transition: opacity 0.12s ease, color 0.2s ease, transform 0.2s var(--ease-out-expo), filter 0.2s ease, text-shadow 0.2s ease;
}

.nav-char.active {
  opacity: 1;
  color: #E0E8F0;
  transform: translateY(0);
  filter: blur(0);
  text-shadow:
    0 0 6px rgba(0, 229, 255, 0.8),
    0 0 18px rgba(0, 229, 255, 0.35),
    0 0 32px rgba(99, 102, 241, 0.2);
}

#nav-brand.online {
  filter: drop-shadow(0 0 14px rgba(0, 229, 255, 0.25));
}

.nav-char.glitching {
  animation: navCharGlitch 0.08s steps(2) 2 !important;
}

@keyframes navCharGlitch {
  0%   { transform: translate(0, 0); color: #E0E8F0; text-shadow: 2px 0 var(--accent-cyan), -2px 0 var(--accent-rose); }
  50%  { transform: translate(-1px, 0); color: var(--accent-cyan); text-shadow: -2px 0 var(--accent-rose), 2px 0 var(--accent-cyan); }
  100% { transform: translate(0, 0); color: #E0E8F0; }
}

/* ── Navbar Links ── */
.nav-link {
  position: relative;
  padding-bottom: 4px;
}

.nav-link::before {
  content: '>';
  position: absolute;
  left: -14px;
  opacity: 0;
  color: var(--accent-cyan);
  font-size: 0.85em;
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out-expo);
  transform: translateX(4px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  transition: width 0.35s var(--ease-out-expo);
}

.nav-link:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-link-decoding {
  color: var(--accent-cyan) !important;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
}

/* ── Magnet ── */
.magnet-element {
  will-change: transform;
}

/* ── Code Mockup ── */
.code-mockup {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: clamp(0.65rem, 1.1vw, 0.85rem);
  line-height: 1.6;
  color: #8B95A5;
}

.code-keyword { color: #F43F5E; }
.code-class { color: #FFB800; }
.code-method { color: #00E5FF; }
.code-string { color: #22C55E; }
.code-comment { color: #475569; font-style: italic; }

/* ── Status Indicator Pulse ── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid currentColor;
  animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.5); opacity: 0; }
}

/* ── Tech Tag Hover ── */
.tech-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0.38rem 0.65rem;
  background: rgba(224, 232, 240, 0.04);
  border: 1px solid rgba(224, 232, 240, 0.08);
  border-radius: 999px;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.tech-tag:hover {
  border-color: rgba(var(--project-accent-rgb, 0, 229, 255), 0.3);
  background: rgba(var(--project-accent-rgb, 0, 229, 255), 0.08);
}

/* ── Section Reveal Clip ── */
.section-reveal {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1s var(--ease-out-expo);
}

/* ── Stagger children animations ── */
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
}

.stagger-in.visible > * {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s var(--ease-out-expo);
}

.stagger-in.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-in.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-in.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger-in.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger-in.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger-in.visible > *:nth-child(6) { transition-delay: 0.4s; }
.stagger-in.visible > *:nth-child(7) { transition-delay: 0.48s; }

/* ── Horizontal Rule Glow ── */
.glow-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-indigo), transparent);
  border: none;
  opacity: 0.4;
}

/* ── Number Counter Glow ── */
.num-glow {
  text-shadow: 0 0 30px currentColor, 0 0 60px currentColor;
}

/* ── Responsive Image Rounding ── */
.project-image-tall {
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border-dim);
}

@media (min-width: 640px) {
  .project-image-tall { border-radius: 24px; }
}
@media (min-width: 768px) {
  .project-image-tall { border-radius: 32px; }
}

/* ── Smooth Loading Screen ── */
.loader-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-bar {
  width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loader-bar-inner {
  width: 0%;
  height: 100%;
  background: var(--gradient-main);
  border-radius: 2px;
  animation: loadProgress 0.65s var(--ease-out-expo) forwards;
}

@keyframes loadProgress {
  to { width: 100%; }
}

/* ── Magnetic Tilt Highlight on Cards ── */
.tilt-highlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(var(--project-accent-rgb, 0, 229, 255), 0.05),
    transparent 40%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* ── Footer Glow Ring ── */
.footer-glow {
  position: absolute;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 60vw;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: footerPulse 6s ease-in-out infinite;
}

@keyframes footerPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

/* ── Project case studies + adaptive sliders ── */
.projects-intro {
  display: block;
  text-align: center;
  position: relative;
  z-index: 2;
  overflow: visible;
}

.projects-intro h2 {
  text-align: center;
}

.projects-heading {
  display: table;
  width: auto;
  max-width: none;
  margin-inline: auto;
  padding: 0.08em 0.22em;
  font-size: clamp(3.25rem, 8vw, 8.5rem);
  line-height: 0.96;
  white-space: nowrap;
  overflow: visible;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: clamp(88px, 13vw, 176px);
  padding-bottom: clamp(80px, 12vw, 150px);
}

.projects-container .project-card-wrapper:nth-child(1) { order: 4; z-index: 4; }
.projects-container .project-card-wrapper:nth-child(2) { order: 6; z-index: 6; }
.projects-container .project-card-wrapper:nth-child(3) { order: 1; z-index: 1; }
.projects-container .project-card-wrapper:nth-child(4) { order: 3; z-index: 3; }
.projects-container .project-card-wrapper:nth-child(5) { order: 2; z-index: 2; }
.projects-container .project-card-wrapper:nth-child(6) { order: 5; z-index: 5; }

.projects-container .project-card-wrapper {
  /* Keep the stacked case-study treatment at every viewport size. */
  position: sticky;
  top: calc(var(--nav-offset) + 12px);
  height: auto;
  margin: 0;
  perspective: none;
}

.projects-container .project-card {
  width: 100%;
  height: auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.65fr);
  align-items: center;
  gap: clamp(34px, 6vw, 88px);
  transform: none !important;
  opacity: 1 !important;
}

.projects-container .project-card::after { display: none; }

.project-card-wrapper--reverse .project-card {
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, 0.72fr);
}

.project-card-wrapper--reverse .project-card__content { grid-column: 2; }
.project-card-wrapper--reverse .project-slider { grid-column: 1; grid-row: 1; }

.project-card__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.projects-container .project-card__header {
  width: 100%;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(224, 232, 240, 0.11);
}

.projects-container .project-card__number {
  color: var(--project-accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.18em;
}

.projects-container .project-card__sequence {
  display: block;
  padding: 0;
  color: rgba(139, 149, 165, 0.5);
  font-size: 0.65rem;
}

.projects-container .project-card__sequence::before { display: none; }

.projects-container .project-card__heading { margin-top: clamp(32px, 5vw, 60px); }

.projects-container .project-card__eyebrow {
  margin-bottom: 10px;
  color: var(--project-accent);
  font-size: 0.66rem;
}

.projects-container .project-card__title {
  max-width: 10ch;
  font-size: clamp(2rem, 3.4vw, 3.8rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

.project-card__description {
  max-width: 41rem;
  margin-top: clamp(24px, 3.5vw, 40px);
  color: var(--text-secondary);
  font-size: clamp(0.92rem, 1.25vw, 1.06rem);
  font-weight: 300;
  line-height: 1.72;
}

.projects-container .project-card__tags {
  margin-top: 28px;
  gap: 8px;
}

.project-slider {
  --project-media-bg: #080b12;
  min-width: 0;
  position: relative;
  isolation: isolate;
}

.project-slider--light { --project-media-bg: #f7f8fa; }
.project-slider--dark { --project-media-bg: #0c0d12; }
.project-slider--neon { --project-media-bg: #050510; }

.project-slider::before {
  content: '';
  position: absolute;
  inset: 12% -4% -8%;
  z-index: -1;
  background: radial-gradient(ellipse, rgba(var(--project-accent-rgb), 0.16), transparent 68%);
  filter: blur(32px);
  opacity: 0.6;
  pointer-events: none;
}

.project-slider__viewport {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(var(--project-accent-rgb), 0.18);
  border-radius: clamp(18px, 3vw, 38px);
  background: var(--project-media-bg);
  box-shadow: 0 38px 90px rgba(0, 0, 0, 0.42);
}

.project-slider__track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translate3d(0, 0, 0);
  transition: transform 0.78s var(--ease-out-expo);
  will-change: transform;
}

.project-slider__slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  background: var(--project-media-bg);
}

.project-slider__slide::before {
  content: '';
  position: absolute;
  inset: -9%;
  z-index: 0;
  background-image: var(--slide-image);
  background-position: center;
  background-size: cover;
  filter: blur(24px) saturate(1.12);
  transform: scale(1.08);
  opacity: 0.92;
  pointer-events: none;
}

.project-slider--dark .project-slider__slide::before {
  filter: blur(24px) brightness(0.72) saturate(1.18);
}

.project-slider--neon .project-slider__slide::before {
  filter: blur(22px) brightness(0.8) saturate(1.45);
}

.project-slider__slide::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(115deg, rgba(var(--project-accent-rgb), 0.08), transparent 38%);
  opacity: 0;
  transition: opacity 0.75s ease;
  pointer-events: none;
}

.project-slider__slide.is-active::after { opacity: 1; }

.project-slider__slide img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: contain;
  transform: scale(1.045);
  filter: brightness(0.76) saturate(0.85);
  transition: transform 1.05s var(--ease-out-expo), filter 0.7s ease;
}

.project-slider__slide.is-active img {
  transform: scale(1);
  filter: brightness(0.94) saturate(1);
}

.project-slider__controls {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding-top: 18px;
}

.project-slider__progress {
  height: 1px;
  background: rgba(224, 232, 240, 0.12);
  overflow: hidden;
}

.project-slider__progress::after {
  content: '';
  display: block;
  width: var(--slider-progress, 25%);
  height: 100%;
  background: var(--project-accent);
  box-shadow: 0 0 12px rgba(var(--project-accent-rgb), 0.65);
  transition: width 0.65s var(--ease-out-expo);
}

.project-slider__count {
  min-width: 58px;
  color: rgba(139, 149, 165, 0.55);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.15em;
}

.project-slider__count b { color: var(--project-accent); }

.project-slider__arrows { display: flex; gap: 8px; }

.project-slider__arrows button {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  background: rgba(224, 232, 240, 0.035);
  border: 1px solid rgba(224, 232, 240, 0.12);
  border-radius: 50%;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-out-expo);
}

.project-slider__arrows svg { width: 16px; height: 16px; }

.project-slider.is-single .project-slider__progress,
.project-slider.is-single .project-slider__arrows { visibility: hidden; }

@media (hover: hover) and (pointer: fine) {
  .project-slider__arrows button:hover {
    color: var(--project-accent);
    border-color: rgba(var(--project-accent-rgb), 0.52);
    background: rgba(var(--project-accent-rgb), 0.08);
    transform: translateY(-2px);
  }

  .project-slider:hover .project-slider__slide.is-active img {
    transform: scale(1.018);
    filter: brightness(1) saturate(1.04);
  }
}

@media (max-width: 899px) {
  .projects-container .project-card,
  .project-card-wrapper--reverse .project-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
  }

  .project-card-wrapper--reverse .project-card__content,
  .project-card-wrapper--reverse .project-slider {
    grid-column: 1;
    grid-row: auto;
  }

  .project-card-wrapper--reverse .project-card__content { order: 0; }
  .project-card-wrapper--reverse .project-slider { order: 1; }
  .projects-container .project-card__title { max-width: none; }
  .projects-container .project-card__heading { margin-top: 28px; }
}

@media (max-width: 520px) {
  .projects-container { gap: 92px; }
  .projects-container .project-card__title { font-size: clamp(2rem, 10vw, 3rem); }
  .project-slider__viewport { aspect-ratio: 4 / 3; border-radius: 18px; }
  .project-slider__controls { gap: 12px; padding-top: 14px; }
  .project-slider__arrows button { width: 40px; height: 40px; }
  .projects-container .tech-tag { font-size: 0.61rem; }
}

@media (prefers-reduced-motion: reduce) {
  .project-slider__track,
  .project-slider__slide img,
  .project-slider__slide::after,
  .project-slider__progress::after { transition-duration: 0.01ms !important; }
}

@media (min-width: 1024px) and (min-height: 800px) {
  .projects-container {
    gap: clamp(48px, 8vh, 84px);
  }

  .projects-container .project-card-wrapper {
    position: sticky;
    top: 92px;
    height: clamp(540px, calc(100svh - 150px), 650px);
  }

  .projects-container .project-card-wrapper:nth-child(1) { order: 4; z-index: 4; }
  .projects-container .project-card-wrapper:nth-child(2) { order: 6; z-index: 6; }
  .projects-container .project-card-wrapper:nth-child(3) { order: 1; z-index: 1; }
  .projects-container .project-card-wrapper:nth-child(4) { order: 3; z-index: 3; }
  .projects-container .project-card-wrapper:nth-child(5) { order: 2; z-index: 2; }
  .projects-container .project-card-wrapper:nth-child(6) { order: 5; z-index: 5; }

  .projects-container .project-card {
    height: 100%;
    padding: clamp(28px, 3vw, 42px);
    overflow: hidden;
    background:
      linear-gradient(145deg, rgba(var(--project-accent-rgb), 0.07), transparent 36%),
      rgba(13, 17, 23, 0.97);
    border: 1px solid rgba(224, 232, 240, 0.1);
    border-radius: clamp(26px, 3vw, 42px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(24px);
  }

  .projects-container .project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(120deg, rgba(var(--project-accent-rgb), 0.08), transparent 28%);
    pointer-events: none;
  }

  .project-slider__viewport {
    max-height: calc(100svh - 260px);
  }
}

/* ── Mobile + tablet responsive system ── */
:root {
  --nav-offset: 92px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  scroll-padding-top: var(--nav-offset);
}

.noise-overlay,
.scanline,
#particle-canvas,
#main-nav {
  width: 100dvw !important;
  max-width: 100dvw !important;
}

#about,
#team,
#projects,
#contact {
  scroll-margin-top: var(--nav-offset);
}

body {
  -webkit-user-select: text;
  user-select: text;
}

a,
button,
[role='tab'] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a:focus-visible,
button:focus-visible,
[tabindex='0']:focus-visible,
[role='tab']:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 4px;
}

[tabindex='-1']:focus {
  outline: none;
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
}

.mobile-menu-toggle,
.mobile-menu {
  display: none;
}

.nav-logo,
.desktop-nav,
.mobile-menu-toggle {
  position: relative;
  z-index: 2;
}

.site-hero,
.about-section {
  min-height: 100vh;
  min-height: 100svh;
}

.hero-portrait {
  --hero-center-y: -50%;
  --hero-parallax-y: 0px;
  --hero-parallax-scale: 1;
  transform: translate3d(-50%, var(--hero-center-y), 0) translate3d(0, var(--hero-parallax-y), 0) scale(var(--hero-parallax-scale)) !important;
  transform-origin: center bottom;
}

.console-body,
.console-body > *,
.console-body > * > * {
  min-width: 0;
}

.code-mockup {
  max-width: 100%;
  overscroll-behavior-inline: contain;
}

#term-dev-skills .tech-tag {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-align: left;
}

.terminal-tab {
  min-height: 44px;
}

.project-slider,
.project-slider__viewport {
  touch-action: pan-y;
  overscroll-behavior-inline: contain;
}

.project-slider:focus-visible {
  outline: 2px solid var(--project-accent);
  outline-offset: 6px;
  border-radius: 20px;
}

.footer-meta nav,
.footer-meta > div {
  flex-wrap: wrap;
  justify-content: center;
  row-gap: 0.75rem;
}

.footer-meta a {
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
}

@media (min-width: 640px) {
  .hero-portrait {
    --hero-center-y: 0%;
  }
}

@media (min-width: 768px) and (max-width: 899px) {
  :root {
    --nav-offset: 82px;
  }

  .nav-cyber {
    padding-inline: 1.5rem !important;
    padding-block: 0.75rem !important;
    min-height: 76px;
  }

  .nav-prefix {
    display: none;
  }

  .desktop-nav {
    gap: clamp(1rem, 2.5vw, 1.5rem) !important;
  }

  .desktop-nav .nav-link {
    font-size: 0.65rem;
    letter-spacing: 0.18em;
  }

  .team-console {
    padding: 1.5rem !important;
  }

  .terminal-tab {
    padding-inline: 0.75rem !important;
    letter-spacing: 0.14em !important;
  }
}

@media (min-width: 768px) and (pointer: coarse) {
  .desktop-nav .nav-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-bottom: 0;
  }
}

@media (max-width: 767px) {
  :root {
    --nav-offset: 76px;
  }

  .main-wrapper,
  .noise-overlay,
  .scanline,
  #particle-canvas,
  #main-nav,
  .mobile-menu {
    width: 100dvw !important;
    max-width: 100dvw !important;
  }

  .nav-cyber {
    min-height: var(--nav-offset);
    padding: max(0.875rem, env(safe-area-inset-top, 0px)) 1.25rem 0.875rem !important;
  }

  .nav-cyber.is-menu-open {
    background: rgba(6, 8, 15, 0.96) !important;
    border-bottom-color: rgba(0, 229, 255, 0.14) !important;
    backdrop-filter: blur(20px) !important;
  }

  .desktop-nav {
    display: none !important;
  }

  .nav-logo {
    max-width: calc(100vw - 8.5rem);
    gap: 0.65rem !important;
    font-size: clamp(0.76rem, 3.6vw, 0.95rem) !important;
  }

  .nav-prefix {
    display: none;
  }

  .nav-brand-wrap {
    min-width: 0;
    letter-spacing: 0.1em !important;
  }

  .mobile-menu-toggle {
    min-width: 4.75rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .mobile-menu-toggle__icon {
    width: 24px;
    height: 16px;
    display: inline-flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .mobile-menu-toggle__icon span {
    width: 100%;
    height: 1px;
    display: block;
    background: currentColor;
    box-shadow: 0 0 8px rgba(0, 229, 255, 0.45);
    transition: transform 0.35s var(--ease-out-expo), color 0.25s ease;
  }

  .mobile-menu-toggle[aria-expanded='true'] .mobile-menu-toggle__icon span:first-child {
    transform: translateY(7.5px) rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded='true'] .mobile-menu-toggle__icon span:last-child {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .mobile-menu {
    position: fixed;
    inset-block: 0;
    left: 0;
    right: auto;
    z-index: 60;
    display: block;
    min-height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
      radial-gradient(circle at 82% 12%, rgba(99, 102, 241, 0.17), transparent 32%),
      radial-gradient(circle at 18% 88%, rgba(0, 229, 255, 0.11), transparent 30%),
      rgba(6, 8, 15, 0.985);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-14px);
    transition: opacity 0.35s ease, transform 0.5s var(--ease-out-expo), visibility 0s linear 0.5s;
  }

  .mobile-menu::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(0, 229, 255, 0.035) 1px, transparent 1px),
      linear-gradient(90deg, rgba(0, 229, 255, 0.035) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(circle at center, black, transparent 86%);
    pointer-events: none;
  }

  .mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
  }

  .mobile-menu__panel {
    width: min(100%, 44rem);
    min-height: 100%;
    margin-inline: auto;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-items: center;
    padding: calc(var(--nav-offset) + 2rem) 1.5rem calc(1.5rem + var(--safe-bottom));
  }

  .mobile-menu__close {
    min-width: 88px;
    min-height: 44px;
    position: absolute;
    top: max(1rem, env(safe-area-inset-top, 0px));
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .mobile-menu__close svg {
    width: 20px;
    height: 20px;
  }

  .mobile-menu__intro {
    align-self: end;
    padding-bottom: clamp(1.25rem, 5vh, 2.5rem);
  }

  .mobile-menu__eyebrow {
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.24em;
  }

  .mobile-menu__intro h2 {
    max-width: 13ch;
    margin-top: 0.65rem;
    color: rgba(224, 232, 240, 0.62);
    font-size: clamp(1.5rem, 7vw, 2.25rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.025em;
  }

  .mobile-menu__links {
    width: 100%;
    align-self: center;
    border-bottom: 1px solid rgba(224, 232, 240, 0.1);
  }

  .mobile-menu__link {
    min-height: 58px;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: center;
    border-top: 1px solid rgba(224, 232, 240, 0.1);
    color: #fff;
    font-size: clamp(2rem, 11vw, 4rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateX(-18px);
    transition: color 0.25s ease, opacity 0.35s ease, transform 0.55s var(--ease-out-expo);
  }

  .mobile-menu__link > span {
    align-self: start;
    padding-top: 1rem;
    color: var(--accent-cyan);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.12em;
  }

  .mobile-menu.is-open .mobile-menu__link {
    opacity: 1;
    transform: translateX(0);
  }

  .mobile-menu.is-open .mobile-menu__link:nth-child(1) { transition-delay: 0.08s; }
  .mobile-menu.is-open .mobile-menu__link:nth-child(2) { transition-delay: 0.13s; }
  .mobile-menu.is-open .mobile-menu__link:nth-child(3) { transition-delay: 0.18s; }
  .mobile-menu.is-open .mobile-menu__link:nth-child(4) { transition-delay: 0.23s; }

  .mobile-menu__footer {
    align-self: end;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-top: clamp(1.25rem, 4vh, 2rem);
    color: rgba(139, 149, 165, 0.62);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-menu__footer > span {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
  }

  .mobile-menu__footer a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--text-primary);
    text-transform: none;
  }

  html.mobile-menu-open,
  body.mobile-menu-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.mobile-menu-open {
    position: fixed;
    inset-inline: 0;
    width: 100%;
  }

  .site-hero {
    min-height: 100svh !important;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem calc(1rem + var(--safe-bottom)) !important;
  }

  .hero-title-wrap {
    margin-top: calc(var(--nav-offset) + 0.65rem) !important;
  }

  .site-hero .hero-main-title > div > span {
    font-size: clamp(3rem, 17.3vw, 6.4rem) !important;
  }

  .hero-portrait {
    --hero-center-y: -50%;
    width: clamp(13rem, 67vw, 18rem) !important;
    top: 48% !important;
    bottom: auto !important;
  }

  .hero-portrait img {
    border-radius: 26px !important;
  }

  .hero-portrait .absolute.bottom-5 {
    left: 0.8rem !important;
    bottom: 0.8rem !important;
    padding: 0.35rem 0.6rem !important;
    font-size: 0.46rem !important;
  }

  .hero-portrait .absolute.top-5 {
    top: 0.8rem !important;
    right: 0.8rem !important;
  }

  .hero-bottom-bar {
    padding-bottom: calc(0.5rem + var(--safe-bottom)) !important;
  }

  .marquee-section {
    padding-top: clamp(3.25rem, 10vw, 5rem) !important;
    padding-bottom: 1rem !important;
  }

  .marquee-row {
    gap: 8px;
  }

  .marquee-tile {
    width: clamp(230px, 78vw, 360px);
    height: auto;
    aspect-ratio: 14 / 9;
    border-radius: 12px;
  }

  .about-section {
    min-height: auto !important;
    padding: clamp(4.5rem, 13vw, 6rem) 1.25rem !important;
  }

  .about-heading {
    margin-bottom: 2rem !important;
  }

  .about-heading .glow-line {
    margin-top: 1rem !important;
  }

  .about-copy {
    margin-bottom: clamp(3rem, 10vw, 4.5rem) !important;
    padding-inline: 0 !important;
  }

  .about-copy p {
    font-size: clamp(0.94rem, 4vw, 1.08rem) !important;
    line-height: 1.65 !important;
  }

  .about-decor {
    width: clamp(3.5rem, 18vw, 5.5rem) !important;
    opacity: 0.22 !important;
    transform: none !important;
  }

  .about-decor--bottom {
    display: none;
  }

  .team-console {
    padding: 1rem !important;
    border-radius: 22px !important;
  }

  .terminal-toolbar {
    gap: 0.9rem !important;
    padding-bottom: 1rem !important;
  }

  .terminal-toolbar > div:first-child {
    max-width: 100%;
    min-width: 0;
  }

  .terminal-title {
    max-width: calc(100vw - 10.5rem);
    margin-left: 0.4rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .terminal-tabs {
    min-width: 0;
  }

  .terminal-tab {
    min-width: 0;
    min-height: 46px;
    padding: 0.55rem 0.5rem !important;
    gap: 0.35rem !important;
    font-size: 0.56rem !important;
    letter-spacing: 0.11em !important;
    line-height: 1.25;
  }

  .console-body {
    gap: 1.5rem !important;
    padding-top: 1.25rem !important;
  }

  .console-body .cyber-panel {
    padding: 1rem !important;
    border-radius: 16px !important;
  }

  .services-section {
    padding: clamp(4.75rem, 14vw, 6rem) 1.25rem clamp(6rem, 16vw, 8rem) !important;
    border-radius: 32px 32px 0 0 !important;
  }

  .services-section h2 {
    margin-bottom: clamp(3rem, 11vw, 5rem) !important;
    font-size: clamp(3.1rem, 15vw, 6.5rem) !important;
  }

  .service-row {
    gap: 1rem !important;
    padding-block: 1.75rem !important;
  }

  .service-row > span {
    font-size: clamp(2.75rem, 13vw, 4.5rem) !important;
  }

  .projects-section {
    padding-top: clamp(4.75rem, 14vw, 6rem) !important;
    border-radius: 32px 32px 0 0 !important;
  }

  .projects-intro {
    margin-bottom: clamp(3.5rem, 12vw, 5rem) !important;
  }

  .projects-container {
    gap: clamp(5.5rem, 20vw, 7rem);
    padding-inline: 1rem !important;
    padding-bottom: clamp(5rem, 16vw, 7rem);
  }

  .projects-container .project-card,
  .project-card-wrapper--reverse .project-card {
    gap: clamp(1.75rem, 7vw, 2.5rem);
  }

  .project-card__description {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.62;
  }

  .projects-container .project-card__tags {
    margin-top: 1.25rem;
  }

  .project-slider__controls {
    gap: 12px;
  }

  .project-slider__arrows button {
    width: 44px !important;
    height: 44px !important;
  }

  .site-footer {
    padding-top: clamp(4.75rem, 15vw, 7rem) !important;
    padding-bottom: calc(2.5rem + var(--safe-bottom)) !important;
  }

  .site-footer > .max-w-6xl {
    padding-inline: 1.25rem !important;
  }

  .site-footer .text-center.mb-16 {
    margin-bottom: clamp(2.75rem, 10vw, 4rem) !important;
  }

  .contact-panel {
    padding: 1.25rem !important;
    border-radius: 22px !important;
  }

  .contact-panel .contact-button {
    min-height: 48px;
    padding-inline: 1rem;
  }

  .footer-meta {
    margin-top: clamp(3.5rem, 12vw, 5rem) !important;
  }
}

@media (max-width: 639px) {
  .hero-bottom-bar {
    align-items: stretch !important;
    gap: 1rem !important;
  }

  .hero-bottom-bar > div {
    width: 100%;
    max-width: none !important;
  }

  .hero-bottom-bar .contact-button {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .hero-bottom-bar p {
    max-width: 16rem;
    margin-inline: auto;
  }

  .mobile-menu__footer {
    flex-direction: column;
  }
}

@media (max-width: 359px) {
  .nav-logo {
    max-width: calc(100vw - 7rem);
  }

  .nav-status-dot {
    display: none;
  }

  .mobile-menu-toggle {
    min-width: 4rem;
  }

  .mobile-menu__panel {
    padding-inline: 1.1rem;
  }

  .terminal-tab svg {
    display: none;
  }

  .contact-panel .contact-button {
    font-size: 0.62rem !important;
    letter-spacing: 0.14em !important;
  }
}

@media (max-width: 767px) and (max-height: 650px) {
  .hero-title-wrap {
    margin-top: calc(var(--nav-offset) + 0.15rem) !important;
  }

  .site-hero .hero-main-title > div > span {
    font-size: clamp(2.8rem, 14vw, 4.8rem) !important;
  }

  .hero-portrait {
    width: clamp(10.5rem, 48vw, 13.25rem) !important;
    top: 46% !important;
  }

  .hero-bottom-bar {
    gap: 0.65rem !important;
    padding-bottom: calc(0.15rem + var(--safe-bottom)) !important;
  }

  .hero-bottom-bar p {
    font-size: 0.55rem !important;
    line-height: 1.45 !important;
  }

  .hero-bottom-bar .contact-button {
    min-height: 44px;
    padding-block: 0.7rem !important;
  }
}

@media (hover: none), (pointer: coarse) {
  *,
  *::before,
  *::after {
    cursor: auto !important;
  }

  .cursor-dot,
  .cursor-ring,
  .cursor-label {
    display: none !important;
  }

  .magnet-element {
    transform: none !important;
    will-change: auto;
  }

  .marquee-tile:hover {
    transform: none;
    filter: grayscale(30%) brightness(0.78) contrast(1.05);
    border-color: var(--border-dim);
    box-shadow: none;
  }

  .project-slider__arrows button {
    width: 48px;
    height: 48px;
  }
}

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

  .mobile-menu,
  .mobile-menu__link,
  .mobile-menu-toggle__icon span,
  .hero-title-part-1,
  .hero-title-part-2,
  .marquee-row,
  .orb,
  .geo-shape,
  .scanline,
  .cyber-panel::before,
  .status-dot::after,
  .footer-glow,
  .nav-prefix,
  #nav-brand::before,
  .contact-button {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .hero-title-part-1,
  .hero-title-part-2 {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .marquee-row {
    transform: none !important;
    will-change: auto;
  }
}
