/* Overrides; this file loads after stylesheet.css.
   Flat editorial layout: no card frames, large serif headings, generous
   spacing and ink-coloured dates; links and publication cards keep the base
   styles. */

:root {
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --measure: 44rem;
  --ivory: #FAF9F5;
  --oat: #F0EEE6;
  --warm-line: #E8E6DC;
  --coral: #D97757;
}

body {
  font-size: 17px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

/* Navigation: quieter, hairline only */

.navbar {
  background: rgba(255, 255, 255, 0.92);
}

.nav-container {
  padding-top: 11px;
  padding-bottom: 11px;
}

.logo {
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.nav-links {
  gap: 34px;
}

.nav-links a {
  position: relative;
  display: inline-block;
  padding: 4px 0;
  color: var(--tertiary);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.015em;
  transition: color 0.2s ease;
}

/* Short coral mark centred under the label */
.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 14px;
  height: 2px;
  margin-left: -7px;
  background: var(--coral);
  border-radius: 2px;
  opacity: 0;
  transform: scaleX(0.3);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.nav-links a:hover::after {
  opacity: 0.45;
  transform: scaleX(1);
}

.nav-links a.active {
  color: var(--text);
  font-weight: 500;
}

.nav-links a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

/* Containers lose their frames; sections are separated by space and a rule */

.section,
.hero {
  margin-top: 0;
  padding: 64px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.hero {
  gap: 72px;
  padding-top: 56px;
  border-top: 0;
}

.info-box-grid {
  gap: 56px;
}

.info-box {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.subpage-header {
  padding: 64px 0 16px;
}

.subpage-header h1 {
  font-size: 52px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.subpage-header p {
  margin-top: 0.6rem;
  font-size: 18px;
}

/* Type scale */

.name {
  margin-top: 1.4rem;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
}

.profile-role {
  margin-top: 0.6rem;
}

.section-title {
  margin-bottom: 1.75rem;
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.info-box h2,
.hero-detail h2 {
  margin-bottom: 1.1rem;
  font-size: 26px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.hero-detail {
  margin-top: 2rem;
  padding-top: 2rem;
}

.profile-copy p,
.research-card p,
.talk-main p,
.story-main p {
  max-width: var(--measure);
  font-size: 17px;
  line-height: 1.65;
}

.profile-copy p {
  max-width: none;
  color: var(--text);
}

.compact-list li::marker,
.service-list li::marker,
.publication-list li::marker {
  color: var(--coral);
}

/* Dates: body face, ink colour, tabular figures */

.item-time,
.news-date,
.talk-time,
.story-date,
.brief-date {
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.01em;
}

/* News: plain list, no rail */

.news-scroll-container {
  padding: 0;
  border-left: 0;
}

.news-list {
  gap: 0.75rem;
}

.timeline-item {
  gap: 0.9rem;
  padding-left: 0;
  font-size: 17px;
}

@media (max-width: 768px) {
  /* keep the two affiliations on separate lines instead of running together */
  .profile-org br {
    display: inline;
  }

  .nav-links a::after {
    left: 0;
    margin-left: 0;
  }

  .section,
  .hero {
    padding: 40px 0;
  }

  .name,
  .subpage-header h1 {
    font-size: 38px;
  }

  .section-title {
    font-size: 30px;
  }
}

/* Subpages: a single reading column so dates, rules and text share one edge */

.page:has(.info-box-grid:not(.info-box-grid--split)) {
  max-width: calc(56rem + 64px);
}

.info-box p,
.info-box .research-card p,
.info-box .talk-main p {
  max-width: none;
}

/* Avoid a doubled rule where a list starts right under a heading or section rule */

.section > .project-card:first-child {
  /* the section rule already separates the first project */
  padding-top: 0;
  border-top: 0;
}

.talk-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.talk-item {
  padding: 18px 0;
}

/* Publication list: links sit on their own line, separated by slashes */
.publication-list li {
  margin-bottom: 1.1rem;
}

.pub-links {
  display: block;
  margin-top: 0.3rem;
}

.pub-links span {
  margin: 0 0.45em;
  color: var(--tertiary);
}

/* Keep news icons on the first line when an item wraps */

.timeline-item {
  align-items: start;
}

.news-date,
.news-icon {
  display: inline-flex;
  align-items: center;
  align-self: start;
  height: 1.65em;
}

.news-date {
  font-size: 14px;
  height: calc(17px * 1.65);
}

/* Cap the bio's line length while keeping its rule aligned with the text */

@media (min-width: 769px) {
  .hero {
    grid-template-columns: 300px minmax(0, 50rem);
  }
}

/* Home: Education and Interests as two balanced columns */

.hero-detail {
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px 56px;
}

.hero-detail h2 {
  margin-bottom: 0.9rem;
  font-size: 24px;
}

.hero-detail .item-list {
  gap: 12px;
}

.hero-detail .info-item {
  padding-bottom: 12px;
}

.hero-detail .item-head {
  align-items: baseline;
}

.hero-detail .item-head h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.hero-detail .info-item p {
  margin-top: 2px;
  font-size: 15px;
  line-height: 1.5;
}

.hero-detail .item-time {
  font-size: 14px;
}

.hero-detail .compact-list {
  padding-left: 1.1rem;
}

.hero-detail .compact-list li {
  margin-bottom: 0.7rem;
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

/* Accents taken from the warm palette: ivory bars, oat chips, coral marks */

::selection {
  background: rgba(217, 119, 87, 0.2);
}

.navbar {
  background: rgba(250, 249, 245, 0.94);
  border-bottom-color: var(--warm-line);
}

.section {
  border-top-color: var(--warm-line);
}

.section-title::before,
.subpage-header h1::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  margin-bottom: 18px;
  background: var(--coral);
  border-radius: 2px;
}

.news-icon {
  color: var(--coral);
}

.project-tags span {
  padding: 3px 10px;
  color: var(--muted);
  background: var(--oat);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
}

.publication-media,
.project-media,
.profile-side .image-shell {
  background: var(--ivory);
}

/* About page: no grey text; secondary levels use the ink colour */

.page-about {
  --muted: #141413;
  --tertiary: #141413;
}

/* Talk dates match the talk title's size and first line */
.talk-time {
  font-size: 16px;
  line-height: calc(17px * 1.5);
}

/* Phone layout */

@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .page {
    padding: 0 20px 48px;
  }

  .nav-container {
    padding: 10px 20px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 32px;
  }

  .profile-photo {
    max-width: 200px;
  }

  .name {
    margin-top: 1.1rem;
    font-size: 34px;
  }

  .profile-copy p,
  .research-card p,
  .talk-main p,
  .story-main p,
  .publication-body p,
  .project-body p,
  .timeline-item {
    font-size: 16px;
    line-height: 1.6;
  }

  .hero-detail {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }

  .hero-detail .item-head {
    flex-direction: row;
    justify-content: space-between;
  }

  .section-title {
    margin-bottom: 1.2rem;
    font-size: 28px;
  }

  .section-title::before,
  .subpage-header h1::before {
    margin-bottom: 14px;
  }

  .subpage-header {
    padding: 36px 0 4px;
  }

  .subpage-header h1 {
    font-size: 36px;
  }

  .info-box h2,
  .hero-detail h2 {
    font-size: 22px;
  }

  .info-box-grid {
    gap: 40px;
  }

  /* News: date sits above the text so the sentence gets the full width */
  .timeline-item {
    grid-template-columns: auto 1fr;
    grid-template-areas: "date date" "icon text";
    gap: 0 0.6rem;
  }

  .news-date {
    grid-area: date;
    height: auto;
    font-size: 13px;
  }

  .news-icon {
    grid-area: icon;
  }

  .timeline-item > span:last-child {
    grid-area: text;
  }

  .news-list {
    gap: 1rem;
  }

  .publication-card {
    gap: 14px;
    margin-top: 8px;
    padding: 20px 0;
  }

  .publication-body h3 {
    font-size: 17px;
  }

  .talk-item {
    gap: 2px;
  }

  .nav-links {
    top: 100%;
    gap: 0;
    padding: 6px 0 10px;
    background: var(--ivory);
    border-bottom: 1px solid var(--warm-line);
    border-radius: 0;
    box-shadow: 0 12px 24px -16px rgba(31, 30, 29, 0.18);
  }

  .nav-links li {
    padding: 5px 20px;
  }

  .nav-links a {
    padding: 3px 0;
    font-size: 16px;
  }
}

/* Phone: compact profile header, photo on the left, name and affiliation beside it */

@media (max-width: 768px) {
  .profile-side {
    display: grid;
    grid-template-columns: 116px 1fr;
    grid-template-rows: auto auto auto 1fr;
    column-gap: 18px;
    align-items: start;
    text-align: left;
  }

  .profile-photo {
    grid-row: 1 / span 4;
    max-width: none;
    margin: 0;
  }

  .profile-side .image-shell {
    border-radius: 16px;
  }

  .profile-side .name {
    margin: -4px 0 0.15rem;
    font-size: 30px;
    text-align: left;
  }

  .profile-role {
    margin: 0 0 0.15rem;
    font-size: 14px;
    line-height: 1.35;
  }

  .profile-org {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
  }

  .contact-links {
    justify-content: flex-start;
    gap: 0 0.35rem;
    margin-top: 0.4rem;
    font-size: 13.5px;
    line-height: 1.5;
  }
}

/* Phone menu: a compact card under the menu button instead of a full-width bar */

@media (max-width: 768px) {
  .nav-links {
    top: calc(100% + 6px);
    right: 16px;
    left: auto;
    min-width: 168px;
    padding: 6px;
    background: #FFFFFF;
    border: 1px solid var(--warm-line);
    border-radius: 12px;
    box-shadow: 0 12px 32px -12px rgba(31, 30, 29, 0.22);
  }

  .nav-links li {
    padding: 0;
  }

  .nav-links a {
    display: block;
    padding: 9px 14px;
    border-radius: 8px;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: var(--ivory);
  }

  .nav-links a::after,
  .nav-links a:hover::after {
    display: none;
  }

  .nav-links a.active::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 14px;
    margin: 0 10px -1px -4px;
    background: var(--coral);
    border-radius: 2px;
  }
}

/* Phone refinements: smaller menu card; project text leads, image follows */

@media (max-width: 768px) {
  .nav-links {
    min-width: 136px;
    padding: 4px;
    border-radius: 10px;
  }

  .nav-links a {
    padding: 7px 12px;
    font-size: 14.5px;
    border-radius: 7px;
  }

  .nav-links a.active::before {
    height: 12px;
    margin-right: 8px;
  }

  .project-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .project-body {
    order: 1;
  }

  .project-media {
    order: 2;
    aspect-ratio: 16 / 9 !important;
  }
}

/* Narrow reading width (about 960px, like a classic academic homepage) */

.page,
.nav-container {
  max-width: 960px;
}

.page:has(.info-box-grid:not(.info-box-grid--split)) {
  max-width: 960px;
}

@media (min-width: 769px) {
  .hero {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 48px;
  }

  .hero-detail {
    gap: 24px 40px;
  }

  .publication-card {
    grid-template-columns: minmax(220px, 36%) 1fr;
    gap: 24px;
  }

  .project-card {
    grid-template-columns: minmax(240px, 40%) 1fr;
    gap: 28px;
  }
}

/* Tighter rhythm */

body {
  line-height: 1.58;
}

.profile-copy p,
.research-card p,
.talk-main p,
.story-main p {
  line-height: 1.58;
}

.profile-copy p {
  margin-bottom: 0.55rem;
}

.contact-links {
  gap: 0.2rem 0.45rem;
}

@media (min-width: 769px) {
  .section,
  .hero {
    padding: 40px 0;
  }

  .hero {
    padding-top: 36px;
  }

  .subpage-header {
    padding: 40px 0 8px;
  }

  .subpage-header h1 {
    font-size: 44px;
  }

  .section-title {
    margin-bottom: 1.1rem;
    font-size: 30px;
  }

  .section-title::before,
  .subpage-header h1::before {
    margin-bottom: 12px;
  }

  .info-box-grid {
    gap: 34px;
  }

  .info-box h2,
  .hero-detail h2 {
    margin-bottom: 0.7rem;
    font-size: 23px;
  }

  .hero-detail {
    margin-top: 1.3rem;
    padding-top: 1.3rem;
  }

  .hero-detail .item-list {
    gap: 8px;
  }

  .hero-detail .info-item {
    padding-bottom: 8px;
  }

  .hero-detail .compact-list li {
    margin-bottom: 0.45rem;
  }

  .item-list {
    gap: 8px;
  }

  .info-item {
    padding-bottom: 8px;
  }

  .research-grid {
    gap: 10px;
  }

  .research-card {
    padding-top: 10px;
  }

  .talk-item {
    padding: 12px 0;
  }

  .news-list {
    gap: 0.45rem;
  }

  .publication-card {
    margin-top: 0;
    padding: 16px 0;
  }

  .publication-list li {
    margin-bottom: 0.8rem;
  }

  .name {
    margin-top: 1rem;
    font-size: 40px;
  }
}

@media (min-width: 769px) {
  .hero-detail {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px 32px;
  }

  .hero-detail .item-head h3 {
    font-size: 15px;
  }

  .hero-detail .item-time {
    font-size: 13.5px;
  }
}

/* Tighter line spacing */

body,
.profile-copy p,
.research-card p,
.talk-main p,
.story-main p,
.publication-body p,
.project-body p,
.info-item p,
.timeline-item,
.compact-list li,
.service-list li,
.publication-list li {
  line-height: 1.46;
}

.hero-detail .info-item p {
  line-height: 1.4;
}

.news-date,
.news-icon {
  height: 1.46em;
}

.news-date {
  height: calc(17px * 1.46);
}

.talk-time {
  line-height: calc(17px * 1.4);
}

@media (max-width: 768px) {
  .contact-links {
    gap: 0 0.3rem;
    font-size: 13px;
    white-space: nowrap;
  }
}

/* Work cards: smaller type */

.publication-body h3 {
  margin-bottom: 0.25rem;
  font-size: 15.5px;
  line-height: 1.4;
}

.publication-body p,
.publication-body .publication-meta,
.publication-body .publication-links {
  margin-bottom: 0.3rem;
  font-size: 15px;
  line-height: 1.45;
}

.publication-body .publication-meta {
  font-size: 14px;
}

.publication-note {
  font-size: 12.5px;
}

@media (max-width: 768px) {
  .publication-body h3 {
    font-size: 15.5px;
  }

  .publication-body p {
    font-size: 15px;
  }
}

/* Slightly wider reading width */

.page,
.nav-container,
.page:has(.info-box-grid:not(.info-box-grid--split)) {
  max-width: 1080px;
}

@media (min-width: 769px) {
  .hero {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 56px;
  }
}

/* Work cards: larger type, tighter spacing */

.publication-body h3 {
  margin-bottom: 0.2rem;
  font-size: 17px;
  line-height: 1.35;
}

.publication-body p,
.publication-body .publication-links {
  margin-bottom: 0.2rem;
  font-size: 16px;
  line-height: 1.4;
}

.publication-body .publication-meta {
  margin-bottom: 0.15rem;
  font-size: 15px;
}

@media (min-width: 769px) {
  .publication-card {
    padding: 10px 0;
  }
}

@media (max-width: 768px) {
  .publication-body h3 {
    font-size: 16.5px;
  }

  .publication-body p {
    font-size: 15.5px;
  }

  .publication-card {
    padding: 14px 0;
  }
}

/* Give Interests more room so each item fits on one line */
@media (min-width: 769px) {
  .hero-detail {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px 36px;
  }
}

/* Work cards: authors and summary back to 15px */
.publication-body p,
.publication-body .publication-links {
  font-size: 15px;
  line-height: 1.42;
}

.publication-body .publication-meta {
  font-size: 15px;
}

@media (max-width: 768px) {
  .publication-body p {
    font-size: 15px;
  }
}

/* Project cards: larger title, smaller body */
.project-body h3 {
  margin-bottom: 0.35rem;
  font-size: 20px;
  line-height: 1.3;
}

.project-body p {
  margin-bottom: 0.35rem;
  font-size: 15px;
  line-height: 1.45;
}

.project-body .project-meta {
  margin-bottom: 0.3rem;
  font-size: 13.5px;
}

@media (max-width: 768px) {
  .project-body h3 {
    font-size: 18.5px;
  }

  .project-body p {
    font-size: 15px;
  }
}

/* Wider reading width */
.page,
.nav-container,
.page:has(.info-box-grid:not(.info-box-grid--split)) {
  max-width: 1160px;
}

/* More breathing room between the navigation bar and the profile */
@media (min-width: 769px) {
  .hero {
    padding-top: 60px;
  }
}

/* More space around the slashes between links */
.publication-links span,
.project-links span {
  margin: 0 0.3em;
}
