/* ============================================
   Tiebe Goossens — Portfolio
   Design system: Cormorant Garamond + Inter + JetBrains Mono
   Dark + Light theme, serif display + sans body
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=DM+Sans:wght@300;400;500;600;700&display=swap");

:root {
  /* Type */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;

  /* Accent */
  --accent: #4a7fd6;
  --accent-soft: #6c95dd;
  --accent-deep: #2f5fb5;

  /* Spacing */
  --section-pad-y: 140px;
  --container: 1200px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Radius (compat) */
  --radius: 8px;
}

/* DARK (default) */
:root,
[data-theme='dark'] {
  --bg: #0d121c;
  --bg-2: #111727;
  --bg-3: #161e30;
  --bg-card: #141a2a;
  --bg-card-2: #1a2236;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --fg: #e9edf5;
  --fg-soft: #b8c0d2;
  --fg-mute: #7e8699;
  --fg-faint: #4d5468;
  --hero-glow: radial-gradient(60% 60% at 70% 50%, rgba(74, 127, 214, 0.18), transparent 60%);
  --grid-line: rgba(255, 255, 255, 0.04);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -20px rgba(0, 0, 0, 0.6);

  /* Old variable aliases for projects.html compatibility */
  --bg-primary: #0d121c;
  --bg-secondary: #111727;
  --text-primary: #e9edf5;
  --text-secondary: #b8c0d2;
  --text-muted: #7e8699;
  --nav-bg: rgba(13, 18, 28, 0.85);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --accent-dark: #2f5fb5;
}

[data-theme='light'] {
  --bg: #f6f5f1;
  --bg-2: #ffffff;
  --bg-3: #ecebe5;
  --bg-card: #ffffff;
  --bg-card-2: #faf9f5;
  --border: rgba(20, 24, 36, 0.08);
  --border-strong: rgba(20, 24, 36, 0.16);
  --fg: #14161f;
  --fg-soft: #3d4255;
  --fg-mute: #6c7384;
  --fg-faint: #a8aebd;
  --hero-glow: radial-gradient(60% 60% at 70% 50%, rgba(74, 127, 214, 0.10), transparent 60%);
  --grid-line: rgba(20, 24, 36, 0.05);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 12px 30px -16px rgba(20, 24, 36, 0.16);

  /* Old variable aliases */
  --bg-primary: #f6f5f1;
  --bg-secondary: #ffffff;
  --text-primary: #14161f;
  --text-secondary: #3d4255;
  --text-muted: #6c7384;
  --nav-bg: rgba(246, 245, 241, 0.85);
  --shadow: 0 4px 24px rgba(20, 24, 36, 0.12);
  --accent-dark: #2f5fb5;
}

/* ============================================
   RESET
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 400ms var(--ease), color 400ms var(--ease);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(56px, 8vw, 120px); }
h2 { font-size: clamp(44px, 5.5vw, 84px); margin-top: 20px; }
h3 { font-size: clamp(24px, 2.4vw, 32px); }
p { margin: 0 0 1em; color: var(--fg-soft); text-wrap: pretty; }

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}
.section {
  padding: var(--section-pad-y) 0;
  position: relative;
}
.section-head { margin-bottom: 64px; max-width: 720px; }
.proj-section .section-head { max-width: none; }
.proj-section .section-head h2 { font-size: clamp(28px, 3vw, 42px); text-wrap: nowrap; }
.proj-section .section-head .lead { text-wrap: nowrap; }
.section-head .lead {
  font-size: 18px;
  color: var(--fg-mute);
  margin-top: 16px;
  margin-bottom: 0;
}

/* ============================================
   TYPE HELPERS
   ============================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--accent);
  display: inline-block;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  transition: all 200ms var(--ease);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg); transform: translateY(-1px); }

/* ============================================
   REVEAL ANIMATION
   ============================================ */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 800ms var(--ease), transform 800ms var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 24px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(0px);
  transition: backdrop-filter 300ms, background 300ms, border-color 300ms;
}
.nav.scrolled {
  backdrop-filter: blur(14px) saturate(120%);
  background: color-mix(in oklab, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.nav-logo .dot { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 36px;
  align-items: center;
}
.nav-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-soft);
  transition: color 200ms;
  position: relative;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0; right: 0;
  height: 1px;
  background: var(--accent);
}
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms;
  margin-left: 8px;
  padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Mobile toggle */
.mobile-toggle {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--fg);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  padding: 0;
}
.mobile-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--fg);
  transition: transform 200ms, opacity 200ms;
}
body.menu-open .mobile-toggle span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
body.menu-open .mobile-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .mobile-toggle span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================
   HERO
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 120px 0 60px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 80%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}
.hero-copy { position: relative; z-index: 2; }
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(72px, 10vw, 160px);
  line-height: 0.95;
  margin: 24px 0 0;
  font-weight: 400;
}
.hero-name .first { display: block; }
.hero-name .last { display: block; color: var(--accent); font-style: italic; }
.hero-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(18px, 1.8vw, 24px);
  color: var(--fg-soft);
  margin: 32px 0 40px;
  max-width: 460px;
  line-height: 1.4;
}
.hero-cta { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.hero-meta {
  margin-top: 80px;
  display: flex;
  gap: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.hero-meta span strong { color: var(--fg-soft); font-weight: 500; }

.hero-portrait {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-card-2) 0%, var(--bg) 100%);
}
.hero-portrait::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg) 100%);
  pointer-events: none;
  z-index: 2;
}
.hero-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
}
.hero-portrait .corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid var(--accent);
  z-index: 3;
}
.hero-portrait .corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.hero-portrait .corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.hero-portrait .corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.hero-portrait .corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.scroll-cue {
  position: absolute;
  bottom: 30px;
  left: 32px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.scroll-cue .line {
  width: 40px;
  height: 1px;
  background: var(--fg-faint);
  position: relative;
  overflow: hidden;
}
.scroll-cue .line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  animation: slide 2.4s var(--ease) infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  60% { transform: translateX(100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   ABOUT + STATS
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
  align-items: start;
}
.about-portrait {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card-2);
  border: 1px solid var(--border);
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.about-meta { margin-top: 28px; display: flex; flex-direction: column; gap: 11px; }
.about-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-soft);
  text-decoration: none;
  transition: color 150ms var(--ease);
}
.about-meta-row svg { color: var(--accent); flex-shrink: 0; }
.about-meta-row[href]:hover { color: var(--fg); }

.about-hobbies { margin-top: 36px; }
.about-section-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 14px;
}
.hobby-list { display: flex; flex-direction: column; gap: 9px; }
.hobby-item { font-size: 15px; color: var(--fg-soft); line-height: 1.5; }
.hobby-item strong { color: var(--fg); font-weight: 600; }

.about-body p { font-size: 17px; color: var(--fg-soft); }
.text-accent { color: var(--accent); }
.about-body .lead-line {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  color: var(--fg);
  margin-bottom: 28px;
  line-height: 1.4;
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 32px;
}
.skill-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 18px 20px;
  border-radius: 6px;
  transition: all 200ms var(--ease);
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.skill-card .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  margin-bottom: 8px;
  font-weight: 600;
  display: block;
}
.skill-card .stack {
  font-size: 13px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
}

/* Stats strip */
.stats {
  margin-top: 120px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  padding: 0 32px;
  border-right: 1px solid var(--border);
  position: relative;
}
.stat:last-child { border-right: none; }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1;
  font-weight: 400;
  color: var(--fg);
}
.stat .num .plus { color: var(--accent); }
.stat .label {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

/* ============================================
   EXPERIENCE
   ============================================ */
.exp-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
/* Stage */
.stage-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
}
.stage-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 28px 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: #131726;
  color: #fff;
}
.stage-meta .stage-info-label { color: rgba(255,255,255,0.65); }
.stage-meta .stage-info-value { color: #fff; }
.stage-meta .stage-company { color: #fff; }
.stage-meta .stage-role { color: #5eead4; }
.stage-meta .stage-period { color: rgba(255,255,255,0.6); }
.stage-meta .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.35); }
.stage-meta .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.stage-meta-action { margin-left: auto; }
.stage-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
  flex-shrink: 0;
}
.stage-company {
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 2px;
}
.stage-role {
  font-size: 13px;
  color: var(--accent);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}
.stage-period {
  font-size: 12px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
}
.stage-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.stage-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.stage-block-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 12px;
}
.stage-block p { font-size: 15px; color: var(--fg-soft); line-height: 1.7; margin: 0; }

/* Skills tags */
.stage-skills { display: flex; flex-direction: column; gap: 16px; }
.stage-skills-group { display: flex; flex-direction: column; gap: 8px; }
.stage-skills-label {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--fg-mute);
  margin-bottom: 2px;
}
.stage-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-tag {
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--fg-soft);
}
.stage-tag--soft {
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Document cards */
.stage-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.stage-doc-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-2);
  text-decoration: none;
  transition: border-color 180ms var(--ease), transform 180ms var(--ease);
  cursor: pointer;
}
a.stage-doc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.stage-doc-card--pending { opacity: 0.55; cursor: default; }
.stage-doc-icon { color: var(--fg-mute); flex-shrink: 0; padding-top: 1px; }
.stage-doc-body { flex: 1; min-width: 0; }
.stage-doc-label { font-size: 14px; font-weight: 600; color: var(--fg); margin-bottom: 3px; }
.stage-doc-desc { font-size: 12px; color: var(--fg-mute); line-height: 1.5; }
.stage-doc-arrow { color: var(--accent); flex-shrink: 0; padding-top: 2px; }
.stage-doc-status {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--fg-mute);
  flex-shrink: 0;
  padding-top: 3px;
  letter-spacing: 0.05em;
}

/* Photo grid */
.stage-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.stage-photo {
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
}
.stage-photo img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 768px) {
  .stage-two-col { grid-template-columns: 1fr; gap: 24px; }
  .stage-meta { flex-wrap: wrap; }
  .stage-meta-action { margin-left: 0; width: 100%; }
  .stage-body { padding: 24px; }
}

.exp-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 40px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  position: relative;
  transition: all 300ms var(--ease);
}
.exp-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.exp-card.featured {
  border-color: rgba(74, 127, 214, 0.3);
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card-2) 100%);
}
.exp-card.featured::before {
  content: '';
  position: absolute;
  left: 0;
  top: 32px;
  bottom: 32px;
  width: 2px;
  background: var(--accent);
}
.exp-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.exp-meta .date { color: var(--accent); margin-bottom: 8px; }
.exp-meta .duration { color: var(--fg-faint); font-size: 10px; }
.exp-meta .location { color: var(--fg-mute); margin-top: 16px; font-size: 10px; }
.exp-logo {
  display: block;
  margin-top: 24px;
  max-height: 60px;
  max-width: 200px;
  width: auto;
  object-fit: contain;
  opacity: 0.8;
}

.exp-body h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--fg);
}
.exp-body .company {
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.exp-body .role-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 20px;
}
.exp-body p { font-size: 15px; }
.exp-body .bullets {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 8px;
}
.exp-body .bullets li {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.6;
}
.exp-body .bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 1px;
  background: var(--accent);
}
.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 24px;
}
.exp-actions {
  margin-top: 16px;
}
.tag {
  padding: 5px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--fg-soft);
  background: var(--bg-card-2);
}
.tag.accent { color: var(--accent); border-color: rgba(74, 127, 214, 0.3); background: rgba(74, 127, 214, 0.08); }

/* ============================================
   TECH STACK
   ============================================ */
/* Skills bars */
.skills-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: start;
}
.skills-group-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.skill-row { margin-bottom: 22px; }
.skill-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.skill-name { font-size: 15px; font-weight: 500; color: var(--fg); }
.skill-pct { font-family: var(--font-mono); font-size: 12px; color: var(--fg-mute); }
.skill-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 900ms cubic-bezier(0.4, 0, 0.2, 1);
}
.skill-tags {
  margin-top: 6px;
  font-size: 12px;
  color: var(--fg-mute);
  font-family: var(--font-mono);
}

.tech-section { background: var(--bg-2); }
.tech-cat {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}
.tech-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.tech-cat-head h4 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--fg);
}
.tech-cat-head .count {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  gap: 4px;
}
.tech-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 6px;
  transition: background 150ms, border-color 150ms;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}
.tech-item:hover { background: var(--bg-card-2); border-color: var(--border); }
.tech-item .left { display: flex; align-items: center; gap: 12px; }
.tech-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.tech-icon img { width: 20px; height: 20px; object-fit: contain; }
.tech-icon-letter {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-mute);
}
.tech-item .name { font-size: 14px; font-weight: 500; color: var(--fg); }
.tech-item .view {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ============================================
   EDUCATION
   ============================================ */
.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.edu-card {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  transition: all 300ms var(--ease);
}
.edu-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.edu-image {
  aspect-ratio: 16/9;
  background: var(--bg-card-2);
  position: relative;
  overflow: hidden;
}
.edu-image img { width: 100%; height: 100%; object-fit: cover; }
.edu-image .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: repeating-linear-gradient(135deg, transparent 0 22px, var(--grid-line) 22px 23px);
}
.edu-body { padding: 28px 32px; border-top: 1px solid var(--border); }
.edu-body .date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.edu-body h3 {
  font-family: var(--font-body);
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--fg);
  line-height: 1.3;
}
.edu-body .school { font-size: 14px; color: var(--fg-mute); margin-bottom: 12px; }
.edu-body p { font-size: 14px; margin: 0; }

/* ============================================
   PROJECTS
   ============================================ */
.proj-section { background: var(--bg-2); }
.proj-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
.proj-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--fg-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 200ms var(--ease);
  cursor: pointer;
}
.proj-filter:hover { color: var(--fg); border-color: var(--border-strong); }
.proj-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.proj-filter .count {
  font-size: 9px;
  opacity: 0.7;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.proj-filter.active .count { background: rgba(255,255,255,0.22); }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.proj-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  transition: all 400ms var(--ease);
  display: flex;
  flex-direction: column;
  color: inherit;
}
.proj-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.proj-img {
  aspect-ratio: 16/10;
  background: var(--bg-card-2);
  position: relative;
  overflow: hidden;
}
.proj-card.large .proj-img { aspect-ratio: 16/9; }
.proj-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
.proj-img.proj-img--contain img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; height: auto; max-width: calc(100% - var(--img-padding, 48px)); max-height: calc(100% - var(--img-padding, 48px)); object-fit: unset; }
.proj-img .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: repeating-linear-gradient(45deg, transparent 0 22px, var(--grid-line) 22px 23px);
}
.proj-cat {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}
.proj-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.proj-body .date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 10px;
}
.proj-body h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--fg);
  line-height: 1.2;
}
.proj-body p { font-size: 14px; margin-bottom: 20px; flex: 1; }
.proj-tech {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: auto;
}
.proj-tech-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.proj-tech-icon img { width: 18px; height: 18px; object-fit: contain; }
.proj-tech-icon span { font-size: 9px; font-weight: 700; color: var(--fg-mute); font-family: var(--font-mono); }

/* View all projects footer */
.proj-footer {
  margin-top: 40px;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-section { padding: 180px 0 120px; position: relative; }
.contact-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 80px; align-items: end; }
.contact-headline { font-size: clamp(56px, 7vw, 110px); }
.contact-headline .em { color: var(--accent); font-style: italic; }
.contact-lead { font-size: 18px; color: var(--fg-mute); margin-top: 24px; max-width: 480px; }
.contact-cta { display: flex; gap: 12px; margin-top: 48px; flex-wrap: wrap; }

.contact-side {
  border-left: 1px solid var(--border);
  padding-left: 40px;
}
.contact-side .row {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.contact-side .row:last-child { border-bottom: none; }
.contact-side .row .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.contact-side .row .value { font-size: 16px; color: var(--fg); }
.contact-side .row .value a:hover { color: var(--accent); }

/* ============================================
   FOOTER
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--bg-2);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-mute);
}
.footer-socials { display: flex; gap: 12px; }
.footer-socials a {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 200ms;
  color: var(--fg-mute);
}
.footer-socials a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }

/* ============================================
   MEDIA-FRAME (shared, all pages)
   ============================================ */
.media-frame {
  position: relative;
  background: var(--bg-card-2);
  overflow: hidden;
}
.media-frame .media-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: var(--fg-faint);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.media-frame.is-broken img { display: none; }
.media-frame.is-broken .media-fallback { display: flex; }

/* Lightbox */
.lightbox-trigger { cursor: default; }
.lightbox-expand-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 6px;
  color: #fff;
  padding: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  line-height: 0;
}
.lightbox-trigger:hover .lightbox-expand-btn { opacity: 1; }
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.lightbox-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}
.lightbox-inner {
  position: relative;
  max-width: 82vw;
  max-height: 82vh;
}
.lightbox-img {
  display: block;
  max-width: 82vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
  z-index: 9001;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border); padding: 24px; }
  .stat:nth-child(2n) { }
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
  .edu-grid { grid-template-columns: 1fr; }
  .exp-card { grid-template-columns: 1fr; gap: 20px; padding: 28px; }
  :root { --section-pad-y: 90px; }
  .contact-side { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 40px; }
}

@media (max-width: 860px) {
  .mobile-toggle { display: flex; }
  .nav-links a { display: none; }
  .nav-links .theme-toggle { margin-left: 0; }
  body.menu-open .nav-links {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 32px;
    z-index: 40;
  }
  body.menu-open .nav-links a {
    display: block;
    font-size: 14px;
    letter-spacing: 0.2em;
  }
  body.menu-open .nav-links .theme-toggle { display: inline-flex; }
  .nav { padding: 20px 24px; }
  :root { --section-pad-y: 80px; }
  .hero { padding-top: 100px; }
  .scroll-cue { display: none; }
  .contact-section { padding: 100px 0 80px; }
}

@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .skill-grid { grid-template-columns: 1fr; }
  .hero-meta { flex-direction: column; gap: 8px; }
  .proj-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
}

/* ============================================
   COMPAT LAYER — for projects.html & detail pages
   ============================================ */

/* Old section header classes */
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  display: block;
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5.5vw, 3.9rem);
  font-weight: 400;
  margin-bottom: 0.85rem;
  line-height: 1.05;
  color: var(--fg);
}
.section-subtitle {
  max-width: 58ch;
  color: var(--fg-soft);
  font-size: 1rem;
  line-height: 1.75;
  margin: 0;
}
.section-cta { margin-top: 2rem; }

.section-alt { background: var(--bg-2); }
.section-divider {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.25;
}

/* Page hero (projects.html) */
.page-hero { padding-top: 7rem; padding-bottom: 1rem; }
[data-page="projects"] #projects { padding-top: 2rem; }
.project-page { padding-top: 7rem; }

/* Back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--fg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.42rem 0.82rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: var(--font-mono);
}
.back-link:hover { color: var(--accent); border-color: var(--accent); }

/* Projects toolbar (projects.html) */
.projects-toolbar {
  margin: 1.8rem 0 1.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: end;
  justify-content: space-between;
}
.filters-group { display: flex; flex-direction: column; gap: 0.5rem; }
.filters-group-select { min-width: min(330px, 100%); }
.toolbar-label {
  color: var(--fg-mute);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  font-family: var(--font-mono);
}
.category-filters { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.filter-pill {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--fg-soft);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }

.projects-toolbar { position: relative; }
.tech-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font-size: 0.92rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: border-color 200ms;
}
.tech-dropdown-trigger:hover { border-color: var(--border-strong); }
.tech-mega-open .tech-dropdown-trigger { border-color: var(--accent); }
.tech-dropdown-trigger .td-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.tech-dropdown-trigger > span { flex: 1; }
.td-chevron { flex-shrink: 0; transition: transform 200ms; color: var(--fg-mute); }
.td-chevron.open { transform: rotate(180deg); }
.tech-mega-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  z-index: 200;
  padding: 12px;
}
.td-all-option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 0.88rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background 150ms, color 150ms;
}
.td-all-option:hover { background: var(--bg-3); color: var(--fg); }
.td-all-option.active { background: rgba(74,127,214,0.15); color: var(--accent-soft); border-color: var(--accent); }
.td-cols { display: grid; gap: 0; border-top: 1px solid var(--border); padding-top: 12px; }
.td-super-col { display: flex; flex-direction: column; padding: 0 12px; border-right: 1px solid var(--border); }
.td-super-col:first-child { padding-left: 0; }
.td-super-col:last-child { border-right: none; padding-right: 0; }
.td-col { flex: 1; }
.td-col + .td-col { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.td-group-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 6px;
}
.td-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg-soft);
  font-size: 0.86rem;
  font-family: var(--font-body);
  cursor: pointer;
  text-align: left;
  transition: background 150ms, color 150ms;
}
.td-option:hover { background: var(--bg-3); color: var(--fg); }
.td-option.active { background: rgba(74,127,214,0.15); color: var(--accent-soft); }
.td-icon { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.td-fallback {
  width: 16px; height: 16px; flex-shrink: 0;
  font-size: 8px; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-faint);
}
.empty-state { margin-top: 1rem; color: var(--fg-mute); }

/* Project grid (projects.html) */
.projects-grid, .related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}
.project-card { min-width: 0; }
.project-card-link {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.project-card-link:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-card);
}
.project-image { aspect-ratio: 16/9; }
.project-image img { width: 100%; height: 100%; object-fit: cover; }
.project-image.project-image--contain img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; height: auto; max-width: calc(100% - var(--img-padding, 48px)); max-height: calc(100% - var(--img-padding, 48px)); object-fit: unset; }
.project-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}
.project-date { color: var(--fg-mute); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-mono); }
.project-name { font-family: var(--font-body); font-weight: 700; font-size: 1rem; line-height: 1.3; color: var(--fg); }
.project-summary { color: var(--fg-soft); font-size: 0.88rem; line-height: 1.68; }
.category-chip {
  position: absolute;
  right: 0.7rem; top: 0.7rem;
  border-radius: 999px;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  background: var(--accent);
  color: #ffffff;
  padding: 0.24rem 0.58rem;
  font-family: var(--font-mono);
}
.project-tech { margin-top: auto; padding-top: 0.7rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tech-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(74, 127, 214, 0.08);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  font-family: var(--font-mono);
}
.tech-chip.more { background: transparent; color: var(--fg-mute); }
.tech-dot {
  width: 1.05rem; height: 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--fg-mute);
  font-size: 0.58rem;
  font-weight: 700;
}
.tech-dot img { width: 0.72rem; height: 0.72rem; object-fit: contain; }
.tech-chip-icon-only { padding: 0.22rem; gap: 0; }
.tech-chip-icon-only .tech-dot { width: 1.2rem; height: 1.2rem; }

/* Project detail layout */
.project-header { margin-top: 1.2rem; margin-bottom: 1.7rem; }
.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.6rem;
  align-items: start;
}
.project-main { display: flex; flex-direction: column; gap: 1.6rem; }
.gallery-main {
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  overflow: hidden;
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-controls { position: absolute; inset: 0; pointer-events: none; }
.gallery-button {
  pointer-events: all;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid transparent;
  width: 36px; height: 36px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #ffffff;
  cursor: pointer;
}
.gallery-button:hover { border-color: rgba(255,255,255,0.6); }
.gallery-button.prev { left: 0.8rem; }
.gallery-button.next { right: 0.8rem; }
.thumbnail-row { margin-top: 0.75rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.thumbnail {
  width: 72px; height: 46px;
  border: 2px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  padding: 0;
}
.thumbnail.active { border-color: var(--accent); }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.project-article { display: flex; flex-direction: column; gap: 1.8rem; }
.project-section { padding-bottom: 1.4rem; border-bottom: 1px solid var(--border); }
.project-section:last-child { border-bottom: 0; }
.project-section-title { font-size: 1.8rem; margin-bottom: 0.85rem; }
.project-section p { color: var(--fg-soft); line-height: 1.82; margin-bottom: 0.8rem; }
.project-section figure { margin: 0 0 1rem; }
.project-section figcaption { margin-top: 0.45rem; color: var(--fg-mute); font-size: 0.82rem; }
.sidebar-card {
  position: sticky;
  top: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.sidebar-section { padding: 1rem 1rem 0.95rem; border-bottom: 1px solid var(--border); }
.sidebar-section:last-child { border-bottom: 0; }
.sidebar-title { margin-bottom: 0.8rem; color: var(--fg-mute); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; font-family: var(--font-mono); }
.meta-list { display: grid; gap: 0.78rem; }
.meta-item-label { color: var(--fg-mute); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; font-family: var(--font-mono); }
.meta-item-value { color: var(--fg); font-size: 0.9rem; }
.sidebar-actions { display: flex; flex-direction: column; gap: 0.55rem; }
.sidebar-actions .btn { width: 100%; }
.attachment-list { display: flex; flex-direction: column; gap: 0.4rem; }
.attachment-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--fg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.82rem;
}
.attachment-link:hover { color: var(--accent); border-color: var(--accent); }

/* Old site-footer alias */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0;
  background: var(--bg-2);
}
.site-footer p { color: var(--fg-mute); font-size: 0.84rem; }

/* Home tech showcase (kept for projects.html compat) */
.home-tech-layout { margin-top: 2rem; display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.home-tech-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  background: var(--bg-card);
}
.home-tech-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.95rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--border); }
.home-tech-group-title { font-family: var(--font-body); font-size: 1.04rem; font-weight: 700; color: var(--fg); }
.home-tech-group-meta { color: var(--fg-mute); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; font-family: var(--font-mono); }
.home-tech-grid { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.65rem; }
.home-tech-link {
  display: flex; align-items: center; gap: 0.65rem;
  min-height: 3.1rem;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--bg-2);
  color: var(--fg);
  padding: 0.55rem 0.62rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}
.home-tech-link:hover { transform: translateY(-1px); border-color: var(--accent); background: rgba(74, 127, 214, 0.08); }
.home-tech-icon {
  width: 2rem; height: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.home-tech-icon img { width: 1.25rem; height: 1.25rem; object-fit: contain; }
.home-tech-fallback { color: var(--fg-mute); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.04em; }
.home-tech-name { font-size: 0.86rem; font-weight: 700; line-height: 1.25; color: var(--fg); }
.home-tech-cta { margin-left: auto; color: var(--accent); font-size: 0.67rem; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 700; font-family: var(--font-mono); }

/* Compat media queries */
@media (max-width: 1024px) {
  .projects-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-layout { grid-template-columns: 1fr; }
  .sidebar-card { position: static; }
}
@media (max-width: 720px) {
  .projects-grid, .related-grid { grid-template-columns: 1fr; }
  .home-tech-grid { grid-template-columns: 1fr; }
  .home-tech-cta { display: none; }
}
