/* ------------------------------------------------------------------
   hesamalizadeh.com — warm editorial
   Type: Newsreader (serif, variable) + Inter (sans, variable), self-hosted.
   No frameworks, no build step.
------------------------------------------------------------------- */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+2074, U+20AC, U+2122;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/newsreader-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+2074, U+20AC, U+2122;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2013-2014, U+2018-201A,
    U+201C-201E, U+2022, U+2026, U+2039-203A, U+2044, U+2074, U+20AC, U+2122;
}

:root {
  --paper: #fffefa;
  --ink: #2d2924;
  --muted: #736d65;
  --accent: #bf791c;
  --accent-ink: #955817;
  --hairline: #e4ddd4;
  --card: #f5f1e9;

  --measure: 45rem;
  --canvas: 64rem;
  --shell: 76rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* The theme script follows the system preference until a choice is saved. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #231e1a;
  --ink: #f0e7dc;
  --muted: #b6a89a;
  --accent: #c88e3a;
  --accent-ink: #e1aa62;
  --hairline: #483b31;
  --card: #2d261f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --paper: #231e1a;
    --ink: #f0e7dc;
    --muted: #b6a89a;
    --accent: #c88e3a;
    --accent-ink: #e1aa62;
    --hairline: #483b31;
    --card: #2d261f;
  }
}

/* ---------- base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  font-optical-sizing: auto;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

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

a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--hairline);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color 130ms ease;
}

a:hover {
  text-decoration-color: var(--accent-ink);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--paper);
  color: var(--ink);
  padding: 0.6rem 1rem;
  z-index: 10;
}

.skip:focus {
  left: 0;
}

/* ---------- header / footer ---------- */

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  max-width: var(--shell);
  padding-block: 1.15rem;
}

.brand {
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: none;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--accent-ink);
}

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

.site-nav a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent-ink);
  background: var(--card);
}

.site-nav a[aria-current="page"] {
  color: var(--accent-ink);
  background: var(--card);
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 5.5rem;
}

.site-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: var(--shell);
  padding-block: 2.2rem 2.8rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-ink);
}

.footer-links {
  display: flex;
  gap: 1.4rem;
  flex-wrap: wrap;
  margin: 0;
}

.colophon {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/* ---------- typography ---------- */

main {
  padding-top: 1rem;
}

h1 {
  font-size: clamp(2.35rem, 5vw, 3.65rem);
  font-weight: 550;
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 4.25rem 0 1.8rem;
  text-wrap: balance;
}

h1 em,
.lede em {
  font-style: italic;
  color: var(--accent-ink);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.7rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
}

p {
  margin: 0 0 1.15rem;
}

.lede {
  font-size: 1.3rem;
  line-height: 1.6;
}

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin: 3.4rem 0 1rem;
}

.kicker::after {
  content: "";
  display: block;
  width: 2.2rem;
  border-top: 1px solid var(--accent);
  margin-top: 0.55rem;
  opacity: 0.6;
}

section {
  margin-bottom: 4rem;
}

ul,
ol {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 0.55rem;
}

li::marker {
  color: var(--accent);
}

hr {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 3rem 0;
}

small,
.small {
  font-size: 0.86em;
  color: var(--muted);
}

/* ---------- figures ---------- */

figure {
  margin: 2.4rem 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--hairline);
}

figcaption {
  font-family: var(--sans);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 0.65rem;
}

/* ---------- projects ---------- */

.entry {
  margin-bottom: 3.6rem;
}

.entry .meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin: -0.2rem 0 0.9rem;
}

.entry .meta a {
  color: var(--muted);
}

.entry h3 a {
  color: inherit;
  text-decoration: none;
}

.entry h3 a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-ink);
  text-underline-offset: 0.2em;
}

.projects-page {
  max-width: var(--canvas);
}

.projects-intro {
  max-width: 42rem;
  margin-bottom: 3.6rem;
}

.projects-intro h1 {
  margin-bottom: 1rem;
}

.project-label {
  margin: 0 0 0.55rem;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-transform: uppercase;
}

.project-card h3,
.research-card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.45rem;
  line-height: 1.25;
}

.project-card > p:not(.project-label),
.research-card > p:not(.project-label) {
  font-size: 1rem;
  line-height: 1.62;
}

.project-action {
  display: inline-block;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
  text-decoration-color: var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.industry-grid {
  margin-top: 0;
}

.industry-card figure {
  position: relative;
  display: grid;
  place-content: end start;
  overflow: hidden;
  padding: 1.2rem;
  color: #fffdf8;
}

.industry-card figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.6rem;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.project-card h3 a {
  color: inherit;
  text-decoration-color: var(--hairline);
}

.project-card figure {
  margin: 1.4rem 0 1.5rem;
}

.project-card .project-context {
  margin-top: auto;
  color: var(--muted);
  font-style: italic;
}

.project-card > .project-action {
  margin-top: 0.25rem;
}

.research-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
}

.research-card figure {
  aspect-ratio: 4 / 3;
  margin: 0 0 1.15rem;
}

.research-card figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.research-card h3 {
  font-size: 1.2rem;
}

.research-links {
  display: flex;
  gap: 1rem;
  font-family: var(--sans);
  font-size: 0.78rem !important;
}

/* ---------- teaching ---------- */

.teaching-page {
  max-width: var(--canvas);
}

.teaching-intro {
  max-width: 49rem;
  margin-bottom: 3.8rem;
}

.teaching-intro h1 {
  margin-top: 0.7rem;
  margin-bottom: 0;
}

.term-label {
  margin: 4.25rem 0 0;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.semester-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
  align-items: start;
}

.course-card {
  padding: clamp(1.5rem, 3vw, 2rem);
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.course-card-featured {
  background: var(--card);
}

.course-code {
  margin: 0 0 0.45rem;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.course-card h3 {
  margin: 0 0 1rem;
  font-size: 1.65rem;
  line-height: 1.18;
}

.course-card > p:not(.course-code, .course-links),
.course-card li {
  font-size: 1rem;
  line-height: 1.62;
}

.course-focus {
  margin: 1.35rem 0 1.6rem;
  padding-left: 1.1rem;
}

.course-focus li {
  margin-bottom: 0.35rem;
}

.coursebook-callout {
  margin: 1.7rem -0.35rem 1.25rem;
  padding: 1.25rem;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
}

.coursebook-callout .coursebook-label {
  margin: 0 0 0.4rem;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.45;
  text-transform: uppercase;
}

.coursebook-callout h4 {
  margin: 0 0 0.55rem;
  font-size: 1.12rem;
  line-height: 1.3;
}

.coursebook-callout p:not(.coursebook-label) {
  margin-bottom: 0.8rem;
  font-size: 0.94rem;
  line-height: 1.55;
}

.coursebook-link,
.course-links a {
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
}

.coursebook-status {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.course-links {
  margin: 1.35rem 0 0;
}

.teaching-history {
  padding: 1.5rem 0 1.75rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.history-heading {
  margin: 0 0 1.2rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.past-courses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.past-courses li {
  margin: 0;
}

.past-courses span,
.past-courses small {
  display: block;
}

.past-courses span {
  margin-bottom: 0.25rem;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
}

.past-courses small {
  font-size: 0.92rem;
  line-height: 1.5;
}

.teaching-roots {
  margin-top: 3rem;
}

.teaching-roots > p {
  max-width: var(--measure);
}

.teaching-path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.8rem;
}

.teaching-stop {
  padding-left: 1.1rem;
  border-left: 2px solid var(--hairline);
}

.teaching-stop .history-meta {
  margin: 0 0 0.45rem;
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.45;
  text-transform: uppercase;
}

.teaching-stop h4 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
  line-height: 1.3;
}

.teaching-stop > p:not(.history-meta) {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .project-grid,
  .semester-grid {
    grid-template-columns: 1fr;
  }

  .project-feature-visual img {
    max-height: 24rem;
  }

  .research-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teaching-path {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .research-grid {
    grid-template-columns: 1fr;
  }

  .research-card {
    padding-bottom: 1.4rem;
    border-bottom: 1px solid var(--hairline);
  }

  .past-courses {
    grid-template-columns: 1fr;
  }
}

/* ---------- course / list rows ---------- */

.courses {
  list-style: none;
  padding: 0;
}

.courses li {
  margin-bottom: 1.05rem;
  padding-left: 1.3rem;
  border-left: 2px solid var(--hairline);
}

.courses .code {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.courses .code a {
  color: inherit;
  text-decoration: none;
}

.courses .code a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: var(--accent-ink);
  text-underline-offset: 0.25em;
}

.courses .count {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-left: 0.5rem;
}

.courses p {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
  line-height: 1.6;
}

/* ---------- publications ---------- */

.pubs {
  list-style: none;
  padding: 0;
}

.pubs li {
  margin-bottom: 1.15rem;
  padding-left: 1.3rem;
  text-indent: -1.3rem;
  font-size: 1.05rem;
  line-height: 1.6;
}

.pubs .venue {
  font-style: italic;
}

/* ---------- now line (home) ---------- */

.home-page {
  max-width: var(--canvas);
}

.home-page h1 {
  max-width: 19ch;
  font-size: clamp(2.75rem, 5.4vw, 4.35rem);
}

.home-page > p,
.home-page .now {
  max-width: var(--measure);
}

.now {
  border-left: 2px solid var(--accent);
  padding-left: 1.1rem;
  margin: 2.8rem 0;
  font-size: 1.05rem;
  line-height: 1.7;
}

.now .label {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: block;
  margin-bottom: 0.3rem;
}

.home-links {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  margin-top: 2.6rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}

/* ---------- about ---------- */

.about-page {
  max-width: var(--canvas);
}

.about-page > h1,
.about-page > p {
  max-width: var(--measure);
}

@media (min-width: 780px) {
  .about-page > section {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, var(--measure));
    column-gap: 2.5rem;
    align-items: start;
    padding-top: 0.5rem;
    border-top: 1px solid var(--hairline);
  }

  .about-page > section > .kicker {
    grid-column: 1;
    grid-row: 1 / span 20;
    margin-top: 1.7rem;
  }

  .about-page > section > :not(.kicker) {
    grid-column: 2;
  }

  .about-page > section > .kicker + * {
    margin-top: 1.45rem;
  }
}

.home-links a {
  text-decoration: none;
  font-weight: 550;
}

.home-links a .arrow {
  color: var(--accent-ink);
  margin-right: 0.35rem;
}

.home-links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent-ink);
  text-underline-offset: 0.3em;
}

/* ---------- 404 ---------- */

.lost {
  padding-block: 4rem 2rem;
}

/* ---------- small screens ---------- */

@media (max-width: 480px) {
  body {
    font-size: 1.0938rem;
  }

  .header-row {
    flex-direction: column;
    justify-content: center;
    gap: 0.65rem;
    text-align: center;
  }

  h1 {
    margin-top: 2.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- theme control and editorial refinements ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0.45rem 0.65rem;
  background: transparent;
  color: var(--muted);
  font: 500 0.72rem var(--sans);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--accent-ink);
  background: var(--card);
}
.theme-icon {
  width: 0.72rem;
  height: 0.72rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-shadow: inset -0.2rem -0.1rem 0 0 currentColor;
}
:root[data-theme="dark"] .theme-icon {
  box-shadow: none;
  background: currentColor;
}
.now {
  background: linear-gradient(90deg, var(--card), transparent 88%);
  padding-block: 0.75rem;
}
.entry + .entry {
  border-top: 1px solid var(--hairline);
  padding-top: 0.25rem;
}
@media (max-width: 480px) {
  .site-nav { gap: 0; }
  .site-nav a { padding-inline: 0.45rem; }
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

  .site-footer .footer-row {
    display: block;
  }

  .footer-links {
    margin-bottom: 0.7rem;
  }
}

/* An open editorial layout, with a classroom note alongside the introduction. */
:root { --canvas: 76rem; --hairline: #e4ddd4; }
.header-row { padding-block: 1.4rem; }
.brand { letter-spacing: -0.035em; font-size: 1.05rem; }
.site-nav a, .theme-toggle { font-size: .875rem; min-height: 44px; display: inline-flex; align-items: center; }
.theme-toggle[hidden] { display: none; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(17rem, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-block: 4.5rem 4rem; margin: 0; }
.eyebrow { font: 600 .75rem/1.6 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 1.4rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hero-description { max-width: 38rem; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.5; margin-bottom: 1.5rem; }
.home-profile { float: right; width: min(100%, 9rem); margin: 0 0 1.5rem 2rem; }
.home-profile img { display: block; width: 100%; height: auto; aspect-ratio: 9 / 11; object-fit: cover; object-position: center 35%; }
.intro-opening { display: block; font-size: clamp(2.6rem, 4.3vw, 3.65rem); line-height: 1.13; letter-spacing: -.035em; margin-bottom: 1.8rem; text-wrap: pretty; }
.intro-accent { color: var(--accent-ink); font-style: italic; }
.hero-background { max-width: 35rem; font-size: 1.125rem; line-height: 1.65; color: var(--muted); }
.hero-actions { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-top: 2rem; }
.button-link, .text-link { font: 600 .875rem/1.5 var(--sans); }
.button-link { display: inline-flex; align-items: center; gap: 1.8rem; background: var(--ink); color: var(--paper); text-decoration: none; padding: .95rem 1.1rem; border: 1px solid var(--ink); }
.button-link:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.text-link { text-decoration: none; display: inline-block; padding-block: .65rem; }
.text-link:hover { text-decoration: underline; }
.semester-note { color: var(--ink); border-top: 3px solid var(--accent); padding: 2rem; background: var(--card); margin-top: .4rem; }
.semester-note a:focus-visible { outline-color: var(--accent); }
.semester-note .note-course { transition: padding-left 150ms ease; }
.semester-note .note-course:hover { padding-left: .4rem; }
.semester-note .eyebrow { margin-bottom: .5rem; }
.semester-note h2 { font-size: clamp(3rem, 4.5vw, 4rem); font-weight: 450; letter-spacing: -.035em; margin-block: .8rem .6rem; }
.note-location { font: .8125rem/1.6 var(--sans); color: var(--muted); margin-bottom: 1.4rem; }
.note-course { position: relative; display: block; border-top: 1px solid var(--hairline); padding: 1.2rem 1rem 1.2rem 0; text-decoration: none; color: var(--ink); }
.note-course > span:first-child { display: block; font: 600 .75rem var(--sans); color: var(--accent-ink); margin-bottom: .55rem; }
.note-course strong { display: block; font-size: 1.3rem; font-weight: 550; line-height: 1.2; margin-bottom: .5rem; }
.note-course small { display: block; font-size: 1rem; line-height: 1.45; }
.note-course:hover strong { color: var(--accent-ink); }
.note-arrow { position: absolute; right: 0; top: 1rem; color: var(--accent-ink); }
.note-foot { font: .75rem/1.5 var(--sans); color: var(--muted); border-top: 1px solid var(--hairline); padding-top: 1rem; margin: 0; }
.home-work { border-top: 1px solid var(--ink); padding-top: 2.5rem; margin-top: 1rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.8rem; }
.section-heading .eyebrow { margin-bottom: .7rem; }
.section-heading h2, .home-perspective h2 { font-size: clamp(2rem, 3.6vw, 2.8rem); font-weight: 450; }
.home-tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.tool-feature { padding: 1.8rem 2rem; background: var(--card); border: 1px solid var(--hairline); border-top: 3px solid var(--accent); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; transition: background 150ms ease, border-color 150ms ease; }
.tool-feature:hover { background: var(--paper); border-color: var(--accent); }
.tool-top { display: flex; justify-content: space-between; gap: 1rem; color: var(--accent-ink); }
.tool-top .eyebrow { margin-bottom: 1.8rem; }
.tool-feature h3 { font-size: clamp(2.4rem, 4vw, 3.1rem); font-weight: 450; letter-spacing: -.035em; margin-bottom: .8rem; }
.tool-feature p { font-size: 1.125rem; line-height: 1.5; max-width: 35rem; }
.tool-bottom { margin-top: auto; padding-top: 1.2rem; border-top: 1px solid var(--hairline); font: .75rem/1.6 var(--sans); color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tool-bottom span { color: var(--accent-ink); }
.home-perspective { display: grid; grid-template-columns: 1fr 1.4fr; gap: 4rem; padding-top: 3rem; border-top: 1px solid var(--hairline); margin-bottom: 0; }
.home-perspective .eyebrow { margin-bottom: 1rem; }
.home-perspective p { line-height: 1.65; }
.personal-note { color: var(--muted); font-style: italic; }
.projects-intro { max-width: 49rem; padding-top: 4rem; }
.projects-intro h1 { margin-top: .8rem; }
.teaching-intro .lede { margin-top: 1.5rem; max-width: 41rem; }
.page-eyebrow { margin-top: 4rem; }
.about-page > h1 { margin-top: 1rem; }
.kicker { font-size: .8125rem; }
.project-card { border-radius: 0; background: var(--card); padding: 2rem; }
.project-card h3 { font-size: 2rem; font-weight: 450; }
.course-card { border-radius: 0; }
.course-card-featured { border-top: 3px solid var(--accent); }
.project-label, .course-code, .project-action, .coursebook-link, .course-links a { font-size: .8125rem; }
.research-card h3 { font-size: 1.4rem; }
.research-card h3 a { color: inherit; text-decoration: none; }
.research-card h3 a:hover { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-ink); text-underline-offset: .2em; }
.research-card figure img { border-radius: 0; }
.industry-card figure a { position: absolute; inset: 0; }
.site-footer { margin-top: 5rem; }
@media (max-width: 900px) {
  .home-hero { gap: 2rem; grid-template-columns: 1.3fr 1fr; }
  .semester-note { padding: 1.5rem; transform: none; }
  .hero-actions { gap: .75rem 1.5rem; }
}
@media (max-width: 700px) {
  .home-hero { grid-template-columns: 1fr; padding-block: 3rem; }
  .semester-note { margin-top: .8rem; margin-right: .65rem; }
  .home-tool-grid, .home-perspective { grid-template-columns: 1fr; }
  .home-perspective { gap: 1.5rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .tool-feature { padding: 1.5rem; }
  .projects-intro { padding-top: 2.5rem; }
  .site-footer .footer-row { flex-wrap: wrap; }
}

.experience-companies { padding-top: 1rem; border-top: 1px solid var(--hairline); color: var(--muted); font: .875rem/1.8 var(--sans); }
.experience-companies span { display: block; margin-bottom: .3rem; color: var(--ink); font-weight: 600; }
.publications-heading { margin-top: 1.5rem; font: 600 .875rem/1.5 var(--sans); }

/* Theme experiment: crisp surfaces, blue accents, serif display with sans prose. */
body { font-family: var(--sans); font-size: 1rem; line-height: 1.8; }
h1, h2, h3, h4, .intro-opening { font-family: var(--serif); }
h1 { font-weight: 450; font-size: clamp(3rem, 6vw, 4.8rem); }
.site-header { background: var(--paper); border-bottom: 0; }
.header-row { position: relative; padding-block: 1.6rem; }
.header-row::after { content: ""; position: absolute; bottom: 0; left: var(--gutter); right: var(--gutter); height: 1px; background: var(--hairline); }
.brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; letter-spacing: -.03em; }
.site-nav { gap: .5rem; }
.site-nav a { border-radius: 0; padding-inline: .5rem; border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: transparent; border-bottom-color: var(--accent); }
.home-hero { grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: clamp(2rem, 6vw, 5.5rem); padding-block: 5rem; }
.hero-description { font-family: var(--sans); font-size: 1.125rem; line-height: 1.8; }
.intro-opening { font-size: clamp(3rem, 4.8vw, 4.25rem); line-height: 1.08; letter-spacing: -.035em; margin-bottom: 2rem; }
.hero-background { font-size: 1rem; line-height: 1.8; }
.hero-actions { margin-top: 1.8rem; }
.button-link { border-color: var(--accent-ink); background: var(--accent-ink); color: var(--paper); border-radius: 4px; padding: .85rem 1.1rem; }
.button-link:hover { background: var(--ink); border-color: var(--ink); }
.semester-note { margin-top: .6rem; border: 1px solid var(--hairline); border-top: 3px solid var(--accent); background: var(--card); border-radius: 0 0 8px 8px; padding: 1.8rem; }
.semester-note h2 { font-size: 3.2rem; }
.note-course strong { font-family: var(--serif); font-size: 1.5rem; font-weight: 500; }
.note-course small { font-family: var(--sans); font-size: .875rem; line-height: 1.7; }
.note-location, .note-foot { font-size: .8125rem; }
.note-arrow { transition: transform 180ms ease; }
.note-course:hover .note-arrow { transform: translate(2px, -2px); }
.home-work { padding-top: 2rem; border-top-color: var(--hairline); }
.section-heading h2, .home-perspective h2 { font-size: clamp(2rem, 3.5vw, 2.7rem); }
.home-tool-grid { gap: 2.5rem; }
.tool-feature { background: transparent; border: 0; border-top: 2px solid var(--accent); padding: 1.5rem 0; }
.tool-feature:hover { background: transparent; }
.tool-feature h3 { font-size: 2.75rem; }
.tool-feature:hover h3 { color: var(--accent-ink); }
.tool-feature p { font-size: 1rem; line-height: 1.75; }
.tool-top .eyebrow { margin-bottom: 1.2rem; }
.tool-bottom { font-size: .8125rem; }
.home-perspective { gap: 3rem; }
.home-perspective p { line-height: 1.8; }
.personal-note { font-family: var(--serif); font-size: 1.2rem; }
.lede { font-family: var(--serif); font-size: 1.65rem; line-height: 1.5; }
.kicker::after { display: none; }
.kicker { font-size: .75rem; line-height: 1.6; letter-spacing: .12em; }
.project-card { background: transparent; border: 0; border-top: 2px solid var(--accent); padding: 1.5rem 0; }
.project-grid { gap: 2.5rem; }
.project-card h3 { font-size: 2.5rem; }
.project-card > p:not(.project-label), .research-card > p:not(.project-label) { line-height: 1.75; }
.research-grid { gap: 2rem; }
.research-card figure { overflow: hidden; border-radius: 6px; }
.research-card figure img { transition: transform 300ms ease; }
.research-card:has(a:hover) figure img { transform: scale(1.025); }
.course-card { border-radius: 0 0 8px 8px; }
.course-card-featured { background: var(--card); }
.course-card > p:not(.course-code, .course-links), .course-card li { line-height: 1.75; }
.course-card h3 { font-size: 2rem; }
.pubs li { font-size: .9375rem; line-height: 1.8; margin-bottom: 1.3rem; }
.courses p { font-size: .9375rem; }
.about-page > section { margin-bottom: 3rem; }
.about-page .lede { margin-bottom: 3rem; }
.site-footer { background: var(--card); border-top: 0; }
@media (max-width: 900px) {
  .home-hero { gap: 2rem; grid-template-columns: 1.3fr 1fr; }
  .semester-note { padding: 1.4rem; }
}
@media (max-width: 700px) {
  .home-hero { grid-template-columns: 1fr; padding-block: 3rem; }
  .home-profile { float: none; width: min(100%, 12rem); margin: 0 0 2rem; }
  .home-profile img { aspect-ratio: 3 / 4; object-position: center; }
  .intro-opening { font-size: clamp(2.8rem, 10vw, 4rem); }
  .home-tool-grid, .project-grid { gap: 1.5rem; }
  .semester-note { margin-right: 0; }
}

:root[data-theme="dark"] {
  --hairline: #483b31;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --hairline: #483b31;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 0;
  }

  .theme-label {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
  }

  .project-card h3 a,
  .research-card h3 a,
  .project-action,
  .course-links a,
  .research-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-block: 0.45rem;
  }
}

@media (min-width: 360px) and (max-width: 480px) {
  .intro-accent {
    display: inline-block;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @keyframes page-arrival { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
  main { animation: page-arrival 420ms ease-out both; }
  .button-link, .tool-feature h3 { transition: background 180ms ease, color 180ms ease, border-color 180ms ease; }
}
