/* — Custom font: Modernline — */
@font-face {
  font-family: "Modernline";
  src: url("assets/modernline.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Modernline";
  src: url("assets/modernline bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
    /* — Light paper background, dark accent (your palette replaces the orangish tones) — */
    --paper:      #faf7f2;   /* base background — warm white */
    --paper-2:    #f0e9dc;   /* elevated surfaces */
    --ink:        #160d10;   /* primary text — wine-tinted near-black */
    --ink-soft:   #3d2230;   /* secondary text — deep wine instead of brown */
    --muted:      #8a87a8;   /* dates, captions — lavender-gray instead of taupe */
    --rule:       #c4c0d4;   /* subtle borders — lavender-tinted */
    --grid-line:  rgba(140,130,170,0.16); /* notebook grid — lavender-gray */

    --clay:       #8a3a4c;   /* primary accent — bright wine (available for emphasis) */
    --clay-deep:  #5e2231;   /* deeper wine — used everywhere visible */
    --moss:       #254037;   /* secondary accent — your forest green */
    --cover-text: #f6efe4;
    --figure-bg:  #ffffff;
    --figure-ink: #160d10;

    /* Two extra colors from your palette, available if you want to use them later:
       --indigo:  #2D2846;
       --navy:    #1E2B4B;
    */

    /* — Type — */
    --display:    "Playfair Display", Georgia, serif;
    --body:       Times, serif;
    --mono:       "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
    --modernline: "Modernline", "Futura", "Century Gothic", sans-serif;

    --maxw: 980px;

    /* — Hand-drawn fountain-pen divider line (tiled along horizontal rules) — */
    --pen-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='6' viewBox='0 0 160 6'%3E%3Cpath d='M0 3 C 26 1.4 52 4.8 80 3 S 134 1.4 160 3' fill='none' stroke='%23254037' stroke-opacity='0.4' stroke-width='1.05' stroke-linecap='round'/%3E%3C/svg%3E");
    --section-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='6' viewBox='0 0 60 6'%3E%3Cpath d='M0 3 C 12 1.4 24 4.8 36 3 S 54 1.4 60 3' fill='none' stroke='%23254037' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  :root[data-theme="dark"] {
    --paper:      #151216;
    --paper-2:    #211b22;
    --ink:        #f3ece8;
    --ink-soft:   #d8cbd1;
    --muted:      #aaa2bd;
    --rule:       #514758;
    --grid-line:  rgba(185,170,205,0.10);
    --clay:       #d2869a;
    --clay-deep:  #e0a0b1;
    --moss:       #9bcbb4;
    --pen-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='6' viewBox='0 0 160 6'%3E%3Cpath d='M0 3 C 26 1.4 52 4.8 80 3 S 134 1.4 160 3' fill='none' stroke='%239bcbb4' stroke-opacity='0.34' stroke-width='1.05' stroke-linecap='round'/%3E%3C/svg%3E");
    --section-line: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='6' viewBox='0 0 60 6'%3E%3Cpath d='M0 3 C 12 1.4 24 4.8 36 3 S 54 1.4 60 3' fill='none' stroke='%239bcbb4' stroke-width='1.2' stroke-linecap='round'/%3E%3C/svg%3E");
  }

  /* Notebook grid background */
  html, body { background: var(--paper); }
  body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
      linear-gradient(var(--grid-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 1;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    color: var(--ink);
    font-family: var(--body);
    font-size: 18px;
    line-height: 1.6;
    font-feature-settings: "ss01", "ss02", "kern";
  }
  main, header, footer, section { position: relative; z-index: 1; }

  a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); transition: border-color .15s, color .15s; }
  a:hover { color: var(--moss); border-bottom-color: var(--clay-deep); }

  /* — Layout — */
  .wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
  /* Homepage: hide the notebook grid behind the central column, keep it in the margins */
  .wrap.plain-center { position: relative; z-index: 1; background: var(--paper); }
  section {
    padding: 64px 0;
    background-image: var(--pen-line);
    background-repeat: repeat-x;
    background-position: top left;
    background-size: 160px 6px;
  }
  section:first-of-type { background-image: none; }

  /* — Top nav — */
  .topnav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 22px 0;
    background-image: var(--pen-line);
    background-repeat: repeat-x;
    background-position: bottom left;
    background-size: 160px 6px;
  }
  .mark {
    font-family: var(--display);
    font-weight: 600;
    font-size: 20px; letter-spacing: -0.01em;
  }
  .mark .dot { color: var(--clay-deep); }

  /* Home icon (house + flower) */
  .home-icon { display: inline-flex; align-items: center; }
  .home-icon svg { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
  .home-icon:hover svg { transform: scale(1.18); }
  .nav-links { display: flex; flex-wrap: nowrap; justify-content: flex-end; align-items: center; gap: 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em; }
  .nav-links a { border-bottom: none; color: var(--ink-soft); }
  .nav-links a:hover { color: var(--moss); }
  .theme-toggle {
    width: 30px; height: 30px; padding: 0;
    border: 1px solid var(--rule); border-radius: 50%;
    background: var(--paper-2); color: var(--ink);
    font: 17px/1 var(--body); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: color .15s, background-color .15s, border-color .15s, transform .15s;
  }
  .theme-toggle:hover { border-color: currentColor; transform: rotate(8deg); }
  /* Hades II-inspired icons: violet moon magick (light theme), Apollo gold sun (dark theme) */
  .theme-toggle { color: #4b3c7d; }
  [data-theme="dark"] .theme-toggle { color: #f0c062; }
  .theme-toggle svg { display: block; transition: filter .25s, transform .6s ease; }
  .theme-toggle:hover svg { filter: drop-shadow(0 0 3px currentColor); }
  [data-theme="dark"] .theme-toggle:hover svg { transform: rotate(22.5deg); }
  .theme-toggle:focus-visible { outline: 2px solid var(--clay-deep); outline-offset: 3px; }

  [data-theme="dark"] .home-icon [stroke="#254037"] { stroke: var(--moss); }
  [data-theme="dark"] .home-icon [fill="#254037"] { fill: var(--moss); }
  [data-theme="dark"] .home-icon [fill="#8a3a4c"] { fill: var(--clay-deep); }
  [data-theme="dark"] .home-icon [fill="#faf7f2"] { fill: var(--paper); }

  /* — Hero — */
  .hero { padding: 72px 0 56px; }
  .hero-layout {
    display: flex;
    align-items: flex-start;
    gap: 48px;
    flex-wrap: wrap;
  }
  .hero-layout > div { position: relative; z-index: 1; flex: 1; min-width: 280px; }
  .hero-layout > img { flex-shrink: 0; position: relative; z-index: 0; }
  .eyebrow {
    font-family: var(--mono);
    font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--clay-deep);
    margin-bottom: 28px;
  }

  .eyebrow-sub { display: block; margin-top: 4px; }

  h1.name {
    font-family: var(--modernline);
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.25;
    letter-spacing: 0.04em;
    margin: 0 0 24px;
    font-weight: 400;
  }
  h1.name em {
    font-style: normal;
    font-weight: 700;
    color: var(--clay-deep);
  }
  .name-accent { color: var(--clay-deep); }
  .name-line2 { display: block; padding-left: 1.55em; }

  .lede {
    font-family: var(--body);
    font-size: clamp(18px, 2vw, 22px);
    line-height: 1.55;
    color: var(--ink-soft);
    max-width: 520px;
    margin: 0 0 28px;
  }

  .job-status {
    max-width: 58ch;
    margin: -6px 0 26px;
    padding-left: 14px;
    border-left: 2px solid var(--clay-deep);
    color: var(--ink-soft);
    font-size: 16px;
    line-height: 1.55;
  }

  .quick {
    display: flex; flex-wrap: wrap; gap: 10px 14px;
    font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
    color: var(--ink-soft);
  }
  .quick span { display: inline-flex; align-items: center; gap: 8px; }
  .quick .pip { width: 6px; height: 6px; background: var(--moss); display: inline-block; border-radius: 50%; }

  /* — Section heads — */
  h2.section-title {
    font-family: var(--mono);
    font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
    color: var(--moss);
    margin: 0 0 32px;
    font-weight: 500;
  }
  h2.section-title::after {
    content: ""; display: inline-block; width: 60px; height: 6px;
    background-image: var(--section-line);
    background-repeat: no-repeat; background-size: contain;
    vertical-align: middle; margin-left: 14px; opacity: .65;
  }

  /* — About / Currently — */
  .prose p { font-size: 19px; line-height: 1.65; color: var(--ink); margin: 0 0 16px; max-width: 70ch; }
  .prose p em { color: var(--moss); font-style: italic; }

  .currently {
    margin-top: 28px;
    padding: 22px 24px;
    border-left: 2px solid var(--clay-deep);
    background: rgba(138, 58, 76, 0.05);
  }
  .currently h3 {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--moss); margin: 0 0 8px; font-weight: 500;
  }
  .currently p { margin: 4px 0; font-size: 17px; }
  .currently .when { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-right: 10px; }

  /* — Publications — */
  .pub {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 24px;
    padding: 22px 0;
    background-image: var(--pen-line);
    background-repeat: repeat-x;
    background-position: top left;
    background-size: 160px 6px;
  }
  .pub:first-of-type { background-image: none; padding-top: 0; }
  .pub .venue {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
    color: var(--clay-deep); text-transform: uppercase; padding-top: 4px;
  }
  .pub .venue small { display: block; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; }
  .pub .title {
    font-family: var(--body);
    font-weight: 500;
    font-size: 22px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.005em;
  }
  .pub .authors { color: var(--ink-soft); font-size: 16px; margin: 0 0 8px; }
  .pub .authors b { color: var(--ink); font-weight: 600; }
  .pub .links { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
  .pub .links a { border-bottom: none; color: var(--moss); margin-right: 14px; }
  .pub .links a::after { content: " →"; }
  .pub .equal { color: var(--muted); font-size: 12px; font-style: italic; margin-left: 6px; }
  .pub-abstract { color: var(--ink-soft); font-size: 15px; line-height: 1.55; margin: 4px 0 10px; font-style: italic; }
  .pub.has-fig { grid-template-columns: 100px 1fr 170px; }
  .pub-fig-link { display: block; border-bottom: none; align-self: start; }
  .pub-fig-link:hover .pub-fig { border-color: var(--moss); opacity: 0.9; }
  .pub-title-link { color: inherit; border-bottom: none; }
  .pub-title-link:hover { color: var(--moss); }
  .equal-note { margin-top: 16px; font-size: 13px; color: var(--muted); font-style: italic; }
  .pub-fig {
    width: 100%; height: auto; display: block; align-self: start;
    border: 1px solid var(--rule); border-radius: 4px;
    background: var(--figure-bg);
  }

  /* — Hero photo + profile links — */
  .photo-col { display: flex; flex-direction: column; align-items: center; gap: 14px; flex-shrink: 0; position: relative; z-index: 0; }
  /* don't let the generic .hero-layout > div { flex: 1 } stretch the photo column */
  .hero-layout > .photo-col { flex: 0 0 auto; min-width: 0; margin-left: auto; }
  .photo-links {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; max-width: 220px;
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  }
  .photo-links a { border-bottom: none; color: var(--moss); }
  .photo-links a:hover { color: var(--clay-deep); }

  /* — Experience / Teaching: compact list — */
  .stack { display: grid; gap: 18px; }
  .row {
    display: grid; grid-template-columns: 140px 1fr; gap: 24px;
    padding-bottom: 18px;
    background-image: var(--pen-line);
    background-repeat: repeat-x;
    background-position: bottom left;
    background-size: 160px 6px;
  }
  .row:last-child { background-image: none; }
  .row .when { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); padding-top: 4px; }
  .row .what h4 { font-family: var(--display); font-weight: 500; font-size: 19px; margin: 0 0 4px; letter-spacing: -0.005em; }
  .row .what p { margin: 0; color: var(--ink-soft); font-size: 16px; }
  .row .what .where { font-style: italic; color: var(--moss); }

  /* — Beyond the lab: gallery grid — */
  .beyond p.intro { font-size: 19px; color: var(--ink); max-width: 70ch; margin: 0 0 28px; }
  .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .tile {
    aspect-ratio: 1 / 1;
    background: var(--paper-2);
    border: 1px solid var(--rule);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    position: relative; overflow: hidden;
  }
  .tile span { padding: 12px; text-align: center; }
  .tile::after {
    content: ""; position: absolute; inset: 6px;
    border: 1px dashed var(--rule);
    pointer-events: none;
  }
  /* When you add real images, just do: <div class="tile"><img src="..." alt=""></div> */
  .tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .tile img + ::after, .tile:has(img)::after { display: none; }

  .gallery-note {
    padding: 34px 28px;
    border: 1px dashed var(--rule);
    background: var(--paper-2);
    text-align: center;
  }
  .gallery-note p {
    margin: 0;
    color: var(--ink-soft);
    font-family: var(--display);
    font-size: 19px;
    font-style: italic;
  }

  .interests {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 28px;
  }
  .chip {
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 7px 12px; border: 1px solid var(--rule); color: var(--ink-soft);
    background: var(--paper);
  }
  .chip.clay { color: var(--moss); border-color: var(--clay-deep); }

  /* — Contact — */
  .contact-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 32px;
    font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em;
  }
  .contact-grid div small { display: block; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 10px; margin-bottom: 6px; }
  .contact-grid a { color: var(--ink); }

  /* — Footer — */
  footer {
    padding: 40px 0 60px;
    background-image: var(--pen-line);
    background-repeat: repeat-x;
    background-position: top left;
    background-size: 160px 6px;
  }
  footer .row { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 0; padding: 0; grid-template-columns: none; background-image: none; }

  /* — Stagger reveal on load — */
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .hero > * { animation: rise .7s ease both; }
  .hero .eyebrow { animation-delay: .05s; }
  .hero h1.name  { animation-delay: .15s; }
  .hero .lede    { animation-delay: .30s; }
  .hero .quick   { animation-delay: .45s; }

  /* — Responsive — */
  @media (max-width: 720px) {
    .wrap { padding: 0 16px; }
    .pub { grid-template-columns: 1fr; gap: 6px; }
    .pub .venue { padding-top: 0; }
    .pub.has-fig { grid-template-columns: 1fr; }
    .pub-fig { max-width: 260px; }
    .row { grid-template-columns: 1fr; gap: 4px; }
    .row .when { padding-top: 0; }
    .gallery { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr; }
    .nav-links { gap: 7px; font-size: 9.5px; }
    .theme-toggle { width: 28px; height: 28px; font-size: 16px; }
    body { font-size: 17px; }
  }

/* ─────────────────────────────────────────────
   Additions for subpages (beyond.html, cv.html)
   ───────────────────────────────────────────── */

/* Active nav link */
.nav-links a.active { color: var(--clay-deep); }

/* Page header (used on subpages, smaller than hero) */
.page-head { padding: 56px 0 40px; }
.page-head h1 {
  font-family: var(--modernline);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.15;
  letter-spacing: 0.04em;
  margin: 8px 0 16px;
  font-weight: 400;
}
/* For pages whose title is long/technical and needs serif legibility — uses the
   same family as .project-title (Playfair Display) but sized for a page header. */
.page-head h1.serif {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(30px, 4.6vw, 46px);
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.page-head p.lede {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(19px, 2.2vw, 22px);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 0;
}

/* CV page: compact lists */
.cv-section { padding: 36px 0; }

.cv-item {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 24px;
  padding: 14px 0;
  background-image: var(--pen-line);
  background-repeat: repeat-x;
  background-position: top left;
  background-size: 160px 6px;
}
.cv-item:first-of-type { background-image: none; padding-top: 4px; }
.cv-item .when {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  color: var(--muted); padding-top: 4px;
}
.cv-item h4 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px; margin: 0 0 4px; letter-spacing: -0.005em;
}
.cv-item .where { color: var(--moss); font-style: italic; }
.cv-item p { margin: 4px 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }
.cv-item ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 15.5px; line-height: 1.55; }
.cv-item ul li { margin-bottom: 4px; }

/* Skills as labeled rows */
.skill-row {
  display: grid; grid-template-columns: 180px 1fr; gap: 24px;
  padding: 10px 0;
  background-image: var(--pen-line);
  background-repeat: repeat-x;
  background-position: top left;
  background-size: 160px 6px;
}
.skill-row:first-of-type { background-image: none; }
.skill-row .label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--clay-deep); padding-top: 4px;
}
.skill-row .values { color: var(--ink); font-size: 16px; }

/* Print styles for the CV page */
@media print {
  body::before { display: none; }
  .topnav, footer, .print-hide { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  a { color: #000; border-bottom: none; }
  .wrap { max-width: 100%; padding: 0; }
  .wrap.plain-center { background: none; }
  section, .cv-section { padding: 12pt 0; page-break-inside: avoid; }
}

@media (max-width: 720px) {
  .cv-item, .skill-row { grid-template-columns: 1fr; gap: 4px; }
  .cv-item .when, .skill-row .label { padding-top: 0; }
}

/* ─────────────────────────────────────────────
   Projects page
   ───────────────────────────────────────────── */

.projects-group { margin-top: 32px; }
.projects-group:first-of-type { margin-top: 0; }
.projects-group h3.group-title {
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 500;
  margin: 0 0 18px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.project {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.project:hover {
  transform: translateY(-2px);
  border-color: var(--clay-deep);
  box-shadow: 0 12px 28px -18px rgba(64,37,46,0.35);
}

.project-cover {
  aspect-ratio: 16 / 9;
  display: flex; align-items: flex-end; padding: 16px 18px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--cover-text); /* cream on dark cover */
  position: relative;
  overflow: hidden;
}
.project-cover.is-clay  { background: linear-gradient(140deg, #8a3a4c, #5e2231); }
.project-cover.is-moss  { background: linear-gradient(140deg, #254037, #1a2e27); }
.project-cover.is-indigo{ background: linear-gradient(140deg, #2D2846, #1E2B4B); }
.project-cover.is-navy  { background: linear-gradient(140deg, #1E2B4B, #5e2231); }
.project-cover.is-mix   { background: linear-gradient(140deg, #8a3a4c 0%, #2D2846 100%); }
.project-cover.is-mix2  { background: linear-gradient(140deg, #254037 0%, #2D2846 100%); }

.project-cover .badge {
  position: absolute; top: 14px; left: 18px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(246,239,228,0.6);
}

/* Real figure as cover image */
.project-cover img.project-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0;
}
/* White-on-figure scrim so the badge + label stay readable over paper-coloured figures */
.project-cover:has(img.project-img)::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg,
    rgba(20,9,12,0.55) 0%, rgba(20,9,12,0.12) 32%,
    rgba(20,9,12,0.18) 64%, rgba(20,9,12,0.78) 100%);
}
.project-cover .badge, .project-cover > span { position: relative; z-index: 2; }

.project-body { padding: 18px 20px 22px; }
.project-meta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 6px;
}
.project-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 22px; line-height: 1.2; margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.project-desc {
  margin: 0 0 12px;
  color: var(--ink-soft); font-size: 15.5px; line-height: 1.55;
}
.project-links {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  display: flex; flex-wrap: wrap; gap: 14px;
}
.project-links a { border-bottom: none; color: var(--moss); }
.project-links a:hover { color: var(--clay-deep); }
.project-links a::after { content: " →"; }

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.project-tags .tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); padding: 3px 8px;
  border: 1px solid var(--rule); background: var(--paper);
}

@media (max-width: 720px) {
  .projects-grid { grid-template-columns: 1fr; gap: 18px; }
}

/* ─────────────────────────────────────────────
   Thesis page (thesis.html)
   ───────────────────────────────────────────── */

.note {
  margin: 8px 0 0;
  padding: 16px 20px;
  background: var(--paper-2);
  border-left: 2px solid var(--moss);
  font-size: 14px; line-height: 1.55; color: var(--ink-soft);
}
.note b { color: var(--ink); font-weight: 600; }

.envs { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 8px 0 4px; }
.env {
  position: relative; overflow: hidden;
  padding: 22px 22px 18px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.env.one { border-left: 2px solid var(--ink-soft); }
.env.two { border-left: 2px solid var(--moss); }
.env .tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--ink-soft); margin: 0 0 8px;
}
.env.two .tag { color: var(--moss); }
.env h3 {
  font-family: var(--display); font-weight: 500;
  font-size: 19px; margin: 0 0 6px; letter-spacing: -0.005em;
}
.env .role { font-size: 14px; color: var(--ink-soft); margin: 0 0 14px; }
.env .flow {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.85;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule); padding: 10px 14px;
}
.env .flow .hl { color: var(--clay-deep); font-weight: 600; }
.env .micro {
  display: inline-block; margin-top: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-soft);
}
.env.two .micro { color: var(--moss); }

figure { margin: 24px 0; }
figure img {
  width: 100%; height: auto; display: block;
  border: 1px solid var(--rule); background: var(--figure-bg);
}
figcaption {
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  color: var(--muted); margin-top: 10px;
}
figcaption b { color: var(--ink-soft); font-weight: 600; }
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.fig-row figure { margin: 0; }

/* Wraps an <img> so we can overlay an English label band over the original
   figure's Farsi caption strip — same idea as the LaTeX overlayimg{} macro. */
.fig-wrap { position: relative; line-height: 0; }
.fig-wrap img { display: block; }
.fig-wrap .fig-cover {
  position: absolute; left: 1px; right: 1px; bottom: 1px;
  background: var(--figure-bg);
  display: flex; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--figure-ink);
  line-height: 1.2;
}
.fig-wrap .fig-cover span { flex: 1; text-align: center; }

.find { list-style: none; padding: 0; margin: 6px 0 0; }
.find li {
  padding: 16px 0;
  display: grid; grid-template-columns: 28px 1fr; gap: 14px; align-items: start;
  background-image: var(--pen-line);
  background-repeat: repeat-x;
  background-position: top left;
  background-size: 160px 6px;
}
.find li:first-child { background-image: none; padding-top: 6px; }
.find .k {
  font-family: var(--mono); font-size: 13px; color: var(--moss); font-weight: 600;
}
.find b { font-weight: 600; color: var(--ink); }

.thesis-links { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.thesis-links a { border-bottom: none; color: var(--moss); }
.thesis-links a::after { content: " →"; }

@media (max-width: 720px) {
  .envs, .fig-row { grid-template-columns: 1fr; }
}
