/* =========================================================
   styles.css
   ---------------------------------------------------------
   Quick edits:
   - Change the accent color  -> the two "--accent" lines below
   - Change the font          -> "--font-sans"
   - Change spacing/corners   -> the "--space-*" / "--radius" lines
   Dark mode colors are in the  [data-theme="dark"]  block.

   Design idea: plain and content-first. One system font, one
   accent color for links and actions, thin lines instead of
   boxes and shadows, and no scroll or hover animations.
   ========================================================= */

/* ---------- 1. THEME VARIABLES ---------- */
:root {
  /* Colors (light theme) */
  --bg: #fbf8f9;
  --surface: #ffffff;
  --text: #1c161a;
  --muted: #5f5660;
  --border: #ece3e7;
  --accent: #b4235f;        /* <- main accent color (deep rose pink). Try #1f4fa3 for blue */
  --accent-ink: #ffffff;    /* text color ON the accent (buttons) */
  --accent-soft: #fce8f0;   /* very light accent tint (image backgrounds, badges) */

  /* Font: the computer's own system font (fast, no download, reads well) */
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Spacing & shape */
  --space-1: .5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --radius: 4px;
  --sidebar-w: 280px;
  --topbar-h: 60px;
}

/* Dark theme: applied when <html data-theme="dark"> */
[data-theme="dark"] {
  --bg: #130f12;
  --surface: #1c161a;
  --text: #f1eaee;
  --muted: #b3a7ae;
  --border: #34292f;
  --accent: #f48fb9;        /* <- accent color in dark mode (lighter so it stays readable) */
  --accent-ink: #1f0a14;
  --accent-soft: #2e1823;
  color-scheme: dark;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }   /* set by JS while a pop-up is open */
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 var(--space-1); letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 var(--space-2); }
ul, ol { margin: 0; padding: 0; }
.mono { font-size: .9rem; }            /* small label text (the class name is historical) */
.muted { color: var(--muted); font-weight: 400; }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem;
}
.skip-link:focus { left: 0; }

/* ---------- 3. BUTTONS & TAGS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.1rem; border-radius: var(--radius); font: 600 .95rem var(--font-sans);
  text-decoration: none; cursor: pointer; border: 1.5px solid transparent;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Tags: plain text separated by dots */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: .1rem .5rem; }
.chips li { color: var(--muted); font-size: .85rem; }
.chips li + li::before { content: "·"; margin-right: .5rem; color: var(--muted); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Theme toggle icons: show moon in light mode, sun in dark mode */
.i-sun { display: none; }
[data-theme="dark"] .i-sun { display: block; }
[data-theme="dark"] .i-moon { display: none; }

/* ---------- 4. SIDEBAR (desktop) ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  overflow-y: auto; display: flex; flex-direction: column;
}
.sidebar-bar { display: flex; justify-content: flex-end; padding: var(--space-2) var(--space-2) 0; }
.bar-brand { display: none; }       /* only shown on mobile */
.bar-actions { display: flex; gap: .5rem; }
.menu-btn { display: none; }        /* only shown on mobile */

.sidebar-panel { padding: var(--space-1) var(--space-3) var(--space-3); text-align: center; }
.avatar {
  width: 132px; height: 132px; margin: 0 auto var(--space-2); border-radius: var(--radius); object-fit: cover;
}
.name { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: .25rem; }
.title { font-size: .85rem; color: var(--muted); margin-bottom: var(--space-1); }
.tagline { font-size: .88rem; margin-bottom: var(--space-2); }

.nav ul { list-style: none; text-align: left; margin-bottom: var(--space-2); }
.nav a {
  display: block; padding: .45rem .8rem; color: var(--muted);
  text-decoration: none; font-weight: 500; font-size: .95rem; border-left: 3px solid transparent;
}
.nav a:hover { color: var(--text); text-decoration: underline; }
.nav a.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }

.sidebar .chips { justify-content: center; margin-bottom: var(--space-2); }
.sidebar .chips li { font-size: .82rem; }
.side-links { display: grid; gap: .5rem; }

/* ---------- 5. MAIN LAYOUT ---------- */
.main { margin-left: var(--sidebar-w); padding: 0 var(--space-4); }
.section { max-width: 920px; margin: 0 auto; padding: var(--space-5) 0 var(--space-1); scroll-margin-top: 1rem; }
.section > h2 { margin-bottom: var(--space-2); }
.hero { padding-top: 4rem; padding-bottom: var(--space-2); }
.eyebrow { color: var(--muted); margin-bottom: var(--space-1); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: var(--space-2) 0 var(--space-3); }
.section-intro { color: var(--muted); max-width: 62ch; margin-bottom: var(--space-3); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* ---------- 6. PROJECT FILTERS & LIST ---------- */
/* Filters: text buttons; the selected one is underlined */
.filters { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.filter-btn {
  font: 500 .95rem var(--font-sans); padding: .6rem 0; cursor: pointer; margin-bottom: -1px;
  background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent;
}
.filter-btn:hover { color: var(--accent); }
.filter-btn[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* Projects: a list separated by thin lines, photo on the left */
.cards { display: grid; grid-template-columns: 1fr; }
.card {
  position: relative; display: grid; grid-template-columns: 220px 1fr; gap: var(--space-3); align-items: start;
  border-top: 1px solid var(--border); padding: var(--space-2) 0;
}
.card:last-child { border-bottom: 1px solid var(--border); }
.card[hidden] { display: none; }
.card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--accent-soft); }
.card h3 { font-size: 1.25rem; margin-bottom: .35rem; }
.card-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
/* Stretch the link's click area over the whole row */
.card-link::after { content: ""; position: absolute; inset: 0; }
.card-link:focus-visible { outline: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.card p { margin-bottom: var(--space-1); }

/* ---------- 7. ABOUT / SKILLS / EXPERIENCE / EDUCATION ---------- */
.about-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--space-4); align-items: start; }
.prose p { max-width: 62ch; }
.facts { margin: 0; display: grid; border-top: 1px solid var(--border); }
.facts div { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }

/* Skills: always 2 groups per row (1 per row on phones) so the rows line up evenly */
.skill-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3) var(--space-4); }
.skill-group, .panel { border-top: 1px solid var(--border); padding-top: var(--space-2); }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.skill-group h3 { margin-bottom: var(--space-2); }
.skill-group ul { list-style: none; }
/* Each skill row is a 3-column grid: name | 3-step bar | level word */
.skill-group li {
  --lvl: 0; display: grid; grid-template-columns: 1fr 42px 5.2rem; align-items: center; gap: .6rem;
  padding: .45rem 0; border-top: 1px solid var(--border); font-size: .93rem;
}
.skill-group li:first-child { border-top: 0; }
.skill-group li[data-level="1"] { --lvl: 1; }
.skill-group li[data-level="2"] { --lvl: 2; }
.skill-group li[data-level="3"] { --lvl: 3; }
.skill-group li::before {
  content: ""; order: 2; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent) calc(var(--lvl) * 33.333%), var(--border) 0);
}
.skill-group li::after { order: 3; text-align: right; font-size: .8rem; color: var(--muted); }
.skill-group li[data-level="1"]::after { content: "Familiar"; }
.skill-group li[data-level="2"]::after { content: "Proficient"; }
.skill-group li[data-level="3"]::after { content: "Advanced"; }

.timeline { list-style: none; position: relative; margin-left: .5rem; padding-left: var(--space-3); border-left: 2px solid var(--border); }
.tl-item { position: relative; padding-bottom: var(--space-3); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: calc(-1 * var(--space-3) - 8px); top: .35rem;
  width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent);
}
.tl-date { color: var(--muted); margin-bottom: .2rem; }
.tl-item ul { margin: .5rem 0 0 1.1rem; color: var(--muted); }
.tl-item li { margin-bottom: .3rem; }

.edu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.panel-wide { grid-column: 1 / -1; }
.chips-inline { margin-top: var(--space-1); }

/* ---------- 8. RESUME / CONTACT / FOOTER ---------- */
.resume-frame { margin-top: var(--space-2); border: 1px solid var(--border); overflow: hidden; background: var(--surface); }
.resume-frame object { width: 100%; height: 70vh; min-height: 420px; display: block; }
.resume-frame .panel { margin: var(--space-2); }

.contact-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-size: 1.1rem; font-weight: 600; margin-bottom: var(--space-3); }
.form { display: grid; gap: var(--space-2); max-width: 520px; }
.form label { display: grid; gap: .3rem; font-weight: 500; font-size: .9rem; }
.form input, .form textarea {
  font: inherit; color: var(--text); background: var(--surface); padding: .7rem .8rem;
  border: 1px solid var(--border); border-radius: var(--radius); width: 100%;
}
.form input:focus, .form textarea:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form .btn { justify-self: start; }

.footer {
  max-width: 920px; margin: var(--space-5) auto 0; padding: var(--space-3) 0 var(--space-4);
  border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  color: var(--muted); font-size: .9rem;
}
.footer p { margin: 0; }

/* ---------- 9. PROJECT PAGES ---------- */
dialog { color: var(--text); }
.lightbox::backdrop { background: rgba(20, 8, 14, .78); }

.project-page { padding-top: var(--space-4); }
.back-link {
  display: inline-block; margin-bottom: var(--space-3); font-size: .9rem;
  text-decoration: none; color: var(--muted); padding: .3rem 0;
}
.back-link:hover { color: var(--accent); text-decoration: underline; }
.pp-head h1 { margin-bottom: var(--space-1); }
.pp-head h1:focus { outline: none; }
.pp-head .lead { margin-bottom: var(--space-2); }
.pp-meta { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; color: var(--muted); margin-bottom: var(--space-2); }
.pp-meta b { color: var(--text); font-weight: 600; margin-right: .35rem; }
.pp-head { display: grid; grid-template-columns: 1fr minmax(200px, 300px); gap: var(--space-4); align-items: center; margin-bottom: var(--space-3); }
.pp-cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--accent-soft); }
/* "Jump to section" links */
.pp-toc { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.toc-btn {
  font: 500 .95rem var(--font-sans); padding: .3rem 0; cursor: pointer;
  background: none; color: var(--accent); border: 0; text-decoration: underline; text-underline-offset: 3px;
}

.pp-section { margin-top: var(--space-5); scroll-margin-top: 1rem; }
.pp-section > h2 { font-size: 1.5rem; padding-bottom: var(--space-1); margin-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.pp-section h3 { font-size: 1rem; font-weight: 600; margin: var(--space-2) 0 .4rem; }
.pp-section h3:first-child { margin-top: 0; }
.pp-section ul { margin-left: 1.2rem; }
.pp-section li { margin-bottom: .3rem; }
.pp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3) var(--space-4); }
/* My contributions and Key specs: full width under the overview columns */
.pp-contrib { margin-top: var(--space-4); max-width: 760px; }
.pp-specs { margin-top: var(--space-4); max-width: 760px; }
.pp-specs .spec-table th { width: 32%; }

.spec-table { width: 100%; border-collapse: collapse; border-top: 1px solid var(--border); font-size: .93rem; margin: var(--space-1) 0; }
.spec-table th, .spec-table td { text-align: left; padding: .6rem .9rem .6rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { width: 38%; font-weight: 500; color: var(--muted); }

/* Roadmap: vertical timeline with status labels */
.roadmap { list-style: none; margin: 0 !important; padding-left: var(--space-3); border-left: 2px solid var(--border); }
.rm-item { position: relative; padding-bottom: var(--space-3); }
.rm-item:last-child { padding-bottom: 0; }
.rm-item::before {
  content: ""; position: absolute; left: calc(-1 * var(--space-3) - 8px); top: .3rem; width: 14px; height: 14px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--border);
}
.rm-done::before { background: var(--accent); border-color: var(--accent); }
.rm-active::before { border-color: var(--accent); }
.rm-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-bottom: .2rem; }
.rm-phase { color: var(--muted); }
.rm-item h3 { font-size: 1.05rem; color: var(--text); margin: 0 0 .2rem; }
.rm-item p { color: var(--muted); margin: 0; }
.status { font-size: .8rem; padding: .1rem .5rem; border-radius: var(--radius); border: 1px solid var(--border); color: var(--muted); }
.status-done { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.status-active { color: var(--accent); border-color: var(--accent); }

/* Showcase: one block per mini-project, separated by a line */
.pitems { display: grid; gap: var(--space-4); }
.pitem { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; border-top: 1px solid var(--border); padding-top: var(--space-3); }
.pitem-media { position: sticky; top: 1rem; min-width: 0; }
.pitem-text { min-width: 0; }
.pitem-text h3 { font-size: 1.35rem; color: var(--text); margin: 0 0 var(--space-1); }
.pitem-text .chips { margin: 0 0 var(--space-2); padding: 0; }
.pitem-text .chips li { margin: 0; }
.pitem-summary { font-size: 1.02rem; margin: 0 0 var(--space-1); }
.pitem-purpose { color: var(--muted); font-size: .93rem; margin: 0 0 var(--space-1); }
.pitem-purpose b { color: var(--text); font-weight: 600; margin-right: .6rem; }
.ctx { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .6rem; margin: 0 0 var(--space-1); color: var(--muted); font-size: .92rem; }
.ctx-badge { border: 1px solid var(--accent); color: var(--accent); padding: .05rem .5rem; border-radius: var(--radius); font-size: .8rem; }

/* Photo carousel: big photo, arrows, counter, thumbnail strip */
.carousel { display: grid; gap: .6rem; min-width: 0; }
.car-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); }
.car-main { all: unset; display: block; width: 100%; cursor: zoom-in; }
.car-main:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* "contain" shows the whole photo (tall phone photos get side bars instead of being cropped) */
.car-main img { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; display: block; background: var(--border); }
.car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; font-size: 1.5rem; line-height: 1; background: rgba(255, 255, 255, .9); color: #1c161a; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.car-arrow:hover { background: #fff; }
.car-arrow:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.car-prev { left: .6rem; } .car-next { right: .6rem; }
.car-count { position: absolute; right: .6rem; bottom: .6rem; background: rgba(0, 0, 0, .62); color: #fff; padding: .1rem .5rem; border-radius: var(--radius); font-size: .8rem; }
.car-cap { color: var(--muted); margin: 0; min-height: 1.3em; }
.car-thumbs { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px .35rem; }
.car-thumbs button { all: unset; flex: 0 0 78px; cursor: pointer; border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; opacity: .65; }
.car-thumbs button:hover { opacity: 1; }
.car-thumbs button[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.car-thumbs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.car-thumbs img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--accent-soft); }

/* Video slides play in the same frame as the photos */
.car-video { width: 100%; aspect-ratio: 3 / 2; object-fit: contain; display: block; background: var(--border); }
.car-main[hidden], .car-video[hidden] { display: none; }
/* Small play mark on video thumbnails */
.car-thumbs button.is-video { position: relative; }
.car-thumbs button.is-video::after {
  content: "▶"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: .9rem; background: rgba(0, 0, 0, .35);
}

/* Files list */
.file-list { list-style: none; margin: var(--space-1) 0 0 !important; display: grid; gap: .5rem; padding: 0; }
.file-list li { margin: 0 !important; }
.file {
  display: flex; align-items: center; gap: .75rem; padding: .65rem .9rem; border-radius: var(--radius); text-decoration: none;
  border: 1px solid var(--border); color: var(--text); font-size: .93rem;
}
a.file:hover { border-color: var(--accent); }
.file-name { font-weight: 500; flex: 1; min-width: 0; }
.file-note { color: var(--muted); font-size: .8rem; }
.file-go { color: var(--accent); }
.file.is-pending { opacity: .75; border-style: dashed; }
.badge { font-size: .75rem; font-weight: 600; padding: .15rem .45rem; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent); min-width: 3.2rem; text-align: center; }

/* Files grouped by kind inside each item */
.files-block { margin-top: var(--space-2); }
.files-block h4 { margin: 0 0 .5rem; font-size: 1rem; }
.file-group { margin-bottom: .8rem; }
.file-kind { margin: 0 0 .3rem; color: var(--muted); }
.pitem .file { padding: .5rem .75rem; font-size: .88rem; }
.pitem .file-list { margin-top: 0 !important; gap: .4rem; }

.video-wrap { aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; }
.video-wrap iframe { width: 100%; height: 100%; border: 0; }

/* Previous / next project links */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-5); border-top: 1px solid var(--border); }
.pager a { display: grid; gap: .2rem; padding: var(--space-2) 0; text-decoration: none; color: var(--text); font-weight: 600; }
.pager a:hover { color: var(--accent); }
.pager a:last-child { text-align: right; }
.pager .mono { color: var(--muted); font-weight: 400; }

/* ---------- 10. LIGHTBOX ---------- */
.lightbox {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 1rem;
  background: transparent; border: 0; overflow: hidden;
}
.lightbox[open] { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .5rem; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: .75rem; min-width: 0; }
.lightbox img { max-width: 100%; max-height: 80vh; width: auto; border-radius: var(--radius); background: #fff; }
.lightbox figcaption { color: #e8ecf2; font-size: .95rem; text-align: center; }
.lb-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.6rem; line-height: 1;
  background: rgba(255, 255, 255, .15); color: #fff;
}
.lb-btn:hover { background: rgba(255, 255, 255, .3); }
.lb-btn:focus-visible { outline: 3px solid #fff; }
.lb-close { position: absolute; top: 1rem; right: 1rem; font-size: 1.1rem; }

/* ---------- 11. TABLET & MOBILE ---------- */
@media (max-width: 960px) {
  /* Sidebar becomes a top bar; its content drops down as a menu */
  .sidebar { inset: 0 0 auto 0; width: 100%; height: auto; max-height: 100vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar-bar { height: var(--topbar-h); align-items: center; justify-content: space-between; padding: 0 var(--space-2); }
  .bar-brand { display: block; font-weight: 700; color: var(--text); text-decoration: none; }
  .menu-btn { display: inline-grid; }
  .sidebar-panel { display: none; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; border-top: 1px solid var(--border); }
  .sidebar.open .sidebar-panel { display: block; }

  .main { margin-left: 0; padding: var(--topbar-h) var(--space-3) 0; }
  html { scroll-padding-top: calc(var(--topbar-h) + 1rem); }
  .section { scroll-margin-top: calc(var(--topbar-h) + 1rem); padding-top: var(--space-4); }
  .hero { padding-top: var(--space-4); }
  .pp-section { scroll-margin-top: calc(var(--topbar-h) + 1rem); }
  .about-grid, .pp-head, .pitem { grid-template-columns: 1fr; }
  .about-grid { gap: var(--space-2); }
  .pitem-media { position: static; }
  .pp-cover { aspect-ratio: 16 / 7; max-height: 190px; }
}

@media (max-width: 560px) {
  .main { padding-left: 1rem; padding-right: 1rem; }
  .card { grid-template-columns: 1fr; gap: var(--space-2); }
  .skill-groups { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pager a:last-child { text-align: left; }
  .lightbox[open] { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .lb-prev, .lb-next { position: absolute; bottom: 1rem; }
  .lb-prev { left: 1rem; } .lb-next { right: 1rem; }
}

/* ---------- 12. RESPECT "REDUCE MOTION" ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
