/* ---------------------------------------------------------
   Ali Hashemi — academic site
   Minimal, content-first design in the spirit of clean
   personal academic pages: generous whitespace, restrained
   color, serif headings over a system sans-serif body.
--------------------------------------------------------- */

:root {
  --bg: #101216;
  --bg-alt: #171a20;
  --text: #e7e9ec;
  --text-muted: #9aa0aa;
  --border: #343a44;
  --accent: #7fb8da;
  --accent-strong: #a9d3ec;
  --accent-soft: #1a2b34;
  --accent2: #e3996b;
  --accent2-strong: #f0b790;
  --accent2-soft: #352720;
  --chip-bg: #1c2027;
  --chip-text: #c4c9d1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --max-width: 860px;
  --max-width-wide: 1160px;
  --sidebar-width: 264px;
  --serif: "Fraunces", Georgia, "Iowan Old Style", "Palatino Linotype", "URW Palladio", P052, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sc-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --avatar-opacity: 0.32;
  --on-accent: #101216;
}

/* Black is the default theme; [data-theme="light"] is the opt-in alternative via the toggle. */
[data-theme="light"] {
  --bg: #ffffff;
  --bg-alt: #f6f7f8;
  --text: #1c1f24;
  --text-muted: #5b616b;
  --border: #dce1e6;
  --accent: #1d4e6b;
  --accent-strong: #143a51;
  --accent-soft: #e7eff3;
  --accent2: #b85c2e;
  --accent2-strong: #96491f;
  --accent2-soft: #f7e8dc;
  --chip-bg: #eef1f3;
  --chip-text: #3a3f46;
  --shadow: 0 1px 2px rgba(20, 24, 30, 0.04), 0 4px 16px rgba(20, 24, 30, 0.04);
  --avatar-opacity: 0.2;
  --on-accent: #ffffff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 6% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%),
    radial-gradient(800px 440px at 102% -4%, color-mix(in srgb, var(--accent2) 9%, transparent), transparent 62%);
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 640px, 100% 640px;
  background-position: 0 0, 0 0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
a:hover { border-bottom-color: currentColor; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.22;
  color: var(--text);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 1.5rem + 1vw, 2.3rem); }
h2 { font-size: 1.5rem; margin-top: 2.4em; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  border-bottom: none;
  white-space: nowrap;
}
.site-brand:hover { color: var(--accent); }

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

.site-nav a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-bottom: none;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); background: var(--bg-alt); }
.site-nav a.active {
  background: var(--accent-soft);
  color: var(--text);
  border-bottom-color: var(--accent);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 0.4rem;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  color: var(--text);
  display: none;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  border-radius: 6px;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
    display: none;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-nav a { width: 100%; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
  .site-nav .theme-toggle { margin: 0.6rem 0 0.2rem; }
}

/* ---------- Main / page ---------- */
main { padding: 3rem 0 5rem; }

.page-layout {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 3.2rem;
  align-items: start;
}

.page-content { min-width: 0; max-width: 700px; }

.page-title {
  margin-top: 0;
  margin-bottom: 0.3em;
}
.page-lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2.4rem;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}

.bio { margin: 0 0 1.1rem; max-width: 65ch; }
.bio:last-child { margin-bottom: 2.4rem; }

.chip {
  background: var(--chip-bg);
  color: var(--chip-text);
  border-radius: 6px;
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
  font-weight: 500;
}

.interest-list {
  list-style: none;
  margin: 0 0 2.6rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem 1.5rem;
}
.interest-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.96rem;
}
.interest-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
@media (max-width: 560px) {
  .interest-list { grid-template-columns: 1fr; }
}

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.8rem;
}

/* ---------- Media cards (shared: projects + publications) ---------- */
.media-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  transition: transform 0.25s var(--sc-ease-out), box-shadow 0.25s var(--sc-ease-out), border-color 0.25s var(--sc-ease-out);
}
.media-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.media-card:focus-within {
  border-color: var(--accent);
}
.card-media {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.card-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
  padding: 0.5rem;
  display: block;
}
.card-badge {
  position: static;
  display: block;
  width: fit-content;
  margin: 0.6rem;
  background: rgba(16, 18, 22, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.28rem 0.6rem;
  border-radius: 6px;
  backdrop-filter: blur(3px);
  text-transform: uppercase;
}
.card-star {
  position: absolute;
  top: 0.6rem;
  right: 0.65rem;
  color: var(--accent2);
  background: rgba(16, 18, 22, 0.55);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.card-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.card-link {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.card-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

/* ---------- Selected Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.1rem;
}
.project-head {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.project-title { font-weight: 700; font-size: 1.05rem; line-height: 1.4; }
.project-metric {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent2-strong);
  background: var(--accent2-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.project-meta { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 0.5rem; }
.project-desc { font-size: 0.93rem; margin-bottom: 0.7rem; flex: 1; }
/* Designed project covers fill the media frame, with no paper-style pad. */
.project-card .card-media {
  background: #163145;
}
.project-card .card-media img {
  padding: 0;
  object-fit: cover;
}
.project-card .entry-tags { margin-top: 0; }

@media (max-width: 700px) {
  .project-grid { grid-template-columns: 1fr; }
  .project-head { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky;
  top: 88px;
  text-align: center;
  isolation: isolate;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: -1.4rem -1.1rem;
  border-radius: 20px;
  background: radial-gradient(
    220px 220px at calc(var(--sc-mx, 0.5) * 100%) calc(var(--sc-my, 0.25) * 100%),
    color-mix(in srgb, var(--accent) 16%, transparent),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: -1;
}
.sidebar:hover::before { opacity: 1; }

.avatar-frame {
  position: relative;
  width: 176px;
  margin: 0 auto 1.2rem;
  perspective: 700px;
}
.avatar-backdrop {
  position: absolute;
  inset: -12px -18px -18px -12px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  opacity: var(--avatar-opacity);
  transform: rotate(-7deg);
  z-index: 0;
}

.sidebar-avatar {
  position: relative;
  z-index: 1;
  width: 176px;
  height: 176px;
  margin: 0;
  border-radius: 16px;
  display: block;
  object-fit: cover;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.sidebar-name {
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.015em;
  margin-bottom: 0.2em;
}
.sidebar-role {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.3;
  white-space: nowrap;
}
.sidebar-org {
  color: var(--text);
  font-weight: 500;
  font-size: 0.94rem;
  margin-bottom: 0.6rem;
}
.sidebar-location {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 1.1rem;
}
.sidebar-location svg { width: 14px; height: 14px; }

.sidebar-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.2rem;
}
.sidebar-social a {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.sidebar-social a:hover { border-color: var(--accent); color: var(--accent); }
.sidebar-social svg { width: 15px; height: 15px; }

.sidebar-cv {
  width: 100%;
  justify-content: center;
  margin-bottom: 1.4rem;
}

.sidebar-proof {
  list-style: none;
  max-width: 22rem;
  margin: 0 auto;
  padding: 0.3rem 0 0;
  border-top: 1px solid var(--border);
  text-align: left;
}
.sidebar-proof li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
}
.sidebar-proof li + li { border-top: 1px solid var(--border); }
.proof-value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.1;
  color: var(--accent2);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
[data-theme="light"] .proof-value { color: var(--accent2-strong); }
.proof-label {
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--text);
  text-wrap: balance;
}
.sidebar-proof li.proof-oneline {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
}
.sidebar-proof li.proof-oneline .proof-value {
  font-size: 1.05rem;
}
.sidebar-proof li.proof-oneline .proof-label {
  font-size: 0.78rem;
  text-wrap: nowrap;
}

/* ---------- Home hero: focus areas ---------- */
.hero { margin-bottom: 2.8rem; }
.hero-title {
  font-size: clamp(1.75rem, 1.25rem + 1.8vw, 2.4rem);
  line-height: 1.15;
  margin: 0 0 1.4rem;
  max-width: 22ch;
  text-wrap: balance;
}
.hero-mark { color: var(--accent-strong); }
[data-theme="light"] .hero-mark { color: var(--accent); }
.focus-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}
.focus-card {
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 10px;
  background: var(--bg-alt);
}
.focus-card:nth-child(even) { border-top-color: var(--accent2); }
.focus-title {
  font-family: var(--sans);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}
.focus-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
  text-wrap: pretty;
}
@media (max-width: 560px) {
  .focus-grid { grid-template-columns: minmax(0, 1fr); gap: 0.7rem; }
}

@media (max-width: 860px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; padding-bottom: 2.4rem; margin-bottom: 2.4rem; border-bottom: 1px solid var(--border); }
}

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: clamp(1.35rem, 1.15rem + 0.5vw, 1.55rem); }
.section-head .see-all { font-size: 0.9rem; white-space: nowrap; }

/* ---------- News table (al-folio style) ---------- */
.news-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.news-table tr { border-bottom: 1px solid var(--border); }
.news-table tr:last-child { border-bottom: none; }
.news-table td { padding: 0.7rem 0; vertical-align: top; }
.news-date {
  width: 92px;
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding-right: 1rem !important;
}
@media (max-width: 480px) {
  .news-table, .news-table tbody, .news-table tr, .news-table td { display: block; width: auto; }
  .news-date { padding: 0.7rem 0 0 !important; }
  .news-table td:last-child { padding-top: 0.1rem; padding-bottom: 0.7rem; }
}

/* ---------- Publications ---------- */
.pub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.8rem;
}
.pub-filter {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.pub-filter:hover { color: var(--text); }
.pub-filter.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.pub-year {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.pub-year:first-of-type { margin-top: 0; }

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.1rem;
  margin-bottom: 0.4rem;
}

.pub-title { font-weight: 600; margin-bottom: 0.3rem; line-height: 1.35; }
.pub-title a { color: var(--text); border-bottom: 1px solid var(--border); }
.pub-title a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.pub-authors { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 0.2rem; line-height: 1.4; }
.pub-authors strong { color: var(--text); }
.pub-venue { color: var(--text-muted); font-size: 0.84rem; font-style: italic; margin-bottom: 0.3rem; }
.pub-takeaway { font-size: 0.88rem; margin: 0.25rem 0 0; color: var(--text); flex: 1; }

@media (max-width: 480px) {
  main { padding: 2rem 0 3rem; }
  .container, .page-layout { padding-inline: 1.25rem; }
  .page-layout { gap: 0; }
  .page-content { width: 100%; }
  .contact-list .value { overflow-wrap: anywhere; }
  .pub-grid, .project-grid { grid-template-columns: 1fr; }
}

/* ---------- CV page ---------- */
.cv-actions { margin-bottom: 2.4rem; }

.cv-section-lede {
  color: var(--text-muted);
  font-size: 0.98rem;
  margin: -0.4rem 0 1.2rem;
  max-width: 62ch;
}
.cv-pub-list { margin: 0 0 2rem; padding-left: 1.2rem; }
.cv-pub-list li { margin: 0 0 0.9rem; }
.cv-pub-title { font-weight: 600; }
.cv-pub-meta { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.15rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: none;
}
.btn:hover { background: var(--accent-strong); border-bottom: none; }
.btn svg { width: 16px; height: 16px; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: transparent; }

.entry { margin-bottom: 1.7rem; }
.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: nowrap;
}
.entry-head > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.entry-title { font-weight: 700; font-size: 1.02rem; }
.entry-org { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.entry-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: right;
}
.entry-current {
  background: var(--accent2-soft);
  color: var(--accent2-strong);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  margin-left: 0.5rem;
}
.entry ul { margin: 0.5rem 0 0.6rem; padding-left: 1.15rem; }
.entry li { margin-bottom: 0.35rem; font-size: 0.96rem; }
.entry-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }

.award-list, .talk-list { list-style: none; padding: 0; margin: 0; }
.award-list li, .talk-list li {
  display: flex;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.96rem;
}
.award-list li:last-child, .talk-list li:last-child { border-bottom: none; }
.award-year, .talk-date {
  flex: none;
  width: 64px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.88rem;
}
.talk-venue { color: var(--text-muted); font-size: 0.88rem; }

.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2.4rem; }
.skills-grid h4 { margin-bottom: 0.5rem; font-size: 0.95rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
@media (max-width: 620px) { .skills-grid { grid-template-columns: 1fr; } }

/* ---------- Contact page ---------- */
.contact-list { list-style: none; padding: 0; margin: 0 0 2rem; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}
.contact-list li:last-child { border-bottom: none; }
.contact-list .icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-list .icon svg { width: 18px; height: 18px; color: var(--accent); }
.contact-list .label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.contact-list .value { font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.2rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.site-footer .container { text-align: center; }

/* ---------- ScrollCraft: minimal scroll-reveal + depth ----------
   Only the handful of rules the engine needs for the data-sc-in,
   data-sc-stagger, data-sc-tilt, data-sc-spotlight and data-sc-count
   attributes we use on this page (all of which run standalone, outside
   the engine's pinned-act/cue system). See static/js/scrollcraft.js. */
/* Visible by default — no JS, no scrolling, nothing hidden. The engine opts
   an element into the hide-then-reveal treatment by adding 'sc-pending' to
   it (see scrollcraft.js); until/unless that happens, this rule never
   applies, so a slow, blocked, or broken script never hides content. */
[data-sc-in], [data-sc-stagger] > * { opacity: 1; transform: none; }
.sc-pending[data-sc-in], [data-sc-stagger] > .sc-pending {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity 620ms var(--sc-ease-out), transform 620ms var(--sc-ease-out);
}
.sc-pending[data-sc-in].sc-in, [data-sc-stagger] > .sc-pending.sc-in { opacity: 1; transform: none; }
[data-sc-tilt] { transform-style: preserve-3d; will-change: transform; transition: transform 0.2s var(--sc-ease-out); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .media-card:hover { transform: none; }
  .sc-pending[data-sc-in], [data-sc-stagger] > .sc-pending { opacity: 1; transform: none; transition: none; }
}

/* Section rhythm and shared surfaces */
.page-layout { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap: clamp(2rem, 4vw, 3.2rem); }
.page-content { width: 100%; overflow-wrap: anywhere; }
.page-lede, .group-lede { max-width: 62ch; }
.section-head, .group-head {
  position: relative;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.section-head::after, .group-head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
}
.section-head { margin-block: 3.5rem 1.5rem; }
.section-head h2, .group-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 1.15rem + 0.5vw, 1.55rem);
}
.project-group { margin-top: 3.5rem; scroll-margin-top: 6rem; }
.group-head { margin-bottom: 1.5rem; }
.group-lede { color: var(--text-muted); font-size: 0.95rem; margin: 0.65rem 0 0; }
.project-grid, .pub-grid, .focus-grid { gap: 1.25rem; }
.media-card, .focus-card, .featured-project {
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.media-card .card-body { padding: 1.35rem; }
.media-card .card-links { margin-top: auto; padding-top: 1rem; }
.focus-card { border-top-width: 1px; }
.focus-title { color: var(--accent-strong); }
.focus-card:nth-child(even) .focus-title { color: var(--accent2-strong); }
.media-card:focus-within, .featured-project:focus-within { border-color: var(--accent); }

/* Project navigation */
.jump-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 2rem; }
.jump-links .chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  line-height: 1.4;
}
.jump-links a:hover { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); }

/* Featured project */
.featured-project {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  background: var(--bg-alt);
  overflow: hidden;
  margin-bottom: 1.5rem;
}
.featured-visual {
  display: grid;
  place-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
  background: radial-gradient(ellipse at 50% 0, color-mix(in srgb, var(--accent) 15%, transparent), transparent 75%), var(--accent-soft);
}
.featured-pipeline { display: block; width: 100%; max-width: 440px; height: auto; }
.pipeline-node rect { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; }
.pipeline-node text { fill: var(--text); font: 600 12px var(--sans); }
.pipeline-arrow { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.featured-body { padding: clamp(1.25rem, 3vw, 2rem); }
.featured-body .project-head { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 0.6rem 1rem; margin-bottom: 1rem; }
.project-label { color: var(--accent-strong); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.featured-body .project-title { font-family: var(--serif); font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); line-height: 1.25; margin-bottom: 0.6rem; }
.featured-body .project-desc { max-width: 60ch; margin-bottom: 1.25rem; }
.featured-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.5rem; }
.featured-link { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 48px; font-size: 0.9rem; font-weight: 600; }
.featured-primary { padding: 0.65rem 1rem; background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: 8px; }
.featured-primary:hover { background: var(--accent-strong); color: var(--on-accent); border-color: var(--accent-strong); }
.featured-secondary { padding-block: 0.6rem; }
.featured-compact .featured-visual { padding-block: 1rem; }
.featured-compact .featured-pipeline { max-width: 360px; }

/* Comfortable controls and narrow screens */
.theme-toggle, .nav-toggle, .sidebar-social a { width: 44px; height: 44px; }
.site-nav a, .site-brand, .card-link, .pub-filter, .btn, .see-all { min-height: 44px; display: inline-flex; align-items: center; }
.card-link { white-space: normal; line-height: 1.4; }
.site-header .container { max-width: var(--max-width-wide); }
.sidebar-role { white-space: normal; }
.news-table { table-layout: fixed; }
.news-table td { padding-block: 1rem; }
.news-table .news-date { width: 92px; }
.news-table td p:last-child { margin-bottom: 0; }
html { scroll-padding-top: 6rem; }
@media (max-width: 1000px) and (min-width: 861px) {
  .page-layout { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .page-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .page-content { max-width: 700px; margin-inline: auto; }
  .sidebar { padding-bottom: 2rem; margin-bottom: 2.5rem; }
  .sidebar::before { inset-inline: 0; }
  .sidebar-cv { max-width: 22rem; }
}
@media (max-width: 768px) {
  .project-grid, .pub-grid, .focus-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .site-nav { padding-inline: 1.25rem; max-height: calc(100dvh - 64px); overflow-y: auto; }
  .site-nav a { padding-inline: 0.75rem; }
  .section-head, .project-group { margin-top: 2.75rem; }
  .featured-visual { padding: 1rem; }
  .featured-actions { align-items: stretch; flex-direction: column; gap: 0.5rem; }
  .featured-link { text-align: center; }
}
@media (max-width: 480px) {
  .news-table .news-date { width: auto; padding-top: 1rem !important; }
  .news-table td:last-child { padding-bottom: 1rem; }
  .entry-head { flex-wrap: wrap; }
  .entry-meta { white-space: normal; }
  .sidebar-proof li.proof-oneline { flex-wrap: wrap; white-space: normal; }
}

/* Animated project covers: inline SVGs, calm idle motion, livelier on hover or focus. */
.card-cover { background: #163145; }
.card-cover .cover-svg { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; }
.media-card:hover .card-media,
.media-card:focus-within .card-media,
.featured-project:hover .featured-visual,
.featured-project:focus-within .featured-visual { --spd: 2; }
.featured-visual.featured-cover { background: #0b1730; padding: 0; }
.featured-visual .cover-svg { display: block; width: 100%; height: auto; }
.featured-cover .cover-svg {
  max-width: 720px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.featured-compact .featured-cover .cover-svg { max-width: 560px; }
@media (prefers-reduced-motion: reduce) {
  .cover-svg * { animation: none !important; transition: none !important; }
}
