/* ============================================================================
   screen.css — website-only styles. Technical, research-forward academic
   portfolio: near-grayscale palette, clean sans-serif, content over decoration.

   Inherits design tokens from base.css but OVERRIDES the screen palette/type
   under `.website` so the print CV (which loads base.css + print.css) is wholly
   unaffected. One subtle accent only; no paper-grain, no heavy entrance motion.
   ============================================================================ */

/* --- Website-scoped palette + type override ------------------------------ */
.website {
  /* Brand tokens now DERIVE from base.css — change a value there, both
     the website and the CV follow. */
  --w-bg:        var(--paper);
  --w-bg-2:      var(--paper-2);
  --w-ink:       var(--ink);
  --w-ink-soft:  var(--ink-soft);
  --w-ink-faint: var(--ink-faint);
  --w-rule:      var(--rule);
  --w-rule-2:    var(--rule-strong);
  --w-accent:    var(--accent);

  --w-sans:  var(--font-body);
  --w-mono:  var(--font-mono);
  --w-serif: var(--font-serif);

  background: var(--w-bg);
  color: var(--w-ink);
  font-family: var(--w-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.website h1, .website h2, .website h3, .website h4 {
  font-family: var(--w-sans);
  color: var(--w-ink);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.website a { color: var(--w-accent); text-decoration: none; }
.website a:hover { text-decoration: underline; text-underline-offset: 2px; }

.website .meta {
  font-family: var(--w-mono);
  font-size: 0.78rem;
  color: var(--w-ink-faint);
  letter-spacing: 0.01em;
  text-transform: none;
}

/* --- Accessibility helpers ---------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  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: -999px; top: 0;
  background: var(--w-ink); color: #fff;
  padding: 0.5em 1em; z-index: 100; border-radius: 0 0 4px 0;
}
.skip-link:focus { left: 0; }
.website a:focus-visible,
.website button:focus-visible {
  outline: 2px solid var(--w-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Layout shell -------------------------------------------------------- */
.website .wrap { width: min(820px, 92vw); margin-inline: auto; }

/* Anchor-link offset: the top bar is sticky (~3rem), so without this the nav
   jumps land each section header behind it. scroll-padding-top on the scroll
   root nudges every #anchor landing clear of the bar. */
html { scroll-padding-top: 4rem; }

/* --- Header -------------------------------------------------------------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--w-bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--w-rule);
}
.head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 0.75rem 0;
  flex-wrap: wrap;
}
.site-mark {
  font-family: var(--w-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--w-ink);
  letter-spacing: -0.01em;
}
.site-mark:hover { text-decoration: none; }
.site-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-nav a {
  font-family: var(--w-sans);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--w-ink-soft);
}
.site-nav a:hover { color: var(--w-accent); text-decoration: none; }

/* --- Hero / About -------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  align-items: start;
  padding: 2.75rem 0 2.25rem;
  border-bottom: 1px solid var(--w-rule);
}
.hero-photo { margin: 0; }
.hero-photo img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: 6px;
  border: 1px solid var(--w-rule);
}
.hero-name { font-size: 2rem; font-weight: 700; margin: 0 0 0.15rem; }
.hero-title { font-size: 1.05rem; font-weight: 600; color: var(--w-ink-soft); margin: 0 0 0.25rem; }
.hero-spec {
  font-family: var(--w-mono);
  font-size: 0.82rem;
  color: var(--w-accent);
  margin: 0 0 1rem;
  letter-spacing: 0.01em;
}
.hero-summary {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 62ch;
  color: var(--w-ink-soft);
  margin: 0 0 0.75rem;
}
.hero-affil { margin: 0 0 1.1rem; }

/* --- Social icon links --------------------------------------------------- */
.social { list-style: none; display: flex; gap: 0.85rem; margin: 0; padding: 0; }
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid var(--w-rule-2);
  border-radius: 6px;
  color: var(--w-ink-soft);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.social a:hover {
  color: var(--w-accent);
  border-color: var(--w-accent);
  background: var(--w-bg-2);
  text-decoration: none;
}
.social .icon { width: 18px; height: 18px; }

/* --- Sections ------------------------------------------------------------ */
.section { padding: 2.5rem 0; border-bottom: 1px solid var(--w-rule); }
.section:last-of-type { border-bottom: none; }
.section-title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--w-ink-faint);
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--w-ink);
  display: inline-block;
}

/* --- Publications -------------------------------------------------------- */
.pub-year-group { margin-bottom: 1.5rem; }
.pub-year {
  font-family: var(--w-mono);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--w-ink-faint);
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--w-rule);
}
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub-item { padding: 0.6rem 0; }
.pub-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.15rem;
  color: var(--w-ink);
}
.pub-title a { color: var(--w-ink); }
.pub-title a:hover { color: var(--w-accent); }
.pub-tag {
  display: inline-block;
  font-family: var(--w-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--w-ink-faint);
  background: var(--w-bg-2);
  border: 1px solid var(--w-rule-2);
  border-radius: 3px;
  padding: 0.1em 0.5em;
  margin-left: 0.4ch;
  vertical-align: 0.1em;
}
.pub-authors {
  font-size: 0.88rem;
  color: var(--w-ink-soft);
  margin: 0 0 0.1rem;
}
.pub-authors strong { color: var(--w-ink); font-weight: 700; }
.pub-venue { margin: 0; }

/* Inline bracketed links — [PDF] [Code] [arXiv] … */
.bracket {
  font-family: var(--w-mono);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  margin-left: 0.4ch;
}
.bracket:hover { text-decoration: none; }
.icon-ext { margin-left: 0.25ch; vertical-align: -0.1em; }

/* --- Experience ---------------------------------------------------------- */
.org { padding: 1.25rem 0; border-top: 1px solid var(--w-rule); }
.org:first-child { border-top: none; padding-top: 0; }
.org-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.org-id { display: flex; align-items: center; gap: 0.6rem; }
.org-logo { height: 26px; width: auto; display: block; }
.org-name { font-size: 1.1rem; font-weight: 700; }
.org-meta { margin: 0; }
.roles { list-style: none; margin: 0; padding: 0 0 0 1rem; border-left: 2px solid var(--w-rule); }
.role { padding: 0 0 1rem; }
.role:last-child { padding-bottom: 0; }
.role-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.role-title { font-size: 0.98rem; font-weight: 600; }
.role-desc { font-size: 0.92rem; color: var(--w-ink-soft); margin: 0.25rem 0 0; max-width: 68ch; }
.role-note { margin: 0.35rem 0 0; font-style: italic; }

/* --- Education ----------------------------------------------------------- */
.edu-list { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.edu-item {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--w-rule);
}
.edu-item:first-child { border-top: none; padding-top: 0; }
.edu-when { padding-top: 0.2rem; }
.edu-degree { font-size: 1rem; font-weight: 600; }
.edu-inst { font-size: 0.92rem; color: var(--w-ink-soft); margin: 0.15rem 0; }
.edu-grade { color: var(--w-accent); margin: 0.15rem 0; }
.edu-detail { font-size: 0.9rem; color: var(--w-ink-soft); margin: 0.25rem 0 0; max-width: 68ch; }
.edu-links { margin: 0.35rem 0 0; }

.train-list { list-style: none; margin: 0; padding-top: 1rem; border-top: 1px solid var(--w-rule); }
.train-item { display: flex; gap: 1rem; padding: 0.2rem 0; font-size: 0.9rem; }
.train-when { flex: 0 0 3rem; }

/* --- Software & Projects ------------------------------------------------- */
.proj-list { list-style: none; margin: 0; padding: 0; }
.proj-item { padding: 1rem 0; border-top: 1px solid var(--w-rule); }
.proj-item:first-child { border-top: none; padding-top: 0; }
.proj-head { display: flex; align-items: baseline; gap: 0.5ch; flex-wrap: wrap; }
.proj-name { font-size: 1.05rem; font-weight: 700; }
.proj-meta { margin: 0.2rem 0 0.35rem; }
.proj-desc { font-size: 0.92rem; color: var(--w-ink-soft); margin: 0; max-width: 68ch; }

/* --- Footer -------------------------------------------------------------- */
.site-foot { padding: 2.5rem 0; }
.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.foot-name { font-weight: 700; margin: 0; font-size: 0.95rem; }
.foot-note { margin: 0; }

/* --- Motion: subtle, with reduced-motion path --------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .website .section,
  .website .hero {
    animation: fade-in 0.5s ease both;
  }
}
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 720px) {
  /* Header stacks into a taller column here, so anchors need a bigger offset. */
  html { scroll-padding-top: 6rem; }
  .hero { grid-template-columns: 1fr; gap: 1.25rem; }
  .hero-photo img { width: 110px; height: 110px; }
  .edu-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .edu-when { padding-top: 0; }
  .head-inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .site-nav { gap: 0.9rem; }
}
