/* Editorial refinements for the research-portfolio redesign. */

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1000;
  padding: 9px 12px;
  background: #151918;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
  text-decoration: none;
}

.hero h1 {
  max-width: 980px;
  font-size: clamp(39px, 4.45vw, 60px);
  line-height: 1.09;
}

.hero-subtitle {
  max-width: 780px;
  font-size: 18px;
}

.hero-affiliation {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-portrait {
  width: 170px;
  height: 170px;
  border-radius: 2px;
}

.feature-role,
.fact-label,
.step-number,
.approach-number {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.feature-role { margin: 0 0 9px; }

.feature-meta {
  margin: 20px 0 20px !important;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.research-home-section .research-feature:last-child {
  padding-bottom: 0;
}

.approach-number { margin-bottom: 13px; }

.approach-item {
  border-top-width: 1px;
}

.approach-item h3 {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 520;
}

/* Research overview */
.research-principles-section {
  background: var(--surface-soft);
  padding-top: 58px;
  padding-bottom: 58px;
}

.principle-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr) 32px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.principle-step h2 {
  margin: 6px 0 8px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 520;
  letter-spacing: -0.02em;
}

.principle-step p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.principle-connector {
  color: #9aa7a2;
  font-family: ui-serif, Georgia, serif;
  font-size: 26px;
  text-align: center;
}

.research-index-item {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 62px;
  align-items: center;
  padding: 54px 0;
  border-top: 1px solid var(--line);
}

.research-index-item:first-of-type {
  border-top: 0;
  padding-top: 18px;
}

.research-index-item.reverse .research-index-copy { order: 2; }
.research-index-item.reverse .research-index-figure { order: 1; }

.research-index-copy h3 {
  margin: 0 0 12px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 520;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.research-index-copy > p:not(.feature-role):not(.research-index-lede) {
  max-width: 62ch;
}

.research-index-lede {
  margin: 0 0 16px;
  color: var(--accent);
  font-size: 17px;
  font-weight: 680;
  line-height: 1.48;
}

.research-index-figure {
  margin: 0;
}

.research-index-figure img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e8ebe8;
}

.research-index-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.cross-cutting-section {
  background: var(--surface-soft);
}

.cross-cutting-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
}

.cross-cutting-grid article {
  padding-top: 18px;
  border-top: 1px solid #aebbb6;
}

.cross-cutting-grid h3 {
  margin: 0 0 10px;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 520;
  line-height: 1.3;
}

.cross-cutting-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* Dedicated project pages */
.project-hero {
  padding: 74px 0 50px;
  border-bottom: 1px solid var(--line);
}

.project-hero-inner {
  max-width: 1020px;
}

.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-hero h1 {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: clamp(48px, 6vw, 74px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.project-lede {
  max-width: 820px;
  margin: 22px 0 0;
  color: #38413f;
  font-size: 21px;
  line-height: 1.55;
}

.project-visual-section {
  padding: 50px 0 34px;
}

.project-hero-figure {
  max-width: 1080px;
  margin: 0 auto;
}

.project-hero-figure img {
  display: block;
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e8ebe8;
}

.project-hero-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.project-facts-section {
  padding: 0 0 50px;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-facts > div {
  min-height: 104px;
  padding: 20px 20px 20px 0;
}

.project-facts > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.project-facts strong {
  display: block;
  margin-top: 7px;
  font-size: 14px;
  line-height: 1.45;
}

.project-story-section {
  padding: 68px 0;
  border-top: 1px solid var(--line);
}

.project-story-section.alt-section,
.project-story-section.inference-section {
  background: var(--surface-soft);
}

.story-grid {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 76px;
  align-items: start;
}

.story-rail {
  position: sticky;
  top: 105px;
}

.story-rail h2 {
  margin: 0;
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 520;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.story-copy {
  max-width: 760px;
}

.story-copy p {
  margin: 0 0 20px;
  font-size: 17px;
  line-height: 1.72;
}

.story-copy ul {
  margin: 0;
  padding-left: 21px;
}

.story-copy li { margin: 9px 0; }

.benchmark-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin: 34px 0 4px;
  padding: 22px 0 3px;
  border-top: 1px solid #aebbb6;
}

.benchmark-callout span:not(.benchmark-arrow):not(.benchmark-note) {
  display: grid;
  gap: 4px;
}

.benchmark-callout small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.benchmark-callout strong {
  font-family: ui-serif, Georgia, Cambria, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 520;
  line-height: 1;
}

.benchmark-arrow {
  color: #8b9994;
  font-size: 24px;
}

.benchmark-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
}

.project-outputs-section {
  padding: 72px 0 88px;
  border-top: 1px solid var(--line);
}

.compact-head { margin-bottom: 20px; }

/* Publications and CV polish */
.publication-item {
  max-width: 940px;
}

.pub-authors strong {
  color: var(--text);
  font-weight: 780;
}

.record-link,
.cv-context-links {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.cv-context-links a { font-weight: 720; }

.cv-entry > ul {
  max-width: 900px;
}

.cv-entry li {
  line-height: 1.62;
}

.publications-section .pub-group + .pub-group {
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

.publications-section .pub-group:last-child {
  margin-bottom: 0;
}

/* Print: make the HTML CV useful on paper without recreating the old resume template. */
@media print {
  .site-header,
  .site-footer,
  .cv-toc,
  .hero-links,
  .back-link {
    display: none !important;
  }

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

  .shell {
    width: 100%;
  }

  .cv-shell {
    display: block;
    padding: 0;
  }

  .page-header {
    padding: 0 0 20px;
  }

  .cv-entry,
  .publication-item {
    break-inside: avoid;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 980px) {
  .principle-flow {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .principle-connector { display: none; }

  .research-index-item,
  .story-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .research-index-item.reverse .research-index-copy,
  .research-index-item.reverse .research-index-figure {
    order: initial;
  }

  .story-rail { position: static; }
  .project-facts { grid-template-columns: repeat(2, 1fr); }
  .project-facts > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .project-facts > div:nth-child(4) { border-top: 1px solid var(--line); }
  .cross-cutting-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 680px) {
  .hero h1 { font-size: 38px; }
  .hero-portrait { width: 124px; height: 124px; }
  .project-hero { padding: 52px 0 38px; }
  .project-hero h1 { font-size: 46px; }
  .project-lede { font-size: 18px; }
  .project-visual-section { padding-top: 34px; }
  .project-facts { grid-template-columns: 1fr; }
  .project-facts > div,
  .project-facts > div + div,
  .project-facts > div:nth-child(3),
  .project-facts > div:nth-child(4) {
    min-height: 0;
    padding: 16px 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .project-facts > div:first-child { border-top: 0; }
  .project-story-section { padding: 50px 0; }
  .story-rail h2 { font-size: 27px; }
  .story-copy p { font-size: 16px; }
  .benchmark-callout { grid-template-columns: 1fr; gap: 12px; }
  .benchmark-arrow { transform: rotate(90deg); justify-self: start; }
  .benchmark-note { grid-column: auto; }
  .research-index-copy h3 { font-size: 30px; }
}
