/* ==========================================================================
   Lady Ikeya — Academic Portfolio
   Design system: warm paper ground, ink type, garnet accent.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */

:root {
  /* Ground & ink */
  --paper:        #fbf9f6;
  --paper-raised: #ffffff;
  --paper-sunken: #f3efe9;
  --ink:          #16181d;
  --ink-soft:     #414751;
  --ink-muted:    #6d747f;
  --rule:         #e2dcd2;
  --rule-strong:  #cec6b9;

  /* Accent — a deep garnet, a quiet nod to Indiana crimson */
  --accent:       #8c1d21;
  --accent-hover: #6f1619;
  --accent-wash:  #f6ecea;

  /* Type */
  --font-display: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale */
  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.89rem);
  --step-0:  clamp(1rem, 0.96rem + 0.18vw, 1.09rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.36vw, 1.44rem);
  --step-2:  clamp(1.45rem, 1.31rem + 0.66vw, 1.9rem);
  --step-3:  clamp(1.75rem, 1.5rem + 1.16vw, 2.55rem);
  --step-4:  clamp(2.1rem, 1.66rem + 2.05vw, 3.5rem);

  /* Space & shape */
  --gutter: clamp(1.25rem, 0.85rem + 2vw, 2.75rem);
  --measure: 68ch;
  --radius: 3px;
  --radius-lg: 6px;

  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.04), 0 2px 8px rgba(22, 24, 29, 0.04);
  --shadow-md: 0 2px 4px rgba(22, 24, 29, 0.05), 0 12px 32px -8px rgba(22, 24, 29, 0.12);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:        #14161a;
    --paper-raised: #1c1f25;
    --paper-sunken: #101215;
    --ink:          #f0ece6;
    --ink-soft:     #c3bfb8;
    --ink-muted:    #8f8d88;
    --rule:         #2b2f36;
    --rule-strong:  #3d434c;
    --accent:       #e08a86;
    --accent-hover: #f0a5a1;
    --accent-wash:  #2a1c1d;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --paper:        #14161a;
  --paper-raised: #1c1f25;
  --paper-sunken: #101215;
  --ink:          #f0ece6;
  --ink-soft:     #c3bfb8;
  --ink-muted:    #8f8d88;
  --rule:         #2b2f36;
  --rule-strong:  #3d434c;
  --accent:       #e08a86;
  --accent-hover: #f0a5a1;
  --accent-wash:  #2a1c1d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.3), 0 12px 32px -8px rgba(0, 0, 0, 0.5);
}

/* ---------- 2. Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 0; }

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

/* ---------- 3. Layout primitives ---------- */

.wrap {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 2.4rem + 5vw, 7rem);
  border-top: 1px solid var(--rule);
}
.section:first-of-type { border-top: 0; }
.section--sunken { background: var(--paper-sunken); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  font-size: var(--step--1);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- 4. Eyebrow / section heading ---------- */

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.section-head {
  margin-bottom: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  max-width: var(--measure);
}
.section-head h2 { font-size: var(--step-3); }
.section-head p {
  margin-top: 0.9rem;
  color: var(--ink-soft);
  font-size: var(--step-0);
  max-width: 60ch;
}

/* ---------- 5. Header & navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 20px -12px rgba(0, 0, 0, 0.4);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.5rem;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 0.4rem + 1.5vw, 2rem);
  list-style: none;
}
.nav-links a {
  position: relative;
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 500;
  padding-block: 0.4rem;
  white-space: nowrap;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.05rem;
  width: 100%;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--ink); }

.nav-tools { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--rule-strong); color: var(--ink); background: var(--paper-raised); }
.icon-btn svg { width: 1.05rem; height: 1.05rem; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .nav-links {
    position: fixed;
    inset: 4.5rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.5rem;
    box-shadow: var(--shadow-md);
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.32s var(--ease), opacity 0.2s var(--ease);
  }
  .nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links li { border-bottom: 1px solid var(--rule); }
  .nav-links li:last-child { border-bottom: 0; }
  .nav-links a { display: block; padding: 0.95rem 0; font-size: 1.02rem; }
  .nav-links a::after { display: none; }
}

/* ---------- 6. Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.35rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.18s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn svg { width: 1rem; height: 1rem; flex: none; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn--ghost:hover { background: var(--paper-raised); color: var(--accent); border-color: var(--accent); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

/* ---------- 7. Hero ---------- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 1.8rem + 6vw, 6.5rem) clamp(3rem, 2rem + 5vw, 6rem);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -12%;
  width: 46rem;
  height: 46rem;
  background: radial-gradient(circle, var(--accent-wash) 0%, transparent 62%);
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .hero-portrait { order: -1; max-width: 17rem; }
}

.hero h1 {
  font-size: var(--step-4);
  letter-spacing: -0.028em;
  margin-bottom: 0.5rem;
}
.hero-role {
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 1.5rem;
  max-width: 34ch;
}
.hero-role strong { color: var(--ink); font-weight: 600; }

.hero-lede {
  font-size: 1.06rem;
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.7;
}

.hero-portrait {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-sunken);
  aspect-ratio: 1 / 1;
  box-shadow: var(--shadow-md);
}
.hero-portrait img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-portrait img[hidden] { display: none; }
.hero-portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(22, 24, 29, 0.08);
  border-radius: inherit;
  pointer-events: none;
}
.portrait-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 4rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

/* JMP callout */
.jmp-card {
  margin-top: clamp(2.5rem, 1.8rem + 3vw, 4rem);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem 1.5rem;
  align-items: start;
  padding: 1.5rem 1.65rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 620px) { .jmp-card { grid-template-columns: minmax(0, 1fr); gap: 0.85rem; } }
.jmp-card .eyebrow { margin-bottom: 0.35rem; }
.jmp-card h3 { font-size: var(--step-1); line-height: 1.3; }
.jmp-card p { margin-top: 0.6rem; color: var(--ink-soft); font-size: 0.96rem; }

/* ---------- 8. Paper list ---------- */

.papers {
  list-style: none;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding-inline: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
}

.paper {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  align-items: baseline;
  gap: 0 1.5rem;
  padding: clamp(1.4rem, 1.1rem + 1vw, 2rem) 0;
  border-bottom: 1px solid var(--rule);
}
.paper:first-child { border-top: 0; }
.paper:last-child { border-bottom: 0; }
@media (max-width: 620px) {
  .paper { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
}

.paper-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.citation {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.45;
  color: var(--ink);
  margin: 0;
  text-wrap: pretty;
}

.citation .me { font-weight: 600; }

.citation cite { font-style: italic; }

.status {
  display: inline;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-muted);
  white-space: normal;
}
.status--accent { color: var(--accent); font-weight: 600; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 100px;
  max-width: 100%;
}
.tag--accent {
  color: var(--accent);
  background: var(--accent-wash);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}

.subhead {
  font-size: var(--step-2);
  margin: clamp(2.75rem, 2.2rem + 2vw, 4rem) 0 clamp(1.25rem, 1rem + 1vw, 1.85rem);
}

.abstract-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.25rem 0.6rem 0.25rem 0.4rem;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.abstract-toggle:hover { color: var(--accent); border-color: var(--accent); }
.abstract-toggle svg {
  width: 0.85rem;
  height: 0.85rem;
  transition: transform 0.22s var(--ease);
}
.abstract-toggle[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.abstract-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.abstract {
  margin-top: 0.9rem;
  padding-left: 1rem;
  border-left: 2px solid var(--rule-strong);
  max-width: 68ch;
}
.abstract[hidden] { display: none; }
.abstract p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.abstract p + p { margin-top: 0.85em; }

/* ---------- 9. Teaching ---------- */

.course {
  padding: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.course-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin-bottom: 0.75rem;
}
.course-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
}
.course-term {
  font-size: 0.82rem;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}
.course h3 { font-size: var(--step-2); margin-bottom: 0.7rem; }
.course p { color: var(--ink-soft); font-size: 0.98rem; max-width: 62ch; }

.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  list-style: none;
}
.course-meta li { font-size: 0.86rem; color: var(--ink-muted); }
.course-meta strong { display: block; color: var(--ink); font-size: 0.95rem; font-weight: 600; }

/* Student comments */
.quote-grid {
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  columns: 1;
  column-gap: 1.25rem;
}
@media (min-width: 700px) {
  .quote-grid { columns: 2; }
}

.quote {
  position: relative;
  display: block;
  break-inside: avoid;
  margin-bottom: 1.25rem;
  padding: 1.75rem 1.6rem 1.4rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.quote:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--rule-strong); }
.quote::before {
  content: "\201C";
  position: absolute;
  top: 0.35rem;
  left: 1.35rem;
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.22;
  pointer-events: none;
}
.quote blockquote {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
}
.quote figcaption {
  margin-top: 1.15rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.minihead {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: clamp(2rem, 1.6rem + 1.4vw, 2.75rem) 0 1rem;
}

/* ---------- 10. Awards timeline ---------- */

.timeline {
  list-style: none;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding-inline: clamp(1.25rem, 0.9rem + 1.6vw, 2.25rem);
}

.award, .term {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0 1.75rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.award:first-child, .term:first-child { border-top: 0; }
.award:last-child, .term:last-child { border-bottom: 0; }
@media (max-width: 620px) {
  .award, .term { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
}

.award-year, .term-year {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  padding-top: 0.22rem;
  font-variant-numeric: tabular-nums;
}
.award-name, .term-name { font-size: 1.06rem; line-height: 1.4; margin-bottom: 0.2rem; }
.award-org, .term-org {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 62ch;
}

.award-amount {
  margin: 0.15rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--ink-muted);
}

/* ---------- 11. Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem;
  margin-top: 2.5rem;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.5rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); text-decoration: none; }
.contact-card .label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.contact-card .value { font-size: 1rem; color: var(--ink); word-break: break-word; }
.contact-card:hover .value { color: var(--accent); }

a.value { color: var(--ink); text-decoration: none; }
a.value:hover { color: var(--accent); text-decoration: underline; }

.card-aside {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.card-aside a { color: var(--ink-muted); text-decoration: underline; }
.card-aside a:hover { color: var(--accent); }

/* ---------- 12. Footer ---------- */

.site-footer {
  padding-block: 3rem 2.5rem;
  border-top: 1px solid var(--rule);
  background: var(--paper-sunken);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-inner p { font-size: 0.86rem; color: var(--ink-muted); margin: 0; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { font-size: 0.86rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }

/* ---------- 13. CV viewer ---------- */

.cv-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 0.4rem + 1.6vw, 2.5rem);
}
.cv-viewer[hidden] { display: none; }

.cv-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 15, 18, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: cv-fade 0.2s var(--ease);
}

.cv-viewer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 60rem);
  max-height: 100%;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: cv-rise 0.28s var(--ease);
}

@keyframes cv-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes cv-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cv-viewer-backdrop, .cv-viewer-panel { animation: none; }
}

.cv-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: none;
  padding: 0.9rem 1rem 0.9rem 1.35rem;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-raised);
}
.cv-viewer-bar h2 {
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.cv-viewer-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn--sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
.btn--sm svg { width: 0.9rem; height: 0.9rem; }

.cv-viewer-pages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: clamp(0.75rem, 0.5rem + 1vw, 1.5rem);
  background: var(--paper-sunken);
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 0.5rem + 1vw, 1.25rem);
}

.cv-page {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}

.cv-viewer-foot {
  margin: 0.5rem 0 0.25rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-muted);
}

/* the two View CV triggers are buttons, not links */
.value-btn {
  align-self: start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.value-btn:hover { color: var(--accent); text-decoration: underline; }

body.cv-open { overflow: hidden; }

/* ---------- 14. Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 15. Print ---------- */

@media print {
  .site-header, .site-footer, .btn-row, .hero-portrait, .theme-toggle, .nav-toggle, .cv-viewer { display: none !important; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section { padding-block: 1rem; border-top: 0; }
  .reveal { opacity: 1; transform: none; }
  a { color: #000; text-decoration: none; }
  .paper, .award, .term, .quote { break-inside: avoid; }
  .abstract-toggle { display: none !important; }
}
