/* =====================================================================
   Swarna Chakraborty — Academic Portfolio
   styles.css
   ---------------------------------------------------------------------
   Every UI knob lives in :root as a CSS custom property. The settings
   panel (see script.js) rewrites these variables live, so the whole
   layout — width, padding, colour, font, type scale — is controllable
   without touching any rule below.
   ===================================================================== */

:root {
  /* ---- CONTROLLABLE KNOBS (settings panel writes to these) ---- */
  --max: 1040px;         /* content max width            */
  --pad: 2rem;           /* horizontal page padding      */
  --radius: 4px;         /* corner rounding              */

  /* Explicit typography controls — size + weight per text role
     Defaults taken from the reference stylesheet:
     body 17px/400 · h2 1.6rem(26px)/600 · h3 1.1rem(18px)/600 · h1 2.6rem(42px)/600 */
  --h1-size: 42px;       --h1-weight: 700;   /* page heading / name  */
  --st-size: 26px;       --st-weight: 700;   /* section titles       */
  --sh-size: 18px;       --sh-weight: 700;   /* subheadings          */
  --body-size: 17px;     --body-weight: 500; /* paragraph text       */

  --accent: #2c5f8a;     /* primary accent               */
  --ink: #1a1a1a;        /* main text                    */
  --paper: #fafaf7;      /* page background              */

  --font-display: 'Lora', Georgia, serif;    /* headings  */
  --font-body: 'DM Sans', system-ui, sans-serif; /* body   */

  /* ---- DERIVED / FIXED TOKENS ---- */
  --ink-soft: color-mix(in srgb, var(--ink) 72%, var(--paper));
  --ink-muted: color-mix(in srgb, var(--ink) 48%, var(--paper));
  --paper-warm: color-mix(in srgb, var(--paper) 88%, var(--ink) 6%);
  --paper-card: color-mix(in srgb, var(--paper) 55%, #ffffff);
  --accent-light: color-mix(in srgb, var(--accent) 12%, var(--paper));
  --accent-dark: color-mix(in srgb, var(--accent) 78%, #000);
  --rule: color-mix(in srgb, var(--ink) 15%, var(--paper));

  --nav-h: 100px;         /* navbar height — knob-controlled */

  /* Brand colours for the icon links */
  --c-email: #ea4335;
  --c-linkedin: #0a66c2;
  --c-github: #181717;
  --c-scholar: #4285f4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;   /* stable base for small utility text (nav, chips, captions) */
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: var(--body-weight);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; }

/* ======================= NAV ======================= */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: center;
  padding: 0 var(--pad);
}
.nav-inner {
  max-width: var(--max);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.nav-links {
  display: flex;
  gap: clamp(0.6rem, 1.25vw, 1.25rem);
  list-style: none;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }

/* Mobile menu toggle (hidden on desktop) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  width: 38px; height: 34px;
  cursor: pointer;
  align-items: center; justify-content: center;
  color: var(--ink);
}
.nav-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }

/* ======================= LAYOUT ======================= */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

section { padding: 2rem 0; }
section + section { border-top: 1px solid var(--rule); }

.section-title {
  font-family: var(--font-display);
  font-size: var(--st-size);
  font-weight: var(--st-weight);
  letter-spacing: 0;
  color: var(--ink);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.6rem;
}
.section-intro {
  font-size: var(--body-size);
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 2rem;
}

/* ======================= HERO / ABOUT ======================= */
#about {
  padding-top: calc(var(--nav-h) + 5rem);
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 4rem;
  align-items: start;
}
.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.75rem;
  display: block;
}
h1 {
  font-family: var(--font-display);
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.hero-role {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}
.hero-bio {
  font-size: var(--body-size);
  color: var(--ink-soft);
  line-height: 1.8;
  text-align: justify;
  hyphens: auto;
  /* fills the container so copy expands as --max grows */
}
.hero-bio p + p { margin-top: 1em; }
.hero-bio a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.2s; }
.hero-bio a:hover { border-color: var(--accent); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.3rem 0.8rem;
  background: color-mix(in srgb, #3a9e5a 14%, var(--paper));
  color: #2a6e40;
  border-radius: 99px;
  margin-bottom: 1.5rem;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #3a9e5a;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

.hero-avatar {
  width: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* ---- ICON LINKS (about) ---- */
.hero-links {
  display: flex; flex-wrap: wrap; gap: 0.7rem;
  margin-top: 2rem;
}
.icon-link {
  --brand: var(--accent);
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  color: var(--ink-soft);
  background: var(--paper-card);
  text-decoration: none;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-link svg { width: 18px; height: 18px; fill: currentColor; }
.icon-link:hover {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-2px);
}
.icon-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ======================= RESEARCH ======================= */
.research-lead {
  font-size: var(--body-size);
  color: var(--ink-soft);
  line-height: 1.8;
  margin-bottom: 2rem;
}
.research-lead strong { color: var(--ink); font-weight: 500; }

.subhead {
  font-family: var(--font-display);
  font-size: var(--sh-size);
  font-weight: var(--sh-weight);
  color: var(--ink);
  margin-bottom: 0.9rem;
}

.current-project {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.1rem 1.3rem;
  margin-bottom: 2.2rem;
}
.current-project .cp-title { font-weight: 500; font-size: calc(var(--body-size) * 0.95); margin-bottom: 0.4rem; color: var(--ink); }
.current-project .cp-desc { font-size: calc(var(--body-size) * 0.9); color: var(--ink-soft); line-height: 1.7; }

.chip-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.8rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chip {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.9rem;
  border-radius: 99px;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  transition: background 0.2s, color 0.2s;
}
.chip:hover { background: var(--accent); color: #fff; }

/* ======================= PUBLICATIONS (list) ======================= */
.pub-list { display: flex; flex-direction: column; }
.pub-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  align-items: start;
}
.pub-item + .pub-item { border-top: 1px solid var(--rule); }
.pub-year {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding-top: 0.15rem;
}
.pub-main { min-width: 0; }
.pub-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}
.pub-title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.pub-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pub-link-icon {
  width: 0.85em; height: 0.85em;
  margin-left: 0.35em;
  vertical-align: -0.06em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--accent);
  opacity: 0.75;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.pub-title a:hover .pub-link-icon { opacity: 1; }
.pub-authors { font-size: 0.86rem; color: var(--ink-soft); margin-bottom: 0.25rem; }
.pub-authors strong { color: var(--ink); font-weight: 600; }
.pub-venue { font-size: 0.85rem; font-style: italic; color: var(--ink-muted); }
.pub-badge {
  justify-self: end;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 3px;
  white-space: nowrap;
}
.pub-badge.accepted { background: color-mix(in srgb,#3a9e5a 16%,var(--paper)); color:#2a6e40; }
.pub-badge.conf { background: var(--accent-light); color: var(--accent-dark); }
.pub-badge.workshop { background: color-mix(in srgb,#b8912e 18%,var(--paper)); color:#7a5a10; }

/* ======================= TIMELINE (exp + edu) ======================= */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 2rem;
  padding: 0 0 2.5rem;
  position: relative;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 120px; top: 0.6rem; bottom: 0;
  width: 1px; background: var(--rule);
  margin-left: 1rem;
}
.timeline-date {
  font-size: 0.78rem; color: var(--ink-muted);
  padding-top: 0.1rem; text-align: right;
}
.timeline-dot {
  position: absolute; left: 120px; top: 0.35rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  margin-left: calc(1rem - 4px);
  border: 2px solid var(--paper);
  outline: 1px solid var(--accent);
  z-index: 1;
}
.timeline-dot.muted { background: var(--rule); outline-color: var(--rule); }
.timeline-content { padding-left: 1.5rem; }
.timeline-role { font-weight: 600; font-size: 0.97rem; color: var(--ink); margin-bottom: 0.1rem; }
.timeline-org { font-size: 0.84rem; color: var(--accent); margin-bottom: 0.5rem; }
.timeline-desc { font-size: calc(var(--body-size) * 0.9); color: var(--ink-soft); line-height: 1.65; }

/* ======================= SKILLS (columns) ======================= */
.skills-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.skill-col {
  padding: 0 1.6rem;
  border-left: 1px solid var(--rule);
}
.skill-col:first-child { padding-left: 0; border-left: none; }
.skill-col:last-child { padding-right: 0; }
.skill-col-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}
.skill-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.skill-col li {
  font-size: 0.87rem;
  color: var(--ink-soft);
  line-height: 1.4;
  position: relative;
  padding-left: 0.9rem;
}
.skill-col li::before {
  content: ''; position: absolute; left: 0; top: 0.62em;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}

/* ======================= PROJECTS ======================= */
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.project-card {
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: box-shadow 0.2s;
}
.project-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.project-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.6rem; }
.project-num { font-family: var(--font-display); font-size: 0.72rem; color: var(--ink-muted); }
.project-link { font-size: 0.72rem; font-weight: 500; color: var(--accent); text-decoration: none; letter-spacing: 0.03em; opacity: 0.85; transition: opacity 0.2s; }
.project-link:hover { opacity: 1; text-decoration: underline; }
.project-title { font-family: var(--font-display); font-size: 0.97rem; font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; line-height: 1.35; }
.project-desc { font-size: calc(var(--body-size) * 0.88); color: var(--ink-soft); line-height: 1.65; }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.project-tag { font-size: 0.7rem; background: var(--paper-warm); border: 1px solid var(--rule); color: var(--ink-muted); padding: 0.15rem 0.5rem; border-radius: 2px; }

/* ======================= CV ======================= */
.cv-card {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  background: var(--paper-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem 1.8rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.cv-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); border-color: var(--accent); transform: translateY(-1px); }
.cv-icon {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: var(--radius);
  background: var(--accent-light);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.cv-icon svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cv-body { flex: 1; }
.cv-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-bottom: 0.15rem; }
.cv-sub { font-size: 0.85rem; color: var(--ink-soft); }
.cv-open { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 500; color: var(--accent); white-space: nowrap; }
.cv-open svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ======================= CONTACT ======================= */
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: stretch; }
.contact-text-wrap { display: flex; align-items: center; }
.contact-text { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); line-height: 1.4; margin: 0; }
.contact-note { font-size: calc(var(--body-size) * 0.9); color: var(--ink-soft); line-height: 1.7; }
.contact-items { display: flex; flex-direction: column; gap: 0.75rem; }
.contact-item { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; color: var(--ink-soft); }
.contact-item a { color: var(--accent); text-decoration: none; }
.contact-item a:hover { text-decoration: underline; }
.contact-icon {
  width: 32px; height: 32px; flex-shrink: 0;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}
.contact-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ======================= SERVICE ======================= */
.service-intro { font-size: calc(var(--body-size) * 0.95); color: var(--ink-soft); margin-bottom: 1.4rem; }
.service-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.service-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
}
.service-item + .service-item { border-top: 1px solid var(--rule); }
.service-role {
  font-family: var(--font-mono, var(--font-body));
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.2rem 0;
}
.service-venue { font-size: 0.95rem; color: var(--ink); line-height: 1.5; }

/* ======================= FOOTER ======================= */
footer {
  border-top: 1px solid var(--rule);
  padding: 2rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ======================= SETTINGS PANEL ======================= */
.settings-fab {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 200;
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--accent); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  transition: transform 0.25s ease;
}
.settings-fab:hover { transform: rotate(45deg); }
.settings-fab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.settings-panel {
  position: fixed; top: 0; right: 0; z-index: 210;
  width: 320px; max-width: 88vw; height: 100%;
  background: var(--paper);
  border-left: 1px solid var(--rule);
  box-shadow: -8px 0 30px rgba(0,0,0,0.12);
  padding: 1.5rem 1.4rem 2rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.settings-panel.open { transform: translateX(0); }
.settings-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.settings-head h3 { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.settings-close { background: none; border: none; cursor: pointer; color: var(--ink-muted); font-size: 1.4rem; line-height: 1; padding: 0.2rem; }
.settings-close:hover { color: var(--ink); }

.ctrl { margin-bottom: 1.35rem; }
.ctrl label { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8rem; font-weight: 500; color: var(--ink); margin-bottom: 0.5rem; }
.ctrl .val { font-size: 0.75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ctrl input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
.ctrl-color { display: flex; align-items: center; gap: 0.6rem; }
.ctrl-color input[type="color"] { width: 38px; height: 30px; border: 1px solid var(--rule); border-radius: 6px; background: none; cursor: pointer; padding: 2px; }
.ctrl-color .hex { font-size: 0.78rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.ctrl select { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--rule); border-radius: 6px; background: var(--paper-card); color: var(--ink); font-family: var(--font-body); font-size: 0.85rem; cursor: pointer; }
.settings-divider { border: none; border-top: 1px solid var(--rule); margin: 0.4rem 0 1.35rem; }

/* group heading inside the panel */
.settings-group-label {
  font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 600; color: var(--accent);
  margin: 0.2rem 0 1rem;
}
/* per-type block: a name + two compact sliders (size / weight) */
.type-ctrl { margin-bottom: 1.2rem; }
.type-ctrl .type-name { font-size: 0.82rem; font-weight: 600; color: var(--ink); margin-bottom: 0.55rem; }
.ctrl.mini { margin-bottom: 0.6rem; }
.ctrl.mini label { font-size: 0.72rem; font-weight: 400; color: var(--ink-soft); margin-bottom: 0.3rem; }
.width-note { display: block; font-size: 0.68rem; color: var(--ink-muted); margin-top: 0.3rem; min-height: 0.9em; }
.settings-reset {
  width: 100%; padding: 0.65rem; margin-top: 0.4rem;
  background: none; border: 1px solid var(--rule); border-radius: 6px;
  color: var(--ink-soft); font-family: var(--font-body); font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.settings-reset:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.settings-hint { font-size: 0.72rem; color: var(--ink-muted); line-height: 1.5; margin-top: 1rem; }

.settings-backdrop {
  position: fixed; inset: 0; z-index: 205;
  background: rgba(0,0,0,0.28);
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.settings-backdrop.open { opacity: 1; pointer-events: auto; }

/* ======================= REVEAL ANIMATION ======================= */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ======================= RESPONSIVE ======================= */
@media (max-width: 1040px) {
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--pad) 1rem;
    max-height: 0; overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .nav-links.open { max-height: 60vh; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 0.7rem 0; width: 100%; }
  .nav-toggle { display: flex; }
}
@media (max-width: 820px) {
  #about { grid-template-columns: 1fr; gap: 2rem; }
  .hero-avatar { max-width: 160px; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-columns { grid-template-columns: 1fr 1fr; }
  .skill-col { padding: 1.2rem 0; border-left: none; border-top: 1px solid var(--rule); }
  .skill-col:first-child { border-top: none; padding-top: 0; }
  .skill-col:nth-child(2) { border-top: none; padding-top: 0; }
  .contact-inner { grid-template-columns: 1fr; gap: 2rem; }
  .timeline-item { grid-template-columns: 84px 1fr; }
  .timeline-item::after, .timeline-dot { left: 84px; }
  .pub-item { grid-template-columns: 48px 1fr; }
  .pub-badge { grid-column: 2; justify-self: start; margin-top: 0.5rem; }
  .cv-card { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .skills-columns { grid-template-columns: 1fr; }
  .skill-col:nth-child(2) { border-top: 1px solid var(--rule); padding-top: 1.2rem; }
}

/* ======================= ACCESSIBILITY ======================= */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
