/* suryascience.org — shared styles
   One warm solar accent on neutral greys. Light/dark follow the system,
   with a manual override stored as data-theme on <html>. */

:root {
  color-scheme: light;
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f2ee;
  --surface-3: #ebe8e2;
  --text: #1b1a17;
  --text-2: #4f4b45;
  --muted: #6f6a62;
  --border: #e5e1da;
  --border-strong: #d3cec5;
  --accent: #c2410c;          /* text-safe orange (AA on white) */
  --accent-strong: #9a3412;
  --accent-soft: #fff1e6;
  --sun-1: #f59e0b;           /* amber */
  --sun-2: #ea580c;           /* orange */
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --chart-muted: #b5aea3;
  --shadow: 0 1px 2px rgb(20 18 14 / 0.05), 0 8px 24px -12px rgb(20 18 14 / 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1180px;
  --read: 70ch;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f0e0c;
    --surface: #171512;
    --surface-2: #1f1c18;
    --surface-3: #2a2621;
    --text: #f3f0ea;
    --text-2: #cfc9bf;
    --muted: #a39c91;
    --border: #2c2823;
    --border-strong: #3d3831;
    --accent: #fb923c;
    --accent-strong: #fdba74;
    --accent-soft: #2a1b10;
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --chart-muted: #5f5850;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0e0c;
  --surface: #171512;
  --surface-2: #1f1c18;
  --surface-3: #2a2621;
  --text: #f3f0ea;
  --text-2: #cfc9bf;
  --muted: #a39c91;
  --border: #2c2823;
  --border-strong: #3d3831;
  --accent: #fb923c;
  --accent-strong: #fdba74;
  --accent-soft: #2a1b10;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --chart-muted: #5f5850;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.6);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; font-weight: 650; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 0.9em; }
pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9em 1em; overflow-x: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -3rem; background: var(--text); color: var(--bg); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { top: 1rem; color: var(--bg); }

.container { width: min(100% - 32px, var(--maxw)); margin-inline: auto; }
.prose { max-width: var(--read); }
.prose p, .prose li { color: var(--text-2); }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--text-2); max-width: 60ch; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.75rem; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1rem; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; margin-right: auto; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fde68a, var(--sun-1) 45%, var(--sun-2) 100%); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sun-1) 18%, transparent); flex: none; }
.brand small { display: block; font-weight: 450; color: var(--muted); font-size: 0.75rem; letter-spacing: 0; }
.nav { display: flex; gap: 0.25rem; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 0.95rem; font-weight: 500; padding: 0.45rem 0.8rem; border-radius: 999px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-3); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .menu-btn { display: inline-grid; }
  .nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; padding: 0.75rem 16px 1rem; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0.9rem; font-size: 1.05rem; border-radius: var(--radius-sm); }
  .brand small { display: none; }
}

/* ---------- sections, cards ---------- */
main { display: block; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-tight { padding-block: clamp(1.5rem, 4vw, 2.5rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.page-hero { padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 3vw, 2rem); }
.page-hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.1rem, 2.5vw, 1.5rem); box-shadow: var(--shadow); }
.card h3 { margin-bottom: 0.35em; }
.card p:last-child { margin-bottom: 0; }
.card-link { display: block; color: inherit; text-decoration: none; transition: border-color .2s, transform .2s; }
.card-link:hover { color: inherit; border-color: var(--border-strong); transform: translateY(-2px); }
.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

.btn { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1.05rem; border-radius: 999px; font-weight: 550; font-size: 0.95rem; text-decoration: none; border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); cursor: pointer; font-family: inherit; line-height: 1.2; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--text-2); color: var(--bg); }
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.82rem; font-weight: 500; }
.btn svg { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 550; padding: 0.18rem 0.6rem; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); white-space: nowrap; }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- tabs ---------- */
.tabs { margin-top: 0.5rem; }
.tablist {
  display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  position: sticky; top: 64px; z-index: 20; background: var(--bg);
}
.tablist::-webkit-scrollbar { display: none; }
.tab {
  flex: none; scroll-snap-align: start;
  appearance: none; background: none; border: 0; font: inherit; font-size: 0.97rem; font-weight: 550;
  color: var(--muted); padding: 0.85rem 0.95rem; cursor: pointer; position: relative; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--sun-1), var(--sun-2)); }
.tabpanel[hidden] { display: none; }
.tabpanel { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- home hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: 0.3em; }
.hero .role { font-size: 1.1rem; color: var(--text-2); font-weight: 500; margin-bottom: 1.1rem; }
.hero .lead { margin-bottom: 1.75rem; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.sun-card { position: relative; }
.sun-figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #1a1208 0%, #000 70%); box-shadow: 0 0 80px -10px color-mix(in srgb, var(--sun-2) 55%, transparent); overflow: hidden; max-width: 460px; margin-inline: auto; }
.sun-figure img { width: 100%; height: 100%; object-fit: cover; transition: opacity .4s; }
.sun-figure img.is-loading { opacity: 0.35; }
.sun-meta { text-align: center; margin-top: 1rem; }
.sun-meta .title { font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem; padding: 0.25rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); margin-top: 0.75rem; }
.seg button { appearance: none; border: 0; background: none; font: inherit; font-size: 0.8rem; font-weight: 550; color: var(--muted); padding: 0.35rem 0.7rem; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.about-card { display: grid; grid-template-columns: 112px 1fr auto; gap: 1.25rem; align-items: center; }
.about-card img { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; object-position: 50% 35%; }
.about-card p { margin: 0; color: var(--text-2); }
@media (max-width: 720px) { .about-card { grid-template-columns: 80px 1fr; } .about-card img { width: 80px; height: 80px; } .about-card .btn-row { grid-column: 1 / -1; } }

/* ---------- feed lists ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.feed-item { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-date { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; padding-top: 0.15rem; }
.feed-title { font-weight: 600; color: var(--text); text-decoration: none; }
.feed-title:hover { color: var(--accent); }
.feed-summary { color: var(--text-2); margin: 0.25rem 0 0.4rem; font-size: 0.95rem; }
.feed-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 600px) { .feed-item { grid-template-columns: 1fr; gap: 0.2rem; } }

.empty { padding: 2rem; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); min-height: 1rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- stats (space weather) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.75rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.stat .label { font-size: 0.8rem; color: var(--muted); font-weight: 550; }
.stat .value { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 0.2rem; }
.stat .value small { font-size: 0.9rem; font-weight: 500; color: var(--muted); margin-left: 0.15rem; }
.stat .note { font-size: 0.8rem; color: var(--muted); margin-top: 0.15rem; }
.level { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; margin-top: 0.3rem; }
.level::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.level-ok { color: var(--good); }
.level-warn { color: var(--warn); }
.level-bad { color: var(--bad); }
.scales { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.scale { display: inline-flex; flex-direction: column; align-items: center; min-width: 64px; padding: 0.5rem 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.scale b { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.scale span { font-size: 0.72rem; color: var(--muted); }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { border-bottom: 1px solid var(--border); }
.alerts li:last-child { border-bottom: 0; }
.alerts details summary { cursor: pointer; padding: 0.75rem 0; display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.75rem; list-style: none; }
.alerts details summary::-webkit-details-marker { display: none; }
.alerts .when { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.alerts .what { font-weight: 550; font-size: 0.95rem; }
.alerts pre { font-size: 0.78rem; white-space: pre-wrap; margin: 0 0 0.9rem; }
@media (max-width: 600px) { .alerts details summary { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ---------- charts ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .series-obs { fill: none; stroke: var(--chart-muted); stroke-width: 1.25; }
.chart .series-main { fill: none; stroke: var(--sun-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-pred { fill: none; stroke: var(--sun-1); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .band { fill: var(--sun-1); opacity: 0.16; }
.chart .cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .dot { fill: var(--sun-2); stroke: var(--surface); stroke-width: 2; }
.chart .marker-label { fill: var(--text-2); font-size: 11px; font-weight: 600; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0.45rem 0.65rem; font-size: 0.8rem; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; }
.chart-tip.show { opacity: 1; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.82rem; color: var(--text-2); margin: 0.5rem 0 0.75rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid; }
.legend i.obs { border-color: var(--chart-muted); border-top-width: 1.5px; }
.legend i.main { border-color: var(--sun-2); }
.legend i.pred { border-color: var(--sun-1); border-top-style: dashed; }
.legend i.band { height: 10px; border: 0; background: var(--sun-1); opacity: 0.3; border-radius: 2px; }

/* ---------- publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-bottom: 1.25rem; }
.filters input[type="search"], .filters select { font: inherit; font-size: 0.92rem; padding: 0.5rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.filters input[type="search"] { flex: 1 1 220px; min-width: 0; }
.toggle { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.9rem; color: var(--text-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--sun-2); width: 16px; height: 16px; }
.pill-group { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; }
.pill-group button { font: inherit; font-size: 0.85rem; font-weight: 550; padding: 0.38rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); cursor: pointer; }
.pill-group button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.pub-year { font-size: 0.9rem; font-weight: 650; color: var(--muted); letter-spacing: 0.04em; margin: 2rem 0 0.25rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border); position: sticky; top: 112px; background: var(--bg); z-index: 5; }
.pub { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: 0; }
.pub :is(h3, h4) { font-size: 1.05rem; font-weight: 600; line-height: 1.4; margin: 0 0 0.3rem; letter-spacing: -0.01em; }
.pub :is(h3, h4) a { color: var(--text); text-decoration: none; }
.pub :is(h3, h4) a:hover { color: var(--accent); }
.pub .authors { font-size: 0.9rem; color: var(--text-2); margin: 0 0 0.2rem; }
.pub .authors .me { color: var(--text); font-weight: 650; }
.pub .venue { font-size: 0.85rem; color: var(--muted); margin: 0 0 0.55rem; }
.pub .summary { font-size: 0.94rem; color: var(--text-2); border-left: 2px solid var(--sun-1); padding-left: 0.85rem; margin: 0.5rem 0 0.75rem; max-width: 75ch; }
.pub .summary b { color: var(--text); font-weight: 600; }
.pub-count { font-size: 0.9rem; color: var(--muted); }

/* ---------- primer (Solar cycle 101) ---------- */
.primer { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.primer .card { position: relative; padding-top: 3.2rem; }
.primer .card::before { counter-increment: step; content: counter(step); position: absolute; top: 1.1rem; left: 1.25rem; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--sun-1), var(--sun-2)); }
.primer .card p { font-size: 0.93rem; color: var(--text-2); }
.primer .card a { font-size: 0.88rem; font-weight: 550; }

/* ---------- projects ---------- */
.project { display: grid; grid-template-columns: 1fr 280px; gap: clamp(1rem, 3vw, 2rem); align-items: start; }
.project + .project { margin-top: 1.25rem; }
.project dl { display: grid; grid-template-columns: 6rem 1fr; gap: 0.4rem 1rem; margin: 0.75rem 0 1rem; font-size: 0.95rem; }
.project dt { color: var(--muted); font-weight: 550; }
.project dd { margin: 0; color: var(--text-2); }
.project figure { margin: 0; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.75rem; border: 1px solid var(--border); }
.project figcaption { font-size: 0.78rem; color: var(--muted); margin-top: 0.4rem; }
.project ul.papers { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.project ul.papers li { margin-bottom: 0.3rem; }
@media (max-width: 820px) { .project { grid-template-columns: 1fr; } .project dl { grid-template-columns: 1fr; gap: 0.1rem; } .project dd { margin-bottom: 0.5rem; } }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; max-width: 760px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--sun-1), var(--sun-2)); border-radius: 2px; }
.timeline li { position: relative; padding: 0 0 1.75rem 2.25rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--sun-2); }
.timeline .when { font-size: 0.82rem; font-weight: 650; color: var(--accent); letter-spacing: 0.03em; }
.timeline h3 { font-size: 1.08rem; margin: 0.15rem 0 0.3rem; }
.timeline p { margin: 0; color: var(--text-2); font-size: 0.97rem; }

/* ---------- CV ---------- */
.cv-block + .cv-block { margin-top: 2rem; }
.cv-row { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
.cv-row:last-child { border-bottom: 0; }
.cv-row .when { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.cv-row b { display: block; font-weight: 600; }
.cv-row span { color: var(--text-2); font-size: 0.95rem; }
@media (max-width: 600px) { .cv-row { grid-template-columns: 1fr; gap: 0.1rem; } }

/* ---------- contact ---------- */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.contact-list a, .contact-list .row { display: flex; align-items: center; gap: 0.75rem; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; }
.contact-list a:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.contact-list svg { width: 20px; height: 20px; flex: none; color: var(--accent); }
.contact-list small { display: block; color: var(--muted); font-size: 0.82rem; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 0.75rem; }
.gallery button { appearance: none; border: 0; padding: 0; background: var(--surface-2); border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery button:hover img { transform: scale(1.03); }
.gallery .cap { position: absolute; inset: auto 0 0 0; padding: 1.5rem 0.75rem 0.6rem; color: #fff; font-size: 0.82rem; font-weight: 550; text-align: left; background: linear-gradient(transparent, rgb(0 0 0 / 0.65)); opacity: 0; transition: opacity .2s; }
.gallery button:hover .cap, .gallery button:focus-visible .cap { opacity: 1; }
.lightbox { border: 0; padding: 0; background: rgb(8 7 6 / 0.94); color: #f3f0ea; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.8); }
.lightbox-inner { display: grid; grid-template-rows: 1fr auto; height: 100%; padding: 56px 16px 16px; }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; }
.lightbox .lb-cap { text-align: center; padding-top: 0.75rem; font-size: 0.92rem; }
.lightbox .lb-cap span { color: #b8b1a6; }
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next { position: absolute; background: rgb(255 255 255 / 0.08); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.3rem; display: grid; place-items: center; }
.lightbox .lb-close { top: 12px; right: 12px; }
.lightbox .lb-prev { left: 12px; top: 50%; }
.lightbox .lb-next { right: 12px; top: 50%; }

.potm { display: grid; grid-template-columns: 1.3fr 1fr; gap: 0; padding: 0; overflow: hidden; }
.potm img { width: 100%; height: 100%; object-fit: cover; min-height: 260px; }
.potm .body { padding: clamp(1.25rem, 3vw, 2rem); align-self: center; }
@media (max-width: 760px) { .potm { grid-template-columns: 1fr; } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: clamp(3rem, 6vw, 5rem); padding-block: 2.25rem; font-size: 0.9rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.footer-links a { color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .tablist, .filters { display: none; }
  .tabpanel[hidden] { display: block; }
  body { background: #fff; color: #000; }
}

/* ---------- about: bio ---------- */
.bio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.bio-side { order: 2; }   /* photo on the right: the portrait faces left, into the text */
.bio-side img { width: 100%; border-radius: var(--radius); aspect-ratio: 1; object-fit: cover; object-position: 50% 30%; }
.bio-id { margin-top: 1rem; display: grid; gap: 0.1rem; line-height: 1.4; }
.bio-id b { font-size: 1.05rem; }
.bio-id span { font-size: 0.92rem; }
.bio-address { font-style: normal; font-size: 0.9rem; line-height: 1.5; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
@media (max-width: 720px) { .bio-grid { grid-template-columns: 1fr; } .bio-side { order: 0; } .bio-side img { max-width: 220px; } }
.pill-group button[aria-pressed="true"] .muted { color: inherit; opacity: 0.65; }
.project { scroll-margin-top: 130px; }

/* ---------- polar field chart (validated pair: #ea580c / #0891b2, light and dark) ---------- */
.chart .zero-line { stroke: var(--border-strong); stroke-width: 1.25; }
.chart .series-north { fill: none; stroke: #ea580c; stroke-width: 2; stroke-linejoin: round; }
.chart .series-south { fill: none; stroke: #0891b2; stroke-width: 2; stroke-linejoin: round; }
.chart .dot-n { fill: #ea580c; stroke: var(--surface); stroke-width: 2; }
.chart .dot-s { fill: #0891b2; stroke: var(--surface); stroke-width: 2; }
.legend i.north { border-color: #ea580c; }
.legend i.south { border-color: #0891b2; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: clamp(1rem, 2vw, 1.5rem); align-items: start; }
.glance-grid .card h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
/* Both At a Glance plots share one size: same card height, one-line legend, same chart box. */
.glance-grid { align-items: stretch; }
.glance-grid .card { display: flex; flex-direction: column; }
.glance-grid .legend { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; min-height: 1.4em; }
.glance-grid .card > p:last-child { margin-top: auto !important; padding-top: .75rem; }

/* ---------- about: mentoring table ---------- */
.mentor-table table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.mentor-table th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); letter-spacing: 0.03em; padding: 0 1rem 0.6rem 0; border-bottom: 1px solid var(--border-strong); }
.mentor-table td { padding: 0.85rem 1rem 0.85rem 0; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.mentor-table td b { color: var(--text); font-weight: 600; }
@media (max-width: 640px) {
  .mentor-table thead { display: none; }
  .mentor-table tr { display: grid; gap: 0.15rem; padding: 0.85rem 0; border-bottom: 1px solid var(--border); }
  .mentor-table td { padding: 0; border: 0; }
  .mentor-table td:not(:first-child)::before { content: attr(data-label) ": "; color: var(--muted); }
}
.project-text { grid-template-columns: 1fr; }
