/* =========================================================
   Guo (Jerry) Cheng — personal academic site
   Minimal · concise · clean · light / dark
   ========================================================= */

/* Light theme (default) */
:root,
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f7f6f3;
  --bg-elevated: #ffffff;
  --bg-soft: #efeee9;
  --ink: #1a1c1e;
  --ink-soft: #3d4248;
  --muted: #6b7178;
  --line: rgba(26, 28, 30, 0.1);
  --line-strong: rgba(26, 28, 30, 0.16);
  --accent: #1e3a5f;
  --accent-hover: #152a45;
  --accent-soft: rgba(30, 58, 95, 0.08);
  --accent-ring: rgba(30, 58, 95, 0.28);
  --accent-on: #f8f7f4;
  --brand-mark-fg: #f7f6f3;

  --header-bg: rgba(247, 246, 243, 0.78);
  --header-bg-scrolled: rgba(247, 246, 243, 0.9);
  --glow-a: rgba(30, 58, 95, 0.06);
  --glow-b: rgba(30, 58, 95, 0.04);
  --section-alt: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(239, 238, 233, 0.7));
  --footer-bg: rgba(239, 238, 233, 0.55);
  --cv-wash: rgba(30, 58, 95, 0.06);
  --card-hover-border: rgba(30, 58, 95, 0.22);
  --btn-ghost-border-hover: rgba(26, 28, 30, 0.22);
  --btn-primary-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 8px 20px rgba(30, 58, 95, 0.18);
  --shadow-soft: 0 1px 2px rgba(26, 28, 30, 0.04), 0 12px 32px rgba(26, 28, 30, 0.06);
  --portrait-bg: linear-gradient(145deg, #e8e6df 0%, #d8dde6 100%);
  --toggle-track: #e4e2db;
  --toggle-thumb: #ffffff;
  --toggle-icon: #5c636b;
  --toggle-icon-active: #1e3a5f;

  /* Type system
     - sans  → UI chrome (nav, labels, buttons, meta)
     - serif → headings + long-form reading (about, abstracts, lede)
     Pairing: Inter + Newsreader (academic, cohesive, not identical everywhere) */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-prose-size: 1.08rem;
  --font-prose-leading: 1.75;

  /* Layout */
  --container: 1080px;
  --content: 42rem;
  --header-h: 4rem;
  --radius: 14px;
  --radius-sm: 10px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 220ms;
}

/* Dark theme — quiet academic night */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #111316;
  --bg-elevated: #1a1d22;
  --bg-soft: #16191e;
  --ink: #f0efeb;
  --ink-soft: #c5c8ce;
  --muted: #9198a1;
  --line: rgba(240, 239, 235, 0.1);
  --line-strong: rgba(240, 239, 235, 0.16);
  --accent: #9bb8db;
  --accent-hover: #bdd0e8;
  --accent-soft: rgba(155, 184, 219, 0.14);
  --accent-ring: rgba(155, 184, 219, 0.35);
  --accent-on: #111316;
  --brand-mark-fg: #111316;

  --header-bg: rgba(17, 19, 22, 0.78);
  --header-bg-scrolled: rgba(17, 19, 22, 0.92);
  --glow-a: rgba(155, 184, 219, 0.08);
  --glow-b: rgba(155, 184, 219, 0.04);
  --section-alt: linear-gradient(180deg, rgba(26, 29, 34, 0.65), rgba(18, 21, 26, 0.9));
  --footer-bg: rgba(14, 16, 19, 0.75);
  --cv-wash: rgba(155, 184, 219, 0.08);
  --card-hover-border: rgba(155, 184, 219, 0.32);
  --btn-ghost-border-hover: rgba(240, 239, 235, 0.28);
  --btn-primary-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 8px 22px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.25), 0 14px 36px rgba(0, 0, 0, 0.28);
  --portrait-bg: linear-gradient(145deg, #2a2f38 0%, #1c222c 100%);
  --toggle-track: #2a3038;
  --toggle-thumb: #f0efeb;
  --toggle-icon: #a0a7b0;
  --toggle-icon-active: #111316;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink-soft);
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--glow-a), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, var(--glow-b), transparent 50%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

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

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}

p {
  margin: 0 0 1rem;
}

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

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  padding: 0.6rem 0.9rem;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  background: var(--header-bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background: var(--header-bg-scrolled);
}

.header-inner {
  height: 100%;
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand:hover {
  color: var(--ink);
  opacity: 0.85;
}

.brand-mark {
  display: block;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 40%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.site-nav ul {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 999px;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--accent-soft);
}

.site-nav a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Theme toggle */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 999px;
  flex-shrink: 0;
  line-height: 0;
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 3.35rem;
  height: 1.85rem;
  padding: 0 0.22rem;
  border-radius: 999px;
  background: var(--toggle-track);
  border: 1px solid var(--line-strong);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.theme-toggle-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: var(--toggle-icon);
  transition: color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.theme-toggle-thumb {
  position: absolute;
  top: 50%;
  left: 0.18rem;
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.04);
  transform: translate(0, -50%);
  transition: transform 280ms var(--ease), background var(--dur) var(--ease);
  z-index: 0;
}

html[data-theme="light"] .theme-toggle-sun {
  color: var(--toggle-icon-active);
}

html[data-theme="dark"] .theme-toggle-moon {
  color: var(--toggle-icon-active);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translate(1.45rem, -50%);
}

.theme-toggle:hover .theme-toggle-track {
  border-color: var(--accent-ring);
}

.theme-toggle:active .theme-toggle-thumb {
  transform: translate(0, -50%) scale(0.94);
}

html[data-theme="dark"] .theme-toggle:active .theme-toggle-thumb {
  transform: translate(1.45rem, -50%) scale(0.94);
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(2.75rem, 7vw, 5.5rem) 0 clamp(3.75rem, 8vw, 6.25rem);
}

/* Flex packs photo next to intro; gap keeps photo slightly off the text */
.hero-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  /* Comfortable air between intro and photo — not cramped, not edge-pushed */
  gap: clamp(2.5rem, 5.5vw, 4rem);
}

.hero-copy {
  flex: 1 1 18rem;
  min-width: 0;
  max-width: 36rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.45rem, 5.2vw, 3.65rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 0.55rem;
}

.hero-role {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 500;
}

.hero-lede {
  max-width: 36rem;
  font-size: clamp(1.14rem, 2.2vw, 1.3rem);
  line-height: 1.58;
  color: var(--ink-soft);
  margin-bottom: 1.75rem;
  font-family: var(--font-serif);
  font-weight: 400;
  font-optical-sizing: auto;
  letter-spacing: -0.012em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.55rem;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.2rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--line);
  max-width: 36rem;
}

.social-list li {
  display: flex;
}

.social-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.social-list a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.social-icon {
  display: inline-grid;
  place-items: center;
  opacity: 0.9;
}

/* Hero photo — Fatty Fries (previous size restored: 280px)
   Absolutely positioned image so intrinsic size cannot blow layout. */
.hero-photo {
  /* Nudge right + slightly down relative to the intro block */
  margin: clamp(0.65rem, 1.5vw, 1.1rem) 0 0 clamp(1.15rem, 3.2vw, 2.25rem);
  flex: 0 0 auto;
  width: 280px;
  max-width: min(280px, 100%);
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 28px;
  overflow: hidden;
  background: var(--portrait-bg);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 45% 40%;
  display: block;
  transition: transform 0.7s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-photo:hover .photo-img {
    transform: scale(1.03);
  }
}

.photo-caption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.85rem;
  padding-inline: 0.15rem;
}

.photo-caption-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.photo-caption-note {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.btn:hover {
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-on);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: var(--bg-elevated);
  color: var(--ink);
  border-color: var(--btn-ghost-border-hover);
}

.btn-lg {
  padding: 0.9rem 1.4rem;
  font-size: 1rem;
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(3.5rem, 8vw, 5.5rem) 0;
}

.section-alt {
  background: var(--section-alt);
  border-block: 1px solid var(--line);
}

.section-header {
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  max-width: var(--content);
}

.section-label {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-header h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.35rem);
}

/* About — education aligns with main background prose (under the section title) */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: clamp(1.75rem, 4vw, 3rem);
  align-items: start;
}

.about-prose {
  max-width: 38rem;
  font-family: var(--font-serif);
  font-size: var(--font-prose-size);
  font-weight: 400;
  font-optical-sizing: auto;
  line-height: var(--font-prose-leading);
  letter-spacing: -0.006em;
  color: var(--ink-soft);
  text-align: left;
}

.about-prose p + p {
  margin-top: 1.05rem;
}

.about-prose > p:first-child {
  margin-top: 0;
}

/* Links inside prose stay clear without breaking the serif rhythm */
.about-prose a {
  font-weight: 500;
  text-underline-offset: 0.2em;
}

.education {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* Match first-line of prose: less top padding so card top ~ text top */
  padding: 0.85rem 1.15rem 0.95rem;
  box-shadow: var(--shadow-soft);
  align-self: start;
  margin-top: 0;
}

.aside-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
  line-height: 1.2;
}

.edu-list > li + li {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}

.edu-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: baseline;
  margin-bottom: 0.12rem;
}

.edu-school {
  font-weight: 600;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.3;
}

.edu-years {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.edu-degree {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.4;
}

.edu-note {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Research */
.research-block + .research-block {
  margin-top: 2.25rem;
}

.research-group-title {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.paper-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem 1.3rem;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.paper-card:hover {
  border-color: var(--card-hover-border);
}

.wip-list {
  display: grid;
  gap: 0.9rem;
}

.paper-title {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 500;
  font-optical-sizing: auto;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.015em;
  margin-bottom: 0.45rem;
}

.paper-meta {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.paper-note {
  margin: 0.55rem 0 0.85rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.paper-note-correction {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.15rem;
  margin-top: 0.85rem;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.text-link:hover {
  gap: 0.5rem;
}

/* Abstract drawer */
.abstract-toggle {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 4px;
  transition: color var(--dur) var(--ease), gap var(--dur) var(--ease);
}

.abstract-toggle:hover {
  color: var(--accent-hover);
  gap: 0.5rem;
}

.abstract-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.abstract-toggle-icon {
  display: inline-block;
  font-size: 0.75em;
  line-height: 1;
  transition: transform 220ms var(--ease);
}

.abstract-toggle[aria-expanded="true"] .abstract-toggle-icon {
  transform: rotate(90deg);
}

.abstract-panel {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: 0;
  transition:
    grid-template-rows 280ms var(--ease),
    opacity 220ms var(--ease),
    margin-top 280ms var(--ease);
}

.abstract-panel.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 0.85rem;
}

.abstract-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.abstract-body {
  margin: 0;
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--font-serif);
  font-size: 0.98rem;
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.72;
  letter-spacing: -0.005em;
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  -webkit-hyphens: auto;
}

/* Avoid tabbing into collapsed abstracts */
.abstract-panel:not(.is-open) .abstract-body {
  visibility: hidden;
}

.abstract-panel.is-open .abstract-body {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .abstract-panel {
    transition: none;
  }

  .abstract-toggle-icon {
    transition: none;
  }
}

/* CV panel */
.cv-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  border-radius: calc(var(--radius) + 4px);
  background:
    linear-gradient(135deg, var(--cv-wash), transparent 50%),
    var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.cv-copy h2 {
  font-size: clamp(1.75rem, 3vw, 2.1rem);
  margin-bottom: 0.4rem;
}

.cv-lede {
  margin: 0;
  color: var(--muted);
  max-width: 28rem;
}

/* Footer — horizontal bar */
.site-footer {
  padding: 1.85rem 0;
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.15rem 2rem;
  max-width: var(--container);
}

.footer-brand {
  flex: 0 1 auto;
  min-width: 10rem;
}

.footer-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.3;
}

.footer-block {
  flex: 1 1 14rem;
  min-width: 0;
}

.footer-label {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-emails {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.footer-emails li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.footer-emails a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
}

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

.footer-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.footer-copy {
  margin: 0;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
  align-self: flex-start;
  padding-top: 0.15rem;
}

@media (max-width: 720px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.15rem;
  }

  .footer-block {
    flex: 1 1 auto;
    width: 100%;
  }

  .footer-copy {
    padding-top: 0.35rem;
    border-top: 1px solid var(--line);
    width: 100%;
    white-space: normal;
    align-self: flex-start;
  }
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid {
    gap: 1.5rem;
  }

  .hero-photo {
    width: 240px;
    max-width: min(240px, 100%);
  }

  .photo-frame {
    border-radius: 22px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container,
  .header-inner {
    width: min(100% - 1.5rem, var(--container));
  }

  .brand-name {
    display: none;
  }

  .site-nav a {
    padding: 0.4rem 0.55rem;
    font-size: 0.88rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .social-list a {
    padding: 0.45rem 0.55rem;
    font-size: 0.86rem;
  }

  .cv-panel {
    align-items: flex-start;
  }

  .btn-lg {
    width: 100%;
  }
}

/* Reduced motion */
@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;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Print always light */
@media print {
  .site-header,
  .hero-actions,
  .theme-toggle,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .section,
  .hero {
    padding: 1rem 0;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .paper-card,
  .education,
  .cv-panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
