:root{
  color-scheme: light;
  --bg:#ffffff;
  --surface:#ffffff;
  --surface-2:#fafafa;
  --logo-bg:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --ink-soft:#334155;
  --accent:#1e3a8a;
  --accent-contrast:#ffffff;
  --border:#e2e8f0;
  --line:rgba(0,0,0,0.08);
  --line-strong:rgba(0,0,0,0.16);
  --header-bg:rgba(255,255,255,.98);
  --scrollbar:#c7cbd1;
  --scrollbar-hover:#aeb4bc;
  --divider-start:#06b6d4;
  --divider-end:rgba(6,182,212,0);
  --social-gmail:#d93025;
  --social-scholar:#1a73e8;
  --social-github:#24292f;
  --social-linkedin:#0a66c2;
  --social-x:#0f1419;
  --social-orcid:#5f7800;
  --social-openreview:#8c1b13;
  --container: 1380px;
}

:root[data-theme="dark"]{
  color-scheme: dark;
  --bg:#161616;
  --surface:#1e1e1e;
  --surface-2:#262626;
  --logo-bg:#f1f5f9;
  --text:#ededed;
  --muted:#a3a3a3;
  --ink-soft:#d4d4d4;
  --accent:#93c5fd;
  --accent-contrast:#161616;
  --border:#2e2e2e;
  --line:rgba(255,255,255,0.09);
  --line-strong:rgba(255,255,255,0.16);
  --header-bg:rgba(20,20,20,.9);
  --scrollbar:#3f3f46;
  --scrollbar-hover:#52525b;
  --social-gmail:#ff8a80;
  --social-scholar:#8ab4f8;
  --social-github:#f0f6fc;
  --social-linkedin:#70b7ff;
  --social-x:#f2f2f2;
  --social-orcid:#b6d957;
  --social-openreview:#ef8179;
}

/* No-JS fallback: honor system preference unless an explicit choice is set */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){
    color-scheme: dark;
    --bg:#161616;
    --surface:#1e1e1e;
    --surface-2:#262626;
    --logo-bg:#f1f5f9;
    --text:#ededed;
    --muted:#a3a3a3;
    --ink-soft:#d4d4d4;
    --accent:#93c5fd;
    --accent-contrast:#161616;
    --border:#2e2e2e;
    --line:rgba(255,255,255,0.09);
    --line-strong:rgba(255,255,255,0.16);
    --header-bg:rgba(20,20,20,.9);
    --scrollbar:#3f3f46;
    --scrollbar-hover:#52525b;
    --social-gmail:#ff8a80;
    --social-scholar:#8ab4f8;
    --social-github:#f0f6fc;
    --social-linkedin:#70b7ff;
    --social-x:#f2f2f2;
    --social-orcid:#b6d957;
    --social-openreview:#ef8179;
  }
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  line-height:1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition:background-color .2s ease, color .2s ease;
}
@media (prefers-reduced-motion: reduce){
  body,
  .site-header,
  .news-list,
  .scroll-card,
  .pub-card,
  .company-logo,
  .btn-chip{
    transition:none !important;
  }
}

a{
  color:var(--accent);
  text-decoration:none;
  border-bottom:1px solid rgba(30,58,138,0.18);
}
a:hover{
  color:var(--accent);
  border-bottom-color:var(--accent);
}

a:focus-visible,
.btn:focus-visible,
.theme-toggle:focus-visible,
.nav-toggle:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

/* Layout */
.container{max-width:var(--container);margin:0 auto;padding:0 0}
.section{padding:24px 0;scroll-margin-top:72px}

.page-layout{
  display:grid;
  grid-template-columns:minmax(360px,540px) minmax(0,1fr);
  gap:24px;
  padding:16px 0 32px;
  align-items:start;
}
.page-layout .container{max-width:none;padding:0}
.sidebar{
  display:flex;
  flex-direction:column;
  gap:20px;
  position:relative;
}
.profile.section{
  padding:0;
  position:relative;
  overflow:hidden;
}
.hero-left{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:6px;
  text-align:left;
  position: relative;
  padding-top: 20px;
  width:100%;
}
.hero-left::before{
  content:'';
  position:absolute;
  top:-20px;
  left:-20px;
  right:-20px;
  height:200px;
  background:linear-gradient(135deg,
    rgba(30,58,138,0.09) 0%,
    rgba(6,182,212,0.12) 50%,
    rgba(30,58,138,0.06) 100%
  );
  border-radius:16px;
  z-index:-1;
  filter:blur(40px);
  opacity:.8;
}

@media (max-width: 900px){
  .hero-left::before{
    left:-14px;
    right:-14px;
  }
}
.hero-left p{margin-top:6px}
.hero-subline{
  display:flex;
  align-items:baseline;
  gap:14px;
  flex-wrap:wrap;
}
.content{
  border-left:1px solid var(--border);
  padding-left:32px;
}

@media (max-width: 900px){
  .container{padding:0 20px}
  .page-layout{grid-template-columns:1fr;gap:24px;padding:16px 14px 24px}
  .content{border-left:none;padding-left:0}
}

h1,h2,h3{
  color:var(--accent);
  margin:0 0 6px 0;
  line-height:1.2;
  font-family:Georgia,"Times New Roman",Times,serif;
}
h1.hero-title{font-size:clamp(30px,4.6vw,46px);font-weight:700;margin-bottom:8px}
h2{font-size:1.75rem;font-weight:700;letter-spacing:-.5px}
h3{font-size:1.1rem;font-weight:600;margin-bottom:12px;letter-spacing:.2px}
.hero-subtitle{font-weight:400;color:var(--muted);margin:0}
.section-divider{
  height:3px;
  width:62%;
  max-width:360px;
  background:linear-gradient(90deg,var(--divider-start),var(--divider-end));
  margin:1px 0 10px;
  border-radius:999px;
  opacity:.85;
}

/* Header / Nav with Active Indicator */
.site-header{
  position:sticky;top:0;z-index:10;background:var(--header-bg);
  border-bottom:1px solid var(--border);backdrop-filter:saturate(180%) blur(8px);
  transition:background-color .2s ease, border-color .2s ease;
}
.nav{display:flex;align-items:center;justify-content:space-between;height:56px;gap:16px}
.nav-left{flex:0 0 auto}
.nav-cta{display:flex;align-items:center;gap:10px}
.nav-cta .btn{padding:6px 12px;font-size:.85rem}
.nav-right{display:flex;align-items:center;gap:16px}

/* Theme toggle */
.theme-toggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  padding:0;
  border:1px solid var(--border);
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  transition:color .15s ease, border-color .15s ease, background-color .15s ease;
}
.theme-toggle:hover{
  color:var(--accent);
  border-color:var(--accent);
}
.theme-toggle svg{width:18px;height:18px;display:block}
.theme-toggle .icon-sun{display:none}
:root[data-theme="dark"] .theme-toggle .icon-sun{display:block}
:root[data-theme="dark"] .theme-toggle .icon-moon{display:none}
.nav-links{display:flex;gap:20px;list-style:none;margin:0;padding:0;align-items:center}
.nav-links li{position:relative}
.nav-link{
  color:var(--text);
  text-decoration:none;
  font-size:.95rem;
  display:block;
  padding:4px 0;
  position:relative;
}
.nav-link::after{
  content:'';
  position:absolute;
  bottom:0;
  left:0;
  width:0;
  height:2px;
  background:var(--accent);
  transition:width .2s ease;
}
.nav-link.active::after{
  width:100%;
}
.nav-link:hover{opacity:.7}

.nav-toggle{
  display:none;
  border:1px solid var(--border);
  background:transparent;
  font-size:28px;
  padding:6px 10px;
  line-height:1;
  cursor:pointer;
}
@media (max-width: 720px){
  .nav-toggle{display:block}
  .hide-sm{display:none}
  .nav-links{
    display:none;position:absolute;top:56px;left:0;right:0;
    background:var(--header-bg);backdrop-filter:blur(8px);
    border-bottom:1px solid var(--border);padding:12px 20px;
    flex-direction:column;align-items:flex-start;gap:12px;
  }
  .nav-links.open{display:flex}
  .nav-link::after{display:none} /* Hide underline on mobile */
}

/* Buttons */
.btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:10px 18px;border:1px solid var(--accent);
  text-decoration:none;font-weight:600;border-radius:6px;
  transition:all .15s ease;
}
.btn-solid{background:var(--accent);color:var(--accent-contrast)}
.btn-outline{background:transparent;color:var(--accent)}
.btn:hover{transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.08)}
.btn-small{padding:8px 14px;font-size:.9rem}

.headshot.round{
  width: 170px;
  height: 170px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.lazy-img{
  opacity:0;
  transition: opacity .25s ease;
}
.lazy-img.is-loaded{
  opacity:1;
}

/* Social icons */
.social-text{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  font-size:.84rem;
  color:var(--muted);
}
.social-text a{
  color:var(--muted);
  text-decoration:none;
  border-bottom:0;
}
.social-text a:hover{
  color:var(--accent);
}
.social-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  height:34px;
  border-radius:8px;
  background:transparent;
  border:1px solid transparent;
  transition:all .2s ease;
}
.social-icon svg{
  width:20px;
  height:20px;
  display:block;
  transition:all .2s ease;
}
.social-icon.gmail svg path{fill:var(--social-gmail)}
.social-icon.scholar svg path{fill:var(--social-scholar)}
.social-icon.github svg path{fill:var(--social-github)}
.social-icon.linkedin svg path{fill:var(--social-linkedin)}
.social-icon.x svg path{fill:var(--social-x)}
.social-icon.orcid svg path{fill:var(--social-orcid)}
.social-icon.openreview svg path{fill:var(--social-openreview)}
.social-icon:hover{
  transform:translateY(-2px);
  box-shadow:0 4px 12px rgba(0,0,0,0.15);
  border-color:transparent;
}
.social-icon.gmail:hover{
  background:#b3261e;
}
.social-icon.gmail:hover svg path{ fill:#fff; }
.social-icon.scholar:hover{
  background:#185abc;
}
.social-icon.scholar:hover svg path{ fill:#fff; }
.social-icon.github:hover{
  background:#3d444d;
}
.social-icon.github:hover svg path{ fill:#fff; }
.social-icon.linkedin:hover{
  background:#0a66c2;
}
.social-icon.linkedin:hover svg path{ fill:#fff; }
.social-icon.x:hover{
  background:#24292f;
}
.social-icon.x:hover svg path{ fill:#fff; }
.social-icon.orcid:hover{
  background:#536b00;
}
.social-icon.orcid:hover svg path{ fill:#fff; }
.social-icon.openreview:hover{
  background:#8C1B13;
}
.social-icon.openreview:hover svg path{ fill:#fff; }

/* Clean List Style - NO BOXES */
.clean-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.clean-list li{
  padding:0;
  border:none;
  background:transparent;
}

.item-header{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin-bottom:6px;
}

.item-title{
  font-weight:600;
  font-size:1rem;
  color:var(--text);
  line-height:1.35;
  letter-spacing:-.2px;
}

.item-meta{
  color:var(--muted);
  font-size:.92rem;
  margin-bottom:6px;
}

.item-desc{
  margin:6px 0;
  color:var(--ink-soft);
  font-size:.96rem;
  line-height:1.65;
  max-width:65ch;
  text-wrap:pretty;
}
.experience-list .item-desc{
  max-width:none;
}

/* Links in items */
.item-links{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:8px;
}

.item-links a{
  color:var(--accent);
  text-decoration:none;
  font-size:.9rem;
  font-weight:400;
  border-bottom:1px solid var(--border);
  padding-bottom:1px;
  transition:all .15s ease;
}

.item-links a:hover{
  border-bottom-color:var(--accent);
}

.projects-section .clean-list{
  gap:14px;
}
.projects-section .item-title{
  font-weight:600;
}
.projects-section .item-header{
  margin-bottom:2px;
  align-items:center;
  gap:14px;
}
.projects-section .item-header .item-links{
  margin-top:0;
  gap:10px;
  margin-left:auto;
}
.projects-section .item-header .item-links a{
  display:inline-flex;
  align-items:center;
  color:var(--muted);
  border-bottom:none;
}
.projects-section .item-header .item-links a svg{
  width:17px;
  height:17px;
  display:block;
}
.projects-section .item-header .item-links a:hover{
  color:var(--accent);
}
.projects-section .item-desc{
  margin:0;
}
.awards-list{
  gap:16px;
}
.awards-list .item-desc{
  margin:4px 0;
  text-wrap:balance;
}
.projects-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:32px;
}
.projects-column h3{
  margin-bottom:12px;
}
@media (max-width: 900px){
  .projects-grid{grid-template-columns:1fr;gap:20px}
}

/* Experience with company logos */
.experience-list{
  gap:28px;
}
.experience-list li{
  display:grid;
  grid-template-columns:40px 1fr;
  column-gap:12px;
  row-gap:0;
  align-items:start;
}

.experience-list .exp-header{
  display:contents;
}

.experience-list .company-logo{
  grid-column:1;
  grid-row:1 / span 2;
  width:40px;
  height:40px;
  object-fit:contain;
  border-radius:8px;
  border:1px solid var(--border);
  padding:6px;
  background:var(--logo-bg);
  flex-shrink:0;
}

.experience-list .exp-title-group{
  grid-column:2;
  grid-row:1;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:0 16px;
  justify-content:space-between;
  margin-bottom:4px;
}

.experience-list .item-title{
  margin:0;
  line-height:1.3;
}

.experience-list .item-meta{
  margin:0;
  line-height:1.3;
  margin-left:auto;
  text-align:right;
}

.experience-list .item-desc{
  grid-column:2;
  grid-row:2;
  margin:0;
  padding:0;
  line-height:1.45;
}

@media (max-width: 600px){
  .experience-list li{
    grid-template-columns:36px 1fr;
    column-gap:10px;
  }
  .experience-list .company-logo{
    width:36px;
    height:36px;
    padding:4px;
  }
}

/* Awards / Off the Clock - tight layout */
.awards-list li{
  display:grid;
  grid-template-columns:40px 1fr;
  column-gap:12px;
  row-gap:0;
  align-items:start;
}
.awards-list .exp-header{
  display:contents;
}
.awards-list .company-logo{
  grid-column:1;
  grid-row:1 / span 2;
  width:40px;
  height:40px;
  object-fit:contain;
  border-radius:8px;
  border:1px solid var(--border);
  padding:6px;
  background:var(--logo-bg);
  flex-shrink:0;
}
.awards-list .exp-title-group{
  grid-column:2;
  grid-row:1;
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:0 12px;
  margin-bottom:4px;
}
.awards-list .item-title{
  margin:0;
  line-height:1.3;
}
.awards-list .item-meta{
  margin:0;
  line-height:1.3;
}
.awards-list .item-desc{
  grid-column:2;
  grid-row:2;
  margin:0;
  padding:0;
  line-height:1.45;
}

@media (max-width: 600px){
  .awards-list li{
    grid-template-columns:36px 1fr;
    column-gap:10px;
  }
  .awards-list .company-logo{
    width:36px;
    height:36px;
    padding:4px;
  }
}



/* Footer */
.site-footer{
  border-top:1px solid var(--border);
  padding:24px 0;
  background:var(--surface-2);
  margin-top:20px;
}
.footer-inner{
  display:flex;justify-content:space-between;align-items:center;
  flex-wrap:wrap;gap:12px;font-size:.92rem;color:var(--muted);
}
.footer-links{display:flex;gap:16px;flex-wrap:wrap}
.footer-links a{text-decoration:none;color:var(--muted)}
.footer-links a:hover{color:var(--text)}

/* Mobile adjustments */
@media (max-width: 600px){
  .section{padding:22px 0}
  .headshot.round{width:160px;height:160px}
  .hero-title{font-size:32px}
  .hero-subline{display:block;width:100%}
  .hero-subtitle{max-width:100%;white-space:normal}
  .hero-subline .social-text{margin-top:10px}
  .company-logo{width:40px;height:40px}
  .exp-header{gap:10px}
  .item-title{font-size:1rem}
}


/* ===== Publications (minimal, left-thumb / right-details) ===== */

.pub-list {
  display: grid;
  gap: 1rem;
}

.pub-card {
  display: grid;
  grid-template-columns: 160px 1fr;       /* thumb | details */
  gap: 1.25rem;
  align-items: start;
  padding: 0.5rem 0;
  border-bottom: 0.5px solid var(--line);
  background: transparent;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.pub-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.pub-thumb {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--surface-2);
}
.no-logos .pub-thumb{
  background: linear-gradient(135deg, rgba(30,58,138,0.14), rgba(6,182,212,0.10));
  min-height: 96px;
}
.no-logos .pub-thumb::after{
  content:"";
  display:block;
  height:100%;
}

.pub-thumb img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;      /* consistent thumbs */
  object-fit: cover;
  display: block;
  transform: scale(1.001);
}

.pub-body {
  min-width: 0;
}

.pub-title {
  margin: 0 0 .35rem;
  font-size: 1rem;
  line-height: 1.35;
  font-weight: 600;
}

.pub-badge {
  display: inline-block;
  margin-left: .5rem;
  padding: .1rem .45rem;
  font-size: .72rem;
  line-height: 1.2;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border: 1px solid #f3d27a;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  vertical-align: baseline;
}

.pub-meta {
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: .6rem;
}

.pub-venue {
  font-weight: 600;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}

/* Chips (small action buttons) */
.btn-chip {
  display: inline-block;
  font-size: .85rem;
  padding: .36rem .6rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: background .15s ease, border-color .15s ease, transform .02s ease;
}

.btn-chip:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}

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

/* Responsive: stack on small screens */
@media (max-width: 720px) {
  .pub-card {
    grid-template-columns: 1fr;
  }
  .pub-thumb img { aspect-ratio: 16 / 9; }
}

/* === Scroll card wrapper with fades + shadows === */
.scroll-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0;                /* the UL has its own padding */
  overflow: hidden;          /* contain fades */
}

/* the actual scrollable area — height is per-section via --scroll-max */
.scroll-card .scroll-body {
  max-height: var(--scroll-max, 320px);
  overflow-y: auto;
  margin: 0;
  list-style: none;
  padding: .25rem 1rem;      /* room for scrollbar */
  scrollbar-gutter: stable;
}

/* Experience: taller panel, and extra top room so the first row's
   right-aligned date clears the "Scroll" pill */
.experience-scroll {
  --scroll-max: 600px;
  --scroll-max-sm: 420px;
}
.experience-scroll .scroll-body {
  padding-top: 2.25rem;
  padding-bottom: .75rem;
}

/* items */
.news-list li {
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
}
.news-list li:last-child { border-bottom: 0; }
.news-date { color: var(--muted); white-space: nowrap; margin-right: .35rem; }

/* Always-visible minimal scrollbar */
.scroll-body { scrollbar-width: thin; scrollbar-color: var(--scrollbar) transparent; }
.scroll-body::-webkit-scrollbar { width: 8px; }
.scroll-body::-webkit-scrollbar-track { background: transparent; }
.scroll-body::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 999px; }
.scroll-body::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-hover); }

/* Top/bottom gradient fades as affordances */
.scroll-card::before,
.scroll-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 22px;
  pointer-events: none;
  transition: opacity .2s ease;
  opacity: 0;                /* hidden when not needed */
}
.scroll-card::before {
  top: 0;
  background: linear-gradient(to bottom, var(--surface), transparent);
  box-shadow: 0 -6px 10px rgba(0,0,0,0.04) inset;
}
.scroll-card::after {
  bottom: 0;
  background: linear-gradient(to top, var(--surface), transparent);
  box-shadow: 0 6px 10px rgba(0,0,0,0.04) inset;
}

/* Show fades when content overflows; hide at edges */
.scroll-card.is-scrollable::before,
.scroll-card.is-scrollable::after { opacity: 1; }
.scroll-card.at-top::before { opacity: 0; }
.scroll-card.at-bottom::after { opacity: 0; }

/* “Scroll” hint */
.scroll-hint {
  position: absolute;
  right: .75rem;
  top: .35rem;
  font-size: .78rem;
  color: var(--muted);
  background: var(--surface-2);
  padding: .15rem .5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  user-select: none;
  transition: opacity .3s ease, transform .3s ease;
  opacity: .95;
}
.prefers-reduced-motion .scroll-hint { transition: none; }

/* fade the hint after first scroll */
.scroll-card.scrolled .scroll-hint {
  opacity: 0;
  transform: translateY(-4px);
}

/* Mobile: shorter panel */
@media (max-width: 720px) {
  .scroll-card .scroll-body { max-height: var(--scroll-max-sm, 240px); }
}


/* ============================================================
   Datasheet theme — fieldset-style panels (title notched into border)
   ============================================================ */
:root{
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --rule:#cdd2da;      /* panel border (a touch stronger than hairline) */
  --stripe:#f6f7f9;    /* subtle zebra tint */
}
:root[data-theme="dark"]{ --rule:#3a3a3d; --stripe:#1c1c1c; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){ --rule:#3a3a3d; --stripe:#1c1c1c; }
}

/* Monospace, uppercase labels (section titles + metadata; prose stays as-is) */
.section h2{
  font-family:var(--mono);
  font-size:.8rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.item-meta,.pub-meta,.pub-venue,.news-date{ font-family:var(--mono); letter-spacing:.01em; }
.pub-meta,.news-date,.item-meta{ font-size:.8rem; }
.projects-column h3{
  font-family:var(--mono); text-transform:uppercase; letter-spacing:.1em;
  font-size:.78rem; color:var(--muted);
}

/* Fieldset-style bordered panels */
#service, #projects, #publications, #experience, #news, #athletics{
  border:1.5px solid var(--rule);
  border-radius:4px;
  background:transparent;
  padding:0;
  margin-top:8px;                 /* room for the legend that straddles the top edge */
}
#service > .container,
#projects > .container,
#publications > .container,
#experience > .container,
#news > .container,
#athletics > .container{
  padding:0 18px 18px;
}
/* The legend: lift the title onto the top border and mask the line behind the text */
#service > .container > h2,
#projects > .container > h2,
#publications > .container > h2,
#experience > .container > h2,
#news > .container > h2,
#athletics > .container > h2{
  display:inline-block;
  margin:0 0 14px 8px;
  transform:translateY(-50%);
  padding:0 8px;
  background:var(--bg);
  color:var(--text);
}
.content #publications, .content #experience{ margin-bottom:22px; }   /* gap between stacked content panels */

/* Old cyan divider not needed — the legend defines the header */
#service .section-divider,
#projects .section-divider,
#publications .section-divider,
#experience .section-divider,
#news .section-divider,
#athletics .section-divider{ display:none; }

/* News scroll-card: drop its own frame; the panel provides it */
#news .scroll-card{ border:0; border-radius:0; background:transparent; }
#news .scroll-card .news-list{ padding-left:0; }

/* Subtle zebra striping (datasheet texture), full-bleed within panel padding */
.experience-list > li:nth-child(odd),
.awards-list > li:nth-child(odd){
  background:var(--stripe);
  margin:0 -18px;
  padding-left:18px;
  padding-right:18px;
}

/* Facts strip — same bordered datasheet look */
.facts{
  margin:18px 0 4px;
  border:1.5px solid var(--rule);
  border-radius:4px;
  overflow:hidden;
  font-family:var(--mono);
  font-size:.8rem;
  background:transparent;
}
.facts .fact{ display:grid; grid-template-columns:92px 1fr; border-bottom:1px solid var(--rule); }
.facts .fact:last-child{ border-bottom:0; }
.facts dt.fact-k{
  margin:0; padding:9px 12px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.1em;
  border-right:1px solid var(--rule); background:var(--stripe);
}
.facts dd.fact-v{ margin:0; padding:9px 12px; color:var(--text); }

/* Athletics — compact PR cards (datasheet style) */
.pr-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.pr-card{
  border:1.5px solid var(--rule);
  border-radius:4px;
  padding:14px 12px;
  background:var(--bg);
  text-align:center;
  font-family:var(--mono);
}
.pr-card .pr-dist{
  margin:0 0 6px; color:var(--muted);
  text-transform:uppercase; letter-spacing:.12em; font-size:.72rem;
}
.pr-card .pr-time{ margin:0; color:var(--accent); font-size:1.6rem; font-weight:700; line-height:1; }
.pr-card .pr-note{ margin:6px 0 0; color:var(--muted); font-size:.68rem; letter-spacing:.04em; }
@media (max-width:480px){ .pr-grid{ grid-template-columns:1fr; } }

/* Athletics — race photo gallery below the timing box (uniform tiles) */
.race-gallery{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.race-shot{ margin:0; }
.race-frame{
  position:relative; width:100%; aspect-ratio:3/4;
  border-radius:4px; overflow:hidden; border:1.5px solid var(--rule);
  background:var(--stripe);
  transition:transform .2s ease, box-shadow .2s ease;
}
.race-frame img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; object-position:center; display:block;
}
.race-shot:hover .race-frame{ transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,0.10); }
@media (max-width:480px){ .race-gallery{ grid-template-columns:repeat(3,1fr); } }

/* Dotted drop-shadow (turbopuffer technique): a tiled-dot layer offset to the
   bottom-right, sitting BEHIND the opaque panel so it only peeks on right+bottom */
:root{ --dots: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Ccircle cx='1' cy='1' r='1' fill='%23000'/%3E%3C/svg%3E"); }

/* panels must be opaque so the dot layer is hidden except at the offset */
#service, #projects, #publications, #experience, #news, #athletics{
  position:relative;
  background:var(--bg);
}
#service::after, #projects::after,
#publications::after, #experience::after, #news::after, #athletics::after{
  content:"";
  position:absolute;
  top:8px; left:8px; right:-8px; bottom:-8px;
  z-index:-1;
  border-radius:4px;
  background-color:var(--rule);
  -webkit-mask:var(--dots) repeat;
  mask:var(--dots) repeat;
}

/* same dotted drop-shadow on the facts strip */
.facts{ position:relative; background:var(--bg); overflow:visible; }
.facts::after{
  content:"";
  position:absolute;
  top:8px; left:8px; right:-8px; bottom:-8px;
  z-index:-1;
  border-radius:4px;
  background-color:var(--rule);
  -webkit-mask:var(--dots) repeat;
  mask:var(--dots) repeat;
}


/* ============================================================
   Header — theme-aware bar with presence (crisp edge + soft lift)
   Light: stays light, separated by a clear border + gentle shadow.
   Dark:  stays dark, separated by a hairline + subtle shadow.
   ============================================================ */
:root{
  --header-bg:rgba(255,255,255,0.80);
  --header-shadow:0 1px 0 rgba(0,0,0,0.04), 0 6px 20px -12px rgba(0,0,0,0.18);
}
:root[data-theme="dark"]{
  --header-bg:rgba(22,22,22,0.78);
  --header-shadow:0 1px 0 rgba(0,0,0,0.6), 0 8px 24px -14px rgba(0,0,0,0.7);
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]):not([data-theme="dark"]){
    --header-bg:rgba(22,22,22,0.78);
    --header-shadow:0 1px 0 rgba(0,0,0,0.6), 0 8px 24px -14px rgba(0,0,0,0.7);
  }
}
.site-header{
  background:var(--header-bg);
  border-bottom:1px solid var(--rule);
  box-shadow:var(--header-shadow);
  backdrop-filter:saturate(180%) blur(12px);
  -webkit-backdrop-filter:saturate(180%) blur(12px);
}

/* Subtle brand gradient keyline under the header (navy -> cyan) */
.site-header{ position:sticky; }
.site-header::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background:linear-gradient(90deg, var(--accent), var(--divider-start));
  opacity:.85;
}
