/* ==========================================================================
   Academic Portfolio — Crafted Minimalist Design
   Andreas Polyvios Delladetsimas · University of Nicosia (IFF)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Surface & Base */
  --bg:             #ffffff;
  --bg-subtle:      #f9fafb;
  --bg-card:        #ffffff;
  --bg-chip:        #f3f4f6;

  /* Borders */
  --border:         #e5e7eb;
  --border-subtle:  #f3f4f6;
  --border-mid:     #d1d5db;
  --border-accent:  #bfdbfe;

  /* Typography */
  --text-heading:   #111827;
  --text-body:      #374151;
  --text-muted:     #6b7280;
  --text-faint:     #9ca3af;

  /* Accent & Lighting */
  --accent:         #2563eb;       /* Modern royal blue */
  --accent-light:   #eff6ff;
  --accent-hover:   #1d4ed8;
  --accent-glow:    rgba(37, 99, 235, 0.05);
  --shadow-accent:  rgba(37, 99, 235, 0.12);

  /* Overlays & Components */
  --navbar-bg:      rgba(255, 255, 255, 0.88);
  --toast-bg:       #111827;
  --toast-color:    #ffffff;

  /* Buttons */
  --btn-primary-bg:           var(--accent);
  --btn-primary-text:         #ffffff;
  --btn-primary-border:       var(--accent);
  --btn-primary-hover-bg:     var(--accent-hover);
  --btn-primary-hover-border: var(--accent-hover);

  /* Fonts & Mechanics */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --max-w: 920px;
  --ease:  cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  /* Surface & Base — Deep slate/zinc for high-contrast, premium look */
  --bg:             #0d0f12;
  --bg-subtle:      #13171f;
  --bg-card:        #13171f;
  --bg-chip:        #1a1f2c;

  /* Borders */
  --border:         #1f2430;
  --border-subtle:  #161a22;
  --border-mid:     #2e3646;
  --border-accent:  #1e3a8a;

  /* Typography */
  --text-heading:   #f9fafb;
  --text-body:      #d1d5db;
  --text-muted:     #9ca3af;
  --text-faint:     #6b7280;

  /* Accent & Lighting */
  --accent:         #3b82f6;       /* Bright accessible blue */
  --accent-light:   rgba(59, 130, 246, 0.12);
  --accent-hover:   #60a5fa;
  --accent-glow:    rgba(59, 130, 246, 0.08);
  --shadow-accent:  rgba(59, 130, 246, 0.18);

  /* Overlays & Components */
  --navbar-bg:      rgba(13, 15, 18, 0.85);
  --toast-bg:       #f9fafb;
  --toast-color:    #0d0f12;

  /* Buttons */
  --btn-primary-bg:           var(--accent);
  --btn-primary-text:         #ffffff;
  --btn-primary-border:       var(--accent);
  --btn-primary-hover-bg:     var(--accent-hover);
  --btn-primary-hover-border: var(--accent-hover);
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

/* Subtle Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-body);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Subtle Page Load Motion */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  animation: pageFadeIn 0.35s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  main {
    animation: none;
  }
}

/* ── Baseline Links ──────────────────────────────────────── */
a {
  color: inherit;
  text-decoration: none;
}

/* ── Layout Container ────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 32px;
}

.logo {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: color 0.15s ease;
}
.logo span {
  color: var(--accent);
  transition: color 0.2s ease;
}
.logo:hover {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 8px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-link:hover {
  color: var(--text-heading);
  background: var(--bg-subtle);
}
.nav-link.active {
  color: var(--text-heading);
  font-weight: 600;
  background: var(--bg-chip);
}

/* ── Theme Toggle Button ─────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, transform 0.15s var(--ease), border-color 0.15s;
}
.theme-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--accent);
  transform: scale(1.05);
}
.theme-toggle:active {
  transform: scale(0.95);
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: 1px solid transparent;
  color: var(--text-heading);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}
.mobile-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
}

/* ── Hero Section ────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 76px 0 60px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  max-width: 100vw;
  height: 380px;
  background: radial-gradient(ellipse at 50% 30%, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 136px 1fr;
  align-items: flex-start;
  gap: 44px;
}

.hero-image-wrapper {
  flex-shrink: 0;
}

.profile-img {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
  box-shadow: 0 0 0 1px var(--border), 0 0 0 4px var(--bg), 0 0 0 5px var(--border), 0 8px 20px rgba(0,0,0,0.06);
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.profile-img:hover {
  transform: scale(1.02);
  box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--bg), 0 0 0 6px var(--border-accent), 0 12px 28px var(--shadow-accent);
}

.hero-text-col {
  flex: 1;
  min-width: 0;
}

.hero-title {
  font-size: 2.65rem;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  color: var(--text-heading);
  margin-bottom: 12px;
}

.hero-affiliation {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-body);
  margin-bottom: 6px;
}

.hero-location {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-bio {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--text-body);
  margin-bottom: 28px;
  max-width: 580px;
}
.hero-bio strong {
  color: var(--text-heading);
  font-weight: 600;
}
.hero-bio a {
  color: var(--text-heading);
  text-decoration: underline;
  text-decoration-color: var(--border-mid);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.hero-bio a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  background-image: none !important;
  text-decoration: none !important;
  transition: all 0.2s var(--ease);
}
.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  border-color: var(--btn-primary-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-border);
  color: var(--btn-primary-text);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-chip);
  border-color: var(--border);
  color: var(--text-body);
}
.btn-secondary:hover {
  background: var(--border);
  color: var(--text-heading);
  border-color: var(--border-mid);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
}

/* ── Hero Social Chips ───────────────────────────────────── */
.hero-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-body);
  background: var(--bg-chip);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 8px;
  transition: color 0.18s var(--ease),
              background 0.18s var(--ease),
              border-color 0.18s var(--ease),
              transform 0.15s var(--ease),
              box-shadow 0.18s var(--ease);
}
.hero-social-link svg {
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.hero-social-link:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--border-accent);
  transform: translateY(-1.5px);
  box-shadow: 0 3px 10px var(--shadow-accent);
}
.hero-social-link:hover svg {
  opacity: 1;
}
.hero-social-link:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Page Headers & Subpage Layout ──────────────────────── */
.page-section {
  padding: 48px 0 60px;
}

.page-title {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.2;
  color: var(--text-heading);
  margin-bottom: 8px;
}

/* ── Content Sections ────────────────────────────────────── */
.section {
  padding: 58px 0;
  border-top: 1px solid var(--border);
}

.section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-heading);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 3.5px;
  height: 14px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-hover));
  border-radius: 99px;
}

.section-desc {
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  line-height: 1.7;
}
.section-desc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-desc a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Bio Prose ───────────────────────────────────────────── */
.bio-content {
  max-width: 700px;
}
.bio-content p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-body);
  margin-bottom: 18px;
}
.bio-content p:last-child {
  margin-bottom: 0;
}
.bio-content strong {
  color: var(--text-heading);
  font-weight: 600;
}
.bio-content a {
  color: var(--text-heading);
  text-decoration: underline;
  text-decoration-color: var(--border-mid);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.bio-content a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Publications List ───────────────────────────────────── */
.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  padding: 22px 18px;
  margin: 0 -18px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.pub-item:first-child { padding-top: 22px; }
.pub-item:last-child { border-bottom: none; }
.pub-item:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  transform: translateX(4px);
}

.pub-item-title {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-heading);
  letter-spacing: -0.2px;
}
.pub-item-title a {
  color: var(--text-heading);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.18s var(--ease), background-size 0.25s var(--ease);
}
.pub-item-title a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}

.pub-item-authors {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.pub-item-authors strong {
  color: var(--text-body);
  font-weight: 600;
}

.pub-item-venue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-faint);
  margin-top: 2px;
}

.pub-tag {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-chip);
  border: 1px solid var(--border);
  padding: 1.5px 8px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
}

.pub-link {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s, text-decoration 0.15s;
}
.pub-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Research Projects ───────────────────────────────────── */
.project-list {
  display: flex;
  flex-direction: column;
}

.project-item {
  padding: 22px 18px;
  margin: 0 -18px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.project-item:first-child { padding-top: 22px; }
.project-item:last-child { border-bottom: none; }
.project-item:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  transform: translateX(4px);
}

.project-item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.project-item-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.3px;
}
.project-item-title a {
  color: var(--text-heading);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1.5px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.18s var(--ease), background-size 0.25s var(--ease);
}
.project-item-title a:hover {
  color: var(--accent);
  background-size: 100% 1.5px;
}

.project-item-meta {
  font-size: 0.84rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-faint);
  white-space: nowrap;
}

.project-item-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.project-item-sub {
  font-size: 0.88rem;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.project-item-sub a {
  color: var(--accent);
  font-weight: 500;
  transition: color 0.15s, text-decoration 0.15s;
}
.project-item-sub a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── CV Entries ──────────────────────────────────────────── */
.cv-section {
  margin-bottom: 44px;
}
.cv-section:last-child {
  margin-bottom: 0;
}

.cv-section-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.cv-entry {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 24px;
  padding: 22px 18px;
  margin: 0 -18px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cv-entry:last-child { border-bottom: none; }
.cv-entry:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  transform: translateX(4px);
}

.cv-date {
  font-size: 0.84rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-faint);
  padding-top: 2px;
  line-height: 1.5;
}

.cv-details h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: -0.2px;
  margin-bottom: 3px;
}

.cv-institution {
  font-size: 0.94rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cv-desc {
  font-size: 0.98rem;
  color: var(--text-body);
  line-height: 1.7;
}
.cv-desc a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.cv-desc a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cv-cert-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 18px;
  margin: 0 -18px;
  border-bottom: 1px solid var(--border);
  border-radius: 10px;
  gap: 16px;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.cv-cert-item:last-child { border-bottom: none; }
.cv-cert-item:hover {
  background: var(--bg-subtle);
  border-color: transparent;
  transform: translateX(4px);
}

.cv-cert-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-heading);
}
.cv-cert-issuer {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.cv-cert-score {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-accent);
  padding: 2px 8px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ── Contact Details ─────────────────────────────────────── */
.contact-block {
  display: flex;
  flex-direction: column;
}

.contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.contact-row:first-child { padding-top: 0; }
.contact-row:last-child { border-bottom: none; }

.contact-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  flex-shrink: 0;
  width: 120px;
}

.contact-val {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: var(--text-body);
}
.contact-val a {
  color: var(--text-heading);
  text-decoration: none;
  transition: color 0.15s;
}
.contact-val a:hover {
  color: var(--accent);
}

.copy-text-btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-chip);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s var(--ease);
}
.copy-text-btn:hover {
  color: var(--text-heading);
  border-color: var(--border-mid);
  background: var(--bg-subtle);
  transform: translateY(-1px);
}
.copy-text-btn:active {
  transform: scale(0.95);
}

/* ── Toast Notification ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--toast-bg);
  color: var(--toast-color);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18), 0 0 0 1px var(--border);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
  font-size: 0.84rem;
  color: var(--text-faint);
}

.footer-nav {
  display: flex;
  gap: 20px;
}
.footer-nav a {
  color: var(--text-faint);
  transition: color 0.15s;
}
.footer-nav a:hover {
  color: var(--text-heading);
}

/* ── Responsive Breakdown ────────────────────────────────── */
@media (max-width: 640px) {
  .container {
    padding: 0 20px;
  }
  .page-section {
    padding: 36px 0 48px;
  }
  .page-title {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
  }
  .nav-container {
    padding: 12px 20px;
  }
  .hero {
    padding: 48px 0 40px;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-title {
    font-size: 2.15rem;
    letter-spacing: -0.8px;
  }
  .cv-entry {
    grid-template-columns: 1fr;
    gap: 4px;
    margin: 0;
    padding: 18px 0;
  }
  .cv-entry:hover, .pub-item:hover, .project-item:hover, .cv-cert-item:hover {
    transform: none;
    background: transparent;
  }
  .pub-item, .project-item, .cv-cert-item {
    margin: 0;
    padding: 18px 0;
  }
  .contact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .contact-label {
    width: auto;
  }
  .mobile-toggle {
    display: block;
  }
  .nav-menu {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    gap: 4px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s var(--ease);
  }
  .nav-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link {
    width: 100%;
    padding: 8px 12px;
  }
  .toast {
    bottom: 20px;
    right: 20px;
    left: 20px;
    justify-content: center;
    text-align: center;
    max-width: calc(100% - 40px);
    transform: translateY(12px) scale(0.96);
  }
  .toast.show {
    transform: translateY(0) scale(1);
  }
  .footer-container {
    padding: 0 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ── Print Stylesheet ────────────────────────────────────── */
@media print {
  body {
    color: #000;
    background: #fff;
  }
  .navbar, footer, .copy-text-btn, .toast, .theme-toggle, .mobile-toggle {
    display: none !important;
  }
  .container, .footer-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .hero::before {
    display: none !important;
  }
}
