/* ==========================================================================
   Mar C. Espadafor — marespadafor.github.io
   Palette: white ground, the green of the "she was super productive" drawing,
   and four accent hues that identify the four research areas.
   ========================================================================== */

/* --- Tokens: light ------------------------------------------------------ */
:root {
  --paper:        #FFFFFF;
  --paper-2:      #F7F7F5;
  --surface:      #FFFFFF;
  --ink:          #14170E;
  --ink-2:        #4C513F;
  --ink-3:        #787D69;
  --rule:         #DEDFD5;
  --rule-soft:    #EDEEE6;
  --sage:         #B1D08D;
  --sage-tint:    #EAF3DD;
  --sage-deep:    #3F6B22;
  --cobalt:       #6D28D9;   /* the single accent */
  --cobalt-fg:    #FFFFFF;
  --cobalt-soft:  #F0E9FE;
  --action:       #6D28D9;   /* primary action = the same accent */
  --action-fg:    #FFFFFF;
  --bar:          #EFE7FB;   /* lavender header bar */
  --lilac-tint:   #F5F0FE;
  --ink-panel:    #14170E;
  --panel-fg:     #F4F5EC;
  --panel-bg:     linear-gradient(112deg, #D8E9C0 0%, #E6EEDD 42%, #EDE4FC 100%);
  --panel-ink:    #14170E;
  --panel-ink-2: #4C513F;
  --panel-rule:  rgba(20,23,14,.16);
  --shadow:       0 1px 2px rgba(20,23,14,.05), 0 10px 28px -14px rgba(20,23,14,.22);

  --font-display: "Familjen Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono:    "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --axis:         clamp(1.25rem, 6vw, 8.5rem);
  --gutter:       clamp(1.15rem, 4.5vw, 4rem);
  --measure:      64ch;
  --head-h:       62px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12140D; --paper-2: #191C13; --surface: #1D2016;
    --ink: #EDEFE3; --ink-2: #B7BBA9; --ink-3: #8B907D;
    --rule: #383C2E; --rule-soft: #282C20;
    --sage: #A6C583; --sage-tint: #212B18; --sage-deep: #BCD79C;
    --cobalt: #C4B5FD; --cobalt-fg: #10120A; --cobalt-soft: #241C3B;
    --action: #C4B5FD; --action-fg: #12140D;
    --bar: #1C1630;
    --lilac-tint: #1B1626;
    --panel-bg: linear-gradient(112deg, #1B2614 0%, #1A1D14 45%, #211A31 100%);
    --panel-ink: #EDEFE3; --panel-ink-2: #B7BBA9; --panel-rule: rgba(237,239,227,.18);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.75);
  }
}
:root[data-theme="dark"] {
  --paper: #12140D; --paper-2: #191C13; --surface: #1D2016;
  --ink: #EDEFE3; --ink-2: #B7BBA9; --ink-3: #8B907D;
  --rule: #383C2E; --rule-soft: #282C20;
  --sage: #A6C583; --sage-tint: #212B18; --sage-deep: #BCD79C;
  --cobalt: #C4B5FD; --cobalt-fg: #10120A; --cobalt-soft: #241C3B;
  --action: #C4B5FD; --action-fg: #12140D;
  --bar: #1C1630;
  --lilac-tint: #1B1626;
  --panel-bg: linear-gradient(112deg, #1B2614 0%, #1A1D14 45%, #211A31 100%);
  --panel-ink: #EDEFE3; --panel-ink-2: #B7BBA9; --panel-rule: rgba(237,239,227,.18);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.75);
}

/* --- Per-area accents --------------------------------------------------- */
.area--01, .line--01 { --accent: var(--cobalt); --accent-tint: var(--cobalt-soft); --accent-fg: var(--cobalt-fg); }
.area--02, .line--02 { --accent: var(--cobalt); --accent-tint: var(--cobalt-soft); --accent-fg: var(--cobalt-fg); }
.area--03, .line--03 { --accent: var(--cobalt); --accent-tint: var(--cobalt-soft); --accent-fg: var(--cobalt-fg); }
.area--04, .line--04 { --accent: var(--cobalt); --accent-tint: var(--cobalt-soft); --accent-fg: var(--cobalt-fg); }

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.1rem);
  line-height: 1.62; font-synthesis-weight: none; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.04; letter-spacing: -.022em; text-wrap: balance; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--cobalt); }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 2px; }

.mono { font-family: var(--font-mono); font-size: .672rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 500; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink-panel); color: var(--panel-fg); padding: .7rem 1rem; }
.skip:focus { left: 0; }

.axis { position: relative; }
.axis::before {
  content: ""; position: absolute; left: var(--axis); top: 0; bottom: 0;
  width: 1px; background: var(--rule); pointer-events: none;
}
@media (max-width: 900px) { .axis::before { display: none; } }

/* --- Scroll progress ---------------------------------------------------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.progress i {
  display: block; height: 100%; width: var(--p, 0%);
  background: var(--cobalt);
  background-size: 100vw 100%;
  transition: width .08s linear;
}
@media (prefers-reduced-motion: reduce) { .progress i { transition: none; } }

/* --- Header ------------------------------------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bar) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--cobalt) 14%, transparent);
}
.site-head__in {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--head-h);
  max-width: 1240px; margin-inline: auto; padding-inline: var(--gutter);
}
.site-head__right { display: flex; align-items: center; gap: clamp(.7rem, 1.6vw, 1.5rem); }
.wordmark {
  font-family: var(--font-body); font-style: italic; font-size: 1.28rem;
  font-weight: 400; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
}
.wordmark:hover { color: var(--cobalt); }
.nav { display: flex; align-items: center; gap: clamp(.7rem, 1.6vw, 1.6rem); }
.nav a {
  font-family: var(--font-display); font-size: .855rem; font-weight: 500;
  text-decoration: none; color: var(--ink-2); padding-block: .3rem;
  border-bottom: 1.5px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--action); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--action); }

.langsw { display: flex; align-items: center; gap: .1rem; flex: none; }
.langsw__opt {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .08em;
  text-decoration: none; color: var(--ink-3); padding: .22rem .42rem; border-radius: 3px;
}
.langsw__opt + .langsw__opt { border-left: 1px solid var(--rule); }
.langsw__opt[aria-current="true"] { color: var(--ink); font-weight: 500; }
.langsw__opt[href]:hover { color: var(--cobalt); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: 999px;
  padding: .35rem .8rem; cursor: pointer; font-family: var(--font-display);
  font-size: .78rem; color: var(--ink);
}
@media (max-width: 860px) {
  .nav-toggle { display: block; order: 3; }
  .nav {
    display: none; position: absolute; top: calc(100% + 8px); right: 0; left: auto; min-width: 200px;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--surface); border: 1px solid var(--rule);
    padding: .3rem 1rem; box-shadow: var(--shadow); z-index: 60;
  }
  .nav[data-open="true"] { display: flex; }
  .site-head__in { position: relative; }
  .nav a { width: 100%; padding-block: .75rem; border-bottom: 1px solid var(--rule-soft); }
  .nav a:last-child { border-bottom: none; }
}

/* --- Hero (typographic) ------------------------------------------------- */
.hero { background: var(--panel-bg); padding-top: clamp(2.6rem, 7vw, 5.5rem); }
.hero__in { display: flex; flex-direction: column; justify-content: center; min-height: calc(88svh - var(--head-h)); }
.hero__in { max-width: 1100px; }
.hero__eyebrow { color: var(--cobalt); display: block; margin-bottom: 1.4rem; }
.hero h1 {
  font-size: clamp(2.5rem, .8rem + 6.9vw, 6.4rem);
  letter-spacing: -.04em; line-height: .98;
  max-width: 17ch;
}
.hero h1 em { font-family: var(--font-body); font-style: italic; font-weight: 400; letter-spacing: -.015em; }

.hero__role {
  margin-top: 1.5rem; color: var(--ink-2); font-size: .78rem;
  padding-top: 1.1rem; border-top: 1px solid var(--rule); max-width: 62ch;
}
.hero__cta { margin-top: clamp(2rem, 4vw, 3rem); display: flex; flex-wrap: wrap; gap: .7rem; }

/* Ticker: the vocabulary of the work, moving */
.ticker {
  margin-top: clamp(2.4rem, 6vw, 4rem);
  background: var(--ink-panel); color: color-mix(in srgb, var(--panel-fg) 88%, transparent);
  display: flex; overflow: hidden; user-select: none;
}
.ticker__track {
  display: flex; flex: none; gap: 0; align-items: center;
  padding-block: .85rem;
  animation: ticker 60s linear infinite;
}
.ticker__track span {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .09em;
  text-transform: uppercase; white-space: nowrap; padding-inline: 1.1rem;
  display: inline-flex; align-items: center;
}
.ticker__track span::after {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--cobalt); margin-left: 2.2rem;
}
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; }
  .ticker { overflow-x: auto; }
}

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-size: .88rem; font-weight: 500;
  text-decoration: none; padding: .66rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--ink); color: var(--ink); background: transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid { background: var(--action); border-color: var(--action); color: var(--action-fg); }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* --- About -------------------------------------------------------------- */
.about { padding-block: clamp(3rem, 7vw, 6rem); }
.about__in {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.8rem, 4vw, 3.5rem); align-items: start;
}
.about__text { min-width: 0; }
.about__label { color: var(--ink-3); display: block; margin-bottom: 1.4rem; }
.about__statement {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(1.3rem, .95rem + 1.25vw, 1.85rem);
  line-height: 1.2; letter-spacing: -.024em; text-wrap: pretty;
}
.about__statement strong { font-weight: 700; }
.about__origin { margin-top: 1.2rem; color: var(--ink-2); }
.about__cv {
  margin-top: 1.6rem; color: var(--ink-2);
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem;
}
.cvlink {
  font-family: var(--font-display); font-size: .82rem; font-weight: 500;
  text-decoration: none; color: var(--cobalt);
  border: 1px solid color-mix(in srgb, var(--cobalt) 40%, transparent);
  background: var(--cobalt-soft);
  border-radius: 999px; padding: .38rem .9rem;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.cvlink:hover { background: var(--ink-panel); color: var(--panel-fg); border-color: var(--ink-panel); }
.acards { margin-top: clamp(1.6rem, 3.5vw, 2.4rem); grid-auto-columns: minmax(280px, 1fr); }
.acard {
  display: grid; gap: .7rem; align-content: start;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 22px; padding: clamp(1.1rem, 2.4vw, 1.5rem);
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.acard:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .acard:hover { transform: none; } }
.acard--cta {
  text-decoration: none; background: var(--cobalt-soft);
  border-color: color-mix(in srgb, var(--cobalt) 26%, transparent);
}
.acard--cta:hover { background: var(--ink-panel); border-color: var(--ink-panel); }
.acard--cta:hover .acard__k, .acard--cta:hover p { color: var(--panel-fg); }
.acard__k { color: var(--cobalt); padding-top: .3rem; }
.acard p { color: var(--ink-2); font-size: .96em; }


.acard a, .about__origin a { color: var(--cobalt); text-decoration-color: color-mix(in srgb, var(--cobalt) 40%, transparent); }

.idcard { display: grid; gap: 1.1rem; justify-items: start; }
.idcard__photo {
  width: min(240px, 74%); aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: var(--surface); justify-self: start;
}
.idcard__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.idcard__name { font-size: 1.28rem; font-weight: 600; letter-spacing: -.022em; }
.idcard__name::after { content: ""; display: block; width: 2.4rem; height: 3px; border-radius: 2px; background: var(--action); margin-top: .6rem; }
.idcard__list { display: grid; gap: .05rem; width: 100%; }
.idcard__list li { display: flex; align-items: center; gap: .6rem; padding-block: .3rem; }
.idcard__list svg { width: 15px; height: 15px; fill: var(--cobalt); flex: none; }
.idcard__list span, .idcard__list a {
  font-family: var(--font-display); font-size: .885rem; color: var(--ink-2); text-decoration: none;
}
.idcard__list a { border-bottom: 1px solid color-mix(in srgb, var(--cobalt) 32%, transparent); }
.idcard__list a:hover { color: var(--cobalt); border-bottom-color: var(--cobalt); }

@media (max-width: 700px) {
  .about__in { grid-template-columns: minmax(0, 1fr); }
  .idcard { position: static; }
}

/* --- Framework band ----------------------------------------------------- */
.fw {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding-block: clamp(3rem, 7vw, 5.5rem);
}
.fw__head { max-width: 62ch; }
.fw__label { color: var(--cobalt); display: block; margin-bottom: 1rem; }
:root[data-theme="dark"] .fw__label, :root:not([data-theme="light"]) .fw__label { color: #C4B5FD; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .fw__label { color: #66379B; } }
.fw h2 { font-size: clamp(1.8rem, 1.1rem + 2.6vw, 3.2rem); letter-spacing: -.032em; color: var(--cobalt); }
.fw__lede { margin-top: 1.1rem; color: var(--ink-2); font-size: 1.05em; }
.fw__grid { margin-top: clamp(2rem, 4vw, 3rem); grid-auto-columns: minmax(280px, 1fr); }
.fw__card { border-radius: 22px; }
.fw__card h3 { font-size: 1.06rem; letter-spacing: -.015em; }
.fw__note {
  margin-top: clamp(1.6rem, 3vw, 2.2rem); max-width: 66ch;
  font-style: italic; color: var(--ink-2);
  padding-left: 1rem; border-left: 2px solid var(--cobalt);
}
.fw__thesis {
  margin-top: 1.1rem; max-width: 66ch; color: var(--ink-2); font-size: .95rem;
  padding-left: 1rem; border-left: 2px solid color-mix(in srgb, var(--cobalt) 45%, transparent);
}
.fw__thesis a { color: var(--cobalt); text-decoration-color: color-mix(in srgb, var(--cobalt) 45%, transparent); }
:root[data-theme="dark"] .fw__thesis a { color: #C4B5FD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fw__thesis a { color: #C4B5FD; } }

.spine {
  margin-top: clamp(1.8rem, 3.5vw, 2.6rem);
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
}
.spine li {
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid color-mix(in srgb, var(--cobalt) 40%, transparent); border-radius: 999px;
  padding: .34rem .8rem; background: transparent; color: var(--cobalt);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"])   :root:not([data-theme="light"])   :root:not([data-theme="light"])   :root:not([data-theme="light"]) }
:root[data-theme="dark"] :root[data-theme="dark"] :root[data-theme="dark"] :root[data-theme="dark"] .spine li + li::before { content: "→"; margin-right: .6rem; margin-left: -.3rem; color: var(--ink-3); }
.spine { --x: 0; }

/* --- Numbered research areas -------------------------------------------- */
.areas { border-top: 1px solid var(--rule); }
.area {
  background: var(--paper);
  border-bottom: none;
  display: flex; align-items: stretch;
  min-height: 100svh;
  padding-block: clamp(2.6rem, 6vw, 4.2rem);
  scroll-margin-top: var(--head-h);
}
.area__in { display: flex; flex-direction: column; justify-content: center; gap: clamp(1.3rem, 3vw, 2.2rem); width: 100%; }
.area__top { margin-bottom: auto; }
.area__foot, .area__work:last-child { margin-top: auto; }
.area__top { display: flex; align-items: center; gap: .9rem; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.area__of { color: var(--accent); }
.area__num {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  background: transparent; color: var(--cobalt); border: 1.5px solid var(--cobalt);
  border-radius: 999px; padding: .5rem 1.15rem;
  font-family: var(--font-mono); font-size: 1rem; font-weight: 500; flex: none;
}
.area__mid { max-width: 68ch; }
.area h2 { font-size: clamp(1.9rem, 1rem + 3.4vw, 4rem); letter-spacing: -.036em; color: var(--ink); }
.area__lede { margin-top: 1.1rem; font-size: 1.05em; color: var(--ink-2); max-width: 62ch; }

.blob {
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 14px;
  padding: clamp(1rem, 2.2vw, 1.35rem);
}
.blob h3 {
  font-family: var(--font-mono); font-size: .64rem; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent);
  margin-bottom: .7rem; padding-bottom: .5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.blob li { font-size: .9rem; line-height: 1.48; color: var(--ink-2); padding-block: .4rem; }
.blob li + li { border-top: 1px solid color-mix(in srgb, var(--accent) 16%, transparent); }

.area__work { margin-top: clamp(1.4rem, 3vw, 2.2rem); }
.area__work-label { color: var(--accent); display: block; margin-bottom: .8rem; }
.wcards { grid-auto-columns: minmax(250px, 1fr); }
.wcard {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: clamp(.95rem, 2vw, 1.2rem);
  display: grid; gap: .45rem; align-content: start;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.wcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--ink-panel); background: var(--ink-panel); }
.wcard:hover h4, .wcard:hover h4 a { color: var(--panel-fg); }
.wcard:hover .mono { color: color-mix(in srgb, var(--panel-fg) 62%, transparent); }
@media (prefers-reduced-motion: reduce) { .wcard:hover { transform: none; } }
.wcard h4 {
  font-family: var(--font-display); font-size: .98rem; font-weight: 600;
  line-height: 1.24; letter-spacing: -.014em;
}
.wcard h4 a { text-decoration: none; }
.wcard h4 a::after { content: ""; position: absolute; inset: 0; }
.wcard { position: relative; }
.wcard:hover h4 a { color: var(--accent); }
.wcard .mono { color: var(--ink-3); line-height: 1.5; }

.area__foot {
  display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  column-gap: clamp(1.2rem, 3vw, 2.5rem); align-items: baseline;
  padding-top: 1rem; border-top: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.area__foot .mono { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li {
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 999px; padding: .3rem .7rem; color: var(--ink-2);
}
@media (max-width: 820px) {
  .area { min-height: 0; }
  .area__mid { grid-template-columns: 1fr; }
  .area__body { max-width: none; }
  .area__foot { grid-template-columns: 1fr; gap: .5rem; }
}

/* Discontinuity divider: a hairline that jumps, with a tick at the cutoff */
.area + .area { position: relative; }
.area + .area::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 22px;
  pointer-events: none;
  background:
    linear-gradient(var(--rule), var(--rule)) 0 16px / 50% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 100% 4px / 50% 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 50% 4px / 2px 13px no-repeat;
}

/* --- FORTHCOMING panel -------------------------------------------------- */
.forthcoming {
  margin-top: clamp(1.2rem, 2.5vw, 1.8rem);
  background: var(--panel-bg); border-radius: 22px;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  display: grid; gap: 1rem; align-content: center;
  position: relative; overflow: hidden;
}
.forthcoming::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(85% 130% at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 62%);
  pointer-events: none;
}
.forthcoming > * { position: relative; }
.forthcoming__word {
  font-family: var(--font-mono); font-weight: 500;
  font-size: clamp(1.4rem, .6rem + 3.2vw, 3.1rem);
  letter-spacing: .16em; line-height: 1;
  color: var(--panel-ink); display: flex; flex-wrap: wrap;
}
.forthcoming__word span {
  display: inline-block;
  animation: fcRise .5s cubic-bezier(.2,.8,.3,1) both;
}
.forthcoming__word span:nth-child(n)   { animation-delay: calc(var(--i, 0) * 0ms); }
.forthcoming__word span:nth-child(1)  { animation-delay: 0ms; }
.forthcoming__word span:nth-child(2)  { animation-delay: 40ms; }
.forthcoming__word span:nth-child(3)  { animation-delay: 80ms; }
.forthcoming__word span:nth-child(4)  { animation-delay: 120ms; }
.forthcoming__word span:nth-child(5)  { animation-delay: 160ms; }
.forthcoming__word span:nth-child(6)  { animation-delay: 200ms; }
.forthcoming__word span:nth-child(7)  { animation-delay: 240ms; }
.forthcoming__word span:nth-child(8)  { animation-delay: 280ms; }
.forthcoming__word span:nth-child(9)  { animation-delay: 320ms; }
.forthcoming__word span:nth-child(10) { animation-delay: 360ms; }
.forthcoming__word span:nth-child(11) { animation-delay: 400ms; }
.forthcoming__word span:nth-child(12) { animation-delay: 440ms; }
.forthcoming__word span:nth-child(13) { animation-delay: 480ms; }
@keyframes fcRise { from { opacity: 0; transform: translateY(.45em); } to { opacity: 1; transform: none; } }
.forthcoming__caret {
  display: inline-block; width: .5em; height: .92em; margin-left: .22em;
  background: var(--accent); animation: fcBlink 1.1s steps(1) infinite;
}
@keyframes fcBlink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .forthcoming__word span { animation: none; }
  .forthcoming__caret { animation: none; }
}
.forthcoming__list { display: grid; gap: .1rem; max-width: 62ch; }
.forthcoming__list li {
  color: var(--panel-ink-2);
  font-size: .97em; padding-block: .45rem;
  border-top: 1px solid var(--panel-rule);
  display: flex; gap: .8rem;
}
.forthcoming__list li::before {
  content: "→"; color: var(--accent); font-family: var(--font-mono); font-size: .85em;
}
.forthcoming__cta {
  justify-self: start; margin-top: .3rem;
  font-family: var(--font-display); font-size: .88rem; font-weight: 500;
  color: var(--paper); background: var(--ink); text-decoration: none;
  border-radius: 999px; padding: .6rem 1.15rem;
  transition: background-color .18s ease, color .18s ease;
}
.forthcoming__cta:hover { background: var(--cobalt); color: #fff; }

/* --- Bands -------------------------------------------------------------- */
.band { padding-block: clamp(3rem, 7vw, 5.5rem); }
 }
.band--sage { background: var(--paper-2); border-block: 1px solid var(--rule); }
.band--lines { background: var(--paper-2); border-block: 1px solid var(--rule); }
.band--future { background: var(--paper-2); border-block: 1px solid var(--rule); }
.band--future .band__kicker { color: #66379B; }
:root[data-theme="dark"] .band--future .band__kicker { color: #C4B5FD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .band--future .band__kicker { color: #C4B5FD; } }
.band__head {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 1rem 2rem; margin-bottom: clamp(1.6rem, 3.5vw, 2.6rem);
  padding-bottom: 1rem; border-bottom: 1px solid var(--rule);
}
.band__head h2 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.7rem); letter-spacing: -.03em; color: var(--accent, var(--cobalt)); }
.band__head p { color: var(--ink-2); max-width: 56ch; margin-top: .6rem; }
.band__kicker { color: var(--accent, var(--cobalt)); display: block; margin-bottom: .7rem; }

/* --- Cards -------------------------------------------------------------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: clamp(.9rem, 1.8vw, 1.4rem);
}
.grid--wide { grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); }

.rail {
  min-width: 0;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(272px, 1fr);
  gap: clamp(.9rem, 1.8vw, 1.4rem);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; padding-bottom: .6rem;
  scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
.rail__hint { color: var(--ink-3); margin-top: .5rem; }
@media (min-width: 1000px) { .rail__hint { display: none; } }

.card {
  scroll-margin-top: calc(var(--head-h) + 20px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--sage-deep) 35%, var(--rule)); }
@media (prefers-reduced-motion: reduce) { .card:hover { transform: none; } }
.card__body { padding: 1.2rem 1.25rem 1.35rem; display: flex; flex-direction: column; gap: .62rem; flex: 1; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.card__year { font-family: var(--font-mono); font-size: .7rem; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-left: auto; }
.card h3 { font-size: 1.06rem; line-height: 1.24; letter-spacing: -.015em; font-weight: 600; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-color: var(--sage); }
.card__authors { font-size: .85rem; color: var(--ink-2); }
.card__authors b { font-weight: 600; color: var(--ink); }
.card__venue { font-style: italic; font-size: .875rem; color: var(--ink-2); }
.card__excerpt { font-size: .9rem; color: var(--ink-2); line-height: 1.55; }
.card__metrics { color: var(--ink-3); }
.card__links {
  margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--rule-soft);
  display: flex; flex-wrap: wrap; gap: .9rem;
}
.card__links a { font-family: var(--font-display); font-size: .8rem; font-weight: 500; color: var(--cobalt); text-decoration: none; }
.card__links a:hover { text-decoration: underline; }
.card__links a::after { content: " ↗"; font-size: .85em; }
.card__links a.no-ext::after { content: ""; }

.card details { margin-top: .1rem; }
.card summary {
  cursor: pointer; list-style: none;
  font-family: var(--font-display); font-size: .8rem; font-weight: 500; color: var(--cobalt);
  display: inline-flex; align-items: center; gap: .35rem;
}
.card summary::-webkit-details-marker { display: none; }
.card summary::after { content: "＋"; font-size: .9em; }
.card details[open] summary::after { content: "－"; }
.card details p { margin-top: .65rem; font-size: .89rem; color: var(--ink-2); line-height: 1.55; }

.chip {
  display: inline-block; font-family: var(--font-mono); font-size: .6rem;
  letter-spacing: .1em; text-transform: uppercase; padding: .26rem .55rem;
  border-radius: 3px; border: 1px solid transparent; white-space: nowrap;
}
.chip--edu   { background: var(--cobalt-soft); color: var(--cobalt); border-color: color-mix(in srgb, var(--cobalt) 26%, transparent); }
.chip--work  { background: var(--cobalt-soft); color: var(--cobalt); border-color: color-mix(in srgb, var(--cobalt) 26%, transparent); }
.chip--inst  { background: var(--cobalt-soft); color: var(--cobalt); border-color: color-mix(in srgb, var(--cobalt) 26%, transparent); }
.chip--fore  { background: var(--cobalt-soft); color: var(--cobalt); border-color: color-mix(in srgb, var(--cobalt) 26%, transparent); }
.chip--plain { background: transparent; color: var(--ink-3); border-color: var(--rule); }

.year-head {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .12em;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
  margin: clamp(1.8rem, 3.5vw, 2.8rem) 0 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--rule); text-transform: uppercase;
}
.year-head:first-of-type { margin-top: 0; }

.press { grid-auto-columns: minmax(215px, 1fr); }
.pbub {
  display: grid; gap: .3rem; align-content: center;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 22px; padding: 1.1rem 1.3rem; min-height: 5.5rem;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}
.pbub__name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; letter-spacing: -.014em; }
.pbub__where { color: var(--ink-3); }
a.pbub:hover {
  transform: translateY(-3px); box-shadow: var(--shadow);
  background: var(--ink-panel); border-color: var(--ink-panel);
}
a.pbub:hover .pbub__name { color: var(--panel-fg); }
a.pbub:hover .pbub__where { color: color-mix(in srgb, var(--panel-fg) 62%, transparent); }
a.pbub .pbub__name::after { content: " ↗"; font-size: .8em; color: var(--cobalt); }
a.pbub:hover .pbub__name::after { color: var(--panel-fg); }
.pbub--flat { opacity: .85; }
@media (prefers-reduced-motion: reduce) { a.pbub:hover { transform: none; } }

/* --- Page head ---------------------------------------------------------- */
.page-head {
  background: var(--paper); border-bottom: 1px solid var(--rule);
  padding-block: clamp(2.4rem, 5.5vw, 4.2rem);
}
.page-head h1 { font-size: clamp(2.1rem, 1.2rem + 3.8vw, 3.8rem); letter-spacing: -.036em; }
.page-head h1::after { content: ""; display: block; width: 4.5rem; height: 5px; border-radius: 3px; background: var(--action); margin-top: 1.1rem; }
.page-head p { margin-top: 1rem; max-width: 60ch; color: var(--ink-2); font-size: 1.04em; }
.page-head .mono { color: var(--action); display: block; margin-bottom: .8rem; }

/* --- Thesis block ------------------------------------------------------- */
.thesis { display: grid; grid-template-columns: minmax(0, 32%) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.thesis__fig { margin: 0; }
.thesis__fig img { width: 100%; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); }
.thesis__text { display: grid; gap: 1rem; color: var(--ink-2); max-width: var(--measure); }
.thesis__text strong { color: var(--ink); }
@media (max-width: 760px) { .thesis { grid-template-columns: 1fr; } .thesis__fig { max-width: 340px; } }

.steps { display: grid; gap: .6rem; margin-top: .3rem; }
.steps li { font-size: .93rem; color: var(--ink-2); padding-left: 1.4rem; position: relative; line-height: 1.55; }
.steps li::before { content: "→"; position: absolute; left: 0; color: var(--sage-deep); font-family: var(--font-mono); font-size: .8rem; }
.steps strong { color: var(--ink); }

/* --- Research lines (horizontal) ---------------------------------------- */
.lines {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.4rem); align-items: stretch;
}
.line {
  background: var(--surface); border: 1px solid var(--rule);
  border-top: 5px solid var(--accent); border-radius: 14px;
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  display: flex; flex-direction: column; gap: .7rem;
  scroll-margin-top: calc(var(--head-h) + 20px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.line:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
@media (prefers-reduced-motion: reduce) { .line:hover { transform: none; } }
.line__n { color: var(--accent); }
.line h3 { font-size: 1.16rem; line-height: 1.22; letter-spacing: -.02em; }
.line__lede { color: var(--ink-2); font-size: .92rem; line-height: 1.55; }
.line__tags { margin-top: auto; padding-top: .9rem; display: flex; flex-wrap: wrap; gap: .35rem; }
.line__tags li {
  font-family: var(--font-mono); font-size: .59rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--accent-tint); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px; padding: .28rem .65rem;
}

/* --- Courses ------------------------------------------------------------ */
.course {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: clamp(1.2rem, 3vw, 2rem); display: grid; gap: .8rem;
  scroll-margin-top: calc(var(--head-h) + 20px);
}
.course + .course { margin-top: 1.2rem; }
.course h2 { font-size: clamp(1.25rem, 1rem + 1.1vw, 1.8rem); letter-spacing: -.024em; }
.course__where { color: var(--ink-3); }
.course__body { color: var(--ink-2); max-width: 66ch; }
.course .card__links { border-top: 1px solid var(--rule-soft); padding-top: .85rem; margin-top: .2rem; }

/* --- CV ----------------------------------------------------------------- */
.cv { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.cv__block { max-width: 900px; }
.tl { display: grid; }
.tl__item {
  display: grid; grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr);
  gap: .4rem 1.5rem; padding-block: .85rem;
  border-bottom: 1px solid var(--rule-soft);
}
.tl__item:last-child { border-bottom: none; }
.tl__when { color: var(--accent, var(--sage-deep)); padding-top: .28rem; white-space: nowrap; }
.tl__what { display: grid; gap: .12rem; }
.tl__what strong { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; letter-spacing: -.014em; }
.tl__where { color: var(--ink-2); font-size: .93rem; }
@media (max-width: 620px) { .tl__item { grid-template-columns: 1fr; } }

.skills { display: flex; flex-wrap: wrap; gap: .5rem; }
.skills li {
  display: inline-flex; align-items: baseline; gap: .5rem;
  border: 1px solid var(--rule); border-radius: 999px; padding: .4rem .95rem;
  background: var(--surface);
}
.skills b { font-family: var(--font-display); font-size: .88rem; }
.skills span { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }

/* --- Signoff ------------------------------------------------------------ */
.signoff { padding-block: clamp(2.6rem, 6vw, 4.5rem); background: var(--paper); }
.signoff figure { margin: 0 auto; max-width: 780px; }
.signoff img { border-radius: 8px; border: 1px solid var(--rule); }
.signoff figcaption {
  margin-top: 1rem; color: var(--ink-3); font-size: .95rem;
  font-style: italic; text-align: center; max-width: 52ch; margin-inline: auto;
}

/* --- Footer ------------------------------------------------------------- */
.site-foot {
  background: var(--panel-bg); color: var(--panel-ink-2);
  padding-block: clamp(3rem, 7vw, 5.5rem); position: relative; overflow: hidden;
}
.site-foot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(75% 120% at 100% 0%, color-mix(in srgb, var(--cobalt) 14%, transparent) 0%, transparent 60%);
}
.site-foot .wrap { position: relative; }
.site-foot__kicker { color: var(--cobalt); display: block; margin-bottom: 1.1rem; }
.site-foot h2 {
  font-size: clamp(1.9rem, 1rem + 3.4vw, 3.6rem); letter-spacing: -.036em;
  color: var(--panel-ink); max-width: 18ch;
}
.site-foot__mail {
  display: inline-block; margin-top: 1.8rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.05rem, .8rem + .9vw, 1.6rem);
  color: var(--panel-ink); text-decoration: none;
  border-bottom: 2px solid var(--cobalt);
  padding-bottom: .1rem;
}
.site-foot__mail:hover { color: var(--cobalt); }
.site-foot__joke {
  margin-top: .9rem; font-style: italic;
  color: color-mix(in srgb, var(--panel-fg) 55%, transparent); font-size: .95rem;
}
.site-foot__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.9rem; }
.site-foot__links a {
  font-family: var(--font-display); font-size: .84rem; text-decoration: none;
  color: var(--panel-ink);
  border: 1px solid var(--panel-rule);
  border-radius: 999px; padding: .38rem .9rem;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.site-foot__links a:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.site-foot__bottom {
  margin-top: clamp(2.4rem, 5vw, 3.6rem); padding-top: 1.1rem;
  border-top: 1px solid var(--panel-rule);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem;
  font-size: .8rem; color: var(--panel-ink-2);
}

/* --- Reveal ------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
