/* =========================================================
   Kameel Khabaz — kameelkhabaz.github.io
   Palette: Oxford Manuscript (vellum + Oxford navy + manuscript gold)
   ========================================================= */

/* ---------- Tokens ---------- */

:root {
  /* Spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --s-9: 6rem;

  /* Reading width */
  --measure: 64ch;

  /* Surfaces */
  --bg: #f4efe1;
  --bg-tint: #ebe5d1;
  --bg-deep: #e1dabe;

  /* Ink */
  --fg: #0d1d44;
  --fg-soft: #2a3961;
  --muted: #6b7392;

  /* Rules and accents */
  --rule: #d8cea8;
  --rule-strong: #c2b681;
  --accent: #1e3a8a;
  --accent-gold: #a8853b;
  --accent-gold-soft: #c9a35a;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(13, 29, 68, 0.05);
  --shadow-md: 0 1px 2px rgba(13, 29, 68, 0.06), 0 8px 24px -6px rgba(13, 29, 68, 0.12);
  --shadow-lg: 0 1px 2px rgba(13, 29, 68, 0.08), 0 24px 60px -12px rgba(13, 29, 68, 0.20);

  /* Layout */
  --max: 720px;

  /* Typefaces */
  --serif: ui-serif, "Iowan Old Style", "Charter", "Source Serif 4", Georgia, serif;
  --display: "Fraunces", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1226;
    --bg-tint: #11193a;
    --bg-deep: #182250;
    --fg: #ece6d2;
    --fg-soft: #c5bea4;
    --muted: #8c97b8;
    --rule: #243366;
    --rule-strong: #324782;
    --accent: #8aaaff;
    --accent-gold: #d4b878;
    --accent-gold-soft: #b89858;
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -10px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 32px 80px -16px rgba(0, 0, 0, 0.75);
  }
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html {
  font-size: 17.5px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  accent-color: var(--accent);
  scrollbar-color: var(--rule-strong) var(--bg);
  scrollbar-width: thin;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--rule-strong);
  border: 2px solid var(--bg);
  border-radius: 999px;
  transition: background 200ms ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold-soft); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--serif);
  line-height: 1.65;
  font-feature-settings: "kern", "liga", "onum", "pnum", "calt", "ss01";
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  hyphens: auto;
  -webkit-hyphens: auto;
}

h1, h2, h3 { text-wrap: balance; }
p, dd, li { text-wrap: pretty; }
address { font-style: normal; }

p { margin: 0 0 1.1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent-gold), var(--accent-gold));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 280ms var(--ease), color 220ms ease;
}
a:hover { background-size: 100% 1px; color: var(--accent-gold); }
a:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: 4px;
  border-radius: 2px;
  background-size: 100% 1px;
}

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

/* ---------- Background layers ---------- */

/* Paper-grain noise */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='5'/%3E%3CfeColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.11 0 0 0 0 0.27 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.7;
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) {
  body::before { mix-blend-mode: screen; opacity: 0.45; }
}

/* Two-blob ambient + layered vignette */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 65% at 50% -5%,  rgba(255, 244, 220, 0.45), transparent 70%),
    radial-gradient(ellipse 80% 50% at 80% 100%,  rgba(184, 140, 60, 0.18),  transparent 70%),
    radial-gradient(ellipse 130% 90% at 50% 105%, rgba(13, 29, 68, 0.12),    transparent 70%),
    radial-gradient(ellipse 120% 100% at 50% 50%, transparent 60%, rgba(13, 29, 68, 0.06) 100%);
}
@media (prefers-color-scheme: dark) {
  .ambient::after {
    background:
      radial-gradient(ellipse 100% 65% at 50% -5%,  rgba(168, 133, 59, 0.14), transparent 70%),
      radial-gradient(ellipse 80% 50% at 80% 100%,  rgba(120, 160, 255, 0.10), transparent 70%),
      radial-gradient(ellipse 130% 90% at 50% 105%, rgba(0, 0, 0, 0.50),       transparent 70%),
      radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  }
}

.ambient .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  will-change: transform;
  animation-play-state: paused;
}
html.animated .ambient .blob { animation-play-state: running; }
.ambient .b1 {
  width: 95vmax; height: 95vmax;
  top: -50vmax; left: 50%;
  margin-left: -47.5vmax;
  background: radial-gradient(circle, rgba(184, 140, 60, 0.15) 0%, transparent 60%);
  animation: drift-up 60s ease-in-out infinite alternate;
}
.ambient .b2 {
  width: 90vmax; height: 90vmax;
  bottom: -55vmax; left: 50%;
  margin-left: -45vmax;
  background: radial-gradient(circle, rgba(30, 58, 138, 0.10) 0%, transparent 65%);
  animation: drift-down 78s ease-in-out infinite alternate;
}
@media (prefers-color-scheme: dark) {
  .ambient .b1 { background: radial-gradient(circle, rgba(212, 184, 120, 0.16) 0%, transparent 62%); }
  .ambient .b2 { background: radial-gradient(circle, rgba(120, 160, 255, 0.16) 0%, transparent 65%); }
}
@keyframes drift-up   { to { transform: translate(-4vw,  3vh) scale(1.08); } }
@keyframes drift-down { to { transform: translate( 4vw, -2vh) scale(1.06); } }

/* Floating gold dust */
.dust {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.dust span {
  position: absolute;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 140, 60, 0.95) 0%, rgba(184, 140, 60, 0.45) 35%, rgba(184, 140, 60, 0) 70%);
  box-shadow: 0 0 7px rgba(184, 140, 60, 0.4);
  animation: float-up linear infinite;
  animation-play-state: paused;
  opacity: 0;
}
html.animated .dust span { animation-play-state: running; }
@media (prefers-color-scheme: dark) {
  .dust span {
    background: radial-gradient(circle, rgba(255, 220, 150, 0.95) 0%, rgba(220, 180, 110, 0.5) 35%, transparent 70%);
    box-shadow: 0 0 9px rgba(255, 220, 150, 0.4);
  }
}
.dust span:nth-child(1)  { left:  3%; bottom: -10px; animation-duration: 38s; animation-delay:   0s; width: 6px; height: 6px; }
.dust span:nth-child(2)  { left:  9%; bottom: -10px; animation-duration: 52s; animation-delay:  -8s; }
.dust span:nth-child(3)  { left: 15%; bottom: -10px; animation-duration: 45s; animation-delay: -22s; width: 4px; height: 4px; }
.dust span:nth-child(4)  { left: 21%; bottom: -10px; animation-duration: 60s; animation-delay: -14s; width: 8px; height: 8px; }
.dust span:nth-child(5)  { left: 27%; bottom: -10px; animation-duration: 42s; animation-delay: -30s; width: 7px; height: 7px; }
.dust span:nth-child(6)  { left: 33%; bottom: -10px; animation-duration: 55s; animation-delay:  -5s; }
.dust span:nth-child(7)  { left: 39%; bottom: -10px; animation-duration: 48s; animation-delay: -18s; width: 4px; height: 4px; }
.dust span:nth-child(8)  { left: 45%; bottom: -10px; animation-duration: 65s; animation-delay: -25s; width: 7px; height: 7px; }
.dust span:nth-child(9)  { left: 51%; bottom: -10px; animation-duration: 40s; animation-delay: -10s; width: 6px; height: 6px; }
.dust span:nth-child(10) { left: 57%; bottom: -10px; animation-duration: 58s; animation-delay: -35s; }
.dust span:nth-child(11) { left: 63%; bottom: -10px; animation-duration: 50s; animation-delay:  -2s; width: 4px; height: 4px; }
.dust span:nth-child(12) { left: 69%; bottom: -10px; animation-duration: 44s; animation-delay: -19s; width: 8px; height: 8px; }
.dust span:nth-child(13) { left: 75%; bottom: -10px; animation-duration: 36s; animation-delay: -28s; width: 5px; height: 5px; }
.dust span:nth-child(14) { left: 81%; bottom: -10px; animation-duration: 62s; animation-delay: -12s; width: 7px; height: 7px; }
.dust span:nth-child(15) { left: 87%; bottom: -10px; animation-duration: 47s; animation-delay:  -7s; width: 4px; height: 4px; }
.dust span:nth-child(16) { left: 93%; bottom: -10px; animation-duration: 54s; animation-delay: -33s; }
.dust span:nth-child(17) { left: 18%; bottom: -10px; animation-duration: 70s; animation-delay: -40s; width: 9px; height: 9px; }
.dust span:nth-child(18) { left: 42%; bottom: -10px; animation-duration: 76s; animation-delay: -55s; width: 9px; height: 9px; }
.dust span:nth-child(19) { left: 66%; bottom: -10px; animation-duration: 82s; animation-delay: -20s; width: 9px; height: 9px; }
.dust span:nth-child(20) { left: 88%; bottom: -10px; animation-duration: 68s; animation-delay: -50s; width: 9px; height: 9px; }
.dust span:nth-child(21) { left: 36%; bottom: -10px; animation-duration: 90s; animation-delay: -45s; width:10px; height:10px; }
.dust span:nth-child(22) { left: 78%; bottom: -10px; animation-duration: 95s; animation-delay: -60s; width:10px; height:10px; }

@keyframes float-up {
  0%   { transform: translate(0, 0); opacity: 0; }
  10%  { opacity: 0.95; }
  50%  { transform: translate(30px, -50vh); opacity: 0.75; }
  92%  { opacity: 0.5; }
  100% { transform: translate(-20px, -110vh); opacity: 0; }
}

/* ---------- Layout ---------- */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}
main { padding: 6.5rem 0 7rem; counter-reset: section; }

section { margin-bottom: var(--s-9); scroll-margin-top: 3rem; }
section > p,
section > ul.cv,
section > ol.pubs,
section > dl,
section > address { max-width: var(--measure); }
section > p { line-height: 1.7; }

/* ---------- Sticky table of contents ---------- */

.toc {
  position: fixed;
  top: 50%;
  left: max(2rem, calc(50vw - var(--max)/2 - 12.5rem));
  transform: translateY(-50%);
  z-index: 5;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  display: none;
}
@media (min-width: 1120px) { .toc { display: block; } }
.toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  counter-reset: toc;
}
.toc li { counter-increment: toc; }
.toc a {
  color: var(--muted);
  display: inline-flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.15rem 0;
  background-image: none;
  transition: color 220ms ease;
}
.toc a::before {
  content: counter(toc, upper-roman);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.82rem;
  width: 1.7rem;
  text-align: right;
  color: var(--rule-strong);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  transition: color 220ms ease, transform 280ms var(--ease);
}
.toc a:hover { color: var(--fg); }
.toc a:hover::before { color: var(--accent-gold); transform: translateX(-2px); }
.toc a.is-active { color: var(--accent); font-weight: 500; }
.toc a.is-active::before { color: var(--accent-gold); transform: translateX(-2px); }

/* ---------- Reveal-on-scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 800ms var(--ease), transform 800ms var(--ease);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 3.5rem;
  align-items: center;
  margin-bottom: calc(var(--s-9) + var(--s-5));
  position: relative;
}

/* Cinematic staggered entrance */
.hero > div > *,
.hero-photo {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 900ms var(--ease) forwards;
}
.hero .kicker { animation-delay:  80ms; }
.hero h1      { animation-delay: 200ms; }
.hero .lede   { animation-delay: 420ms; }
.hero .links  { animation-delay: 580ms; }
.hero-photo   { animation-delay: 280ms; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

.hero-text { min-width: 0; }

.kicker {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--muted);
  margin: 0 0 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  font-feature-settings: "kern", "tnum";
}
.kicker::before {
  content: "";
  width: 30px;
  height: 1px;
  background: linear-gradient(to right, var(--accent-gold), var(--accent-gold-soft));
  transform-origin: left center;
  animation: rule-grow 1.4s var(--ease) 0.2s both;
}
@keyframes rule-grow {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  margin: 0 0 1.3rem;
  color: var(--fg);
  font-variation-settings: "opsz" 144, "SOFT" 20;
}
.h1-soft {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.42em;
  color: var(--accent-gold);
  font-variation-settings: "opsz" 60, "SOFT" 100;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin-top: 0.85rem;
  max-width: 24em;
}

.lede {
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--fg-soft);
  margin: 0 0 1.9rem;
  max-width: 56ch;
  font-feature-settings: "kern", "liga", "onum", "ss01";
  text-wrap: pretty;
}

.links {
  font-family: var(--sans);
  font-size: 0.86rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  row-gap: 0.5rem;
}
.links a {
  color: var(--fg);
  font-weight: 500;
  position: relative;
  background-image: none;
  padding-bottom: 4px;
}
.links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--rule-strong);
  transform-origin: 0 50%;
  transition: background 200ms ease, transform 240ms var(--ease);
}
.links a:hover { color: var(--accent-gold); }
.links a:hover::after { background: var(--accent-gold); transform: scaleX(1.08); }

/* Hero photo */
.hero-photo {
  margin: 0;
  width: 230px;
  height: 230px;
  padding: 5px;
  border-radius: 50%;
  background: var(--rule);
  position: relative;
  isolation: isolate;
  box-shadow: 0 0 0 1px var(--accent-gold-soft), var(--shadow-lg);
}
.hero-photo::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 133, 59, 0.20) 0%, transparent 65%);
  filter: blur(20px);
  z-index: -1;
}
.hero-photo .photo-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
}
.hero-photo .photo-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 240, 220, 0.18),
    inset 0 -60px 90px -50px rgba(13, 29, 68, 0.28);
  pointer-events: none;
  z-index: 2;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05) contrast(1.02);
  transition: transform 900ms var(--ease);
}
.hero-photo:hover img { transform: scale(1.05); }

/* ---------- Section headings (chapter style) ---------- */

h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 calc(var(--s-6) + 0.25rem);
  display: flex;
  align-items: center;
  gap: 1.1rem;
  counter-increment: section;
  font-feature-settings: "tnum";
}
h2 span { white-space: nowrap; }
h2::before {
  content: counter(section, upper-roman);
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent-gold);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  min-width: 2rem;
  text-align: left;
}
h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right,
    var(--rule-strong) 0%,
    var(--rule-strong) 55%,
    var(--accent-gold-soft) 80%,
    transparent 100%);
}

/* ---------- About: drop cap ---------- */

#about > p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 500;
  font-style: italic;
  float: left;
  font-size: 4.2rem;
  line-height: 1;
  margin: 0.05rem 0 -0.2rem 0;
  padding: 0.18rem 0.55rem 0 0;
  color: var(--accent-gold);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-feature-settings: "ss01";
}

/* ---------- News ---------- */

dl.news {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 2rem;
  margin: 0;
  font-size: 0.97rem;
  max-width: none;
}
dl.news dt {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  padding: 0.95rem 0 0;
  border-top: 1px solid var(--rule);
  font-feature-settings: "tnum";
}
dl.news dt time { color: inherit; }
dl.news dt:first-of-type,
dl.news dd:first-of-type { border-top: none; padding-top: 0; }
dl.news dd {
  margin: 0;
  padding: 0.85rem 0 1.1rem;
  border-top: 1px solid var(--rule);
  color: var(--fg-soft);
  transition: color 200ms ease;
}
dl.news dd em { color: var(--fg); font-style: italic; }
dl.news dd:hover { color: var(--fg); }

/* ---------- Research threads ---------- */

.threads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 720px) {
  .threads { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}

#research.is-visible .threads article {
  animation: card-rise 700ms var(--ease) both;
}
#research.is-visible .threads article:nth-child(1) { animation-delay:  60ms; }
#research.is-visible .threads article:nth-child(2) { animation-delay: 160ms; }
#research.is-visible .threads article:nth-child(3) { animation-delay: 260ms; }
#research.is-visible .threads article:nth-child(4) { animation-delay: 360ms; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.threads article {
  padding: 1.85rem 1.9rem 1.7rem;
  background: var(--bg-tint);
  border-radius: 4px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 380ms var(--ease), box-shadow 380ms ease, background 280ms ease;
}
.threads article::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-gold));
  opacity: 0.7;
  transition: width 380ms var(--ease), opacity 280ms ease;
}
.threads article:hover {
  transform: translateY(-3px);
  background: var(--bg-deep);
  box-shadow: var(--shadow-md);
}
.threads article:hover::before { width: 3px; opacity: 1; }

.thread-mark {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.65rem;
  line-height: 1;
  color: var(--accent-gold-soft);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-feature-settings: "ss01";
  pointer-events: none;
  opacity: 0.5;
  transition: color 320ms ease, opacity 320ms ease, transform 420ms var(--ease);
}
.threads article:hover .thread-mark {
  color: var(--accent-gold);
  opacity: 1;
  transform: translateY(-1px);
}

.thread-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 0.65rem;
  padding: 0.24rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  font-feature-settings: "tnum";
  transition: border-color 280ms ease, color 280ms ease;
}
.threads article:hover .thread-tag {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.threads h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.18rem;
  letter-spacing: -0.012em;
  margin: 0 0 0.55rem;
  padding-right: 1.5rem;
  color: var(--fg);
  font-variation-settings: "opsz" 36, "SOFT" 30;
}
.threads article p {
  font-size: 0.93rem;
  line-height: 1.55;
  margin: 0;
  color: var(--fg-soft);
}

/* ---------- Currently / Projects ---------- */

ol.projects {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: proj;
}
ol.projects li {
  display: grid;
  grid-template-columns: 3.4rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-top: 1px solid var(--rule);
}
ol.projects li:first-child { border-top: none; padding-top: 0.2rem; }
ol.projects li:last-child  { border-bottom: 1px solid var(--rule); }

.proj-num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--accent-gold);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  font-feature-settings: "ss01";
  text-align: right;
  padding-top: 0.05rem;
}
.proj-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.proj-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--fg);
}
.proj-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- Publications ---------- */

.meta {
  font-style: italic;
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

ol.pubs {
  list-style: none;
  padding: 0;
  margin: 0;
}
ol.pubs li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1.6rem;
  padding: 1.3rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.95rem;
  line-height: 1.6;
}
ol.pubs li:last-child { border-bottom: 1px solid var(--rule); }

.pub-year {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  color: var(--accent-gold);
  font-variation-settings: "opsz" 144, "SOFT" 100;
  padding-top: 0.05rem;
}
.pub-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pub-title { color: var(--fg); }
.pub-venue { color: var(--muted); font-size: 0.9rem; }
.pub-venue a {
  display: inline-block;
  vertical-align: 1px;
  margin-left: 0.55rem;
  padding: 0.18rem 0.5rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  background-image: none;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  transition: border-color 220ms ease, color 220ms ease, background 220ms ease, transform 220ms var(--ease);
}
.pub-venue a:hover {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
  color: var(--bg);
  transform: translateY(-1px);
}

/* ---------- CV-style lists ---------- */

ul.cv {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.cv li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 0.8rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.97rem;
}
ul.cv li:first-child { border-top: none; padding-top: 0; }
ul.cv li:last-child  { border-bottom: 1px solid var(--rule); }
.cv-where { color: var(--fg); }
.cv-what {
  font-family: var(--sans);
  font-size: 0.83rem;
  letter-spacing: 0.03em;
  color: var(--muted);
  text-align: right;
}

/* ---------- Asterism divider ---------- */

.asterism {
  text-align: center;
  font-family: var(--display);
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent-gold);
  margin: var(--s-7) 0;
  user-select: none;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  opacity: 0.55;
}

/* ---------- Footer ---------- */

footer {
  margin-top: 5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  font-feature-settings: "tnum";
}
footer p { margin: 0; }
footer time { color: var(--accent-gold); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal.is-visible { opacity: 1; transform: none; transition: none; }
  .ambient .blob,
  .dust span,
  .hero > div > *,
  .hero-photo,
  #research.is-visible .threads article,
  .kicker::before { animation: none; }
  .dust { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  html { font-size: 16.5px; }
  main { padding: 3.5rem 0 4.5rem; }

  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }
  .hero-photo {
    width: 132px;
    height: 132px;
    padding: 4px;
    order: -1;
  }
  .kicker { margin-bottom: 1rem; }

  dl.news { grid-template-columns: 1fr; gap: 0; }
  dl.news dt { padding: 0.85rem 0 0.15rem; border-top: 1px solid var(--rule); }
  dl.news dt:first-of-type { border-top: none; padding-top: 0; }
  dl.news dd { padding: 0 0 0.95rem; border-top: none; }
  dl.news dd:first-of-type { padding-top: 0; }

  ol.pubs li {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    padding: 0.95rem 0;
  }

  ol.projects li {
    grid-template-columns: 2.4rem 1fr;
    gap: 1rem;
  }
  .proj-num { font-size: 1.35rem; }
  .proj-title { font-size: 1rem; }

  ul.cv li { grid-template-columns: 1fr; gap: 0.15rem; }
  .cv-what { text-align: left; }

  #about > p:first-of-type::first-letter {
    font-size: 3rem;
    padding-right: 0.5rem;
  }

  .dust span:nth-child(2n) { display: none; }

  .ambient .blob { filter: blur(80px); }
  .ambient .b1 { width: 130vmax; height: 130vmax; }
  .ambient .b2 { width: 120vmax; height: 120vmax; }
}

@media (max-width: 420px) {
  .page { padding: 0 1.1rem; }
}
