/* ==========================================================================
   HUANG BOSHENG — Portfolio
   ========================================================================== */

:root {
  --bg: #07090f;
  --bg-2: #0c1019;
  --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: #e6edf6;
  --text-dim: #9aa6b8;
  --text-faint: #647084;
  --accent: #22d3ee;
  --accent-2: #818cf8;
  --accent-3: #f472b6;
  --accent-ink: #04141a;
  --grad: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 18px;
  --radius-sm: 10px;
  --max: 1160px;
  --nav-h: 68px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f7f8fb;
  --bg-2: #eef1f7;
  --surface: rgba(255, 255, 255, 0.75);
  --surface-2: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #7b8799;
  --accent: #0891b2;
  --accent-2: #6366f1;
  --accent-3: #db2777;
  --accent-ink: #ffffff;
  --shadow: 0 20px 50px -24px rgba(15, 23, 42, 0.25);
  color-scheme: light;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }

::selection { background: var(--accent); color: var(--accent-ink); }

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

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ---------- Background decoration ---------- */

.bg-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
  opacity: .55;
}

.bg-blob {
  position: fixed; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; border-radius: 50%;
  filter: blur(110px); opacity: .28;
  animation: drift 22s ease-in-out infinite alternate;
}
.bg-blob.b1 { background: var(--accent); top: -160px; left: -120px; }
.bg-blob.b2 { background: var(--accent-2); top: 30%; right: -200px; animation-delay: -8s; }
.bg-blob.b3 { background: var(--accent-3); bottom: -220px; left: 30%; opacity: .16; animation-delay: -14s; }
:root[data-theme="light"] .bg-blob { opacity: .14; }

@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 {
  position: fixed; top: 0; left: 0; z-index: -1; pointer-events: none;
  width: 480px; height: 480px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 14%, transparent), transparent 65%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
  opacity: 0;
}

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 100;
  background: var(--grad);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-color: var(--border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; }
.logo-mark {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad); color: #fff;
  font-family: var(--mono); font-size: .8rem; font-weight: 700;
  box-shadow: 0 6px 20px -6px var(--accent);
}
.logo-text small { display: block; font-size: .7rem; font-weight: 500; color: var(--text-faint); font-family: var(--mono); line-height: 1.1; }

.nav-links { display: flex; gap: 4px; }
.nav-links a {
  position: relative; padding: 8px 14px; border-radius: 999px;
  font-size: .92rem; color: var(--text-dim);
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 50%; bottom: 3px; width: 16px; height: 2px;
  border-radius: 2px; background: var(--grad); transform: translateX(-50%);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center;
  height: 38px; min-width: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-size: .85rem; font-weight: 600;
  transition: color .2s, border-color .2s, transform .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.theme-toggle .fa-sun { display: none; }
:root[data-theme="light"] .theme-toggle .fa-sun { display: inline; }
:root[data-theme="light"] .theme-toggle .fa-moon { display: none; }

.menu-toggle { display: none; }

/* ---------- Buttons & chips ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 12px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  transition: transform .2s, box-shadow .25s, border-color .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--accent); }
.btn-primary {
  border: 0; color: #fff;
  background: var(--grad); background-size: 180% 180%;
  box-shadow: 0 10px 30px -10px var(--accent);
  animation: shimmer 6s ease infinite;
}
.btn-primary:hover { box-shadow: 0 14px 40px -10px var(--accent-2); }
@keyframes shimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .76rem; font-family: var(--mono);
  color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
}

/* ---------- Hero ---------- */

.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: calc(var(--nav-h) + 40px) 0 80px; }
.hero .container { display: grid; grid-template-columns: 1.25fr .9fr; gap: 64px; align-items: center; }

.status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .82rem; color: var(--text-dim);
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.hero h1 {
  margin: 22px 0 14px;
  font-size: clamp(2.6rem, 6.2vw, 4.6rem);
  line-height: 1.04; letter-spacing: -.035em; font-weight: 800;
}
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero-role { font-family: var(--mono); font-size: clamp(1rem, 2.2vw, 1.3rem); color: var(--text-dim); min-height: 1.8em; }
.hero-role .prompt { color: var(--accent); }
.typed { color: var(--text); }
.caret { display: inline-block; width: 2px; height: 1.1em; background: var(--accent); vertical-align: -3px; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-desc { margin: 22px 0 32px; max-width: 580px; color: var(--text-dim); font-size: 1.06rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats { display: flex; gap: 36px; margin-top: 48px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.hero-stats div > span { font-size: .82rem; color: var(--text-faint); }

.hero-visual { position: relative; justify-self: center; width: min(380px, 100%); }
.photo-frame {
  position: relative; aspect-ratio: 4 / 5; border-radius: 28px; padding: 3px;
  background: var(--grad);
  box-shadow: 0 30px 80px -30px var(--accent-2);
  transform: rotate(2deg);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.photo-frame:hover { transform: rotate(0) scale(1.01); }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 25px; background: var(--bg-2); }

.float-chip {
  position: absolute; display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  font-size: .82rem; font-weight: 600; box-shadow: var(--shadow);
  animation: bob 5s ease-in-out infinite;
}
.float-chip i { font-size: 1.25rem; }
.float-chip.c1 { top: 8%; left: -18%; }
.float-chip.c2 { top: 44%; right: -16%; animation-delay: -1.6s; }
.float-chip.c3 { bottom: 7%; left: -12%; animation-delay: -3.2s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.code-card {
  position: absolute; right: -10%; bottom: -8%;
  padding: 14px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--bg-2) 90%, transparent);
  border: 1px solid var(--border-strong);
  font-family: var(--mono); font-size: .74rem; line-height: 1.6;
  box-shadow: var(--shadow); color: var(--text-dim);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.code-card .k { color: var(--accent-2); } .code-card .s { color: #34d399; } .code-card .p { color: var(--accent); }
.code-dots { display: flex; gap: 5px; margin-bottom: 8px; }
.code-dots span { width: 9px; height: 9px; border-radius: 50%; background: #f87171; }
.code-dots span:nth-child(2) { background: #fbbf24; } .code-dots span:nth-child(3) { background: #34d399; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 24px; height: 38px; border: 2px solid var(--border-strong); border-radius: 14px;
}
.scroll-hint::after {
  content: ""; position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; margin-left: -1.5px;
  border-radius: 2px; background: var(--accent); animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(12px); } }

/* ---------- Marquee ---------- */

.marquee {
  position: relative; overflow: hidden; padding: 22px 0;
  border-block: 1px solid var(--border); background: var(--surface);
  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 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text-dim); font-weight: 600; }
.marquee-item i { font-size: 1.6rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */

section.block { padding: 120px 0; position: relative; }
.section-head { margin-bottom: 56px; max-width: 680px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: .82rem; color: var(--accent); margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--accent); }
.section-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 800; }
.section-head p { margin-top: 16px; color: var(--text-dim); font-size: 1.04rem; }

.card {
  position: relative; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: border-color .3s, transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%);
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: var(--border-strong); transform: translateY(-4px); box-shadow: var(--shadow); }

/* ---------- About ---------- */

.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; }
.about-text { padding: 36px; }
.about-text p { color: var(--text-dim); font-size: 1.04rem; }
.about-text p + p { margin-top: 16px; }
.about-text strong { color: var(--text); }
.about-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fact { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.fact i { font-size: 1.3rem; color: var(--accent); }
.fact h4 { font-size: 1rem; }
.fact p { font-size: .88rem; color: var(--text-dim); line-height: 1.5; }

/* ---------- Stack ---------- */

.stack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stack-card { padding: 28px; }
.stack-card.wide { grid-column: span 2; }
.stack-card header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.stack-icon {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent);
  color: var(--c, var(--accent)); font-size: 1.15rem;
}
.stack-card h3 { font-size: 1.12rem; }
.stack-card header p { font-size: .82rem; color: var(--text-faint); }
.tech-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tech {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .86rem; font-weight: 500;
  transition: transform .2s, border-color .2s;
}
.tech:hover { transform: translateY(-2px); border-color: var(--accent); }
.tech i { font-size: 1.15rem; }
.tech .fa-solid, .tech .fas, .tech .fab { color: var(--text-dim); font-size: 1rem; }

/* ---------- Projects ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.filter {
  padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .88rem; color: var(--text-dim); font-weight: 500;
  transition: all .2s;
}
.filter:hover { color: var(--text); border-color: var(--border-strong); }
.filter.active { color: #fff; background: var(--grad); border-color: transparent; }
.filter .count { margin-left: 6px; font-family: var(--mono); font-size: .75rem; opacity: .7; }

.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project { display: flex; flex-direction: column; }
.project.featured { grid-column: span 2; }
.project.hide { display: none; }
.project.pop { animation: pop .45s cubic-bezier(.2,.8,.2,1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.project-cover {
  position: relative; height: 170px; overflow: hidden;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--c1) 55%, transparent), transparent 55%),
    radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--c2) 55%, transparent), transparent 55%),
    var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.project.featured .project-cover { height: 210px; }
.project-cover::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .5;
}
.project-cover .big-icon {
  position: relative; z-index: 1; font-size: 3.2rem; color: #fff;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.35));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.project:hover .big-icon { transform: scale(1.12) rotate(-4deg); }
.project-cover .badge {
  position: absolute; z-index: 1; top: 14px; left: 14px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0,0,0,.45); color: #fff; font-size: .72rem; font-weight: 600;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.project-cover .badge.star { left: auto; right: 14px; background: linear-gradient(90deg, #f59e0b, #ef4444); }

.project-body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-size: 1.18rem; letter-spacing: -.01em; }
.project-body p { color: var(--text-dim); font-size: .92rem; }
.project-highlights { display: grid; gap: 6px; margin: 2px 0 4px; }
.project-highlights li { position: relative; padding-left: 18px; font-size: .86rem; color: var(--text-dim); }
.project-highlights li::before { content: "▹"; position: absolute; left: 0; color: var(--accent); }
.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.project-links { display: flex; gap: 16px; padding-top: 14px; border-top: 1px dashed var(--border); }
.project-links a { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--text-dim); transition: color .2s; }
.project-links a:hover { color: var(--accent); }

/* ---------- Journey ---------- */

.timeline { position: relative; max-width: 860px; margin: 0 auto; }
.timeline::before {
  content: ""; position: absolute; left: 19px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-2), var(--accent-3), transparent);
}
.tl-item { position: relative; padding-left: 64px; margin-bottom: 26px; }
.tl-dot {
  position: absolute; left: 0; top: 18px;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg); border: 2px solid var(--accent); color: var(--accent);
  font-size: .9rem; box-shadow: 0 0 0 6px var(--bg);
}
.tl-card { padding: 22px 26px; }
.tl-date { font-family: var(--mono); font-size: .78rem; color: var(--accent); }
.tl-card h3 { font-size: 1.1rem; margin: 4px 0 6px; }
.tl-card p { font-size: .92rem; color: var(--text-dim); }
.tl-card .project-tags { margin-top: 12px; }

/* ---------- Coursework ---------- */

.course-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.course { display: flex; flex-direction: column; }
.course-img { aspect-ratio: 16 / 10; overflow: hidden; }
.course-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.course:hover .course-img img { transform: scale(1.07); }
.course-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { font-size: 1rem; }
.course-body p { font-size: .85rem; color: var(--text-dim); flex: 1; }
.course-body a { font-size: .85rem; font-weight: 600; color: var(--accent); display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; }
.course-body a i { transition: transform .2s; }
.course-body a:hover i { transform: translateX(4px); }

/* ---------- GitHub stats ---------- */

.gh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.gh-card { padding: 18px; display: grid; place-items: center; min-height: 180px; }
.gh-card img { width: 100%; height: auto; }
.gh-card.full { grid-column: 1 / -1; }

/* ---------- Contact ---------- */

.contact-wrap { padding: 56px; text-align: center; background:
  radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 50%),
  radial-gradient(circle at 100% 100%, color-mix(in srgb, var(--accent-3) 14%, transparent), transparent 50%),
  var(--surface); }
.contact-wrap:hover { transform: none; }
.contact-wrap h2 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.03em; line-height: 1.1; font-weight: 800; }
.contact-wrap > p { color: var(--text-dim); max-width: 560px; margin: 16px auto 32px; }
.contact-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 40px; text-align: left; }
.contact-item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .2s, transform .2s;
  min-width: 0; text-align: left; width: 100%;
}
a.contact-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.contact-item i { font-size: 1.1rem; color: var(--accent); width: 20px; text-align: center; flex-shrink: 0; }
.contact-item small { display: block; font-size: .72rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; }
.contact-item span { font-size: .88rem; font-weight: 600; word-break: break-word; }

.copy-btn { position: relative; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 200;
  padding: 12px 20px; border-radius: 12px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: .9rem;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: all .35s cubic-bezier(.2,.8,.2,1);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- Footer ---------- */

.footer { padding: 36px 0 44px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: .86rem; }
.footer .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.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(--text-dim);
  transition: all .2s;
}
.socials a:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--accent);
  opacity: 0; transform: translateY(20px); pointer-events: none; transition: all .3s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2,.8,.2,1), transform .8s cubic-bezier(.2,.8,.2,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .float-chip.c1 { left: -8%; } .float-chip.c2 { right: -8%; } .float-chip.c3 { left: -4%; }
  .code-card { right: -4%; }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 920px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 12px; right: 12px;
    flex-direction: column; padding: 12px; gap: 2px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    opacity: 0; transform: translateY(-10px); pointer-events: none; transition: all .25s;
  }
  .nav-links.open { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links a { padding: 12px 16px; border-radius: 10px; }
  .nav-links a.active::after { left: 6px; top: 50%; bottom: auto; width: 3px; height: 16px; transform: translateY(-50%); }
  .menu-toggle { display: grid; }

  .hero .container { grid-template-columns: 1fr; gap: 56px; }
  .hero-visual { order: -1; width: min(300px, 78%); }
  .hero { padding-top: calc(var(--nav-h) + 32px); }
  .scroll-hint { display: none; }

  .about-grid { grid-template-columns: 1fr; }
  .stack-grid { grid-template-columns: 1fr 1fr; }
  .stack-card.wide { grid-column: span 2; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .gh-grid { grid-template-columns: 1fr; }
  section.block { padding: 90px 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .logo-text small { display: none; }
  .hero-stats { gap: 24px; }
  .hero-stats strong { font-size: 1.5rem; }
  .float-chip { font-size: .72rem; padding: 7px 10px; }
  .float-chip.c1 { left: -10%; } .float-chip.c2 { right: -10%; } .float-chip.c3 { left: -6%; }
  .code-card { display: none; }
  .stack-grid, .projects-grid, .course-grid, .about-facts, .contact-grid { grid-template-columns: 1fr; }
  .stack-card.wide, .project.featured { grid-column: auto; }
  .about-text, .contact-wrap { padding: 26px; }
  .tl-item { padding-left: 54px; }
  .footer .container { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
