/* =========================================================
   Ahmed Gamal Ramadan — Portfolio
   Designed mobile-first. Senior-dev, polished, animated.
   ========================================================= */

/* ----------  RESET  ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Sora', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.55;
  overflow-x: hidden;
  transition: background .6s ease, color .6s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ----------  THEME TOKENS  ---------- */
body[data-theme="dark"] {
  --bg: #07090f;
  --bg-2: #0b0f18;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.09);
  --fg: #e7ecf2;
  --fg-dim: #98a2b3;
  --muted: #6b7280;
  --accent: #3ddc84;          /* Android green */
  --accent-2: #6c8cff;
  --accent-3: #ff5bd0;
  --code-bg: #0a0e17;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --grad: linear-gradient(135deg,#3ddc84 0%,#6c8cff 55%,#ff5bd0 100%);
  --blob-1: #3ddc84;
  --blob-2: #6c8cff;
  --blob-3: #ff5bd0;
  color-scheme: dark;
}
body[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-2: #ffffff;
  --surface: rgba(10,15,30,0.04);
  --surface-2: #ffffff;
  --border: rgba(10,15,30,0.10);
  --fg: #101522;
  --fg-dim: #4b5563;
  --muted: #6b7280;
  --accent: #1f9d55;
  --accent-2: #3b5cf6;
  --accent-3: #d1378f;
  --code-bg: #0a0e17;
  --shadow: 0 20px 60px rgba(15,25,55,.12);
  --grad: linear-gradient(135deg,#1f9d55 0%,#3b5cf6 55%,#d1378f 100%);
  --blob-1: #80efb6;
  --blob-2: #aebcff;
  --blob-3: #ffb1e1;
  color-scheme: light;
}

/* ----------  LAYOUT  ---------- */
.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

.section {
  padding: clamp(70px, 10vw, 130px) 0;
  position: relative;
}
.section-tight { padding: 40px 0; }
.section-projects { overflow: hidden; }

.section-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 14px;
}
.section-eyebrow.small { font-size: 10px; margin: 0 0 6px; }

.section-title {
  font-size: clamp(28px, 4.4vw, 52px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 36px;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--fg-dim); margin: 0; }

/* ----------  BACKGROUND DECORATION  ---------- */
.bg-decoration {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.blob {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .35;
  transition: opacity .6s ease;
  animation: float 20s ease-in-out infinite;
}
body[data-theme="light"] .blob { opacity: .55; }
.blob-1 { background: var(--blob-1); top: -200px; left: -200px; }
.blob-2 { background: var(--blob-2); bottom: -250px; right: -150px; animation-delay: -7s; }
.blob-3 { background: var(--blob-3); top: 40%; left: 50%; animation-delay: -13s; width: 480px; height: 480px; }

@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-60px) scale(1.08); }
  66%     { transform: translate(-30px,40px) scale(.95); }
}

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  opacity: .35;
}

/* ----------  NAV  ---------- */
.nav-shell {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav-shell.scrolled { border-bottom-color: var(--border); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.nav-logo {
  display: flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: .02em;
}
.logo-bracket { color: var(--accent); }
.logo-text { color: var(--fg); }
.logo-dot { color: var(--accent-3); }

.nav-links {
  display: flex;
  gap: 28px;
  font-size: 14.5px;
  font-weight: 500;
  order: 3;
}
.nav-links a {
  position: relative;
  color: var(--fg-dim);
  transition: color .25s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--grad);
  border-radius: 2px;
  transition: width .3s ease;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a:hover::after { width: 100%; }

.nav-burger {
  display: none;
  width: 36px; height: 36px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  order: 4;
}
.nav-burger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: .3s;
}
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ----------  THEME TOGGLE (sun/moon)  ---------- */
.theme-toggle {
  order: 2;
  padding: 0;
}
.toggle-track {
  position: relative;
  display: inline-flex;
  width: 64px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f2937, #0f172a);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4), 0 0 24px rgba(108,140,255,.15);
  transition: background .5s ease, box-shadow .5s ease;
  overflow: hidden;
}
body[data-theme="light"] .toggle-track {
  background: linear-gradient(135deg,#ffd874,#ffb86b);
  box-shadow: inset 0 1px 2px rgba(255,255,255,.7), 0 0 30px rgba(255,184,107,.35);
}
.toggle-track::before {
  /* Stars (dark) */
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(2px 2px at 14px 8px, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(1.2px 1.2px at 22px 18px, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.6px 1.6px at 10px 22px, rgba(255,255,255,.6), transparent 60%);
  opacity: 1;
  transition: opacity .5s;
}
body[data-theme="light"] .toggle-track::before { opacity: 0; }

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fefefe, #cfd6e3);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  transition: left .55s cubic-bezier(.7,-.2,.3,1.4), transform .55s, background .5s;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #0a0e17;
}
body[data-theme="light"] .toggle-thumb {
  left: 35px;
  background: radial-gradient(circle at 30% 30%, #fff7d6, #ffd574);
  box-shadow: 0 0 0 4px rgba(255,213,116,.25), 0 4px 14px rgba(255,184,107,.5);
}

.toggle-thumb .icon {
  position: absolute;
  width: 18px; height: 18px;
  transition: opacity .45s ease, transform .55s ease;
}
.toggle-thumb .sun {
  color: #f59e0b;
  opacity: 0;
  transform: rotate(-90deg) scale(.4);
}
.toggle-thumb .moon {
  color: #1f2937;
  opacity: 1;
  transform: rotate(0) scale(1);
}
body[data-theme="light"] .toggle-thumb .sun {
  opacity: 1;
  transform: rotate(0) scale(1);
  animation: sunSpin 12s linear infinite;
}
body[data-theme="light"] .toggle-thumb .moon {
  opacity: 0;
  transform: rotate(90deg) scale(.4);
}
@keyframes sunSpin {
  to { transform: rotate(360deg); }
}

/* ----------  LOADER  ---------- */
.loader {
  position: fixed; inset: 0;
  background: var(--bg);
  display: grid; place-items: center;
  z-index: 200;
  transition: opacity .6s ease, visibility .6s ease;
}
.loader.hidden {
  opacity: 0; visibility: hidden;
}
.loader-inner { text-align: center; }
.loader-inner p {
  margin-top: 26px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--fg-dim);
  font-size: 13px;
  letter-spacing: .14em;
}
.loader-bot {
  position: relative;
  width: 96px; height: 90px;
  margin: 0 auto;
  background: var(--accent);
  border-radius: 48px 48px 14px 14px;
  animation: botBob 1.4s ease-in-out infinite;
}
.loader-antenna {
  position: absolute;
  top: -16px; left: 50%;
  transform: translateX(-50%);
  width: 2px; height: 14px;
  background: var(--accent);
}
.loader-antenna::after {
  content: "";
  position: absolute;
  top: -6px; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
}
.loader-eye {
  position: absolute;
  top: 30px;
  width: 12px; height: 12px;
  background: #07090f;
  border-radius: 50%;
  animation: blink 2.4s infinite;
}
.loader-eye.left  { left: 22px; }
.loader-eye.right { right: 22px; }
.loader-mouth {
  position: absolute;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 4px;
  background: #07090f;
  border-radius: 2px;
}
@keyframes botBob {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-10px); }
}
@keyframes blink {
  0%,92%,100% { transform: scaleY(1); }
  95%         { transform: scaleY(0.1); }
}

/* ----------  HERO  ---------- */
.hero {
  padding-top: clamp(50px, 8vw, 90px);
  padding-bottom: clamp(50px, 8vw, 90px);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 60px;
  align-items: center;
  min-height: 70vh;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--fg-dim);
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin: 0 0 22px;
}
.dot-pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  70%  { box-shadow: 0 0 0 12px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  margin: 0 0 22px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.hero-title .line { display: block; }
.typed-line .typed { color: var(--accent); }
.typed-line .caret {
  display: inline-block;
  color: var(--accent);
  animation: caret 1s steps(1) infinite;
  margin-left: 2px;
}
@keyframes caret { 50% { opacity: 0; } }

.hero-sub {
  font-size: clamp(15px, 1.2vw, 17.5px);
  color: var(--fg-dim);
  max-width: 540px;
  margin: 0 0 32px;
}

.hero-cta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-bottom: 36px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .25s ease, box-shadow .3s, background .3s, color .3s;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  color: #07090f;
  background: var(--grad);
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
  box-shadow: 0 10px 30px -8px color-mix(in oklab, var(--accent) 60%, transparent);
}
.btn-primary:hover { transform: translateY(-3px); }
.btn-ghost {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
}
.btn-ghost:hover { background: var(--surface-2); }

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

.hero-social {
  display: flex; gap: 12px;
}
.hero-social a {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-dim);
  transition: transform .25s, color .25s, border-color .25s, background .25s;
}
.hero-social a:hover {
  transform: translateY(-3px);
  color: var(--fg);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: var(--surface-2);
}

/* Hero visual: phone + code window */
.hero-visual {
  position: relative;
  min-height: 480px;
  display: grid;
  place-items: center;
}
.code-window {
  position: absolute;
  top: 20px; right: 0;
  width: 78%;
  background: var(--code-bg);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  transform: rotate(-3deg);
  animation: floatY 8s ease-in-out infinite;
}
.code-window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.code-window-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.code-title {
  margin-left: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #94a3b8;
}
.code-block {
  margin: 0;
  padding: 16px 18px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: #d6e3ff;
  line-height: 1.65;
  white-space: pre;
  overflow-x: auto;
}
.code-block .k  { color: #f472b6; }
.code-block .cl { color: #60a5fa; }
.code-block .fn { color: #34d399; }
.code-block .s  { color: #fbbf24; }
.code-block .cm { color: #64748b; font-style: italic; }

@keyframes floatY {
  0%,100% { transform: rotate(-3deg) translateY(0); }
  50%     { transform: rotate(-3deg) translateY(-12px); }
}

.phone {
  position: relative;
  width: 230px; height: 460px;
  border-radius: 38px;
  background: linear-gradient(160deg,#1d222d,#0a0d14);
  border: 1px solid rgba(255,255,255,.1);
  padding: 10px;
  box-shadow: 0 35px 80px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255,255,255,.04);
  margin-top: 60px;
  transform: rotate(4deg);
  animation: floatY2 7s ease-in-out infinite;
  z-index: 1;
}
@keyframes floatY2 {
  0%,100% { transform: rotate(4deg) translateY(0); }
  50%     { transform: rotate(4deg) translateY(-14px); }
}
.phone-notch {
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  width: 80px; height: 22px;
  background: #07090f;
  border-radius: 0 0 14px 14px;
  z-index: 2;
}
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 28px;
  background: linear-gradient(180deg,#0d1320,#10182b);
  overflow: hidden;
  padding: 18px 14px;
}
.phone-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 14px;
}
.phone-icons { display: inline-flex; gap: 4px; align-items: center; }
.phone-greeting { margin-bottom: 14px; }
.ph-eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #94a3b8;
}
.phone-greeting h3 {
  margin: 2px 0 0;
  font-size: 20px;
  color: #fff;
  letter-spacing: -.01em;
}
.phone-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  margin-bottom: 10px;
  opacity: 0;
  transform: translateY(8px);
  animation: phoneIn .6s forwards;
}
.phone-card-1 { animation-delay: .8s; }
.phone-card-2 { animation-delay: 1.1s; }
.phone-card-3 { animation-delay: 1.4s; }
@keyframes phoneIn { to { opacity: 1; transform: translateY(0); } }

.ph-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}
.ph-icon-1 { background: linear-gradient(135deg,#3ddc84,#10b981); }
.ph-icon-2 { background: linear-gradient(135deg,#6c8cff,#3b5cf6); }
.ph-icon-3 { background: linear-gradient(135deg,#ff5bd0,#a855f7); }
.ph-lines { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.ph-lines span {
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.12);
}
.ph-lines span:nth-child(2) { width: 60%; background: rgba(255,255,255,.06); }
.phone-fab {
  position: absolute;
  bottom: 22px; right: 22px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--grad);
  color: #07090f;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px -6px rgba(61,220,132,.6);
  animation: fabPulse 2.4s ease-in-out infinite;
}
@keyframes fabPulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.08); }
}

@media (max-width: 900px) {
  .hero-visual { min-height: 460px; }
  .code-window { width: 90%; top: 10px; right: auto; left: 0; }
  .phone { transform: rotate(2deg); margin-top: 100px; }
}

.scroll-cue {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 38px;
  border: 2px solid var(--fg-dim);
  border-radius: 14px;
  opacity: .7;
}
.scroll-cue span {
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  width: 3px; height: 8px;
  background: var(--fg-dim);
  border-radius: 2px;
  animation: scrollDown 1.6s infinite;
}
@keyframes scrollDown {
  0%   { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 14px); }
}

/* ----------  ABOUT  ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 50px;
}
.about-grid:has(.about-photo) { grid-template-columns: 320px 1fr; }
@media (max-width: 800px) {
  .about-grid:has(.about-photo) { grid-template-columns: 1fr; }
}

.about-photo .photo-frame {
  position: relative;
  width: 280px; height: 360px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-photo .photo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  animation: ringPulse 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes ringPulse {
  0%,100% { transform: scale(1); opacity: .6; }
  50%     { transform: scale(1.04); opacity: 1; }
}

.about-text p {
  font-size: 16.5px;
  color: var(--fg-dim);
  margin: 0 0 16px;
}
.about-text strong { color: var(--fg); font-weight: 600; }

.quick-facts {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.quick-facts li {
  position: relative;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  cursor: default;
  transition:
    transform .45s cubic-bezier(.22,.61,.36,1),
    border-color .35s ease,
    background .35s ease,
    box-shadow .45s ease;
}
.quick-facts li::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.quick-facts li::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, color-mix(in oklab, var(--accent) 25%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}
.quick-facts li:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: 0 22px 50px -16px color-mix(in oklab, var(--accent) 50%, transparent);
}
.quick-facts li:hover::before { opacity: 1; }
.quick-facts li:hover::after  { opacity: 1; }
.quick-facts li:hover strong { transform: scale(1.12); }
.quick-facts li:hover span   { color: var(--fg); }

.quick-facts strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: transform .4s cubic-bezier(.22,.61,.36,1);
  transform-origin: left center;
}
.quick-facts span {
  color: var(--fg-dim);
  font-size: 13px;
  transition: color .3s;
}

/* ----------  EXPERIENCE  ---------- */
.timeline {
  position: relative;
  margin-left: 14px;
  padding-left: 30px;
  border-left: 2px dashed var(--border);
}
.t-item { position: relative; padding-bottom: 32px; }
.t-item:last-child { padding-bottom: 0; }
.t-dot {
  position: absolute;
  left: -41px;
  top: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px color-mix(in oklab, var(--accent) 15%, transparent);
}
.t-card {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: transform .3s ease, border-color .3s;
}
.t-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}
.t-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.t-head h3 { margin: 0; font-size: 18px; }
.t-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
}
.t-company {
  margin: 6px 0 12px;
  color: var(--fg-dim);
  font-size: 14.5px;
}
.t-bullets {
  list-style: disc;
  padding-left: 18px;
}
.t-bullets li {
  margin-bottom: 8px;
  color: var(--fg-dim);
  font-size: 15px;
}
.t-bullets strong { color: var(--fg); }

/* ----------  PROJECTS RAIL  ---------- */
.projects-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.rail-nav { display: flex; gap: 10px; }
.rail-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg);
  display: grid; place-items: center;
  transition: all .25s;
}
.rail-btn:hover {
  background: var(--accent);
  color: #07090f;
  border-color: var(--accent);
  transform: translateY(-2px);
}
.rail-hint {
  margin-top: 18px;
  margin-bottom: 24px;
  color: var(--fg-dim);
  font-size: 14px;
  font-family: 'JetBrains Mono', monospace;
}

.rail-wrap {
  position: relative;
  padding-block: 10px;
  /* Edge mask so cards fade off-screen */
  mask-image: linear-gradient(90deg, transparent 0, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 5%, black 95%, transparent 100%);
}
.rail {
  display: flex;
  gap: 22px;
  padding: 20px max(4vw, 30px);
  overflow-x: auto;
  scrollbar-width: none;
  /* `auto` so JS can drive continuous scroll smoothly via RAF
     while manual arrow clicks still get a smooth animated jump */
  scroll-behavior: auto;
}
.rail.smooth { scroll-behavior: smooth; }
.rail::-webkit-scrollbar { display: none; }

.p-card {
  flex: 0 0 340px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.22,.61,.36,1), box-shadow .35s, border-color .3s;
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.p-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 22px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.p-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}
.p-card:hover::before { opacity: 1; }

.p-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #0e1322, #161b2e);
  overflow: hidden;
}
body[data-theme="light"] .p-thumb {
  background: linear-gradient(135deg,#eef0f7,#f7f8fb);
}
.p-thumb img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s ease, opacity .5s ease;
}
.p-card:hover .p-thumb img { transform: scale(1.07); }

.p-thumb.empty {
  display: grid; place-items: center;
  color: var(--fg-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: .12em;
}

.p-badges {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}
.p-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(7,9,15,.7);
  color: #e7ecf2;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
}
.p-badge.live {
  background: var(--accent);
  color: #07090f;
  border-color: transparent;
}
.p-badge.wip {
  background: color-mix(in oklab, var(--accent-2) 18%, rgba(7,9,15,.6));
  color: #e7ecf2;
  border-color: color-mix(in oklab, var(--accent-2) 60%, transparent);
}
body[data-theme="light"] .p-badge.wip {
  background: color-mix(in oklab, var(--accent-2) 20%, #fff);
  color: var(--fg);
}

.p-store {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  display: flex; gap: 6px;
}
.p-store a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #07090f;
  color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  transition: transform .25s;
}
.p-store a:hover { transform: translateY(-2px); }
.p-store svg { display: block; }

.p-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.p-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.p-desc {
  margin: 0;
  color: var(--fg-dim);
  font-size: 14px;
  min-height: 40px;
}
.p-tech {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.p-tech span {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.p-cta {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.p-cta svg { transition: transform .25s; }
.p-card:hover .p-cta svg { transform: translateX(4px); }

/* ----------  SKILLS  ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.skill-group {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  transition: transform .3s, border-color .3s;
}
.skill-group:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}
.skill-group h4 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--fg);
  transition: transform .2s, background .25s, color .25s;
}
.chip:hover {
  background: var(--accent);
  color: #07090f;
  transform: translateY(-2px);
}

/* ----------  EDU PANE  ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.card-pane {
  position: relative;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform .45s cubic-bezier(.22,.61,.36,1),
    border-color .35s ease,
    background .35s ease,
    box-shadow .45s ease;
}
.card-pane::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.card-pane::after {
  content: "";
  position: absolute;
  top: -40%; right: -20%;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 25%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity .5s ease, transform .8s ease;
  pointer-events: none;
}
.card-pane:hover {
  transform: translateY(-8px);
  border-color: transparent;
  background: var(--surface-2);
  box-shadow: 0 24px 60px -18px color-mix(in oklab, var(--accent) 50%, transparent);
}
.card-pane:hover::before { opacity: 1; }
.card-pane:hover::after {
  opacity: 1;
  transform: translate(-30px, 30px);
}
.card-pane:hover h3 {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.card-pane h3 {
  margin: 0 0 6px;
  font-size: 18px;
  transition: color .3s, background .3s;
}
.pill-row { margin: 14px 0 0; }
.pill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  color: var(--accent);
}

/* ----------  CONTACT  ---------- */
.section-contact { padding-bottom: 70px; }
.contact-lead { color: var(--fg-dim); max-width: 540px; margin: 0 0 40px; }

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: transform .3s, border-color .3s, background .3s;
}
.contact-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: var(--surface-2);
}
.contact-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad);
  color: #07090f;
  flex-shrink: 0;
}
.contact-val { margin: 2px 0 0; font-weight: 500; font-size: 14.5px; word-break: break-all; }

/* ----------  FOOTER  ---------- */
.footer {
  padding: 26px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--fg-dim);
}
.footer-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.heart {
  color: var(--accent-3);
  display: inline-block;
  animation: beat 1.2s infinite;
}
@keyframes beat { 50% { transform: scale(1.2); } }
.back-top {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

/* ----------  REVEAL ANIMATIONS  ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .8s ease, transform .8s cubic-bezier(.22,.61,.36,1);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* ----------  MODAL  ---------- */
.modal {
  position: fixed; inset: 0;
  display: none;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; animation: modalFade .3s ease; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }

.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(7,9,15,.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.modal-shell {
  position: relative;
  width: min(960px, 100%);
  max-height: 92vh;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: modalPop .4s cubic-bezier(.22,.61,.36,1);
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(7,9,15,.7);
  color: #fff;
  display: grid; place-items: center;
  z-index: 5;
  border: 1px solid rgba(255,255,255,.15);
  transition: transform .25s;
}
.modal-close:hover { transform: rotate(90deg); }

.modal-body { display: grid; grid-template-columns: 1.1fr .9fr; max-height: 92vh; }
@media (max-width: 800px) { .modal-body { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; } }

.slider {
  position: relative;
  background: #0a0e17;
  overflow: hidden;
  min-height: 380px;
  max-height: 92vh;
  width: 100%;
}
.slider-track {
  display: flex;
  height: 100%;
  width: 100%;
  transition: transform .7s cubic-bezier(.22,.61,.36,1);
  will-change: transform;
}
.slider-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  display: grid;
  place-items: center;
  padding: 30px;
  box-sizing: border-box;
}
.slider-slide img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.slider-empty {
  display: grid; place-items: center;
  height: 360px;
  color: #94a3b8;
  font-family: 'JetBrains Mono', monospace;
  text-align: center;
  padding: 20px;
}
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}
.slider-dots button {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
  transition: width .3s, background .3s;
}
.slider-dots button.active {
  width: 22px;
  border-radius: 4px;
  background: var(--accent);
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(7,9,15,.6);
  color: #fff;
  display: grid; place-items: center;
  z-index: 3;
  border: 1px solid rgba(255,255,255,.12);
  transition: background .25s;
}
.slider-arrow:hover { background: var(--accent); color: #07090f; }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }

.modal-info {
  padding: 32px 30px;
  overflow-y: auto;
}
.modal-info .pill-row { margin-top: 4px; }
.modal-info h3 {
  margin: 4px 0 6px;
  font-size: 24px;
  letter-spacing: -.01em;
}
.modal-tagline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--accent);
  margin: 0;
}
.modal-desc { color: var(--fg-dim); margin: 12px 0 18px; font-size: 15px; }
.modal-meta { margin: 0 0 18px; color: var(--fg-dim); font-size: 13.5px; }
.modal-meta strong { color: var(--fg); }
.modal-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}
.modal-bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
  color: var(--fg-dim);
  font-size: 14.5px;
}
.modal-bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--grad);
}
.modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.modal-tech span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.modal-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: #07090f;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  transition: transform .25s, background .3s;
  border: 1px solid rgba(255,255,255,.12);
}
.modal-cta:hover { transform: translateY(-3px); }
.modal-cta + .modal-cta { margin-left: 8px; }

/* ----------  MOBILE NAV  ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    inset: 60px 0 auto 0;
    padding: 30px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 22px;
    transform: translateY(-110%);
    transition: transform .35s ease;
    z-index: 40;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-burger { display: flex; }
  .quick-facts strong { font-size: 22px; }
}

/* =========================================================
   RESPONSIVE — comprehensive breakpoints for every device
   ========================================================= */

/* ----------  Ultra-wide ( ≥ 1600px )  ---------- */
@media (min-width: 1600px) {
  .container { width: min(1320px, 90%); }
  .hero-title { font-size: clamp(48px, 4.5vw, 86px); }
  .section-title { font-size: clamp(36px, 3.5vw, 60px); }
  .p-card { flex: 0 0 380px; }
}

/* ----------  Large desktop ( 1200 – 1599 )  ---------- */
@media (max-width: 1199px) {
  .container { width: 94%; }
  .hero-grid { gap: 40px; }
  .code-window { font-size: 12px; }
}

/* ----------  Tablet landscape ( 900 – 1099 )  ---------- */
@media (max-width: 1099px) {
  .nav-links { gap: 22px; font-size: 14px; }
  .hero-grid { gap: 36px; }
  .skills-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .p-card { flex: 0 0 320px; }
}

/* ----------  Tablet portrait ( 760 – 899 )  ---------- */
@media (max-width: 899px) {
  .section { padding: 80px 0; }
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
    min-height: auto;
  }
  .hero-title { font-size: clamp(36px, 7vw, 60px); }
  .hero-visual { min-height: 480px; max-width: 480px; margin: 0 auto; width: 100%; }
  .code-window { width: 88%; top: 0; left: 0; right: auto; }
  .phone { margin-top: 90px; transform: rotate(3deg); }
  .about-grid:has(.about-photo) {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: left;
  }
  .modal-body { grid-template-columns: 1fr; max-height: 92vh; overflow-y: auto; }
  .slider { min-height: 300px; max-height: 60vh; }
  .slider-slide { padding: 20px; }
  .modal-info { padding: 24px 22px; }
  .two-col { grid-template-columns: 1fr; }
  .projects-head { align-items: flex-start; }
}

/* ----------  Small tablet / large phone ( 600 – 759 )  ---------- */
@media (max-width: 759px) {
  .nav { padding: 12px 0; }
  .nav-links {
    position: fixed;
    inset: 60px 0 auto 0;
    padding: 30px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 20px;
    transform: translateY(-110%);
    transition: transform .35s ease;
    z-index: 40;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-burger { display: flex; }

  .section { padding: 64px 0; }
  .section-title { font-size: clamp(26px, 7vw, 38px); margin-bottom: 28px; }
  .hero-title { font-size: clamp(34px, 9vw, 50px); }
  .hero-sub { font-size: 15px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { justify-content: center; padding: 13px 18px; font-size: 14.5px; }
  .hero-eyebrow { font-size: 11px; }

  .p-card { flex: 0 0 86vw; }
  .rail { gap: 16px; padding: 18px max(4vw, 18px); }

  .timeline { padding-left: 22px; }
  .t-dot { left: -32px; width: 14px; height: 14px; }
  .t-card { padding: 18px; }
  .t-head h3 { font-size: 16.5px; }
  .t-bullets li { font-size: 14px; }

  .quick-facts { grid-template-columns: 1fr 1fr; }
  .skills-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
  .skill-group { padding: 18px; }
  .contact-grid { grid-template-columns: 1fr; }

  .modal-shell { border-radius: 18px; }
  .modal-info { padding: 20px 18px; }
  .modal-info h3 { font-size: 20px; }
  .modal-cta { padding: 11px 14px; font-size: 13px; }

  .footer-row { flex-direction: column; gap: 10px; text-align: center; }
}

/* ----------  Phone ( 480 – 599 )  ---------- */
@media (max-width: 599px) {
  .section { padding: 56px 0; }
  .hero { padding-top: 28px; }
  .hero-visual { min-height: 420px; }
  .phone { width: 200px; height: 400px; margin-top: 110px; }
  .code-window { width: 92%; }
  .code-block { font-size: 11px; padding: 12px 14px; }
  .quick-facts { grid-template-columns: 1fr; }
  .quick-facts strong { font-size: 22px; }
  .p-card { flex: 0 0 88vw; }
  .p-store a { padding: 5px 8px; font-size: 10.5px; }
  .p-badges, .p-store { top: 10px; }
  .p-body { padding: 16px 16px 18px; }
  .p-name { font-size: 17px; }
  .p-desc { font-size: 13.5px; }
  .slider { min-height: 260px; max-height: 50vh; }
  .slider-arrow { width: 32px; height: 32px; }
  .toggle-track { width: 56px; height: 28px; }
  .toggle-thumb { width: 22px; height: 22px; top: 3px; left: 3px; }
  body[data-theme="light"] .toggle-thumb { left: 31px; }
  .toggle-thumb .icon { width: 14px; height: 14px; }
}

/* ----------  Small phone ( ≤ 380px )  ---------- */
@media (max-width: 380px) {
  .container { width: 92%; }
  .hero-title { font-size: 32px; line-height: 1.06; }
  .hero-sub { font-size: 14px; }
  .section-title { font-size: 24px; }
  .nav-logo { font-size: 14px; }
  .hero-social a { width: 38px; height: 38px; }
  .p-card { flex: 0 0 92vw; }
  .rail-btn { width: 38px; height: 38px; }
  .chip { font-size: 12px; padding: 5px 10px; }
  .contact-card { padding: 16px; gap: 12px; }
  .contact-icon { width: 40px; height: 40px; }
  .contact-val { font-size: 13.5px; }
}

/* ----------  Landscape phones ( height < 480 )  ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero { min-height: auto; padding: 30px 0; }
  .hero-grid { min-height: auto; }
  .hero-visual { display: none; }
  .scroll-cue { display: none; }
}

/* ----------  Touch-only refinements  ---------- */
@media (hover: none) and (pointer: coarse) {
  .p-card:hover { transform: none; box-shadow: 0 4px 20px rgba(0,0,0,.08); }
  .p-card:hover .p-thumb img { transform: none; }
  .skill-group:hover { transform: none; }
  .chip:hover { transform: none; }
  .rail-hint::after { content: " (swipe →)"; }
}

/* ----------  Foldables / very narrow ( ≤ 280px )  ---------- */
@media (max-width: 280px) {
  .container { width: 96%; }
  .hero-title { font-size: 26px; }
  .nav-links { padding: 20px; }
  .btn { font-size: 13px; padding: 12px 14px; }
}

/* ----------  PREFERS REDUCED MOTION  ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
