/* =========================================================
   Farhan Khan — portfolio styles
   Dark, glassy, animated. All motion respects reduced-motion.
   ========================================================= */

:root {
  --bg: #070b12;
  --bg-2: #0c1220;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e8eef6;
  --muted: #94a3b8;
  --dim: #64748b;
  --teal: #2dd4bf;
  --sky: #38bdf8;
  --violet: #a78bfa;
  --pink: #f472b6;
  --grad: linear-gradient(120deg, var(--teal) 0%, var(--sky) 45%, var(--violet) 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --nav-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; position: relative; z-index: 1; }
img { max-width: 100%; display: block; }
a { color: var(--sky); text-decoration: none; transition: color .2s; }
a:hover { color: var(--teal); }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-size: .85em; color: var(--teal); }
::selection { background: rgba(45, 212, 191, .35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--teal), var(--violet)); border-radius: 10px; border: 2px solid var(--bg); }

/* ---------- Ambient background ---------- */
.bg-fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-fx .blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45;
  animation: drift 22s var(--ease) infinite alternate;
}
.bg-fx .b1 { width: 520px; height: 520px; background: #0f766e; top: -160px; left: -120px; }
.bg-fx .b2 { width: 460px; height: 460px; background: #1d4ed8; top: 30%; right: -160px; animation-delay: -6s; opacity: .35; }
.bg-fx .b3 { width: 420px; height: 420px; background: #6d28d9; bottom: -180px; left: 25%; animation-delay: -12s; opacity: .3; }
.bg-fx .grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 80%);
}
#net { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.1); }
  100% { transform: translate(-40px, 80px) scale(.95); }
}

/* Cursor glow (desktop only, added by JS) */
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 420px; height: 420px; margin: -210px 0 0 -210px;
  border-radius: 50%; pointer-events: none; z-index: 0;
  background: radial-gradient(circle, rgba(56,189,248,.12), transparent 65%);
  transition: opacity .3s; will-change: transform;
}

/* Scroll progress */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px rgba(56,189,248,.7); }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled { background: rgba(7, 11, 18, .72); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-color: var(--border); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-weight: 700; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand .mono {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: var(--grad); color: #04121a; font-size: .95rem; font-weight: 800;
  box-shadow: 0 6px 20px -6px rgba(56,189,248,.7);
  transition: transform .4s var(--ease);
}
.brand:hover .mono { transform: rotate(-8deg) scale(1.06); }
.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  position: relative; display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--muted); font-size: .92rem; font-weight: 500; transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 16px; height: 2px; margin-left: -8px;
  border-radius: 2px; background: var(--grad);
}
.menu-btn { display: none; width: 44px; height: 44px; border: 1px solid var(--border); background: var(--surface); border-radius: 12px; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .35s var(--ease), opacity .2s; }
.menu-btn span:nth-child(1) { top: 15px; }
.menu-btn span:nth-child(2) { top: 21px; }
.menu-btn span:nth-child(3) { top: 27px; }
.nav.open .menu-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.open .menu-btn span:nth-child(2) { opacity: 0; }
.nav.open .menu-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.section { padding: clamp(64px, 10vw, 110px) 0; position: relative; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.25);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.h-title { font-family: var(--font-head); font-size: clamp(2rem, 4.5vw, 3.2rem); line-height: 1.1; letter-spacing: -.03em; margin: 18px 0 14px; }
.h-sub { color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); max-width: 640px; }
.grad-text { background: var(--grad); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 6s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.sub-head { font-family: var(--font-head); font-size: 1.35rem; letter-spacing: -.01em; margin: 56px 0 22px; display: flex; align-items: center; gap: 14px; }
.sub-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.sub-head:first-child { margin-top: 0; }

/* ---------- Buttons ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: .95rem; color: var(--text); border: 1px solid var(--border-strong); background: var(--surface);
  backdrop-filter: blur(6px); transition: transform .35s var(--ease), border-color .3s, background .3s, box-shadow .35s;
  overflow: hidden; isolation: isolate;
}
.btn:hover { color: var(--text); transform: translateY(-3px); border-color: rgba(56,189,248,.6); background: var(--surface-2); box-shadow: 0 12px 30px -12px rgba(56,189,248,.6); }
.btn svg { width: 18px; height: 18px; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { color: #04121a; border: 0; background: var(--grad); background-size: 160% auto; box-shadow: 0 10px 30px -10px rgba(45,212,191,.7); }
.btn-primary:hover { color: #04121a; background-position: right center; box-shadow: 0 16px 40px -10px rgba(56,189,248,.9); }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .8s var(--ease);
}
.btn-primary:hover::after { transform: translateX(120%); }

/* ---------- Hero (home) ---------- */
.hero { overflow-x: clip; min-height: 100vh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 80px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.hero h1 { font-family: var(--font-head); font-size: clamp(2.8rem, 7vw, 5.2rem); line-height: 1; letter-spacing: -.045em; margin: 22px 0 18px; }
.hero h1 .hi { display: block; font-size: .42em; letter-spacing: -.01em; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.typed-line { font-family: var(--font-head); font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--text); min-height: 1.6em; }
.typed { color: var(--teal); }
.role-line { font-family: var(--font-head); font-weight: 600; font-size: clamp(1.15rem, 2.4vw, 1.6rem); color: var(--text); margin: 0 0 4px; }
.hero .typed-line { font-size: clamp(1rem, 1.9vw, 1.25rem); }
.fix-label { color: var(--muted); }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--teal); margin-left: 3px; vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero .loc { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); margin-top: 14px; font-size: .98rem; }
.hero .loc svg { width: 16px; height: 16px; color: var(--teal); }

.avatar-wrap { --w: clamp(230px, 19vw, 260px); position: relative; width: var(--w); aspect-ratio: 1; margin: 0 auto; }
.avatar-ring {
  position: absolute; inset: 0; border-radius: 50%; padding: 4px;
  background: conic-gradient(from 0deg, var(--teal), var(--sky), var(--violet), var(--pink), var(--teal));
  animation: spin 8s linear infinite;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
.avatar-glow { position: absolute; inset: 8%; border-radius: 50%; background: var(--grad); filter: blur(50px); opacity: .45; animation: breathe 5s ease-in-out infinite; }
.avatar { position: absolute; inset: 14px; border-radius: 50%; overflow: hidden; border: 6px solid var(--bg); background: var(--bg-2); }
.avatar picture { display: block; width: 100%; height: 100%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.avatar-wrap:hover .avatar img { transform: scale(1.06); }
/* Side-by-side hero: nudge the photo right so the outer ring clears the text without leaving the screen */
@media (min-width: 1181px) { .hero-grid .avatar-wrap { left: calc(-22px + (100vw - 1181px) * .13); } }
@media (min-width: 1300px) { .hero-grid .avatar-wrap { left: 6px; } }
@media (min-width: 1420px) { .hero-grid .avatar-wrap { left: 34px; } }
/* Skill orbits: each ring spins; each chip counter-spins at the same speed so its text stays level */
.orbit {
  --r: calc(var(--w) * .6); --dur: 60s;
  position: absolute; z-index: 2; left: 50%; top: 50%; width: calc(var(--r) * 2); height: calc(var(--r) * 2);
  margin: calc(var(--r) * -1) 0 0 calc(var(--r) * -1);
  border-radius: 50%; border: 1px dashed rgba(255,255,255,.1); pointer-events: none;
  animation: spin var(--dur) linear infinite;
}
.orbit.o-outer { --r: calc(var(--w) * 1.05); border-color: rgba(255,255,255,.06); }
.orbit .chip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--a)) translateX(var(--r)) rotate(calc(var(--a) * -1)); }
.chip-in {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  font-size: .66rem; font-weight: 600; white-space: nowrap; color: var(--text);
  background: rgba(12,18,32,.88); border: 1px solid var(--border-strong); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.85);
  animation: spin var(--dur) linear infinite reverse;
}
.o-outer .chip-in { background: rgba(8,30,32,.9); border-color: rgba(45,212,191,.35); }
.chip-in .ok { display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; flex: none; color: var(--teal); background: rgba(45,212,191,.16); }
.chip-in i { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.avatar-wrap:hover .orbit, .avatar-wrap:hover .chip-in { animation-play-state: paused; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { opacity: .35; transform: scale(.95); } 50% { opacity: .6; transform: scale(1.05); } }

.scroll-hint { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--dim); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; }
.scroll-hint .mouse { width: 24px; height: 38px; border: 2px solid var(--dim); border-radius: 14px; position: relative; }
.scroll-hint .mouse::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--teal); animation: wheel 1.8s infinite; }
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(12px); } }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { padding: 26px 22px; text-align: left; }
.stat .num { font-family: var(--font-head); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.stat .label { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* ---------- Cards ---------- */
.card {
  position: relative; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  overflow: hidden; isolation: isolate;
  transition: transform .5s var(--ease), border-color .3s, background .3s, box-shadow .5s var(--ease);
}
.card::before { /* mouse spotlight */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(56,189,248,.14), transparent 45%);
}
.card::after { /* gradient border on hover */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; opacity: 0; transition: opacity .3s; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(45,212,191,.9), rgba(167,139,250,.5) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.card:hover { border-color: var(--border-strong); background: var(--surface-2); box-shadow: 0 24px 60px -30px rgba(0,0,0,.9); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card-body { padding: 28px; }

/* About */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.about-text p { color: #c9d4e2; font-size: 1.04rem; }
.about-text p + p { margin-top: 18px; }
.about-text strong { color: var(--text); font-weight: 600; }
.highlights { display: grid; gap: 14px; }
.highlight { display: flex; gap: 16px; align-items: flex-start; padding: 20px 22px; }
.highlight h3 { font-size: 1rem; font-family: var(--font-head); margin-bottom: 2px; }
.highlight p { color: var(--muted); font-size: .9rem; line-height: 1.55; }

.icon {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(140deg, rgba(45,212,191,.18), rgba(167,139,250,.18)); border: 1px solid var(--border-strong);
  color: var(--teal); transition: transform .5s var(--ease);
}
.icon svg { width: 22px; height: 22px; }
.card:hover .icon { transform: rotate(-8deg) scale(1.08); }

.about-wide { max-width: 820px; }
.about-text p.looking { margin-top: 26px; padding: 16px 20px; border-left: 3px solid var(--teal); border-radius: 0 12px 12px 0; background: linear-gradient(90deg, rgba(45,212,191,.1), rgba(45,212,191,0)); color: var(--text); }

/* What AI can't do */
.human-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.human .card-body { height: 100%; }
.human-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.human-n { font-family: var(--font-head); font-size: 2rem; font-weight: 700; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.18); transition: color .4s, -webkit-text-stroke-color .4s; }
.human:hover .human-n { color: var(--teal); -webkit-text-stroke-color: transparent; }
.human h3 { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: -.01em; margin-bottom: 8px; }
.human p { color: var(--muted); font-size: .95rem; }
/* Stack the hero (photo above text) until there is room for the full skill orbit beside the text */
@media (max-width: 1180px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-grid .btns, .hero .loc-wrap { justify-content: center; }
  .hero .avatar-wrap { order: -1; --w: min(230px, 46vw); margin: 152px auto 148px; }
  .hero h1 .hi { margin-bottom: 6px; }
  .scroll-hint { display: none; }
}
@media (max-width: 960px) { .human-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .human-grid { grid-template-columns: 1fr; } }

/* Skills */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.skill-card h3 { font-family: var(--font-head); font-size: 1.15rem; margin: 18px 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 5px 12px; border-radius: 999px; font-size: .8rem; font-weight: 500; color: #cbd5e1;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); transition: all .25s var(--ease);
}
.tag:hover { color: #04121a; background: var(--teal); border-color: var(--teal); transform: translateY(-2px); }

/* Projects */
.project-list { display: grid; gap: 22px; }
.project { display: grid; grid-template-columns: 76px 1fr auto; gap: 24px; align-items: start; padding: 30px; }
.project .idx { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; line-height: 1; letter-spacing: -.04em; -webkit-text-stroke: 1px rgba(255,255,255,.25); color: transparent; transition: color .4s, -webkit-text-stroke-color .4s; }
.project:hover .idx { color: var(--teal); -webkit-text-stroke-color: transparent; }
.project h3 { font-family: var(--font-head); font-size: 1.3rem; letter-spacing: -.01em; line-height: 1.3; }
.project .org { color: var(--teal); font-size: .88rem; font-weight: 600; margin: 4px 0 14px; }
.project ul { list-style: none; display: grid; gap: 8px; margin-bottom: 18px; }
.project li { position: relative; padding-left: 22px; color: #c2ccda; font-size: .98rem; }
.project li::before { content: ""; position: absolute; left: 0; top: .7em; width: 10px; height: 2px; border-radius: 2px; background: var(--grad); }
.metric { text-align: right; min-width: 110px; }
.metric .num { font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; line-height: 1; }
.metric .label { color: var(--muted); font-size: .78rem; margin-top: 6px; max-width: 120px; margin-left: auto; line-height: 1.4; }

/* Timeline */
.timeline { position: relative; padding-left: 44px; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.timeline .fill { position: absolute; left: 13px; top: 6px; width: 2px; height: calc((100% - 12px) * var(--p, 0)); background: var(--grad); border-radius: 2px; box-shadow: 0 0 14px rgba(56,189,248,.8); }
.t-item { position: relative; margin-bottom: 22px; }
.t-item:last-child { margin-bottom: 0; }
.t-dot { position: absolute; left: -44px; top: 30px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 2px solid var(--border-strong); transition: border-color .4s, box-shadow .4s; }
.t-dot::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dim); transition: background .4s, transform .4s var(--ease); }
.t-item.lit .t-dot { border-color: var(--teal); box-shadow: 0 0 0 6px rgba(45,212,191,.12), 0 0 20px rgba(45,212,191,.5); }
.t-item.lit .t-dot::after { background: var(--teal); transform: scale(1.1); }
.t-item .card-body { padding: 24px 28px; }
.t-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; align-items: baseline; }
.t-item h3 { font-family: var(--font-head); font-size: 1.2rem; letter-spacing: -.01em; }
.t-date { font-size: .82rem; font-weight: 600; color: var(--teal); padding: 3px 12px; border-radius: 999px; background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.22); white-space: nowrap; }
.t-org { color: #cbd5e1; font-weight: 500; margin-top: 4px; }
.t-loc { color: var(--dim); font-size: .88rem; }
.t-item p.desc { color: var(--muted); margin-top: 10px; }
.now { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #04121a; background: var(--teal); padding: 2px 9px; border-radius: 999px; margin-left: 8px; vertical-align: 3px; }

/* Interests */
.interest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; }
.interest .emoji { font-size: 2.2rem; line-height: 1; display: inline-block; transition: transform .6s var(--ease); }
.interest:hover .emoji { transform: translateY(-4px) rotate(-10deg) scale(1.15); }
.interest h3 { font-family: var(--font-head); font-size: 1.12rem; margin: 18px 0 6px; }
.interest p { color: var(--muted); font-size: .95rem; }

/* GitHub repos */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 20px; }
.repo { display: flex; flex-direction: column; color: var(--text); height: 100%; }
.repo:hover { color: var(--text); }
.repo .card-body { display: flex; flex-direction: column; height: 100%; }
.repo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.repo-top svg.gh { width: 26px; height: 26px; color: var(--muted); transition: color .3s; }
.repo:hover .repo-top svg.gh { color: var(--text); }
.repo-top .arrow { width: 20px; height: 20px; color: var(--dim); transition: transform .4s var(--ease), color .3s; }
.repo:hover .repo-top .arrow { transform: translate(3px, -3px); color: var(--teal); }
.repo h3 { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 1rem; font-weight: 600; color: var(--sky); word-break: break-word; margin-bottom: 10px; }
.repo p { color: var(--muted); font-size: .93rem; flex: 1; }
.repo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 20px; font-size: .8rem; color: #cbd5e1; }
.lang { display: inline-flex; align-items: center; gap: 7px; }
.lang i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.badge-live { display: inline-flex; align-items: center; gap: 6px; color: #4ade80; font-weight: 600; }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px #4ade80; animation: pulse 1.6s infinite; }
.badge-wip { color: #fbbf24; font-weight: 600; }

/* Certifications */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.filter { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: var(--surface); border: 1px solid var(--border); transition: all .3s var(--ease); }
.filter span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; font-size: .75rem; background: var(--surface-2); color: var(--text); }
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { color: #04121a; background: var(--grad); border-color: transparent; box-shadow: 0 8px 24px -10px rgba(45,212,191,.8); }
.filter.active span { background: rgba(4,18,26,.18); color: #04121a; }
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.cert { display: flex; flex-direction: column; }
.cert .card-body { display: flex; flex-direction: column; height: 100%; }
.cert.is-hidden { display: none; }
.cert.pop { animation: pop .5s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.cert-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.issuer-mono { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; font-family: var(--font-head); font-weight: 700; font-size: 1.1rem; color: #fff; background: var(--c); box-shadow: 0 8px 22px -8px var(--c); transition: transform .5s var(--ease); }
.cert:hover .issuer-mono { transform: rotate(-8deg) scale(1.08); }
.cert-date { font-size: .78rem; font-weight: 600; color: var(--teal); padding: 3px 11px; border-radius: 999px; background: rgba(45,212,191,.08); border: 1px solid rgba(45,212,191,.22); }
.cert-kind { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.cert h3 { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.3; letter-spacing: -.01em; margin: 6px 0 4px; }
.cert-issuer { color: #cbd5e1; font-size: .92rem; font-weight: 500; }
.cert-id { margin-top: 10px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .76rem; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cert-foot { margin-top: auto; padding-top: 18px; }
.cert-link { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; }
.cert-link svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.cert-link:hover svg { transform: translate(2px, -2px); }
.cert-link.muted { color: var(--dim); font-weight: 500; }

/* Feature banner (live demo, GitHub CTA, contact) */
.banner { margin-top: 26px; }
.banner .card-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 30px; }
.banner h3 { font-family: var(--font-head); font-size: 1.2rem; }
.banner p { color: var(--muted); font-size: .95rem; }
.banner .btns { margin-top: 0; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 20px; }
.contact-item { display: flex; align-items: center; gap: 18px; color: var(--text); }
.contact-item:hover { color: var(--text); }
.contact-item .card-body { display: flex; align-items: center; gap: 18px; width: 100%; padding: 24px; }
.contact-item .k { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.contact-item .v { font-weight: 600; word-break: break-word; }
.copy-btn { margin-left: auto; flex: none; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--muted); border-radius: 10px; padding: 7px 12px; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.copy-btn:hover { color: #04121a; background: var(--teal); border-color: var(--teal); }
.cta-card { text-align: center; margin-bottom: 26px; }
.cta-card .card-body { padding: clamp(36px, 6vw, 60px) 28px; }
.cta-card h2 { font-family: var(--font-head); font-size: clamp(1.7rem, 3.6vw, 2.5rem); letter-spacing: -.03em; line-height: 1.15; }
.cta-card p { color: var(--muted); margin: 14px auto 0; max-width: 520px; }
.cta-card .btns { justify-content: center; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: .85rem; font-weight: 600; color: #4ade80; margin-bottom: 18px; padding: 6px 14px; border-radius: 999px; background: rgba(74,222,128,.08); border: 1px solid rgba(74,222,128,.25); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 10px #4ade80; animation: pulse 1.6s infinite; }

/* Page hero (inner pages) */
.page-hero { padding: calc(var(--nav-h) + clamp(56px, 9vw, 100px)) 0 clamp(24px, 4vw, 40px); }

/* Marquee of tech */
.marquee { position: relative; overflow: hidden; padding: 22px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(255,255,255,.015);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--font-head); font-size: 1.15rem; font-weight: 600; color: var(--dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 48px; transition: color .3s; }
.marquee span:hover { color: var(--text); }
.marquee span::after { content: "✦"; color: var(--teal); font-size: .8rem; opacity: .6; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Footer */
.footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 34px 0; margin-top: 40px; background: rgba(7,11,18,.6); }
.footer .container { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.footer p { color: var(--dim); font-size: .88rem; }
.socials { display: flex; gap: 10px; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); transition: all .3s var(--ease); }
.socials a:hover { color: #04121a; background: var(--teal); border-color: var(--teal); transform: translateY(-3px); }
.socials svg { width: 18px; height: 18px; }

/* ---------- Motion: reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-left { transform: translateX(-40px); }
.js .reveal-scale { transform: scale(.92); }
.js .reveal-left.in, .js .reveal-scale.in { transform: none; }

/* Hero entrance */
.js .enter { opacity: 0; transform: translateY(24px); animation: enter 1s var(--ease) forwards; animation-delay: var(--d, 0s); }
@keyframes enter { to { opacity: 1; transform: none; } }

/* Page fade */
.js body { animation: pageIn .6s var(--ease); }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
body.leaving { opacity: 0; transition: opacity .3s ease; }

/* Toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translate(-50%, 30px); opacity: 0; z-index: 200; padding: 12px 20px; border-radius: 12px; background: #0f1a2b; border: 1px solid var(--border-strong); color: var(--text); font-size: .9rem; font-weight: 500; box-shadow: 0 20px 40px -12px rgba(0,0,0,.8); transition: all .4s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}
/* Eight menu items: collapse to the menu button below laptop width */
@media (max-width: 1080px) {
  .menu-btn { display: block; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 12px; right: 12px; flex-direction: column; gap: 4px; padding: 12px;
    background: rgba(10,15,25,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: 18px;
    opacity: 0; transform: translateY(-12px) scale(.98); pointer-events: none; transition: opacity .3s, transform .4s var(--ease);
  }
  .nav.open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav.open { background: rgba(7,11,18,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
  .nav-links a { padding: 12px 16px; font-size: 1rem; }
  .nav-links a.active::after { left: 6px; top: 50%; bottom: auto; width: 3px; height: 16px; margin: -8px 0 0; }
  .nav-links { max-width: 420px; margin-left: auto; }
}
@media (max-width: 820px) {
  .project { grid-template-columns: 1fr; gap: 10px; padding: 24px; }
  .project .idx { font-size: 1.8rem; }
  .metric { text-align: left; display: flex; align-items: baseline; gap: 10px; }
  .metric .label { margin: 0; max-width: none; }
}
/* Phones and small tablets: inner ring only */
@media (max-width: 640px) {
  .orbit.o-outer { display: none; }
  .hero .avatar-wrap { --w: min(180px, 46vw); margin: 72px auto 84px; }
  .orbit.o-inner { --r: calc(var(--w) * .72); }
  .chip-in { font-size: .64rem; padding: 4px 9px; gap: 5px; }
  .chip-in i { width: 6px; height: 6px; }
}
@media (max-width: 360px) {
  .hero .avatar-wrap { --w: 48vw; }
  .chip-in { font-size: .58rem; padding: 4px 8px; gap: 4px; }
}
@media (max-width: 520px) {
  .eyebrow { font-size: .7rem; letter-spacing: .1em; }
  .contact-item .card-body { gap: 14px; padding: 18px; }
  .contact-item .v { font-size: .9rem; }
  .hero .loc { display: block; font-size: .92rem; }
  .hero .loc svg { display: inline; vertical-align: -3px; margin-right: 4px; }
  .stats { gap: 12px; }
  .stat { padding: 20px 16px; }
  .btn { padding: 12px 20px; }
  .card-body { padding: 22px; }
  .timeline { padding-left: 34px; }
  .t-dot { left: -34px; width: 22px; height: 22px; }
  .timeline::before, .timeline .fill { left: 10px; }
  .banner .card-body { padding: 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .js .reveal, .js .enter { opacity: 1; transform: none; }
  #net, .cursor-glow { display: none; }
}
