/* ==========================================================================
   ismailukman.github.io — Redesign stylesheet
   Premium-simple academic portfolio. No framework, no build step.
   Design system: deep-blue accent, serif headings + Inter body, dark mode.
   ========================================================================== */

/* ----- Fonts ----- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ----- Design tokens ----- */
:root {
  --accent:        #1A4F8B;   /* deep blue (matches CV) */
  --accent-soft:   #2C6BB0;
  --accent-tint:   #E8F0F8;

  --bg:            #FAFAF8;
  --surface:       #FFFFFF;
  --surface-2:     #F2F3F1;
  --border:        #E3E5E0;
  --text:          #14181D;
  --text-muted:    #51585F;
  --text-faint:    #828A92;

  --shadow-sm: 0 1px 2px rgba(20,24,29,.06), 0 1px 3px rgba(20,24,29,.05);
  --shadow-md: 0 4px 14px rgba(20,24,29,.08);
  --shadow-lg: 0 12px 32px rgba(20,24,29,.12);

  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1080px;
  --readw:     760px;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --ease: cubic-bezier(.22,.61,.36,1);

  --z-nav: 50;
}

[data-theme="dark"] {
  --accent:        #5B9BD5;
  --accent-soft:   #7FB3E0;
  --accent-tint:   #16263A;

  --bg:            #0E1116;
  --surface:       #151A21;
  --surface-2:     #1C232C;
  --border:        #28313B;
  --text:          #E6E8EB;
  --text-muted:    #A3ABB4;
  --text-faint:    #727B85;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 14px rgba(0,0,0,.45);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.55);
}

/* ----- Reset / base ----- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; }
body { overflow-x: hidden; }
/* never let a long word/URL push the layout wider than the screen */
p, li, h1, h2, h3, h4, a, span { overflow-wrap: break-word; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--text); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-soft); }
img { max-width: 100%; display: block; }

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

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

/* ----- Layout helpers ----- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: 24px; }
.section   { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.readable  { max-width: var(--readw); }
.center    { text-align: center; }
.muted     { color: var(--text-muted); }
.faint     { color: var(--text-faint); }

.eyebrow {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .6rem;
}

.section-head { margin-bottom: 36px; }

/* ----- Nav ----- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav);
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.nav__inner { display: flex; align-items: center; gap: 20px; height: 64px; }
.nav__brand { font-family: var(--serif); font-weight: 600; font-size: .9rem; color: var(--text); white-space: nowrap; opacity: .55; transition: opacity .2s var(--ease); }
.nav__brand:hover { opacity: 1; }
.nav__links { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.nav__links a {
  position: relative;
  color: var(--text-muted); font-weight: 500; font-size: .95rem;
  padding: 9px 16px; border-radius: 999px;
  isolation: isolate;
  transition: color .35s var(--ease);
}
/* fluid filled pill that grows from center on hover */
.nav__links a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 999px; background: var(--accent);
  transform: scale(.6); opacity: 0;
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}
.nav__links a:hover { color: #fff; }
.nav__links a:hover::before { transform: scale(1); opacity: 1; }
/* active page: solid filled pill, subtle glow */
.nav__links a.is-active {
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent);
}
.nav__links a.is-active::before { transform: scale(1); opacity: 1; }
[data-theme="dark"] .nav__links a:hover,
[data-theme="dark"] .nav__links a.is-active { color: #0E1116; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); cursor: pointer;
  transition: color .2s, border-color .2s, background-color .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: block; }
[data-theme="dark"] .theme-toggle .moon { display: none; }

.nav__toggle { display: none; }

@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px; box-shadow: var(--shadow-md);
    transform: translateY(-120%); transition: transform .3s var(--ease);
  }
  .nav__links.open { transform: translateY(0); }
  .nav__links a { padding: 12px 16px; border-radius: 12px; }
  .nav__links a::before { border-radius: 12px; }
  .nav__toggle { display: inline-flex; }
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  padding: 11px 20px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: all .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-soft); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
/* invert: filled by default, becomes outline on hover (opposite of ghost) */
.btn--invert { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--invert:hover { background: transparent; color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
[data-theme="dark"] .btn--invert { color: #0E1116; }
[data-theme="dark"] .btn--invert:hover { color: var(--accent); }
/* wider button */
.btn--wide { padding-inline: 34px; }

/* ----- Hero ----- */
.hero { padding: 64px 0 40px; }
.hero__grid { display: grid; grid-template-columns: 340px 1fr; gap: 52px; align-items: center; }
.hero__photo {
  width: 220px; height: 220px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface); box-shadow: var(--shadow-lg);
}
.hero__title { margin-bottom: .15em; }
.hero__role { font-family: var(--sans); font-size: 1.1rem; font-weight: 600; color: var(--accent); margin: 0 0 .5rem; }
.hero__affil { color: var(--text-muted); margin-bottom: 1.2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.social { display: flex; gap: 10px; margin-top: 20px; }
.social a {
  width: 40px; height: 40px; border-radius: 10px; display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  transition: all .2s var(--ease);
}
.social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.social svg { width: 19px; height: 19px; }

@media (max-width: 760px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; gap: 24px; justify-items: center; }
  .hero__actions, .social { justify-content: center; }
}

/* ----- Cards ----- */
.cards { display: grid; gap: 20px; }
.cards--2 { grid-template-columns: repeat(2, 1fr); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cards--3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 600px) { .cards--2, .cards--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card__tag { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card h3 { margin: .4rem 0 .5rem; }
.card p { color: var(--text-muted); font-size: .96rem; margin: 0; }
.card__link { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: .9rem; }
.card__link svg { width: 15px; height: 15px; }
a.card { color: inherit; }
a.card:hover h3 { color: var(--accent); }

/* ----- Panels (bordered content blocks, echoes original dark-rounded boxes) ----- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.panel:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.panel + .panel { margin-top: 20px; }
.panel h2, .panel h3 { margin-top: 0; }

/* accordion boxes share the same hover highlight as cards/panels */
.accordion {
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.accordion:hover { box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

/* ----- Lists ----- */
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 12px 0; border-bottom: 1px solid var(--border); display: flex; gap: 16px; align-items: baseline; justify-content: space-between; }
.list-clean li:last-child { border-bottom: 0; }
.list-clean .it-title { font-weight: 500; color: var(--text); }
.list-clean .it-meta { color: var(--text-faint); font-size: .88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.bullets { padding-left: 1.1em; margin: 0; }
.bullets li { margin: .35em 0; color: var(--text-muted); }

/* hover-able list rows (for Roles / Memberships / Teaching items) */
.bullets--hover { padding-left: 0; list-style: none; }
.bullets--hover li {
  margin: 2px 0; padding: 8px 12px 8px 30px; position: relative;
  border-radius: 10px; border: 1px solid transparent;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.bullets--hover li::before {
  content: ""; position: absolute; left: 12px; top: 1.05em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.bullets--hover li:hover {
  background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  transform: translateX(3px); color: var(--text);
}

/* ----- Tags / chips ----- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: .82rem; font-weight: 500; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-tint); color: var(--accent); border: 1px solid transparent;
}

/* ----- Stat strip ----- */
.stats { display: flex; flex-wrap: wrap; gap: 28px; }
.stat .num { font-family: var(--serif); font-size: 2rem; font-weight: 600; color: var(--accent); line-height: 1; }
.stat .lbl { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }

/* ----- Footer ----- */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 40px; text-align: center; }
.footer .social { justify-content: center; align-items: center; }
.footer__copy { color: var(--text-faint); font-size: .88rem; margin-top: 18px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 6px 4px; justify-content: center; margin-top: 18px; }
.footer__nav a {
  position: relative; isolation: isolate;
  color: var(--text-muted); font-weight: 500; font-size: .92rem;
  padding: 8px 16px; border-radius: 999px;
  transition: color .35s var(--ease);
}
/* same fluid filled pill that grows from center as the top nav */
.footer__nav a::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: 999px; background: var(--accent);
  transform: scale(.6); opacity: 0;
  transition: transform .35s var(--ease), opacity .3s var(--ease);
}
.footer__nav a:hover { color: #fff; }
.footer__nav a:hover::before { transform: scale(1); opacity: 1; }
[data-theme="dark"] .footer__nav a:hover { color: #0E1116; }

/* ----- Scroll reveal ----- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* highlight mark used in bio */
mark { background: var(--accent-tint); color: var(--accent); padding: 0 .15em; border-radius: 3px; }

/* ==========================================================================
   Additions: animated photo, accordion, embeds, research cards, timeline
   ========================================================================== */

/* ----- Hero photo: static image, animated neon glow border ----- */
.hero__photo-wrap {
  --ring: 6px;
  position: relative;
  width: 340px; height: 340px;
  border-radius: 50%;
  padding: var(--ring);
  /* gradient ring stays still (no rotation) */
  background: linear-gradient(135deg, var(--accent), var(--accent-soft) 55%, #8ec5ff);
  /* neon lightening: the glow pulses, the photo does not move */
  animation: neon-glow 2.8s ease-in-out infinite;
}
.hero__photo-wrap::after {
  content: ""; position: absolute; inset: var(--ring);
  border-radius: 50%; background: var(--bg);
}
.hero__photo-wrap img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--surface);
}
@keyframes neon-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
      0 0 14px 1px color-mix(in srgb, var(--accent) 35%, transparent),
      0 0 26px 4px color-mix(in srgb, var(--accent-soft) 22%, transparent);
  }
  50% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent-soft) 70%, transparent),
      0 0 24px 4px color-mix(in srgb, var(--accent) 65%, transparent),
      0 0 48px 12px color-mix(in srgb, #8ec5ff 45%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero__photo-wrap { animation: none; box-shadow: var(--shadow-lg); }
}
@media (max-width: 760px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__photo-wrap { width: 260px; height: 260px; }
}

/* ----- Accordion / collapsible ----- */
.accordion { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.acc-item + .acc-item { border-top: 1px solid var(--border); }
.acc-head {
  width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; background: transparent; border: 0;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--text);
  transition: background-color .2s;
}
.acc-head:hover { background: var(--accent-tint); }
.acc-head--serif { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--accent); }
.acc-head .acc-meta { color: var(--text-faint); font-size: .85rem; font-weight: 500; white-space: nowrap; }
.acc-head .acc-chevron { transition: transform .3s var(--ease); flex-shrink: 0; }
.acc-head .acc-chevron svg { width: 18px; height: 18px; }
.acc-item.open .acc-chevron { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.acc-body__inner { padding: 0 20px 18px; color: var(--text-muted); font-weight: 300; }
.acc-body__inner p { margin: 0 0 .6rem; }
.acc-body__inner a { font-weight: 400; }

/* ----- Video embed (responsive 16:9) ----- */
.embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ----- Research / project media card (image + text) ----- */
.media-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.media-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.media-card.rev { grid-template-columns: 1fr 1fr; }
.media-card__img { background: var(--surface-2) center/cover no-repeat; min-height: 240px; }
.media-card__img img { width: 100%; height: 100%; object-fit: cover; }
.media-card__body { padding: 28px; }
.media-card__body h3 { margin-top: 0; }
.media-card__body p { color: var(--text-muted); }
@media (max-width: 720px) {
  .media-card, .media-card.rev { grid-template-columns: 1fr; }
  .media-card__img { min-height: 200px; }
}

/* ----- Timeline (for CV experience/education) ----- */
.timeline { position: relative; margin: 0; padding: 0 0 0 28px; list-style: none; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 26px; }
.tl-item::before {
  content: ""; position: absolute; left: -28px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--accent);
}
.tl-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.tl-role { font-weight: 600; color: var(--text); font-size: 1.05rem; }
.tl-org { color: var(--accent); font-weight: 600; }
.tl-meta { color: var(--text-faint); font-size: .87rem; font-variant-numeric: tabular-nums; }
.tl-item p { margin: .4rem 0 0; color: var(--text-muted); font-size: .96rem; }
.tl-item .bullets { margin-top: .3rem; }

/* promotion sub-roles within one org (stacked, current on top) */
.tl-subrole {
  display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline;
  justify-content: space-between;
  margin-top: 8px; padding-left: 14px; position: relative;
  font-weight: 600; color: var(--text);
}
.tl-subrole::before {
  content: ""; position: absolute; left: 0; top: .55em;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
}
.tl-subrole--prev { font-weight: 500; color: var(--text-muted); }
.tl-subrole--prev::before { background: transparent; border: 1.5px solid var(--accent); }
.tl-subrole .tl-meta { font-weight: 500; }

/* ----- Page hero (sub-pages) ----- */
.page-hero { padding: 56px 0 8px; }
.page-hero h1 { margin-bottom: .2em; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; margin-bottom: 14px; }
.back-link svg { width: 15px; height: 15px; }

/* ----- Two-column content ----- */
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
.split--even { grid-template-columns: 1fr 1fr; align-items: start; }
.split--even .panel { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 820px) { .split, .split--even { grid-template-columns: 1fr; } }

/* ----- Pub list ----- */
.pub { padding: 16px 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: 0; }
.pub__title { font-weight: 600; color: var(--text); }
.pub__meta { color: var(--text-muted); font-size: .9rem; margin-top: 2px; }
.pub__venue { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   CV page
   ========================================================================== */
.cv-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 400px at 20% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 360px at 95% 0%, color-mix(in srgb, var(--accent-soft) 14%, transparent), transparent 55%);
  border-bottom: 1px solid var(--border);
}
.cv-hero__inner { display: grid; grid-template-columns: 180px 1fr auto; gap: 32px; align-items: center; padding: 48px 0; }
/* bigger CV photo with neon lightening glow (static image) */
.cv-hero__photo-wrap {
  --ring: 5px;
  position: relative; width: 180px; height: 180px; border-radius: 26px;
  padding: var(--ring);
  background: linear-gradient(135deg, var(--accent), var(--accent-soft) 55%, #8ec5ff);
  animation: neon-glow 2.8s ease-in-out infinite;
}
.cv-hero__photo-wrap::after { content: ""; position: absolute; inset: var(--ring); border-radius: 22px; background: var(--bg); }
.cv-hero__photo-wrap img { position: relative; z-index: 1; width: 100%; height: 100%; border-radius: 22px; object-fit: cover; border: 3px solid var(--surface); }
@media (prefers-reduced-motion: reduce) { .cv-hero__photo-wrap { animation: none; box-shadow: var(--shadow-lg); } }
.cv-hero__photo { width: 120px; height: 120px; border-radius: 22px; object-fit: cover; box-shadow: var(--shadow-lg); border: 3px solid var(--surface); }
.cv-hero h1 { margin: 0 0 4px; }
.cv-hero .role { color: var(--accent); font-weight: 600; }
.cv-hero .meta { color: var(--text-muted); font-size: .92rem; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cv-hero .meta a { color: var(--text-muted); }
.cv-hero .meta a:hover { color: var(--accent); }
.cv-actions { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 820px) {
  .cv-hero__inner { grid-template-columns: 130px 1fr; }
  .cv-hero__photo-wrap { width: 130px; height: 130px; }
  .cv-hero__photo { width: 92px; height: 92px; }
  .cv-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}

/* CV layout: sticky TOC + content */
.cv-layout { display: grid; grid-template-columns: 200px 1fr; gap: 48px; align-items: start; }
.cv-toc { position: sticky; top: 84px; }
.cv-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.cv-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); font-size: .92rem; font-weight: 500; }
.cv-toc a:hover { color: var(--accent); }
.cv-toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
@media (max-width: 880px) { .cv-layout { grid-template-columns: 1fr; } .cv-toc { display: none; } }

.cv-section { padding: 26px 0; scroll-margin-top: 84px; border-top: 1px solid var(--border); }
.cv-section:first-of-type { border-top: 0; }
.cv-section > h2 { display: flex; align-items: center; gap: 10px; }
.cv-section > h2::before { content: ""; width: 4px; height: 1.05em; background: var(--accent); border-radius: 2px; display: inline-block; }

/* skill groups with animated bar */
.skill-group { margin-bottom: 16px; }
.skill-group h4 { margin: 0 0 8px; font-family: var(--sans); font-size: .92rem; font-weight: 600; color: var(--accent); }
/* overflow visible so the neon glow can spill beyond the track */
.skill-bar { height: 8px; border-radius: 999px; background: var(--surface-2); margin-top: 4px; }
.skill-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-soft));
  transition: width 1.1s var(--ease);
  position: relative; overflow: hidden;
}
/* once filled (.in), keep a continuous neon-lightening glow + moving sheen */
.skill-bar.in span {
  width: var(--pct, 80%);
  animation: skill-glow 2.6s ease-in-out infinite;
}
/* moving light sheen sweeping across the filled bar */
.skill-bar.in span::after {
  content: ""; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent);
  transform: translateX(-120%);
  animation: skill-sheen 2.8s ease-in-out infinite;
}
@keyframes skill-glow {
  0%, 100% { box-shadow: 0 0 4px 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50%      { box-shadow: 0 0 12px 2px color-mix(in srgb, var(--accent-soft) 80%, transparent),
                         0 0 22px 4px color-mix(in srgb, #8ec5ff 45%, transparent); }
}
@keyframes skill-sheen {
  0%   { transform: translateX(-120%); }
  60%, 100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
  .skill-bar.in span { animation: none; }
  .skill-bar.in span::after { animation: none; display: none; }
}
.skill-bar.in span { width: var(--pct, 80%); }

/* print: clean A4-ish output */
@media print {
  .nav, .footer, .cv-toc, .cv-actions, .theme-toggle, .back-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .cv-layout { grid-template-columns: 1fr; gap: 0; }
  .cv-hero { background: none; border-bottom: 1px solid #ccc; }
  .reveal { opacity: 1 !important; transform: none !important; }
  a { color: #000; text-decoration: none; }
  .card, .panel, .accordion { box-shadow: none; border-color: #ddd; }
}

/* ==========================================================================
   Mobile responsiveness — tablet then phone refinements
   ========================================================================== */

/* Tablet / small laptop */
@media (max-width: 900px) {
  .container { padding-inline: 20px; }
  .section { padding: 56px 0; }
  .section--tight { padding: 40px 0; }
}

/* Phone (≤ 640px) */
@media (max-width: 640px) {
  :root { --maxw: 100%; }
  body { font-size: 16px; }
  .container { padding-inline: 16px; }
  .section { padding: 44px 0; }
  .section--tight { padding: 32px 0; }
  h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  h2 { font-size: clamp(1.35rem, 5vw, 1.7rem); }

  /* hero: stacked, full-width buttons */
  .hero { padding: 36px 0 24px; }
  .hero__actions { flex-direction: column; align-items: stretch; width: 100%; }
  .hero__actions .btn { width: 100%; justify-content: center; }
  .btn--wide { padding-inline: 20px; }            /* drop extra width on phone */
  .hero__affil, .hero__role { font-size: .98rem; }

  /* panels / cards tighter padding */
  .panel { padding: 20px; }
  .card { padding: 20px; }
  .accordion .acc-head { padding: 14px 16px; font-size: .96rem; }
  .acc-head--serif { font-size: 1.05rem; }
  .acc-body__inner { padding: 0 16px 16px; }

  /* lists & section heads */
  .list-clean li { flex-direction: column; gap: 2px; }
  .list-clean .it-meta { white-space: normal; }

  /* CV: stacked hero, actions full width */
  .cv-hero__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 18px; padding: 32px 0; }
  .cv-hero .meta { justify-content: center; }
  .cv-actions { width: 100%; }
  .cv-actions .btn { flex: 1; justify-content: center; }
  .cv-section > h2 { font-size: 1.35rem; }

  /* footer */
  .footer { padding: 32px 0; }
}

/* Small phone (≤ 380px) */
@media (max-width: 380px) {
  .container { padding-inline: 14px; }
  .nav__brand { font-size: .98rem; }
  .hero__photo-wrap { width: 190px; height: 190px; }
  .chip { font-size: .78rem; }
}

/* Coarse-pointer (touch) targets: ensure tappable sizes */
@media (pointer: coarse) {
  .nav__links a, .btn, .icon-btn, .acc-head, .social a, .card__link { min-height: 44px; }
  .acc-head { align-items: center; }
}
