/* =========================================================
   Portfolio — Creative & Bold
   ========================================================= */

:root {
  --bg:        #050505;
  --bg-soft:   #121212;
  --text:      #f4f1e8;
  --muted:     #b8aa8f;
  --border:    rgba(255, 140, 0, 0.16);
  --card:      rgba(255, 255, 255, 0.06);

  --primary:   #ff8c00;
  --secondary: #ff5a00;
  --accent:    #ffb347;
  --warning:   #ffa500;
  --gradient:  linear-gradient(135deg, #ff8c00 0%, #ff5a00 45%, #ffb347 100%);
  --gradient-soft: linear-gradient(135deg, #ff8c0022, #ff5a0022);

  --shadow-sm: 0 12px 28px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 80px rgba(255, 140, 0, .18);

  --radius:    20px;
  --radius-sm: 12px;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
  --font-alt:     'Manrope', sans-serif;
  --scrollY: 0px;

  --container: 1320px;
}

[data-theme="dark"] {
  --bg:        #0b0a14;
  --bg-soft:   #14122a;
  --text:      #f5f3ff;
  --muted:     #a39ec2;
  --border:    rgba(255, 255, 255, 0.1);
  --card:      rgba(255, 255, 255, 0.04);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 60px rgba(255, 61, 127, .25);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  scrollbar-color: var(--primary) var(--bg-soft);
  scrollbar-width: thin;
  background: radial-gradient(circle at 14% 14%, rgba(255, 140, 0, 0.08), transparent 15%),
              radial-gradient(circle at 86% 10%, rgba(255, 255, 255, 0.06), transparent 14%),
              linear-gradient(180deg, #09080d 0%, #050505 100%);
}
*::-webkit-scrollbar { width: 16px; height: 16px; }
*::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.06); border-radius: 999px; }
*::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(255,140,0,0.95), rgba(255,90,0,0.85)); border-radius: 999px; border: 4px solid rgba(5,5,5,0.95); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 0 18px rgba(255,140,0,0.24); }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(255,180,80,0.95), rgba(255,120,20,0.95)); }
*::-webkit-scrollbar-corner { background: transparent; }
body {
  font-family: var(--font-alt);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  isolation: isolate;
  transition: background .4s ease, color .4s ease;
  letter-spacing: 0.01em;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); }
h3 { font-size: 1.2rem; }

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Background blobs ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
#networkCanvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 1;
}

/* Custom cursor — a small dot plus a lagging outer ring.
   Only enabled on devices with a precise pointer (mouse/trackpad). */
.cursor-ring, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  html { cursor: none; }
  a, button, input, textarea, .frame, .orbit-item, .skill-pill { cursor: none; }
  .cursor-ring, .cursor-dot {
    display: block;
    position: fixed;
    top: 0; left: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--primary);
    transition: opacity .2s ease;
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1.5px solid rgba(255,140,0,.55);
    transition: width .2s ease, height .2s ease, border-color .2s ease, background .2s ease;
  }
  .cursor-ring.hovered {
    width: 54px; height: 54px;
    background: rgba(255,140,0,.1);
    border-color: var(--primary);
  }
}
.blob {
  position: absolute; width: 500px; height: 500px; border-radius: 50%;
  filter: blur(120px); opacity: .28; animation: float 18s ease-in-out infinite;
}
.blob-1 { background: var(--primary);   top: -150px; left: -100px; }
.blob-2 { background: var(--secondary); bottom: -150px; right: -100px; animation-delay: -6s; }
.blob-3 { background: var(--accent);    top: 40%; left: 50%; animation-delay: -12s; }
@keyframes float {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(32px,-24px) scale(1.08); }
}

/* ---------- Navbar ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  backdrop-filter: blur(14px);
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-bottom: 1px solid var(--border);
}
.logo { font-family: var(--font-mono); font-weight: 600; font-size: 1.1rem; }
.logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 1.1rem; list-style: none; flex-wrap: wrap; }
.nav-links a {
  font-size: .85rem; font-weight: 500; color: var(--muted);
  position: relative; padding: .25rem 0;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; height: 2px; width: 0;
  background: var(--gradient); transition: width .3s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-actions { display: flex; gap: .5rem; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border);
  font-size: 1.1rem; transition: transform .2s, background .2s;
}
.icon-btn:hover { transform: scale(1.1); background: var(--gradient-soft); }
.menu-btn { display: none; }

/* ---------- Music toggle ---------- */
#musicToggle.is-playing {
  color: #fff;
  border-color: transparent;
  background: var(--gradient);
  animation: music-pulse 1.6s ease-in-out infinite;
}
@keyframes music-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.0); }
  50% { box-shadow: 0 0 0 6px rgba(255,255,255,.08); }
}

/* ---------- Layout ---------- */
.section {
  max-width: var(--container); margin: 0 auto;
  padding: 5rem clamp(1rem, 4vw, 3rem);
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 2.8vw, 2.5rem);
  margin-bottom: 3rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid rgba(255, 140, 0, .16);
  display: flex; align-items: center; gap: .75rem;
  position: relative;
}
.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 160px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 140, 0, .95), rgba(255, 90, 0, .45));
  opacity: .55;
}
.section-title .num {
  font-family: var(--font-mono); font-size: 1rem;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 0;
  max-width: var(--container); margin: 0 auto;
  padding: 5.5rem clamp(1rem, 4vw, 3rem) 4rem;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem;
  align-items: center;
}
.eyebrow { color: var(--primary); font-weight: 600; margin-bottom: .5rem; font-family: var(--font-mono); }
.hero h1 {
  margin-bottom: .5rem;
  position: relative;
  background-image: linear-gradient(120deg, #fff 0%, #ff9c12 30%, #fff 60%, #ff8c00 100%);
  background-size: 250% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  animation: hero-name-wave 5s ease-in-out infinite;
  text-shadow: 0 0 18px rgba(255, 140, 0, .15);
}
.hero h2 {
  color: var(--muted);
  font-weight: 500;
  font-size: clamp(1.3rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
  letter-spacing: 0.03em;
  max-width: 680px;
}
.hero h2 .gradient-text { font-weight: 700; }
.hero h2 .caret { margin-left: .25rem; }
.caret { animation: blink 1s steps(1) infinite; color: var(--primary); }
@keyframes blink { 50% { opacity: 0; } }
@keyframes hero-name-wave {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.lead { color: var(--muted); max-width: 540px; margin-bottom: 2rem; font-size: 1.05rem; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-card { display: grid; place-items: center; }
.hero-card .code-window { width: 100%; max-width: 560px; }
.btn {
  padding: .95rem 1.65rem; border-radius: calc(var(--radius-sm) + 2px);
  font-weight: 700; font-size: .98rem;
  transition: transform .2s, box-shadow .2s, background .2s;
  display: inline-flex; align-items: center; gap: .45rem;
}
.btn-primary { background: var(--gradient); color: white; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-ghost { border: 1.5px solid var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-3px); box-shadow: 0 18px 40px rgba(255, 140, 0, .15); }
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top left, rgba(255,255,255,.18), transparent 40%);
  opacity: 0;
  transition: opacity .35s ease;
}
.btn:hover::before { opacity: 1; }
.socials { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.socials a { font-size: .95rem; font-weight: 600; color: var(--muted); padding-bottom: 2px; border-bottom: 1px solid transparent; }
.socials a:hover { color: var(--primary); border-color: var(--primary); }

/* Code window */
.code-window {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; transform: rotate(-1.2deg); transition: transform .4s;
}
.code-window:hover { transform: rotate(0) scale(1.02); }
.dots { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); }
.dots span:nth-child(2) { background: var(--warning); }
.dots span:nth-child(3) { background: var(--accent); }
.code-window pre { padding: 1.5rem; font-family: var(--font-mono); font-size: .85rem; line-height: 1.7; overflow-x: auto; }
.kw  { color: var(--primary); } .cls { color: var(--accent); } .str { color: var(--warning); }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 3rem; align-items: center; }
.about-grid p { color: var(--muted); margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.85; }
.quick-facts { list-style: none; margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.quick-facts li {
  padding: .7rem 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem;
}

/* Profile image — free-flowing frame, no card or blob mask */
.profile-wrap { position: relative; display: grid; place-items: center; }
.profile-frame {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 3 / 4;
}

/* =========================================================
   Skills — orbit + category breakdown
   ========================================================= */
.skills-lead { color: var(--muted); max-width: 640px; margin: 0 auto 4.5rem; text-align: center; font-size: 1.05rem; line-height: 1.8; }

/* ---- Visual layout: orbit centered, flanking panels fill the
   spare width either side on wide screens instead of sitting empty. ---- */
.skills-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5.5rem;
  margin-bottom: 4.5rem;
}
.orbit-side {
  display: none;
  flex-direction: column;
  width: 200px;
  flex-shrink: 0;
}
.orbit-side-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
  padding-bottom: .65rem;
  border-bottom: 1px solid rgba(255,140,0,.2);
  width: 100%;
}
.orbit-side-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding-left: 1.4rem;
}
.orbit-side-list::before {
  content: '';
  position: absolute;
  left: 4px; top: 8px; bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,140,0,.55), rgba(255,140,0,.04));
}
.mini-chip {
  position: relative;
  padding: .6rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,140,0,.16);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  opacity: 0;
  transform: translateX(-8px);
  animation: side-chip-in .5s ease forwards;
}
.orbit-side-list .mini-chip:nth-child(1) { animation-delay: .1s; }
.orbit-side-list .mini-chip:nth-child(2) { animation-delay: .22s; }
.orbit-side-list .mini-chip:nth-child(3) { animation-delay: .34s; }
.orbit-side-list .mini-chip:nth-child(4) { animation-delay: .46s; }
.mini-chip::before {
  content: '';
  position: absolute;
  left: -1.4rem; top: 50%;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(255,140,0,.65);
}
@keyframes side-chip-in {
  to { opacity: 1; transform: translateX(0); }
}
.mini-chip:hover { transform: translateX(3px); border-color: var(--primary); background: rgba(255,140,0,.1); }

.orbit-side--right { align-items: flex-end; }
.orbit-side--right .orbit-side-list { padding-left: 0; padding-right: 1.4rem; align-items: flex-end; }
.orbit-side--right .orbit-side-list::before { left: auto; right: 4px; }
.orbit-side--right .mini-chip { transform: translateX(8px); }
.orbit-side--right .mini-chip::before { left: auto; right: -1.4rem; }
.orbit-side--right .mini-chip:hover { transform: translateX(-3px); }
@keyframes side-chip-in-right {
  to { opacity: 1; transform: translateX(0); }
}
.orbit-side--right .mini-chip { animation-name: side-chip-in-right; }

@media (min-width: 1420px) {
  .orbit-side { display: flex; }
}

/* ---- Orbit: items placed with real trigonometry (rotate + translate + counter-rotate)
   so they're always evenly spaced and can never overlap, at any size. ---- */
.skills-orbit {
  position: relative;
  width: 420px;
  height: 420px;
  max-width: 100%;
  --radius: 175px;
}
.orbit-ring {
  position: absolute; inset: 0; margin: auto;
  border-radius: 50%;
  border: 1px dashed rgba(255,140,0,.16);
}
.ring-1 { width: 68%; height: 68%; animation: orbit-spin 44s linear infinite; }
.ring-2 { width: 100%; height: 100%; animation: orbit-spin 70s linear infinite reverse; border-style: dotted; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }

.orbit-core {
  position: absolute; inset: 0; margin: auto;
  width: 132px; height: 132px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(160deg, rgba(255,140,0,.22), rgba(255,90,0,.1));
  border: 1px solid rgba(255,140,0,.3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  animation: orbit-pulse 2.8s ease-out infinite;
  z-index: 2;
}
@keyframes orbit-pulse {
  0%, 100% { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 0 rgba(255,140,0,.35); }
  50%      { box-shadow: 0 20px 50px rgba(0,0,0,.35), 0 0 0 16px rgba(255,140,0,0); }
}

.orbit-item {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  transform: rotate(calc(360deg / 8 * var(--i))) translateX(var(--radius));
}
.orbit-item span {
  position: absolute;
  top: 0; left: 0;
  transform: rotate(calc(-360deg / 8 * var(--i))) translate(-50%, -50%) scale(.4);
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.15rem;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,140,0,.24);
  color: var(--text);
  font-weight: 700;
  font-size: .82rem;
  box-shadow: 0 15px 32px rgba(0,0,0,.3);
  opacity: 0;
  animation: orbit-pop .55s cubic-bezier(.34,1.56,.64,1) forwards;
  animation-delay: calc(var(--i) * 90ms + .2s);
  transition: border-color .25s ease, background .25s ease, transform .25s ease;
}
.orbit-item:hover span {
  border-color: var(--primary);
  background: rgba(255,140,0,.16);
  transform: rotate(calc(-360deg / 8 * var(--i))) translate(-50%, -50%) scale(1.1);
}
@keyframes orbit-pop {
  to { opacity: 1; transform: rotate(calc(-360deg / 8 * var(--i))) translate(-50%, -50%) scale(1); }
}

/* ---- Category breakdown ---- */
.skill-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.skill-category {
  position: relative;
  padding: 1.9rem 1.6rem 1.6rem;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-left: 3px solid rgba(255,140,0,.35);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.skill-category::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,140,0,.08) 38%, transparent 100%);
  opacity: .6;
}
.skill-category:hover { transform: translateY(-6px); border-left-color: var(--primary); }
.skill-category-index {
  display: block;
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  margin-bottom: .9rem;
  position: relative;
  z-index: 1;
}
.skill-category h3 {
  margin-bottom: .75rem;
  position: relative;
  z-index: 1;
}
.skill-category p {
  color: var(--muted);
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}
.skill-pill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  position: relative;
  z-index: 1;
}
.skill-pill {
  padding: .65rem .95rem;
  border-radius: 999px;
  background: rgba(255,140,0,.13);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid rgba(255,140,0,.16);
  transition: transform .2s ease, background .2s ease;
}
.skill-pill:hover { transform: translateY(-2px); background: rgba(255,140,0,.22); }

/* =========================================================
   FREE-FLOWING IMAGE FRAMES — no borders, no card backdrop.
   The image bleeds naturally; a floating glass tag labels it.
   ========================================================= */

/* Image frame (used everywhere) */
.frame {
  position: relative; cursor: pointer;
  display: grid; place-items: center;
  overflow: hidden;
  width: 100%;
  border-radius: 28px;
  transform-origin: center center;
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s;
  box-shadow: 0 30px 70px rgba(0,0,0,.4);
}
.frame:hover { transform: translateY(-8px); box-shadow: 0 40px 90px rgba(0,0,0,.5); }
.frame img {
  position: absolute;
  inset: 0;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  object-fit: cover;
  object-position: center;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at center, #000 78%, transparent 100%);
  mask-image: radial-gradient(ellipse 85% 85% at center, #000 78%, transparent 100%);
}

/* About photo — fully free-flowing: no hard edges, no card box,
   just the portrait fading into the page with floating badges around it. */
.profile-frame {
  overflow: visible;
  box-shadow: none;
}
.profile-frame img {
  -webkit-mask-image: radial-gradient(ellipse 62% 68% at 50% 40%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 68% at 50% 40%, #000 55%, transparent 100%);
}
.floating-badge {
  position: absolute;
  z-index: 4;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  color: #fff;
  background: rgba(8, 8, 16, .65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 10px 28px rgba(0,0,0,.4);
  white-space: nowrap;
}
.badge-1 { top: 8%; right: -6%; }
.badge-2 { top: 48%; left: -14%; }
.badge-3 { bottom: 10%; right: -10%; }

/* Floating tag — dark glass pill resting over the image, like a caption chip */
.frame-tag {
  position: absolute; top: 16px; left: 16px; z-index: 3;
  padding: .4rem .9rem; border-radius: 999px;
  font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  color: #fff;
  background: rgba(8, 8, 16, .55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  letter-spacing: .03em;
}

/* Zigzag — Projects, Internships */
.zigzag { display: flex; flex-direction: column; gap: 7rem; }
.zz-item {
  position: relative;
  display: grid; grid-template-columns: minmax(240px, 400px) 1fr; gap: 4.5rem; align-items: center;
  overflow: hidden;
}
.zz-item:nth-child(even) { direction: rtl; }
.zz-item:nth-child(even) > * { direction: ltr; }

.zz-item .frame {
  aspect-ratio: 4 / 3;
  width: 100%;
  max-width: 400px;
}

/* gradient backdrop behind the frame */
.zz-item .frame::before {
  content: ''; position: absolute;
  inset: -18px -18px auto auto;
  width: 65%; height: 65%; z-index: -1;
  background: var(--gradient); opacity: .25; filter: blur(40px);
  border-radius: 30px;
}

.zz-text h3 { font-size: clamp(1.45rem, 2.5vw, 1.8rem); margin-bottom: 1rem; letter-spacing: .01em; font-weight: 700; }
.zz-text h3 .t-org { display: block; margin-top: .45rem; color: var(--primary); font-weight: 700; font-size: 1rem; }
.zz-text > p { color: var(--muted); margin-bottom: 1rem; font-family: var(--font-alt); font-size: 1.03rem; line-height: 1.8; }
.zz-text { padding-top: .5rem; max-width: 580px; justify-self: left; }
.zz-text ul { margin-top: .85rem; padding-left: 1.25rem; }
.zz-text ul li { font-family: var(--font-alt); font-size: 1.03rem; line-height: 1.8; }
.zz-text > .t-org {
  display: block;
  margin: -.5rem 0 1rem;
  color: var(--primary);
  font-weight: 700;
  font-size: .88rem;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}

/* Link pills — gradient outline */
.link-row { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.link-pill {
  position: relative; padding: .55rem 1.1rem;
  font-size: .82rem; font-weight: 600;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid transparent;
  background-image: linear-gradient(var(--bg), var(--bg)), var(--gradient);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  transition: transform .2s, box-shadow .2s, color .2s;
}
.link-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--primary);
}
.zz-text .chips {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  margin-top: 1.2rem;
}
.zz-text .chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .75rem 1.15rem;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  background: rgba(255,140,0,.18);
  border: 1px solid rgba(255,140,0,.28);
  box-shadow: 0 18px 42px rgba(0,0,0,.18);
  transition: transform .2s, background .2s, border-color .2s, box-shadow .2s;
}
.zz-text .chips span:hover {
  transform: translateY(-2px) scale(1.02);
  background: rgba(255,140,0,.32);
  border-color: rgba(255,140,0,.48);
  box-shadow: 0 18px 50px rgba(255, 140, 0, .45), inset 0 0 0 1px rgba(255,255,255,.12);
}

/* ---------- Certifications — simplified logo cards ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.cert-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  box-shadow: 0 18px 40px rgba(0,0,0,.16);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  position: relative;
  overflow: hidden;
}
.cert-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,140,0,.07), transparent 55%);
  pointer-events: none;
}
.cert-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.cert-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.cert-logo {
  flex-shrink: 0;
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.cert-logo--hackerrank { background: linear-gradient(135deg, #2ec866, #14854a); }
.cert-logo--tuf        { background: linear-gradient(135deg, #6c5ce7, #4834b8); }
.cert-logo--anthropic  { background: linear-gradient(135deg, #d97757, #b85c3f); }
.cert-head-text h3 { font-size: 1.05rem; margin-bottom: .3rem; line-height: 1.35; }
.cert-card .cert-issuer { color: var(--muted); font-size: .85rem; display: block; margin: 0; }
.cert-card ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .6rem;
  position: relative; z-index: 1;
}
.cert-card ul li {
  position: relative;
  padding-left: 1.2rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.cert-card ul li::before {
  content: '•';
  position: absolute; left: 0; top: 0;
  color: var(--primary);
}
.cert-card .link-row { margin-top: auto; position: relative; z-index: 1; }

@media (max-width: 900px) {
  .cert-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .cert-grid { grid-template-columns: 1fr; }
}

/* ---------- Education ---------- */
.edu-lead { color: var(--muted); max-width: 640px; margin-bottom: 2.5rem; font-family: var(--font-alt); font-size: 1.05rem; line-height: 1.8; }
.edu-cards { display: grid; gap: 1.75rem; }
.edu-card {
  position: relative;
  padding: 2rem 1.8rem 1.7rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  box-shadow: 0 28px 70px rgba(0,0,0,.2);
  overflow: hidden;
}
.edu-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 6px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--secondary));
  border-radius: 999px;
}
.edu-card h3 { margin-bottom: .5rem; }
.edu-card .t-org { display: block; margin-bottom: .75rem; color: var(--muted); font-weight: 400; }
.edu-card .t-date { display: block; color: var(--accent); font-family: var(--font-mono); margin-bottom: 1rem; }
.edu-card ul { list-style: none; padding-left: 0; display: grid; gap: .75rem; }
.edu-card ul li {
  position: relative;
  padding-left: 1.35rem;
  color: var(--muted);
  font-family: var(--font-alt);
  font-size: 1.03rem;
  line-height: 1.8;
}
.edu-card ul li::before {
  content: '•';
  position: absolute;
  left: 0; top: 0;
  color: var(--primary);
}

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--gradient); border-radius: 2px;
}
.t-item { position: relative; padding-bottom: 2rem; }
.t-dot {
  position: absolute; left: -1.85rem; top: 6px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
}
.t-body h3 { margin-bottom: .25rem; }
.t-org { color: var(--muted); font-weight: 400; font-size: .95rem; }
.t-date { color: var(--accent); font-family: var(--font-mono); font-size: .85rem; margin-bottom: .5rem; }
.t-body p:last-child { color: var(--muted); }

/* ---------- Contact ---------- */
.contact-lead { color: var(--muted); margin-bottom: 2rem; max-width: 600px; font-size: 1.05rem; line-height: 1.8; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr .8fr;
  gap: 2rem;
  align-items: start;
  position: relative;
}
.contact-details {
  display: flex; flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  max-width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
.contact-details h3 {
  color: var(--primary);
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: .25rem;
}
.contact-detail {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem;
  border-radius: calc(var(--radius-sm) - 2px);
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
a.contact-detail:hover {
  border-color: var(--primary);
  background: rgba(255,140,0,.08);
  transform: translateX(3px);
}
.contact-detail-icon { font-size: 1.3rem; flex-shrink: 0; }
.contact-detail-text { display: flex; flex-direction: column; gap: .15rem; }
.contact-detail-text strong { color: var(--text); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.contact-detail-text span { color: var(--muted); font-size: .98rem; font-family: var(--font-alt); }
.btn-large {
  padding: .9rem 1.6rem;
  font-size: 1rem;
  align-self: flex-start;
  margin-top: .5rem;
}
.contact-panel {
  display: flex; flex-direction: column; gap: 1.25rem;
  padding: 1.75rem; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); box-shadow: 0 16px 40px rgba(0,0,0,.16);
  position: relative;
}
.contact-panel h3 {
  color: var(--primary); position: relative; z-index: 1;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .04em; text-transform: uppercase;
}
.quick-connect {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: .6rem;
  position: relative; z-index: 1;
}
.quick-connect a {
  display: flex; align-items: center; gap: .35rem;
  padding: .55rem .95rem;
  border-radius: 999px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,140,0,.16);
  font-weight: 600;
  font-size: .88rem;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.quick-connect a i { font-style: normal; color: var(--primary); }
.quick-connect a:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  background: rgba(255,140,0,.1);
}
.contact-availability {
  padding: .9rem 1.05rem;
  border-radius: var(--radius-sm);
  background: rgba(255,140,0,.08);
  border: 1px solid rgba(255,140,0,.14);
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: .2rem;
}
.contact-availability strong { color: var(--text); font-size: .85rem; }
.contact-availability span { color: var(--muted); font-size: .85rem; }

@media (max-width: 900px) {
  .contact-panel { order: -1; }
}

/* ---------- Footer ---------- */
.footer {
  padding: 4.5rem clamp(1rem, 4vw, 3rem) 2rem;
  border-top: 1px solid rgba(255, 140, 0, .14);
  color: var(--muted);
  font-size: .95rem;
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}
.footer-top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.75rem;
}
.footer-logo {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.footer-logo:hover { color: var(--primary); }
.footer-tagline {
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 320px;
}
.footer-socials { display: flex; flex-wrap: wrap; gap: .6rem; }
.footer-socials a {
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255,140,0,.18);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  transition: border-color .2s, background .2s, transform .2s;
}
.footer-socials a:hover {
  border-color: var(--primary);
  background: rgba(255,140,0,.1);
  transform: translateY(-2px);
}
.footer-col h3 {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1.2rem;
}
.footer-col a {
  display: block;
  margin-bottom: .85rem;
  color: var(--muted);
  transition: color .2s, transform .2s;
}
.footer-col a:hover { color: var(--text); transform: translateX(3px); }
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,140,0,.1);
}
.footer-bottom p { color: var(--muted); }
.footer-bottom .icon-btn {
  width: 48px; height: 48px;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 140, 0, .16);
}

/* ---------- Scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .6s, transform .6s;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 10%, rgba(255, 140, 0, 0.16), transparent 18%),
              radial-gradient(circle at 90% 15%, rgba(255, 90, 0, 0.12), transparent 14%),
              radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.06), transparent 18%);
  opacity: .85;
  mix-blend-mode: screen;
  z-index: -1;
}

.section {
  position: relative;
  overflow: hidden;
}

.section::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 140, 0, 0.12), transparent 55%);
  opacity: .55;
  pointer-events: none;
  transform: translateY(calc(var(--scrollY) * -0.15));
}

.section:nth-child(even)::before {
  left: -30px;
  right: auto;
  top: 30px;
  background: radial-gradient(circle, rgba(255, 90, 0, 0.10), transparent 55%);
}

.nav {
  background: rgba(8, 8, 22, 0.82);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
}

.nav.scrolled {
  backdrop-filter: blur(18px);
  background: rgba(8, 8, 22, 0.92);
  border-color: rgba(255, 140, 0, 0.18);
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 140, 0, 0.12), transparent 25%),
              radial-gradient(circle at 80% 40%, rgba(255, 255, 255, 0.08), transparent 18%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-card {
  perspective: 1200px;
}

.code-window {
  transform-style: preserve-3d;
  transition: transform .4s ease, box-shadow .4s ease;
}

.code-window:hover {
  box-shadow: 0 30px 80px rgba(255, 140, 0, 0.3);
}

.hero-card:hover .code-window {
  transform: rotateX(3.2deg) rotateY(-4.8deg) translateZ(4px);
}

.frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.18), transparent 30%);
  opacity: 0;
  transition: opacity .4s ease;
}

.frame:hover::after {
  opacity: 1;
}

.edu-card:hover,
.contact-panel:hover,
.contact-details:hover {
  transform: translateY(-5px);
}

.link-pill {
  background-image: linear-gradient(var(--bg), var(--bg)), linear-gradient(135deg, rgba(255, 140, 0, 0.18), rgba(255, 90, 0, 0.22));
}

.link-pill:hover {
  color: #fff;
  background-image: linear-gradient(135deg, rgba(255, 140, 0, 0.95), rgba(255, 90, 0, 0.95)), linear-gradient(var(--bg), var(--bg));
}

.footer {
  background: radial-gradient(circle at top center, rgba(255, 140, 0, 0.05), transparent 60%);
}

@media (max-width: 780px) {
  .hero-card:hover .code-window {
    transform: none;
  }
}

/* ---------- Tablet: shrink the orbit radius so labels have room ---------- */
@media (max-width: 1180px) and (min-width: 769px) {
  .skills-orbit { width: 360px; height: 360px; --radius: 148px; }
  .orbit-core { width: 112px; height: 112px; font-size: .92rem; }
  .skill-categories { grid-template-columns: 1fr 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1300px) {
  .hero { grid-template-columns: 1fr; text-align: left; }
  .about-grid { grid-template-columns: 1fr; }
  .profile-frame { max-width: 260px; }
  .contact-grid { grid-template-columns: 1fr; }
  .zz-item { grid-template-columns: 1fr; gap: 2rem; }
  .zz-item:nth-child(even) { direction: ltr; }
  .zz-item .frame, .zz-item:nth-child(even) .frame { transform: rotate(0); }
  .zigzag { gap: 4.5rem; }
  .skill-categories { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
/* Nav needs real room for 10 items — collapse to the hamburger menu
   well before it would wrap onto two messy lines. */
@media (max-width: 1150px) {
  .menu-btn { display: grid; }
  .nav-links {
    position: absolute; top: 100%; right: 1rem;
    flex-direction: column; gap: .5rem; padding: 1rem;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    display: none; min-width: 180px;
  }
  .nav-links.open { display: flex; }
}
@media (max-width: 768px) {
  .quick-facts { grid-template-columns: 1fr; }
  .badge-1 { top: 6%; right: 2%; }
  .badge-2 { top: 46%; left: -4%; }
  .badge-3 { bottom: 6%; right: 0%; font-size: .68rem; }
  .skills-orbit {
    width: 100%; height: auto;
    display: flex; flex-wrap: wrap;
    justify-content: center;
    gap: .7rem;
  }
  .orbit-ring { display: none; }
  .orbit-core {
    position: static;
    width: auto; height: auto;
    flex-basis: 100%;
    padding: 1rem 1.5rem;
    border-radius: 999px;
    margin: 0 auto .75rem;
    line-height: 1.1;
  }
  .orbit-item { position: static; width: auto; height: auto; transform: none; }
  .orbit-item span {
    position: static;
    animation: none;
    opacity: 1;
    transform: none;
  }
  .skill-categories { grid-template-columns: 1fr; }
}

/* Lighter decorative layers on smaller/lower-power devices —
   blur() is expensive, and phones were carrying the full stack
   of blobs + section glows + hover glows at once. */
@media (max-width: 768px) {
  .blob { filter: blur(70px); }
  .section::before { display: none; }
  body::before { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  .frame, .zz-item .frame { transform: none !important; }
  .orbit-item span { opacity: 1 !important; }
}
@media (prefers-reduced-motion: reduce) and (min-width: 769px) {
  .orbit-item span {
    transform: rotate(calc(-360deg / 8 * var(--i))) translate(-50%, -50%) scale(1) !important;
  }
}
/* =========================================================
   NEW — Skills tag-cloud (Languages / Backend & APIs / Databases & Tools / AI-Assisted Tools)
   ========================================================= */
.skills-cloud {
  display: grid;
  gap: 2.6rem;
  margin-top: 3rem;
}
.skills-group {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 1.75rem;
  align-items: start;
  padding-bottom: 2.2rem;
  border-bottom: 1px solid var(--border);
}
.skills-group:last-child { border-bottom: none; padding-bottom: 0; }
.skills-group-label {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.skills-group-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--gradient-soft);
  font-size: 1.15rem;
}
.skills-group-label h3 { font-size: 1.02rem; margin: 0; line-height: 1.3; }
.skills-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: .7rem;
}
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  font-family: var(--font-alt);
  font-size: .87rem;
  color: var(--text);
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease;
}
.skill-chip:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  background: rgba(255,140,0,.1);
  box-shadow: 0 10px 24px rgba(255,140,0,.15);
}
.chip-icon { font-size: .95rem; width: 18px; height: 18px; flex-shrink: 0; object-fit: contain; }
.chip-icon--emoji { display: inline-flex; align-items: center; justify-content: center; }

@media (max-width: 760px) {
  .skills-group { grid-template-columns: 1fr; gap: .9rem; }
}


/* =========================================================
   NEW — Projects card grid
   ========================================================= */
.project-filter {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem;
  margin-bottom: 3rem;
}
.filter-btn {
  padding: .65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}
.filter-btn:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }
.filter-btn.active {
  background: var(--gradient);
  border-color: transparent;
  color: #1a0a00;
  box-shadow: 0 14px 32px rgba(255,140,0,.28);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  column-gap: 2rem;
  row-gap: 3.5rem;
}
.project-card.is-filtered-out { display: none; }
.project-card {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  transition: transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.project-card:hover { transform: translateY(-8px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.project-card-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--bg-soft); }
.project-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.project-card:hover .project-card-media img { transform: scale(1.06); }
.project-card-tag {
  position: absolute; top: .9rem; left: .9rem;
  padding: .35rem .85rem; border-radius: 999px;
  background: rgba(5,5,5,.72); backdrop-filter: blur(6px);
  color: var(--accent); font-family: var(--font-mono); font-size: .7rem;
  border: 1px solid var(--border);
}
.project-card-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; flex: 1; }
.project-card-body h3 { font-size: 1.06rem; line-height: 1.4; }
.project-card-body p { color: var(--muted); font-size: .92rem; line-height: 1.7; font-family: var(--font-alt); }
.project-card-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.project-card-tags span {
  padding: .3rem .75rem; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,140,0,.08);
  color: var(--accent); font-size: .72rem; font-family: var(--font-mono);
}
.project-card-actions { margin-top: auto; display: flex; gap: .75rem; }
.project-btn {
  flex: 1; text-align: center;
  padding: .65rem 1rem; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project-btn:hover { transform: translateY(-2px); }
.project-btn-primary { background: var(--gradient); border-color: transparent; color: #1a0a00; }
.project-btn-primary:hover { box-shadow: 0 14px 32px rgba(255,140,0,.3); }
.project-btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* =========================================================
   NEW — Alternating timeline (Work Experience & Education)
   ========================================================= */
.timeline-alt { position: relative; display: grid; gap: 2.5rem; padding: 1rem 0; }
.timeline-alt::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; background: var(--gradient); border-radius: 2px; transform: translateX(-50%);
}
.timeline-alt-item {
  position: relative; display: grid;
  grid-template-columns: 1fr 44px 1fr; align-items: start; gap: 1.5rem;
}
.timeline-alt-item .timeline-alt-card { grid-column: 1; }
.timeline-alt-item:nth-child(even) .timeline-alt-card { grid-column: 3; }
.timeline-alt-dot {
  grid-column: 2; justify-self: center; margin-top: .4rem;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
  position: relative; z-index: 1;
}
.timeline-alt-item.is-current .timeline-alt-dot {
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(255,140,0,.18);
  animation: orbit-pulse 2.4s ease-out infinite;
}
.timeline-alt-card {
  padding: 1.5rem 1.6rem; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--card);
  box-shadow: 0 18px 40px rgba(0,0,0,.16);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.timeline-alt-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.timeline-alt-badge {
  display: inline-block; margin-bottom: .7rem;
  padding: .3rem .8rem; border-radius: 999px;
  background: rgba(255,140,0,.12); border: 1px solid var(--border);
  color: var(--accent); font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em;
}
.timeline-alt-card h3 { font-size: 1.04rem; margin-bottom: .3rem; line-height: 1.4; }
.timeline-alt-org { display: block; color: var(--primary); font-weight: 600; font-size: .92rem; margin-bottom: .3rem; }
.timeline-alt-date { display: block; color: var(--muted); font-family: var(--font-mono); font-size: .78rem; margin-bottom: .9rem; }
.timeline-alt-card ul { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .55rem; }
.timeline-alt-card ul li { position: relative; padding-left: 1.15rem; color: var(--muted); font-size: .9rem; line-height: 1.7; font-family: var(--font-alt); }
.timeline-alt-card ul li::before { content: '•'; position: absolute; left: 0; top: 0; color: var(--primary); }
.timeline-alt-tags { display: flex; flex-wrap: wrap; gap: .5rem; }
.timeline-alt-tags span { padding: .28rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,140,0,.08); color: var(--accent); font-size: .72rem; font-family: var(--font-mono); }

@media (max-width: 760px) {
  .timeline-alt::before { left: 20px; }
  .timeline-alt-item, .timeline-alt-item:nth-child(even) {
    grid-template-columns: 40px 1fr;
  }
  .timeline-alt-item .timeline-alt-card,
  .timeline-alt-item:nth-child(even) .timeline-alt-card { grid-column: 2; }
  .timeline-alt-dot { grid-column: 1; }
}
/* =========================================================
   NEW — LeetCode progress card
   ========================================================= */
.leetcode-lead { color: var(--muted); max-width: 62ch; margin-bottom: 2.5rem; font-size: .96rem; }

.leetcode-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  padding: 2rem clamp(1.25rem, 3vw, 2.25rem);
}

.leetcode-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}
.leetcode-identity { display: flex; align-items: center; gap: .9rem; }
.leetcode-mark {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--gradient);
  color: #1a0a00; font-family: var(--font-mono); font-weight: 700; font-size: .95rem;
}
.leetcode-identity h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.leetcode-rank {
  display: block; color: var(--muted); font-family: var(--font-mono); font-size: .8rem;
}
.leetcode-profile-btn { flex: none; padding: .6rem 1.2rem; }

.leetcode-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2rem;
}

.leetcode-ring-wrap { position: relative; width: 160px; height: 160px; margin: 0 auto; }
.leetcode-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-progress {
  fill: none;
  stroke-width: 11;
}
.ring-track { stroke: var(--border); }
.ring-progress {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 427.26;
  stroke-dashoffset: 427.26;
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,1,.36,1);
}
.leetcode-ring-label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.leetcode-ring-label strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.leetcode-ring-label span { color: var(--muted); font-size: .74rem; font-family: var(--font-mono); margin-top: .25rem; }

.leetcode-bars { display: grid; gap: 1.1rem; }
.leetcode-bar-row {
  display: grid;
  grid-template-columns: 76px 1fr 56px;
  align-items: center;
  gap: .9rem;
}
.leetcode-bar-label { font-family: var(--font-mono); font-size: .82rem; font-weight: 600; }
.leetcode-easy { color: var(--lc-easy, #22c55e); }
.leetcode-medium { color: var(--primary); }
.leetcode-hard { color: var(--lc-hard, #ef4444); }
.leetcode-bar-track {
  height: 9px; border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  overflow: hidden;
}
.leetcode-bar-fill { height: 100%; width: 0%; border-radius: inherit; transition: width 1.1s cubic-bezier(.22,1,.36,1); }
.leetcode-easy-fill { background: linear-gradient(90deg, #22c55e, #4ade80); }
.leetcode-medium-fill { background: var(--gradient); }
.leetcode-hard-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
.leetcode-bar-count { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); text-align: right; }

.leetcode-heatmap-wrap { padding-top: 1.75rem; border-top: 1px solid var(--border); }
.leetcode-heatmap-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .9rem; color: var(--muted); font-size: .82rem; flex-wrap: wrap; gap: .4rem;
}
.leetcode-active-days { font-family: var(--font-mono); color: var(--accent); font-size: .78rem; }
.leetcode-heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: .35rem;
}
.leetcode-day {
  width: 11px; height: 11px;
  border-radius: 3px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
}
.leetcode-day[data-level="1"] { background: rgba(255,140,0,.28); border-color: transparent; }
.leetcode-day[data-level="2"] { background: rgba(255,140,0,.48); border-color: transparent; }
.leetcode-day[data-level="3"] { background: rgba(255,140,0,.7); border-color: transparent; }
.leetcode-day[data-level="4"] { background: rgba(255,178,80,.95); border-color: transparent; }

.leetcode-status {
  margin-top: 1.25rem;
  font-size: .82rem;
  color: var(--muted);
  font-family: var(--font-mono);
}
.leetcode-status.is-error { color: var(--lc-hard, #ef4444); }
.leetcode-status.is-hidden { display: none; }

@media (max-width: 720px) {
  .leetcode-body { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .leetcode-bar-row { grid-template-columns: 64px 1fr 46px; gap: .6rem; }
}

/* =========================================================
   Preloader — "Compiling Backend Systems" boot sequence
   ========================================================= */
body.is-loading { overflow: hidden; }

.preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
  cursor: default;
  transition: opacity .8s ease, visibility .8s ease;
}

.preloader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  padding: 1.5rem;
  will-change: transform;
}

/* ---- Atmosphere: large soft color blobs replacing the flat black ---- */
.preloader-glow {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .55;
  will-change: transform;
}
.glow-a {
  width: 640px; height: 640px;
  top: -14%; left: -12%;
  background: radial-gradient(circle, color-mix(in oklab, var(--primary) 55%, transparent), transparent 70%);
  animation: glow-drift-a 14s ease-in-out infinite;
}
.glow-b {
  width: 560px; height: 560px;
  bottom: -18%; right: -10%;
  background: radial-gradient(circle, color-mix(in oklab, var(--secondary) 50%, transparent), transparent 70%);
  animation: glow-drift-b 17s ease-in-out infinite;
}
.glow-c {
  width: 420px; height: 420px;
  top: 32%; left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(circle, color-mix(in oklab, var(--accent) 40%, transparent), transparent 72%);
  opacity: .4;
  animation: glow-drift-c 11s ease-in-out infinite;
}
@keyframes glow-drift-a { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.08); } }
@keyframes glow-drift-b { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-35px, -25px) scale(1.1); } }
@keyframes glow-drift-c { 0%,100% { transform: translate(-50%,0) scale(1); } 50% { transform: translate(-50%,-16px) scale(1.05); } }

/* ---- Fine grain texture for a premium, non-flat feel ---- */
.preloader-noise {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: .05;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, #fff 1px, transparent 0);
  background-size: 3px 3px;
}

/* ---- Slow vertical scanline sweep ---- */
.preloader-scanline {
  position: absolute;
  left: 0; right: 0;
  height: 140px;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    transparent,
    color-mix(in oklab, var(--primary) 10%, transparent) 45%,
    color-mix(in oklab, var(--accent) 16%, transparent) 50%,
    color-mix(in oklab, var(--primary) 10%, transparent) 55%,
    transparent);
  animation: scanline-sweep 5.5s ease-in-out infinite;
}
@keyframes scanline-sweep {
  0%   { top: -140px; opacity: 0; }
  8%   { opacity: .8; }
  50%  { top: 100%; opacity: .8; }
  58%  { opacity: 0; }
  100% { top: 100%; opacity: 0; }
}

/* ---- Faint drifting hex/circuit backdrop ---- */
.preloader-hexgrid {
  position: absolute;
  inset: -10%;
  z-index: 1;
  opacity: .6;
  will-change: transform, background-position;
  background-image:
    linear-gradient(30deg, color-mix(in oklab, var(--primary) 16%, transparent) 1px, transparent 1px),
    linear-gradient(150deg, color-mix(in oklab, var(--primary) 16%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--accent) 12%, transparent) 1px, transparent 1px);
  background-size: 52px 90px, 52px 90px, 52px 90px;
  mask-image: radial-gradient(65% 65% at 50% 45%, #000 15%, transparent 80%);
  animation: hex-drift 16s linear infinite;
}
@keyframes hex-drift {
  to { background-position: 260px 450px, -260px 450px, 130px 0; }
}

/* ---- Rising embers ---- */
.preloader-embers { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ember {
  position: absolute;
  bottom: -10px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 1px color-mix(in oklab, var(--primary) 70%, transparent);
  opacity: 0;
  animation-name: ember-rise;
  animation-timing-function: ease-in;
  animation-iteration-count: infinite;
}
@keyframes ember-rise {
  0%   { transform: translate(0, 0) scale(.6); opacity: 0; }
  12%  { opacity: .9; }
  100% { transform: translate(var(--drift, 20px), -78vh) scale(1.1); opacity: 0; }
}

/* ---- Floating tech badges — fill the side dead-space ---- */
.preloader-badges { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.float-badge {
  position: absolute;
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .1em;
  padding: .3rem .6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: color-mix(in oklab, var(--bg-soft) 70%, transparent);
  opacity: .5;
  backdrop-filter: blur(2px);
  animation: badge-bob 6s ease-in-out infinite;
  will-change: transform;
}
.float-badge:nth-of-type(2) { animation-duration: 7.2s; animation-delay: -1.5s; }
.float-badge:nth-of-type(3) { animation-duration: 6.6s; animation-delay: -3s; }
.float-badge:nth-of-type(4) { animation-duration: 8s;   animation-delay: -.8s; }
.float-badge:nth-of-type(5) { animation-duration: 5.4s; animation-delay: -2.2s; }
.float-badge:nth-of-type(6) { animation-duration: 7s;   animation-delay: -4s; }
@keyframes badge-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

/* ---- HUD corner readouts ---- */
.preloader-hud {
  position: absolute;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  color: var(--muted);
  opacity: .75;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.hud-tl { top: 1.4rem; left: 1.6rem; }
.hud-tr { top: 1.4rem; right: 1.6rem; color: var(--accent); }
.hud-bl { bottom: 1.4rem; left: 1.6rem; }
.hud-br { bottom: 1.4rem; right: 1.6rem; color: var(--accent); }
.hud-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 2px color-mix(in oklab, var(--primary) 70%, transparent);
  animation: blink 1.6s ease-in-out infinite;
}

@media (max-width: 640px) {
  .preloader-badges, .glow-c { display: none; }
  .hud-tl, .hud-tr, .hud-bl, .hud-br { font-size: .56rem; letter-spacing: .08em; }
  .hud-tl, .hud-bl { left: 1rem; }
  .hud-tr, .hud-br { right: 1rem; }
}

/* ---- Sonar pulse rings ---- */
.pulse-ring {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 1px solid color-mix(in oklab, var(--primary) 55%, transparent);
  opacity: 0;
  animation: sonar 3.2s ease-out infinite;
}
.pr-2 { animation-delay: 1.05s; }
.pr-3 { animation-delay: 2.1s; }
@keyframes sonar {
  0%   { transform: scale(1);   opacity: .55; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ---- Rotating ring core ---- */
.preloader-core {
  position: relative;
  width: 214px; height: 214px;
  margin-bottom: .3rem;
  will-change: transform;
}
.preloader-rings { width: 100%; height: 100%; overflow: visible; position: relative; z-index: 1; }
.preloader-rings .ring { fill: none; stroke-width: 1.4; transform-origin: 120px 120px; }
.ring-1 {
  stroke: color-mix(in oklab, var(--primary) 55%, transparent);
  filter: drop-shadow(0 0 6px color-mix(in oklab, var(--primary) 65%, transparent));
  stroke-dasharray: 6 10;
  animation: spin-cw 9s linear infinite;
}
.ring-2 {
  stroke: color-mix(in oklab, var(--accent) 70%, transparent);
  stroke-dasharray: 2 6;
  animation: spin-ccw 6.5s linear infinite;
}
.ring-3 {
  stroke: color-mix(in oklab, var(--secondary) 80%, transparent);
  stroke-dasharray: 1 4;
  filter: drop-shadow(0 0 4px color-mix(in oklab, var(--secondary) 60%, transparent));
  animation: spin-cw 4.2s linear infinite;
}
@keyframes spin-cw  { to { transform: rotate(360deg); } }
@keyframes spin-ccw { to { transform: rotate(-360deg); } }

.orbit { position: absolute; inset: 0; margin: auto; border-radius: 50%; z-index: 1; }
.orbit-1 { width: 232px; height: 232px; animation: spin-cw 5.5s linear infinite; }
.orbit-2 { width: 156px; height: 156px; animation: spin-ccw 3.4s linear infinite; }
.orbit-dot {
  position: absolute;
  top: -2px; left: 50%;
  width: 6px; height: 6px;
  border-radius: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 10px 2px color-mix(in oklab, var(--primary) 80%, transparent);
}
.orbit-2 .orbit-dot { width: 4px; height: 4px; background: var(--secondary); }

.preloader-badge {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 100px; height: 100px;
  border-radius: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 20%, transparent),
              0 0 34px color-mix(in oklab, var(--primary) 35%, transparent);
  animation: badge-pulse 2.4s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 20%, transparent), 0 0 24px color-mix(in oklab, var(--primary) 25%, transparent); }
  50%      { box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 35%, transparent), 0 0 48px color-mix(in oklab, var(--primary) 60%, transparent); }
}

.preloader-mono {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .02em;
  color: var(--accent);
  text-shadow: 0 0 12px color-mix(in oklab, var(--primary) 60%, transparent);
  animation: glitch-in 1.1s steps(2, end) 1;
}
@keyframes glitch-in {
  0%   { opacity: 0; filter: blur(4px); transform: translateX(-3px); clip-path: inset(0 0 60% 0); }
  20%  { opacity: 1; filter: blur(0); transform: translateX(2px);  clip-path: inset(20% 0 30% 0); }
  35%  { transform: translateX(-2px); clip-path: inset(0 0 70% 0); }
  50%  { transform: translateX(1px);  clip-path: inset(40% 0 0 0); }
  70%  { transform: translateX(0);    clip-path: inset(0 0 0 0); }
  100% { opacity: 1; transform: translateX(0); clip-path: inset(0 0 0 0); }
}

/* ---- Eyebrow with scanning sweep ---- */
.preloader-eyebrow {
  position: relative;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  background-image: linear-gradient(100deg, var(--accent) 30%, #fff 42%, var(--accent) 54%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: eyebrow-sweep 3.4s ease-in-out infinite;
}
@keyframes eyebrow-sweep {
  0%   { background-position: 140% 0; }
  55%  { background-position: -40% 0; }
  100% { background-position: -40% 0; }
}

.preloader-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: .02em;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-align: center;
  padding: 0 1.5rem;
}

/* ---- Terminal build log ---- */
.preloader-terminal {
  width: min(360px, 80vw);
  margin-top: .25rem;
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in oklab, var(--bg-soft) 90%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.preloader-terminal-head {
  display: flex; align-items: center; gap: 5px;
  padding: .45rem .6rem;
  background: color-mix(in oklab, var(--bg-soft) 96%, black 4%);
  border-bottom: 1px solid var(--border);
}
.preloader-terminal-head span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .55; }
.preloader-terminal-head span:nth-child(1) { background: var(--secondary); opacity: .8; }
.preloader-terminal-head span:nth-child(2) { background: var(--accent); opacity: .8; }
.preloader-terminal-head span:nth-child(3) { background: var(--primary); opacity: .8; }
.preloader-terminal-head em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: .62rem; color: var(--muted); letter-spacing: .04em; }

.preloader-terminal-body {
  height: 96px;
  padding: .5rem .65rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  line-height: 1.55;
  color: var(--muted);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.term-line {
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  animation: term-line-in .35s ease forwards;
}
.term-line .term-ok { color: var(--accent); margin-right: .35em; }
.term-line.is-current::after {
  content: '▍'; color: var(--primary); margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes term-line-in { to { opacity: 1; transform: translateY(0); } }

/* ---- Tech-stack checklist ---- */
.preloader-stack {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .4rem; max-width: 340px; margin-top: .1rem;
}
.stack-chip {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .02em;
  padding: .28rem .55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: color-mix(in oklab, var(--bg-soft) 85%, transparent);
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .3s ease;
}
.stack-chip.is-active {
  color: var(--bg);
  background: var(--gradient);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in oklab, var(--primary) 45%, transparent);
}
.stack-chip.is-active::before { content: '✓ '; }

/* ---- Progress bar with shimmer ---- */
.preloader-bar-track {
  position: relative;
  width: min(280px, 70vw);
  height: 5px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-top: .4rem;
}
.preloader-bar-fill {
  position: relative;
  width: 0%; height: 100%;
  border-radius: 999px;
  background: var(--gradient);
  box-shadow: 0 0 10px color-mix(in oklab, var(--primary) 70%, transparent);
  transition: width .3s linear;
  overflow: hidden;
}
.preloader-bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: bar-shimmer 1.3s linear infinite;
}
@keyframes bar-shimmer { to { background-position: -200% 0; } }

.preloader-percent {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  transition: transform .15s ease;
}
.preloader-percent.is-tick { animation: percent-pop .25s ease; }
@keyframes percent-pop { 0% { transform: scale(1.2); } 100% { transform: scale(1); } }
.preloader-percent small { font-size: .68em; color: var(--muted); margin-left: 1px; }

@media (max-width: 480px) {
  .preloader-core { width: 168px; height: 168px; }
  .preloader-badge { width: 80px; height: 80px; }
  .orbit-1 { width: 186px; height: 186px; }
  .orbit-2 { width: 124px; height: 124px; }
  .preloader-terminal-body { height: 88px; font-size: .68rem; }
  .glow-a, .glow-b { width: 380px; height: 380px; filter: blur(50px); }
}

@media (prefers-reduced-motion: reduce) {
  .ring-1, .ring-2, .ring-3, .preloader-badge, .orbit-1, .orbit-2,
  .pulse-ring, .preloader-eyebrow, .ember, .preloader-hexgrid, .preloader-mono,
  .preloader-bar-fill::after, .preloader-scanline, .glow-a, .glow-b, .glow-c,
  .float-badge, .hud-dot { animation: none; }
}
/* ---------- Deter casual copying ---------- */
/* Blocks text selection and image drag/save via CSS. Like the JS
   shortcut-blocking, this deters casual copying only — it can't stop
   view-source, browser dev tools, or screenshots (screenshots happen
   at the OS/hardware level, outside what any website can control). */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Still allow selection in fields people need to type into */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

img {
  -webkit-user-drag: none;
  -moz-user-drag: none;
  -ms-user-drag: none;
  user-drag: none;
}
/* =========================================================
   J.O.E.L — guided portfolio assistant
   ========================================================= */
.joel { position: fixed; right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 32px); z-index: 900; }

.joel-fab {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px 13px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  position: relative;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.joel-fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: rgba(255,140,0,.4); }
.joel-fab:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.joel-fab-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--gradient); color: #0a0a0a; flex-shrink: 0;
}
.joel-fab-icon svg { width: 18px; height: 18px; }
.joel-fab-dot {
  position: absolute; top: 10px; left: 34px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 2px var(--bg-soft), 0 0 10px #22c55e;
  animation: joelPulse 2s ease-in-out infinite;
}
@keyframes joelPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.joel-fab-label { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .02em; white-space: nowrap; }
.joel.is-open .joel-fab { display: none; }

.joel-panel {
  position: fixed;
  right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 32px);
  width: min(378px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 96px));
  display: flex; flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform-origin: bottom right;
  animation: joelOpen .28s cubic-bezier(.2,.9,.3,1.2);
}
.joel-panel[hidden] { display: none; }
@keyframes joelOpen { from { opacity: 0; transform: scale(.92) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@media (prefers-reduced-motion: reduce) { .joel-panel { animation: none; } }

.joel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,140,0,.10), transparent);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.joel-head-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.joel-head-avatar {
  display: grid; place-items: center; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gradient); color: #0a0a0a;
}
.joel-head-avatar svg { width: 16px; height: 16px; }
.joel-head-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.joel-head-text strong { font-family: var(--font-display); font-size: .95rem; letter-spacing: .02em; }
.joel-head-text span { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.joel-head-text em { color: #22c55e; font-style: normal; }
.joel-head-text i { opacity: .5; font-style: normal; }
.joel-close {
  display: grid; place-items: center; flex-shrink: 0;
  width: 28px; height: 28px; border-radius: 50%;
  color: var(--muted); font-size: .85rem;
  transition: background .2s, color .2s;
}
.joel-close:hover { background: var(--card); color: var(--text); }

.joel-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin; scrollbar-color: var(--primary) transparent;
}
.joel-body::-webkit-scrollbar { width: 8px; }
.joel-body::-webkit-scrollbar-thumb { background: rgba(255,140,0,.4); border-radius: 999px; }

.joel-msg {
  max-width: 88%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-alt);
  font-size: .85rem; line-height: 1.6;
  animation: joelRise .22s ease both;
}
.joel-msg.bot p { margin: 0 0 10px; }
.joel-msg.bot p:last-child { margin-bottom: 0; }
.joel-msg.bot ul { margin: 0 0 10px; padding-left: 18px; }
.joel-msg.bot ul:last-child { margin-bottom: 0; }
.joel-msg.bot li { margin-bottom: 7px; }
.joel-msg.bot li:last-child { margin-bottom: 0; }
.joel-msg.bot li::marker { color: var(--primary); }
.joel-msg.bot strong { color: var(--accent); font-weight: 600; }
@keyframes joelRise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.joel-msg.bot {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text);
}
.joel-msg.user {
  align-self: flex-end;
  background: var(--gradient);
  color: #0a0a0a;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.joel-msg.typing { display: flex; align-items: center; gap: 4px; padding: 13px; }
.joel-typing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: joelBounce 1s infinite ease-in-out; }
.joel-typing-dot:nth-child(2) { animation-delay: .15s; }
.joel-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes joelBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.joel-chips {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,.15);
  max-height: 40%;
  overflow-y: auto;
}
.joel-chip {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--text);
  font-family: var(--font-alt);
  font-size: .74rem;
  font-weight: 500;
  transition: border-color .2s, background .2s, transform .2s;
}
.joel-chip:hover { border-color: var(--primary); background: var(--gradient-soft); transform: translateY(-1px); }
.joel-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.joel-chip.is-primary { border-color: rgba(255,140,0,.4); background: var(--gradient-soft); }
.joel-chip.is-restart { font-family: var(--font-mono); color: var(--muted); }

@media (max-width: 480px) {
  .joel-fab-label { display: none; }
  .joel-fab { padding: 13px; }
  .joel-panel { width: calc(100vw - 24px); height: calc(100vh - 100px); right: 12px; bottom: 12px; }
}

/* ---------- Intro bubble ---------- */
.joel-intro {
  position: absolute;
  bottom: calc(100% + 16px);
  right: 0;
  width: 240px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-alt);
  font-size: .8rem; line-height: 1.5;
  color: var(--text);
  opacity: 0;
  transform: translateY(8px) scale(.95);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  cursor: pointer;
}
.joel-intro[hidden] { display: block; visibility: hidden; }
.joel-intro.is-visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; visibility: visible; }
.joel-intro p { margin: 0; }
.joel-intro strong { color: var(--accent); }
.joel-intro::after {
  content: '';
  position: absolute;
  bottom: -7px; right: 26px;
  width: 13px; height: 13px;
  background: var(--bg-soft);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
.joel-intro-close {
  position: absolute; top: 8px; right: 8px;
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  color: var(--muted); font-size: .65rem;
  transition: background .2s, color .2s;
}
.joel-intro-close:hover { background: var(--card); color: var(--text); }
@media (prefers-reduced-motion: reduce) { .joel-intro { transition: opacity .15s linear; } }
@media (max-width: 480px) { .joel-intro { width: min(260px, calc(100vw - 48px)); } }