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

:root {
  --bg:      #fafaf8;
  --text:    #1b1b1f;
  --muted:   #74747d;
  --accent:  #2f5fd6;
  --border:  #e6e6e3;
  --tag-bg:  #f3f3f1;
}

[data-theme="dark"] {
  --bg:      #18181b;
  --text:    #f4f4f5;
  --muted:   #a1a1aa;
  --accent:  #60a5fa;
  --border:  #3f3f46;
  --tag-bg:  #27272a;
}

[data-theme="neon"] {
  --bg:      #09090f;
  --text:    #d8d8f0;
  --muted:   #5a5a8a;
  --accent:  #00ffe5;
  --border:  #161630;
  --tag-bg:  #0d0d1e;
}


html { scroll-behavior: smooth; }

body { transition: background-color 0.2s ease, color 0.2s ease; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Layout ── */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 5.5rem 2rem 6rem;
}

/* Subpage title block */
header {
  margin-bottom: 2.5rem;
}

/* ── Intro / About (two-column) ── */
.intro {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  margin-bottom: 5rem;
}

.intro-sidebar {
  width: 220px;
  flex-shrink: 0;
  text-align: center;
}

.intro-bio {
  flex: 1;
  min-width: 0;
}

.intro-bio h2 { margin-top: 0.2rem; }

.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1.25rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.intro-sidebar h1 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.intro-sidebar .tagline {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.availability {
  font-size: 0.775rem;
  color: var(--muted);
  margin-top: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.avail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0px rgba(34,197,94,0.4); }
  50%       { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}

.tagline {
  color: var(--muted);
  font-size: 0.95rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.1rem;
  font-size: 0.85rem;
  margin-top: 1.1rem;
}

.links a {
  color: var(--muted);
  text-decoration: none;
}

.links a:hover { color: var(--accent); }

.ext-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--tag-bg);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.ext-link:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}
.ext-link svg { flex-shrink: 0; }

header .links { justify-content: flex-start; }

/* ── Sections ── */
section {
  margin-bottom: 4.5rem;
}

h2 {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.6rem;
}

section p {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.75;
  margin-bottom: 0.8rem;
}

section p:last-child { margin-bottom: 0; }

section a {
  color: var(--accent);
  text-decoration: none;
}

section a:hover { text-decoration: underline; }

/* ── News ── */
.news-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-list li {
  display: flex;
  gap: 1.25rem;
  font-size: 0.875rem;
  align-items: baseline;
}

.date {
  font-size: 0.775rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 68px;
  font-variant-numeric: tabular-nums;
}

/* ── Projects ── */
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.project {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.project:hover {
  transform: scale(1.012);
  background: var(--tag-bg);
  border-color: transparent;
  box-shadow: 0 10px 34px rgba(0,0,0,0.07);
}

.project-thumb {
  width: 110px;
  height: 110px;
  border-radius: 7px;
  flex-shrink: 0;
  background: var(--tag-bg);
}

.project-thumb-img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.eye-tracking { background: linear-gradient(135deg, #c9d8f5 0%, #8faee8 100%); }
.emotion      { background: linear-gradient(135deg, #f5d9c9 0%, #e8a88f 100%); }
.nlp          { background: linear-gradient(135deg, #d0ecd4 0%, #85c98e 100%); }

.project-body h3 {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.project-body p {
  font-size: 0.855rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.tags {
  font-size: 0.75rem;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.project-body a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.75rem;
}

.project-body a:hover { text-decoration: underline; }

.work-badge {
  font-family: 'Inter', sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.08rem 0.45rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.45rem;
  letter-spacing: 0.06em;
}

/* ── Publications ── */
.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pub-title {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.pub-title a { color: var(--text); text-decoration: none; }
.pub-title a:hover { color: var(--accent); }

.pub-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.pub-status {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.05rem 0.4rem;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 0.25rem;
  letter-spacing: 0.01em;
}

.pub-desc {
  font-size: 0.855rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 0.4rem;
}

.pub-body a {
  font-size: 0.8rem;
  color: var(--accent);
  text-decoration: none;
  margin-right: 0.75rem;
}

.pub-body a:hover { text-decoration: underline; }

/* ── Education ── */
.edu-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.edu-list li {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  position: relative;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.edu-list li:hover {
  transform: scale(1.012);
  background: var(--tag-bg);
  border-color: transparent;
  box-shadow: 0 10px 34px rgba(0,0,0,0.07);
}

.edu-logo-col {
  width: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
  min-height: 36px;
  overflow: visible;
}

.logo-lewagon { width: 130px; max-width: none; max-height: none; height: auto; }
[data-theme="dark"] .logo-lewagon,
[data-theme="neon"] .logo-lewagon { filter: brightness(0) invert(1); }

.edu-logo {
  max-height: 60px;
  max-width: 90px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.edu-title-link { color: inherit; text-decoration: none; }
.edu-title-link:hover { text-decoration: underline; }

/* Stretched link: whole edu card is clickable via degree title */
.edu-title-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  z-index: 1;
}

/* Thesis links remain clickable above the overlay */
.edu-detail {
  position: relative;
  z-index: 2;
}



.edu-content {
  flex: 1;
  min-width: 0;
}

.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.edu-row strong {
  font-weight: 500;
  font-size: 0.875rem;
}

.institution {
  color: var(--muted);
  font-size: 0.825rem;
  display: block;
  margin-top: 0.1rem;
}

.edu-detail {
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.55;
  margin-top: 0.2rem;
  margin-bottom: 0 !important;
}

/* ── Project title links ── */
.project-body h3 a {
  color: var(--text);
  text-decoration: none;
}

.project-body h3 a:hover { color: var(--text); }

/* Stretched link: whole card is clickable via h3 link */
.project-body h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  z-index: 1;
}

/* Keep secondary links above the overlay */
.project-body > a,
.project-body .tags {
  position: relative;
  z-index: 2;
}

/* ── Theme toggle ── */
.theme-picker { position: relative; flex-shrink: 0; }

.theme-picker::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  height: 10px;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 5px;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
}

.theme-toggle:hover { color: var(--text); border-color: var(--muted); }

.theme-toggle .icon-light-mode { display: inline-flex; }
.theme-toggle .icon-dark-mode  { display: none; }
.theme-toggle .icon-neon-mode  { display: none; }
[data-theme="dark"] .theme-toggle .icon-light-mode { display: none; }
[data-theme="dark"] .theme-toggle .icon-dark-mode  { display: inline-flex; }
[data-theme="dark"] .theme-toggle .icon-neon-mode  { display: none; }
[data-theme="neon"] .theme-toggle .icon-light-mode { display: none; }
[data-theme="neon"] .theme-toggle .icon-dark-mode  { display: none; }
[data-theme="neon"] .theme-toggle .icon-neon-mode  { display: inline-flex; }

.theme-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.3rem;
  min-width: 90px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.theme-picker:hover .theme-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.theme-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  font-family: 'Inter', system-ui, sans-serif;
  white-space: nowrap;
  transition: background 0.1s, color 0.1s;
}

.theme-dropdown button:hover { background: var(--tag-bg); color: var(--text); }

html:not([data-theme]) .theme-dropdown [data-for="light"],
html[data-theme="dark"] .theme-dropdown [data-for="dark"],
html[data-theme="neon"] .theme-dropdown [data-for="neon"] {
  color: var(--accent);
  font-weight: 500;
}

/* ── Skills ── */
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.skill-row {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
}

.skill-row dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  min-width: 90px;
  flex-shrink: 0;
}

.skill-row dd {
  color: var(--text);
  font-size: 0.855rem;
}

/* ── Subpage nav ── */
.back-nav {
  margin-bottom: 1.5rem;
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.back-nav a {
  color: var(--muted);
  text-decoration: none;
}

.back-nav a:hover { color: var(--accent); }

/* ── Subpage content ── */
.project-image {
  width: 100%;
  max-width: 580px;
  border-radius: 8px;
  margin: 1rem 0 1.25rem;
  border: 1px solid var(--border);
  display: block;
}

.detail-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.detail-list li {
  padding-left: 1.1rem;
  position: relative;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.65;
}

.detail-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--muted);
}

.lessons-list {
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.lessons-list li { padding-left: 0.2rem; }

/* ── Dark mode overrides ── */
[data-theme="dark"] .abstract-block { background: var(--tag-bg); }

/* ── Neon mode overrides ── */
@keyframes neon-glow {
  0%, 100% {
    text-shadow:
      0 0 7px #fff,
      0 0 10px #fff,
      0 0 21px #fff,
      0 0 42px #00ffe5,
      0 0 82px #00ffe5,
      0 0 100px #00ffe5;
  }
  50% {
    text-shadow:
      0 0 4px #fff,
      0 0 11px #fff,
      0 0 19px #fff,
      0 0 40px #00ffe5,
      0 0 80px #00ffe5,
      0 0 90px #00ffe5,
      0 0 150px #00ffe5;
  }
}

[data-theme="neon"] body {
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(0,255,229,0.08) 0%, transparent 55%),
    linear-gradient(rgba(0,255,229,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,229,0.07) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  text-shadow: 0 0 2px rgba(216,216,240,0.45);
}

[data-theme="neon"] .abstract-block { background: var(--tag-bg); }

[data-theme="neon"] header {
  border-bottom-color: rgba(0,255,229,0.35);
  box-shadow: 0 1px 24px rgba(0,255,229,0.08);
}

[data-theme="neon"] h1 {
  color: #fff;
  text-shadow: none;
  animation: neon-glow 3s ease-in-out infinite;
}

[data-theme="neon"] h2 {
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 30px rgba(0,255,229,0.55), 0 0 60px rgba(0,255,229,0.2);
}

[data-theme="neon"] .tagline {
  color: rgba(0,255,229,0.75);
  text-shadow: 0 0 10px rgba(0,255,229,0.45);
}

[data-theme="neon"] .links a {
  color: rgba(0,255,229,0.65);
  text-shadow: 0 0 6px rgba(0,255,229,0.35);
}

[data-theme="neon"] .links a:hover {
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent), 0 0 24px rgba(0,255,229,0.5);
}

[data-theme="neon"] .date {
  color: var(--accent);
  text-shadow: 0 0 7px var(--accent);
  opacity: 0.85;
}

[data-theme="neon"] .project-thumb-img {
  border-color: rgba(0,255,229,0.4);
  box-shadow: 0 0 20px rgba(0,255,229,0.18), 0 0 6px rgba(0,255,229,0.35);
}

[data-theme="neon"] .project-body h3 a {
  text-shadow: 0 0 5px rgba(216,216,240,0.35);
}

[data-theme="neon"] .project-body h3 a:hover {
  color: inherit;
  text-shadow: 0 0 5px rgba(216,216,240,0.35);
}

[data-theme="neon"] .project-body a {
  text-shadow: 0 0 7px currentColor;
}

[data-theme="neon"] .tags {
  color: rgba(0,255,229,0.55);
}

[data-theme="neon"] section a {
  text-shadow: 0 0 7px currentColor;
}

[data-theme="neon"] #site-nav {
  background: rgba(9,9,15,0.88);
  backdrop-filter: blur(14px);
  border-bottom-color: rgba(0,255,229,0.22);
  box-shadow: 0 1px 24px rgba(0,255,229,0.1);
}

[data-theme="neon"] .site-nav-name {
  text-shadow: 0 0 8px rgba(216,216,240,0.4);
}

[data-theme="neon"] .site-nav-links a.active,
[data-theme="neon"] .site-nav-links a:hover {
  text-shadow: 0 0 12px currentColor;
}

[data-theme="neon"] .theme-toggle {
  color: var(--accent);
  border-color: rgba(0,255,229,0.55);
  box-shadow: 0 0 14px rgba(0,255,229,0.3), inset 0 0 8px rgba(0,255,229,0.06);
  text-shadow: 0 0 8px var(--accent);
}

[data-theme="neon"] .profile-photo {
  border-color: rgba(0,255,229,0.45);
  box-shadow: 0 0 24px rgba(0,255,229,0.22), 0 0 50px rgba(0,255,229,0.08);
}

[data-theme="neon"] .edu-logo:not(.logo-lewagon) {
  filter: drop-shadow(0 0 5px rgba(0,255,229,0.35));
}

[data-theme="neon"] footer {
  border-top-color: rgba(0,255,229,0.18);
  text-shadow: 0 0 6px rgba(0,255,229,0.3);
}

[data-theme="neon"] .avail-dot {
  background: var(--accent);
  animation: pulse-dot 2.5s ease-in-out infinite,
             neon-ring-pulse 2.5s ease-in-out infinite;
}

[data-theme="neon"] .pub-status {
  text-shadow: 0 0 6px var(--accent);
  box-shadow: 0 0 6px rgba(0,255,229,0.2);
}

[data-theme="neon"] .pub-title a {
  text-shadow: 0 0 5px rgba(216,216,240,0.3);
}

[data-theme="neon"] .pub-title a:hover {
  text-shadow: 0 0 10px var(--accent), 0 0 22px rgba(0,255,229,0.4);
}

/* Pulsing animations */
@keyframes neon-h2-pulse {
  0%, 100% { text-shadow: 0 0 10px var(--accent), 0 0 30px rgba(0,255,229,0.55), 0 0 60px rgba(0,255,229,0.2); }
  50%       { text-shadow: 0 0 16px var(--accent), 0 0 48px rgba(0,255,229,0.75), 0 0 90px rgba(0,255,229,0.35); }
}
[data-theme="neon"] h2 { animation: neon-h2-pulse 4s ease-in-out infinite; }

@keyframes neon-btn-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,255,229,0.45), 0 0 50px rgba(0,255,229,0.15), inset 0 0 18px rgba(0,255,229,0.08); }
  50%       { box-shadow: 0 0 32px rgba(0,255,229,0.7),  0 0 80px rgba(0,255,229,0.28), inset 0 0 28px rgba(0,255,229,0.14); }
}

@keyframes neon-ring-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(0,255,229,0.22), 0 0 50px rgba(0,255,229,0.08); }
  50%       { box-shadow: 0 0 38px rgba(0,255,229,0.42), 0 0 80px rgba(0,255,229,0.18); }
}
[data-theme="neon"] .profile-photo {
  border-color: rgba(0,255,229,0.45);
  animation: neon-ring-pulse 3s ease-in-out infinite;
}

/* CRT scanlines overlay */
[data-theme="neon"] body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.055) 2px,
    rgba(0,0,0,0.055) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* Neon text selection */
[data-theme="neon"] ::selection {
  background: rgba(0,255,229,0.28);
  color: #fff;
  text-shadow: 0 0 12px #00ffe5;
}

/* Neon scrollbar */
[data-theme="neon"] ::-webkit-scrollbar { width: 5px; }
[data-theme="neon"] ::-webkit-scrollbar-track { background: #09090f; }
[data-theme="neon"] ::-webkit-scrollbar-thumb {
  background: rgba(0,255,229,0.35);
  border-radius: 3px;
}
[data-theme="neon"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,255,229,0.65); }

/* News list — neon left rail */
[data-theme="neon"] .news-list li {
  border-left: 1px solid rgba(0,255,229,0.35);
  padding-left: 0.85rem;
  box-shadow: -1px 0 10px rgba(0,255,229,0.18);
}

/* Project thumb hover flare */
[data-theme="neon"] .project-thumb-img { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
[data-theme="neon"] .project:hover .project-thumb-img {
  border-color: rgba(0,255,229,0.7);
  box-shadow: 0 0 30px rgba(0,255,229,0.38), 0 0 8px rgba(0,255,229,0.65);
}

/* Education rows */
[data-theme="neon"] .edu-row strong {
  text-shadow: 0 0 6px rgba(216,216,240,0.35);
}

[data-theme="neon"] .institution {
  color: rgba(0,255,229,0.5);
  text-shadow: 0 0 6px rgba(0,255,229,0.25);
}

/* Cards — neon */
[data-theme="neon"] .project,
[data-theme="neon"] .edu-list li {
  border-color: rgba(0,255,229,0.18);
}

[data-theme="neon"] .project:hover,
[data-theme="neon"] .edu-list li:hover {
  border-color: rgba(0,255,229,0.38);
  box-shadow: 0 4px 32px rgba(0,255,229,0.18);
}

/* Cards — dark */
[data-theme="dark"] .project,
[data-theme="dark"] .edu-list li {
  border-color: #2e2e33;
}

[data-theme="dark"] .project:hover,
[data-theme="dark"] .edu-list li:hover {
  border-color: transparent;
  box-shadow: 0 10px 34px rgba(0,0,0,0.4);
}

/* ── Top nav bar (always visible) ── */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.site-nav-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-nav-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}

.site-nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav-links {
  display: flex;
  gap: 1.5rem;
}

.site-nav-links a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.site-nav-links a:hover,
.site-nav-links a.active { color: var(--accent); }

/* ── Nav search ── */
.nav-search {
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.nav-search.open {
  background: var(--tag-bg);
  border-color: var(--border);
  padding-right: 0.5rem;
}

.nav-search.open:focus-within { border-color: var(--accent); }

.nav-search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 0.3rem;
  line-height: 1;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.nav-search-toggle:hover { color: var(--text); }
.nav-search.open .nav-search-toggle { color: var(--accent); }

.nav-search input {
  width: 0;
  opacity: 0;
  border: none;
  background: none;
  outline: none;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text);
  padding: 0;
  letter-spacing: inherit;
  transition: width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.nav-search.open input {
  width: 132px;
  opacity: 1;
  margin-left: 0.2rem;
}

.nav-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

[data-theme="neon"] .nav-search.open {
  border-color: rgba(0,255,229,0.35);
  box-shadow: inset 0 0 8px rgba(0,255,229,0.05);
}
[data-theme="neon"] .nav-search.open:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0,255,229,0.25), inset 0 0 8px rgba(0,255,229,0.08);
}

section[id] { scroll-margin-top: 72px; }


/* ── Footer ── */
footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.775rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 720px) {
  .intro {
    flex-direction: column;
    align-items: center;
    gap: 1.75rem;
    text-align: center;
  }
  .intro-sidebar { width: 100%; max-width: 360px; }
  .intro-bio { text-align: left; width: 100%; }
}

@media (max-width: 540px) {
  .container { padding: 4.5rem 1.5rem 3rem; }
  .profile-photo { width: 150px; height: 150px; }
  .news-list li { flex-direction: column; gap: 0.1rem; }
  .project { flex-direction: column; border-radius: 10px; }
  .edu-list li { flex-direction: column; gap: 0.3rem; border-radius: 10px; }

  .edu-logo-col { min-height: unset; justify-content: flex-start; }
  .edu-row { flex-direction: column; gap: 0.1rem; }
  .site-nav-links { display: none; }
  .site-nav-right { gap: 0.6rem; }
  .nav-search.open input { width: 100px; }
}
