/* ==========================================================================
   Gurnaj Singh — Portfolio
   Organized as: 1) Tokens  2) Reset  3) Layout  4) Components  5) Sections
   ========================================================================== */

/* ------------------------------ 1. Tokens ------------------------------- */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid type scale */
  --fs-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.82rem);
  --fs-sm: clamp(0.85rem, 0.82rem + 0.2vw, 0.95rem);
  --fs-md: clamp(0.95rem, 0.9rem + 0.3vw, 1.05rem);
  --fs-lg: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
  --fs-xl: clamp(1.35rem, 1.15rem + 1vw, 1.75rem);
  --fs-2xl: clamp(1.8rem, 1.4rem + 2vw, 2.6rem);
  --fs-3xl: clamp(2.4rem, 1.8rem + 3.2vw, 4rem);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  --container: 1180px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 10px 30px -12px rgba(0,0,0,0.25);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,0.35);
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg: #0b0f19;
  --bg-alt: #0f1424;
  --bg-elev: #131a2d;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text: #e8ecf3;
  --text-soft: #b4bccd;
  --text-muted: #8892a8;
  --accent: #8b5cf6;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --success: #34d399;
  --grad: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 50%, #f472b6 100%);
  --glow: radial-gradient(60% 80% at 50% 0%, rgba(139,92,246,0.25) 0%, rgba(34,211,238,0.08) 40%, transparent 70%);
  --hero-bg: radial-gradient(80% 60% at 20% 10%, rgba(139,92,246,0.18), transparent 60%),
             radial-gradient(60% 50% at 90% 20%, rgba(34,211,238,0.14), transparent 60%),
             radial-gradient(40% 40% at 50% 100%, rgba(244,114,182,0.10), transparent 60%);
  color-scheme: dark;
}

/* Light theme */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f7f8fc;
  --bg-elev: #ffffff;
  --surface: rgba(16,24,40,0.03);
  --surface-strong: rgba(16,24,40,0.06);
  --border: rgba(16,24,40,0.08);
  --border-strong: rgba(16,24,40,0.16);
  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --accent: #6d28d9;
  --accent-2: #0891b2;
  --accent-3: #db2777;
  --success: #059669;
  --grad: linear-gradient(135deg, #6d28d9 0%, #0891b2 50%, #db2777 100%);
  --glow: radial-gradient(60% 80% at 50% 0%, rgba(109,40,217,0.12) 0%, rgba(8,145,178,0.06) 40%, transparent 70%);
  --hero-bg: radial-gradient(80% 60% at 20% 10%, rgba(109,40,217,0.10), transparent 60%),
             radial-gradient(60% 50% at 90% 20%, rgba(8,145,178,0.08), transparent 60%),
             radial-gradient(40% 40% at 50% 100%, rgba(219,39,119,0.06), transparent 60%);
  color-scheme: light;
}

/* ------------------------------ 2. Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
p { margin: 0; }

.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200;
  padding: 8px 12px; background: var(--accent); color: #fff;
  border-radius: var(--radius-sm);
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ------------------------------ 3. Layout ------------------------------- */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

.section {
  padding-block: clamp(4rem, 2rem + 6vw, 7rem);
  position: relative;
}
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 56ch; margin-bottom: var(--space-7); }
.section-kicker {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.18em;
  margin-bottom: var(--space-3);
}
.section-title { font-size: var(--fs-2xl); font-weight: 700; }
.section-lead {
  margin-top: var(--space-3); color: var(--text-soft); font-size: var(--fs-lg);
}
.section-lead a { color: var(--accent); border-bottom: 1px dashed currentColor; }
.sub-heading { font-size: var(--fs-xl); font-weight: 600; margin-bottom: var(--space-5); }

/* ------------------------------ Header --------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--border); }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; background: var(--grad); color: #fff;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 0.98rem; }
.nav-list { display: flex; gap: var(--space-5); }
.nav-list a {
  font-size: 0.94rem; color: var(--text-soft); font-weight: 500;
  position: relative; padding: 6px 2px;
}
.nav-list a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; border-radius: 2px; background: var(--grad);
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav-list a:hover { color: var(--text); }
.nav-list a:hover::after, .nav-list a.active::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: var(--space-2); }

.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; color: var(--text-soft);
  border: 1px solid var(--border); background: var(--surface);
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-strong); }
.icon-btn:active { transform: scale(0.96); }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-btn { display: none; flex-direction: column; gap: 4px; }
.menu-btn span {
  display: block; width: 18px; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ------------------------------ Buttons -------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 0.94rem;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.3s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  color: #fff;
  background: var(--grad); background-size: 200% 100%;
  box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--accent) 60%, transparent);
}
.btn-primary:hover { background-position: 100% 0; box-shadow: 0 18px 40px -12px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-strong); border-color: var(--border-strong); }
.btn-outline { color: var(--text); border-color: var(--border-strong); background: transparent; }
.btn-outline:hover { background: var(--surface); }

/* ------------------------------ Hero ----------------------------------- */
.hero {
  position: relative;
  padding-top: clamp(3rem, 2rem + 4vw, 5rem);
  padding-bottom: clamp(4rem, 3rem + 5vw, 7rem);
  overflow: hidden;
  background: var(--hero-bg), var(--bg);
}
.hero::before {
  content: ''; position: absolute; inset: -2px; z-index: 0;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(50% 50% at 50% 40%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(50% 50% at 50% 40%, #000 20%, transparent 80%);
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 2vw + 1rem, 4rem);
  align-items: center; position: relative; z-index: 1;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: var(--fs-xs); color: var(--text-soft);
  font-family: var(--font-mono); margin-bottom: var(--space-5);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero-title { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; }
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.accent { color: var(--accent-2); }
.hero-sub {
  margin-top: var(--space-5); font-size: var(--fs-lg);
  color: var(--text-soft); max-width: 56ch;
}
.hero-sub .caret {
  display: inline-block; width: 2px; height: 1.1em; background: var(--accent);
  vertical-align: -2px; margin-left: 2px; animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero-cta {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-top: var(--space-6);
}
.social-row {
  display: flex; gap: var(--space-3);
  margin-top: var(--space-7);
}
.social-row a {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.social-row a:hover { color: var(--text); transform: translateY(-3px); border-color: var(--border-strong); }

/* Hero visual */
.hero-visual {
  position: relative; aspect-ratio: 1; max-width: 460px; margin-inline: auto;
  width: 100%;
}
.avatar-ring {
  position: absolute; inset: 12%; border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  box-shadow: var(--shadow-lg);
  animation: spin 18s linear infinite;
}
.avatar-ring img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; background: var(--bg-elev);
  animation: spin 18s linear infinite reverse;
  border: 4px solid var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

.floating-card {
  position: absolute; z-index: 3;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: var(--radius-pill);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.88rem; font-weight: 500;
  animation: float 6s ease-in-out infinite;
}
.floating-card i { font-size: 18px; }
.card-top { top: 2%; left: -2%; }
.card-bottom { bottom: 4%; right: -4%; animation-delay: -2s; }
.card-right { top: 40%; right: -14%; animation-delay: -4s; }
.floating-card .pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.scroll-hint {
  position: absolute; left: 50%; bottom: 16px; translate: -50% 0;
  width: 24px; height: 40px; border-radius: 14px;
  border: 2px solid var(--border-strong); display: grid; place-items: start center;
  opacity: 0.7;
}
.scroll-hint span {
  width: 3px; height: 8px; border-radius: 2px; background: var(--text-soft);
  margin-top: 6px; animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(12px); opacity: 0; }
}

/* ------------------------------ About ---------------------------------- */
.about-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1.6fr 1fr;
  align-items: start;
}
.about-copy p + p { margin-top: var(--space-4); }
.about-copy p { color: var(--text-soft); font-size: var(--fs-lg); }
.about-facts {
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--border);
}
.about-facts h3 {
  font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: var(--space-4); font-weight: 600;
}
.facts li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.facts li:last-child { border-bottom: 0; }
.facts li span { color: var(--text-muted); font-size: 0.92rem; }
.facts li strong { font-weight: 600; text-align: right; }

/* Timeline */
.edu-wrap { margin-top: var(--space-8); }
.timeline {
  position: relative; padding-left: 26px;
}
.timeline::before {
  content: ''; position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 2px; background: linear-gradient(to bottom, var(--accent), transparent);
}
.timeline li {
  position: relative; padding: 14px 0 14px 22px;
}
.timeline li::before {
  content: ''; position: absolute; left: 4px; top: 22px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.t-card {
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.t-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.t-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.t-role { font-size: var(--fs-lg); font-weight: 600; }
.t-org { color: var(--accent-2); font-weight: 500; font-size: 0.95rem; margin-top: 2px; }
.t-date {
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--text-muted); white-space: nowrap;
}
.t-desc { margin-top: var(--space-3); color: var(--text-soft); }
.t-bullets { margin-top: var(--space-3); display: grid; gap: 6px; }
.t-bullets li {
  color: var(--text-soft); font-size: 0.95rem; line-height: 1.6;
}
.t-bullets li::before {
  content: ''; display: inline-block;
  width: 6px; height: 6px; background: var(--accent-2); border-radius: 50%;
  vertical-align: middle;
  margin-right: -2px;
  transform: translateY(1px);
}

/* ------------------------------ Skills --------------------------------- */
.skills-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
.do-list { display: grid; gap: var(--space-3); }
.pro-exp-item {
  padding: 16px 18px; border-radius: var(--radius-md);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.pro-exp-item:hover { border-color: var(--border-strong); transform: translateX(4px); }
.pro-exp-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: var(--space-2);
}
.pro-exp-category {
  font-size: 0.95rem; color: var(--accent); font-weight: 600;
}
.pro-exp-project {
  font-size: var(--fs-xs); color: var(--accent-2);
  font-family: var(--font-mono);
}
.pro-exp-desc {
  font-size: 0.9rem; color: var(--text-soft); line-height: 1.6;
  margin-bottom: var(--space-3);
}
.pro-exp-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.tech-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.tech {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px; border-radius: var(--radius-md);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.25s var(--ease), box-shadow 0.3s var(--ease);
  position: relative; overflow: hidden;
}
.tech::before {
  content: ''; position: absolute; inset: 0;
  background: var(--glow); opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.tech:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.tech:hover::before { opacity: 1; }
.tech i { font-size: 34px; position: relative; z-index: 1; }
.tech span {
  font-size: 0.82rem; color: var(--text-soft); font-weight: 500;
  position: relative; z-index: 1;
}

/* ------------------------------ Experience ----------------------------- */
.timeline-wide li { padding-right: 0; }

/* ------------------------------ Projects ------------------------------- */
.projects-toolbar {
  display: flex; gap: var(--space-4); align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-bottom: var(--space-6);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
}
.chip .count {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 0.72rem; font-family: var(--font-mono);
}
.select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 34px 8px 14px; border-radius: var(--radius-pill);
  background: var(--surface) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 14px center;
  border: 1px solid var(--border); color: var(--text); font-size: 0.9rem;
}
.select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

.projects-state {
  padding: var(--space-5) 0; text-align: center; color: var(--text-muted);
}
.projects-state.error {
  color: #f87171; padding: var(--space-5); border-radius: var(--radius-md);
  background: color-mix(in srgb, #f87171 10%, transparent);
  border: 1px solid color-mix(in srgb, #f87171 25%, transparent);
}

.projects-grid {
  display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.repo-card {
  display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
  position: relative; overflow: hidden;
  cursor: pointer;
}
.repo-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.repo-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.repo-card:hover::before { transform: scaleX(1); }
.repo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.repo-head { display: flex; align-items: center; gap: 10px; }
.repo-icon {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.repo-name { font-size: 1.05rem; font-weight: 600; }
.repo-desc {
  color: var(--text-soft); font-size: 0.93rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
  min-height: 4.2em;
}
.repo-topics {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto;
}
.topic {
  font-size: 0.72rem; padding: 3px 10px; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  color: var(--accent-2); font-family: var(--font-mono);
}
.repo-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-3); padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
}
.repo-meta .lang { display: inline-flex; align-items: center; gap: 6px; }
.lang-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.repo-stats { display: flex; gap: 12px; }
.repo-stats span { display: inline-flex; align-items: center; gap: 4px; }

.repo-actions {
  display: flex; gap: 8px;
}
.repo-actions a {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-soft); font-size: 0.82rem; font-weight: 500;
  transition: all 0.2s var(--ease);
}
.repo-actions a:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-strong); }
.repo-actions a.primary { background: var(--grad); color: #fff; border-color: transparent; }

.projects-cta { display: flex; justify-content: center; margin-top: var(--space-7); }

/* Skeletons */
.repo-card.skeleton {
  cursor: default;
  pointer-events: none;
  min-height: 240px;
}
.repo-card.skeleton .bar {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%);
  background-size: 400% 100%; animation: shimmer 1.6s ease-in-out infinite;
  height: 12px; border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ------------------------------ Highlights ----------------------------- */
.highlight-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.h-card {
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: var(--space-3);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.h-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.h-card .emblem {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 700;
}
.h-card h3 { font-size: 1.1rem; font-weight: 600; }
.h-card p { color: var(--text-soft); font-size: 0.95rem; }
.h-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.h-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-soft);
  transition: all 0.2s var(--ease);
}
.h-links a:hover { color: var(--text); border-color: var(--border-strong); }

/* ------------------------------ Certifications ------------------------- */
.cert-grid {
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.cert-card {
  display: flex; flex-direction: column;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 40px -22px rgba(0, 0, 0, 0.5);
}
.cert-card.is-degraded { opacity: 0.88; }

.cert-media {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--surface); overflow: hidden;
}
.cert-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cert-media-fallback {
  display: grid; place-items: center;
  background: var(--grad); color: #fff;
  font-size: 2.2rem; font-weight: 700; letter-spacing: 0.05em;
}

.cert-body {
  padding: var(--space-4) var(--space-5) var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-3); flex: 1;
}
.cert-issuer {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-soft);
}
.cert-issuer img {
  width: 20px; height: 20px; border-radius: 4px; object-fit: contain;
  background: #fff; padding: 2px; flex-shrink: 0;
}
.cert-issuer time { font-variant-numeric: tabular-nums; }
.cert-dot { opacity: 0.5; }

.cert-title {
  font-size: 1.05rem; font-weight: 600; line-height: 1.35;
  color: var(--text);
}
.cert-desc {
  font-size: 0.9rem; color: var(--text-soft); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

.cert-skills {
  display: flex; flex-wrap: wrap; gap: 6px; list-style: none;
  padding: 0; margin: 0;
}
.cert-skills li {
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.76rem; color: var(--text-soft);
}

.cert-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto;
  padding-top: var(--space-3);
}
.cert-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-soft);
  transition: all 0.2s var(--ease);
}
.cert-btn:hover { color: var(--text); border-color: var(--border-strong); }
.cert-btn-primary {
  background: var(--grad); color: #fff; border-color: transparent;
}
.cert-btn-primary:hover { color: #fff; filter: brightness(1.08); }

.cert-state {
  margin-top: var(--space-4); font-size: 0.85rem;
  color: var(--text-soft); text-align: center; min-height: 1.2em;
}

/* Skeleton variants */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-strong) 50%, var(--surface) 75%);
  background-size: 400% 100%; animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
}
.cert-skeleton { pointer-events: none; }
.cert-skeleton .cert-media { background: transparent; }
.cert-skeleton .cert-media.skeleton { aspect-ratio: 16 / 9; border-radius: 0; }
.skel-line { height: 12px; margin: 6px 0; }
.skel-issuer { width: 50%; }
.skel-title { width: 80%; height: 16px; }
.skel-desc { width: 95%; }

/* ------------------------------ Contact -------------------------------- */
.contact-grid {
  display: grid; gap: var(--space-6);
  grid-template-columns: 1fr 1.1fr;
  align-items: start;
}
.contact-list { display: grid; gap: var(--space-3); }
.contact-list > li {
  display: flex; gap: 14px; align-items: center;
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--bg-elev); border: 1px solid var(--border);
}
.contact-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.contact-list li span { display: block; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.contact-list li a { font-weight: 500; }
.contact-list li a:hover { color: var(--accent-2); }
.contact-socials { display: flex; align-items: center; gap: 12px; }
.contact-socials > span { flex-shrink: 0; }
.mini-social { display: flex; gap: 8px; }
.mini-social a {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 10px; color: var(--text-soft);
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}
.mini-social a:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-2px); }

.contact-form {
  display: grid; gap: var(--space-4);
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border);
}
.field { display: grid; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--text-soft); font-weight: 500; }
.field input, .field textarea {
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  font-family: inherit;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  background: var(--bg);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field.invalid input, .field.invalid textarea {
  border-color: #f87171;
}
.form-note { font-size: 0.85rem; color: var(--text-muted); min-height: 1.2em; }
.form-note.ok { color: var(--success); }
.form-note.err { color: #f87171; }

/* ------------------------------ Footer --------------------------------- */
.site-footer {
  padding-block: var(--space-6);
  border-top: 1px solid var(--border);
  font-size: 0.88rem; color: var(--text-muted);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  flex-wrap: wrap;
}

/* ------------------------------ Modal ---------------------------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: var(--space-4);
  animation: fadeIn 0.2s var(--ease);
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-panel {
  position: relative; z-index: 1; max-width: 560px; width: 100%;
  padding: var(--space-6); border-radius: var(--radius-lg);
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.25s var(--ease-out);
}
.modal-close { position: absolute; top: 12px; right: 12px; }
.modal h3 { font-size: var(--fs-xl); margin-bottom: var(--space-3); padding-right: 2.5rem; }
.modal p { color: var(--text-soft); }
.modal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--space-4); }
.modal-meta .chip { cursor: default; }
.modal-actions { display: flex; gap: var(--space-3); margin-top: var(--space-5); flex-wrap: wrap; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ------------------------------ Reveal animations ---------------------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ------------------------------ Responsive ----------------------------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 340px; order: -1; }
  .card-right { right: 0; }

  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }

  .nav {
    position: fixed; top: 48px; left: 0; right: 0;
    z-index: 49;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 0.3s var(--ease);
  }
  .nav.open { clip-path: inset(0 0 -1px 0); }
  .nav-list {
    flex-direction: column; gap: 0;
    padding: var(--space-4);
  }
  .nav-list li { border-bottom: 1px solid var(--border); }
  .nav-list li:last-child { border-bottom: 0; }
  .nav-list a { display: block; padding: 14px 4px; font-size: 1rem; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; }
}
@media (max-width: 560px) {
  .header-inner { min-height: 44px; }
  .brand-name { display: none; }
  .nav { top: 44px; }
  .projects-toolbar { flex-direction: column; align-items: stretch; }
  .sort-group { display: flex; justify-content: flex-end; }
  .footer-inner { flex-direction: column; text-align: center; }
  .tech-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .tech { padding: 14px 8px; }
  .tech i { font-size: 28px; }
}

/* Focus styles */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}

/* Selection */
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); color: #fff; }
