/* =============================================================================
   site.css — the portfolio's design system
   -----------------------------------------------------------------------------
   One idea: black ink on white paper. No shadows, no rounded bubbles —
   hairlines, tight display type, monospaced labels instead. The single
   exception is --accent, a signal-red trace reserved for live elements.

   Everything is a token, so flipping data-theme="dark" on <html> turns the
   whole site into white ink on black paper.

   Parts:
     1. tokens + base
     2. the system (.wrap, .section, .card, .chip, .btn, .tl, .marquee, ...)
     3. interactions (reveal, filters, progress, toast, modal)
     4. compatibility layer — the pages still carry Tailwind colour utilities
        from the previous design, and these rules re-point every one of them
        at the tokens so old and new markup render identically.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------------------------------------------------------------- 1. tokens */
:root {
    --paper: #ffffff;
    --paper-2: #f4f4f4;
    --paper-a: rgba(255, 255, 255, .84);
    --ink: #0a0a0a;
    --ink-2: #333333;
    --muted: #767676;
    --line: #e4e4e4;
    --line-2: #c9c9c9;
    --inv-bg: #0a0a0a;
    --inv-fg: #ffffff;
    /* the one colour the site allows itself: a vermilion signal trace, used
       only for things that are live (the hero signal, featured visuals) */
    --accent: #d6402b;
    --accent-soft: rgba(214, 64, 43, .12);

    --display: 'Inter', "Helvetica Neue", Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --wrap: 1140px;
    --gut: clamp(1.25rem, 4vw, 2.75rem);
    --t: cubic-bezier(.22, .7, .2, 1);
}

html[data-theme="dark"] {
    --paper: #0b0b0b;
    --paper-2: #161616;
    --paper-a: rgba(11, 11, 11, .84);
    --ink: #fafafa;
    --ink-2: #dcdcdc;
    --muted: #9b9b9b;
    --line: #262626;
    --line-2: #3a3a3a;
    --inv-bg: #fafafa;
    --inv-fg: #0b0b0b;
    --accent: #ff6a4d;
    --accent-soft: rgba(255, 106, 77, .14);
}

/* ------------------------------------------------------------------- 2. base */
* { box-sizing: border-box; }

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

body {
    margin: 0;
    background-color: var(--paper);
    color: var(--ink);
    font-family: var(--display);
    font-size: 16px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* the only decoration the site allows itself: a fine dot matrix */
#background-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: var(--paper) !important;
    background-image: radial-gradient(var(--line) 1px, transparent 1px) !important;
    background-size: 22px 22px;
    background-position: -11px -11px;
    height: 100% !important;
    width: 100% !important;
}

.orb { display: none !important; }

img { filter: grayscale(1) contrast(1.03); }

h1, h2, h3, h4, h5 {
    margin: 0;
    font-weight: 600;
    line-height: 1.14;
    letter-spacing: -.022em;
    color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.4rem); }

p { color: var(--ink-2); }

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

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

.eyebrow,
.mono,
.section-label,
.eyebrow * {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 var(--gut);
}

.section {
    padding: clamp(3rem, 7vw, 6rem) 0;
    border-bottom: 1px solid var(--line);
}

.section:last-of-type { border-bottom: 0; }

.section-head {
    display: flex;
    align-items: baseline;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 2.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.section-head h2 { margin-right: auto; order: 2; }
.section-head .index { order: 1; }
.section-head .eyebrow { order: 3; }

.section-head .index {
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .18em;
    color: var(--muted);
}

.lead { font-size: clamp(1rem, 1.5vw, 1.2rem); color: var(--ink-2); max-width: 68ch; }

/* ------------------------------------------------------------------ nav */
.site-nav,
body nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--paper-a) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line) !important;
    box-shadow: none !important;
}

.site-nav .wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    justify-content: space-between;
    padding-top: .8rem;
    padding-bottom: .8rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-family: var(--mono);
    font-size: .76rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--ink);
    white-space: nowrap;
}

.nav-links,
.nav-list {
    display: flex;
    align-items: center;
    gap: .2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    position: relative;
    display: inline-block;
    padding: .5rem .7rem;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted) !important;
    background: none !important;
    border-radius: 0 !important;
    transition: color .25s var(--t);
}

.nav-link::after {
    content: "";
    position: absolute;
    left: .7rem;
    right: .7rem;
    bottom: .3rem;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s var(--t);
}

.nav-link:hover { color: var(--ink) !important; }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--ink) !important; }
.nav-link.active::after { transform: scaleX(1); }

.hamburger {
    display: none;
    background: none;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: .55rem .7rem;
    cursor: pointer;
    line-height: 1;
}

.dropdown-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: .5rem 0 1rem;
    border-top: 1px solid var(--line);
}

.dropdown-menu.active { display: block; }
.dropdown-menu .nav-link { display: block; text-align: left; padding: .6rem .2rem; }
.dropdown-menu .nav-link::after { left: .2rem; right: auto; width: 1.5rem; }

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: none;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: border-color .25s var(--t);
}

.theme-toggle:hover { border-color: var(--ink); }

.theme-toggle .dot {
    width: 14px;
    height: 14px;
    border: 1px solid var(--ink);
    background: linear-gradient(90deg, var(--ink) 50%, transparent 50%);
    transition: transform .45s var(--t);
}

.theme-toggle:hover .dot { transform: rotate(180deg); }

/* ------------------------------------------------------------------ hero */
.hero {
    position: relative;
    padding: clamp(5rem, 11vw, 8rem) var(--gut) clamp(2.5rem, 6vw, 4.5rem) !important;
    min-height: 0 !important;
    height: auto !important;
    border-bottom: 1px solid var(--line);
    background: var(--paper) !important;
    background-image: none !important;
    text-align: center;
}

.hero > .absolute,
.hero .floating-ring,
.hero .floating-ring-2,
.hero .floating-glow,
.hero .particle,
.hero .particle-container { display: none !important; }

.hero .portrait {
    position: relative;
    width: clamp(140px, 22vw, 210px) !important;
    height: clamp(140px, 22vw, 210px) !important;
    margin: 0 auto clamp(1.5rem, 4vw, 2.5rem) !important;
    padding: 0;
    border: 1px solid var(--ink);
    aspect-ratio: 1 / 1;
}

.hero img.floating-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border: 0 !important;
    filter: grayscale(1) contrast(1.05);
    transition: filter .6s var(--t), transform .7s var(--t);
}

.hero .portrait:hover img { transform: scale(1.03); }

.hero h1 { margin: 0 auto .9rem; max-width: 18ch; }

.hero .role {
    max-width: 58ch;
    margin: 0 auto;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--ink-2);
}

.hero #current-time { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) !important; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    justify-content: center;
    margin-top: 2.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-meta b { color: var(--ink); font-weight: 500; }

/* ------------------------------------------------------------------ buttons */
.btn,
.btn:visited {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .82rem 1.3rem;
    font-family: var(--mono);
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--ink);
    border-radius: 0;
    cursor: pointer;
    transition: background .25s var(--t), color .25s var(--t), transform .25s var(--t);
}

.btn:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }

/* :visited is listed alongside each variant so a link you have already
   opened keeps its colours (.btn:visited would otherwise win and paint
   ink-on-ink) */
.btn--solid, .btn--solid:visited { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--paper); color: var(--ink); }

.btn--ghost, .btn--ghost:visited { border-color: var(--line-2); color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--ink); color: var(--paper); }

/* -------------------------------------------------------------------- cards */
.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > * { background: var(--paper); border: 0 !important; }

.card {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    padding: clamp(1.25rem, 2.4vw, 1.9rem);
    background: var(--paper);
    border: 1px solid var(--line);
    transition: border-color .3s var(--t), background .3s var(--t), color .3s var(--t), transform .3s var(--t);
}

.card:hover { border-color: var(--ink); }
.card h3, .card p { margin: 0; }

.card .card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.card .num {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .16em;
    color: var(--muted);
}

.card--link { cursor: pointer; }

.card--link:hover,
.card--invert:hover {
    background: var(--ink);
    color: var(--paper);
}

.card--link:hover h3,
.card--link:hover p,
.card--link:hover .num,
.card--link:hover .chip,
.card--invert:hover h3,
.card--invert:hover p { color: var(--paper) !important; border-color: var(--paper) !important; }

/* --------------------------------------------------------------------- chips */
.chip {
    display: inline-block;
    padding: .32rem .58rem;
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 0;
    transition: border-color .25s var(--t), color .25s var(--t);
}

.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }

.chip--status,
.chip.is-status {
    color: var(--ink);
    background: transparent;
    border-color: var(--line-2);
}

/* ------------------------------------------------------------------ lists */
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.index-list li { border-bottom: 1px solid var(--line); }

.index-list a,
.index-list .row {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: baseline;
    padding: 1.1rem .25rem;
    transition: padding-left .3s var(--t), background .3s var(--t);
}

.index-list a:hover { padding-left: 1rem; background: var(--paper-2); }
.index-list .n { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; color: var(--muted); }
.index-list .t { color: var(--ink); font-weight: 500; }
.index-list .m { font-family: var(--mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------------- timeline */
.tl { position: relative; margin: 0; padding: 0 0 0 2rem; list-style: none; }

.tl::before {
    content: "";
    position: absolute;
    left: 3px;
    top: .6rem;
    bottom: .6rem;
    width: 1px;
    background: var(--line);
}

.tl > li { position: relative; padding-bottom: 2.4rem; }
.tl > li:last-child { padding-bottom: 0; }

.tl > li::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: .6rem;
    width: 7px;
    height: 7px;
    background: var(--paper);
    border: 1px solid var(--ink);
    transition: background .25s var(--t);
}

.tl > li:hover::before { background: var(--ink); }

.tl .when,
.tl .where {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

.tl h3 { margin: .3rem 0 .25rem; }
.tl p { margin: .6rem 0 0; max-width: 74ch; }

/* -------------------------------------------------------------------- stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
}

.stats > * {
    background: var(--paper);
    padding: clamp(1.1rem, 2.2vw, 1.75rem) 1rem;
    text-align: center;
}

.stats b {
    display: block;
    font-family: var(--mono);
    font-size: clamp(1.5rem, 3.4vw, 2.3rem);
    font-weight: 500;
    letter-spacing: -.02em;
    color: var(--ink);
}

.stats span { font-family: var(--mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ----------------------------------------------------------------- statement */
.statement {
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid var(--ink);
    font-size: clamp(1.1rem, 2.1vw, 1.5rem);
    line-height: 1.5;
    letter-spacing: -.01em;
    color: var(--ink);
}

.statement .eyebrow { display: block; margin-bottom: 1rem; }

/* Above-the-fold marquee: the fastest way to say "this site moves". */
.marquee {
    overflow: hidden;
    background: var(--inv-bg);
    color: var(--inv-fg);
    padding: 1rem 0;
    user-select: none;
}

.marquee-track { display: flex; width: max-content; animation: marquee 34s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; }

.marquee span {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    font-family: var(--mono);
    font-size: .76rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
}

.marquee span::after { content: "◆"; font-size: .5rem; opacity: .55; }

@keyframes marquee {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ----------------------------------------------------------------- filters */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; }

.filter {
    padding: .5rem .85rem;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: color .25s var(--t), border-color .25s var(--t), background .25s var(--t);
}

.filter:hover { color: var(--ink); border-color: var(--ink); }
.filter[aria-pressed="true"] { color: var(--inv-fg); background: var(--inv-bg); border-color: var(--inv-bg); }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.filter-bar .filters { margin-bottom: 0; }

.filter-count { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-left: auto; }

.is-hidden { display: none !important; }

/* -------------------------------------------------------------- modal + toast */
.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(3px);
}

.modal.hidden { display: none !important; }

.modal-inner {
    width: min(760px, 100%);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--ink);
}

.modal-head,
.modal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
}

.modal-head { border-bottom: 1px solid var(--line); }
.modal-foot { border-top: 1px solid var(--line); }
.modal-body { padding: 1.25rem; overflow: auto; }

.modal-body pre,
#bibtex-content {
    margin: 0;
    padding: 1rem;
    background: var(--paper-2) !important;
    border: 1px solid var(--line);
    font-family: var(--mono) !important;
    font-size: .78rem;
    line-height: 1.6;
    color: var(--ink-2) !important;
    overflow-x: auto;
}

#toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 95;
    transform: translate(-50%, 160%);
    padding: .78rem 1.2rem;
    background: var(--inv-bg);
    color: var(--inv-fg);
    border: 1px solid var(--inv-bg);
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: transform .4s var(--t);
    pointer-events: none;
}

#toast.show { transform: translate(-50%, 0); }

/* --------------------------------------------------------------- chrome */
#progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--ink);
    z-index: 80;
}

#to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 70;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .3s var(--t), transform .3s var(--t), border-color .3s var(--t);
}

#to-top.show { opacity: 1; transform: none; }
#to-top:hover { border-color: var(--ink); }

/* ------------------------------------------------------------------ footer */
.site-footer,
body footer {
    background: var(--inv-bg) !important;
    color: var(--inv-fg);
    padding: clamp(2.25rem, 5vw, 3.5rem) 0 1.75rem;
    border-top: 1px solid var(--inv-bg);
    margin-top: 0;
}

.site-footer a,
body footer a { color: var(--inv-fg) !important; }

.site-footer .footer-top {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(128, 128, 128, .35);
}

.site-footer h4 { color: var(--inv-fg); font-size: 1rem; margin-bottom: .5rem; }
.site-footer p { color: var(--inv-fg); opacity: .68; }

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

.footer-links a {
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .72;
    transition: opacity .25s var(--t);
}

.footer-links a:hover { opacity: 1; }

/* the 3D pill lives on an inverted band here, so it inverts the other way */
.site-footer a[href*="3d/index.html"],
body footer a[href*="3d/index.html"] {
    background: transparent !important;
    border-color: currentColor !important;
    color: var(--inv-fg) !important;
}

.site-footer a[href*="3d/index.html"]:hover,
body footer a[href*="3d/index.html"]:hover {
    background: var(--inv-fg) !important;
    color: var(--inv-bg) !important;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    justify-content: space-between;
    padding-top: 1.25rem;
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .55;
}

/* ------------------------------------------------------- 3. interactions */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .75s var(--t), transform .75s var(--t);
}

.reveal.in { opacity: 1; transform: none; }

/* homepage chapters, converted into a numbered editorial index */
.chapter-section .chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    font-family: var(--mono);
    font-size: .82rem;
    font-weight: 500;
    color: var(--ink) !important;
    background: var(--paper) !important;
    background-image: none !important;
    border: 1px solid var(--ink);
    border-radius: 0 !important;
    flex: none;
}

.chapter-section h3 { color: var(--ink); }

.chapter-section > div:last-child {
    margin-left: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-top: 1px solid var(--line) !important;
    border-left: 0 !important;
    padding-top: 1.1rem !important;
    margin-top: 1.1rem !important;
}

.chapter-section { display: block; }

/* abstracts on the research page */
.abstract-container { position: relative; margin-top: .6rem; }
.abstract-container.is-collapsed .abstract-text::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1.6em;
    background: linear-gradient(transparent, var(--paper));
}

.abstract-text {
    position: relative;
    max-height: 3.4em;
    overflow: hidden;
    margin: 0;
    transition: max-height .45s var(--t);
}

.abstract-text.is-open { max-height: 200em; }

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-top: .8rem;
    padding: 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    color: var(--muted) !important;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .25s var(--t), border-color .25s var(--t);
}

.read-more-btn:hover { color: var(--ink) !important; border-color: var(--ink); }

.research-item {
    padding: clamp(1.3rem, 2.6vw, 2rem);
    border: 1px solid var(--line);
    background: var(--paper);
    transition: border-color .3s var(--t), transform .3s var(--t);
}

.research-item:hover { border-color: var(--ink); }
.research-item + .research-item { margin-top: 1px; }
.research-item h3 { margin-bottom: .5rem; }
.research-item h4 { font-family: var(--mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 1.1rem 0 .4rem; }

/* copy-to-clipboard affordance, injected by site.js */
.copy-btn {
    margin-left: .5rem;
    padding: .1rem .45rem;
    font-family: var(--mono);
    font-size: .6rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: color .25s var(--t), border-color .25s var(--t);
}

.copy-btn:hover { color: var(--ink); border-color: var(--ink); }

/* =========================================================================
   4. compatibility layer
   The pages were built with Tailwind colour utilities. Each rule below
   re-points one of those utilities at a token. `body` prefixes give these
   rules the specificity they need to beat the Tailwind stylesheet, which is
   injected into <head> after this file.
   ========================================================================= */

/* the page itself — Tailwind's bg-gray-900 / text-white classes sit on <body> */
body[class*="bg-"] { background-color: var(--paper) !important; background-image: none !important; }
body[class*="text-"] { color: var(--ink) !important; }

/* display sizes: the old markup carried fixed Tailwind text-* steps */
body [class*="text-5xl"],
body [class*="text-4xl"] { font-size: clamp(2.1rem, 5.4vw, 3.9rem) !important; line-height: 1.06 !important; }
body [class*="text-3xl"] { font-size: clamp(1.55rem, 3.1vw, 2.35rem) !important; }
body [class*="text-2xl"] { font-size: clamp(1.25rem, 2vw, 1.7rem) !important; }
body [class*="tracking-tight"] { letter-spacing: -.03em !important; }

body [class^="bg-"],
body [class*=" bg-"] { background-color: transparent; background-image: none; }

body [class*="text-gray-1"],
body [class*="text-gray-2"],
body [class*="text-gray-3"] { color: var(--ink-2); }

body [class*="text-gray-4"],
body [class*="text-gray-5"] { color: var(--muted); }

body [class*="text-white"],
body [class*="text-black"] { color: var(--ink); }

body [class*="text-amber-"], body [class*="text-blue-"], body [class*="text-purple-"],
body [class*="text-indigo-"], body [class*="text-teal-"], body [class*="text-cyan-"],
body [class*="text-green-"], body [class*="text-emerald-"], body [class*="text-yellow-"],
body [class*="text-red-"], body [class*="text-rose-"], body [class*="text-pink-"],
body [class*="text-orange-"] { color: var(--muted); }

body [class*="border-blue-"], body [class*="border-purple-"], body [class*="border-green-"],
body [class*="border-yellow-"], body [class*="border-red-"], body [class*="border-indigo-"],
body [class*="border-teal-"], body [class*="border-cyan-"], body [class*="border-pink-"],
body [class*="border-orange-"], body [class*="border-gray-"] { border-color: var(--line); }

body [class*="shadow-"] { box-shadow: none !important; }
body [class*="rounded-"] { border-radius: 0 !important; }

/* tiles and panels become paper with a hairline edge */
body .bg-gray-800,
body .bg-gray-800\/50,
body .bg-gray-800\/40,
body .bg-gray-800\/70,
body .bg-gray-900 { background-color: var(--paper) !important; border: 1px solid var(--line); }

body .bg-gray-700 { background-color: var(--paper-2) !important; border: 1px solid var(--line); }

body .bg-gray-600,
body .bg-gray-500 { background-color: var(--ink) !important; color: var(--paper) !important; border: 1px solid var(--ink); }

/* any hover-background utility becomes a full inversion: the strongest
   black-and-white gesture on the page */
body [class*="hover:bg-"]:hover,
body [class*="hover:bg-"]:focus-visible {
    background-color: var(--ink) !important;
    color: var(--paper) !important;
}

body [class*="hover:text-"]:hover { color: var(--paper) !important; }
body [class*="hover:scale-"]:hover { transform: none !important; }

/* chips: the small pills used for tags, tools and publication status */
body span[class*="px-3"][class*="text-sm"],
body span[class*="px-4"][class*="rounded-full"],
body span[class*="px-3"][class*="rounded-full"] {
    display: inline-block;
    padding: .32rem .58rem;
    margin: 0 .35rem .35rem 0;
    font-family: var(--mono);
    font-size: .64rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted) !important;
    background: transparent !important;
    border: 1px solid var(--line) !important;
    border-radius: 0 !important;
}

/* a status chip keeps the same pill as every other chip and is told apart by
the ink of its text, never by a filled black block */
body span.is-status[class*="is-status"],
body span.chip-status[class*="chip-status"] {
    color: var(--ink) !important;
    background: transparent !important;
    border-color: var(--line-2) !important;
}

/* buttons built out of utilities */
body button[class*="px-4"][class*="py-2"],
body a[class*="px-4"][class*="py-2"]:not([href*="3d/index.html"]) {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: var(--mono);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink) !important;
    background: transparent !important;
    border: 1px solid var(--line) !important;
    cursor: pointer;
    transition: border-color .25s var(--t), background .25s var(--t), color .25s var(--t);
}

body button[class*="px-4"][class*="py-2"]:hover,
body a[class*="px-4"][class*="py-2"]:not([href*="3d/index.html"]):hover {
    border-color: var(--ink) !important;
    background: var(--ink) !important;
    color: var(--paper) !important;
}

/* the 3D tour entry point in the navigation is the one filled pill on the
   site; links styled as .btn keep their own button treatment */
body a[href*="3d/index.html"]:not(.btn) {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .85rem;
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--inv-fg) !important;
    background: var(--inv-bg) !important;
    border: 1px solid var(--inv-bg) !important;
    transition: background .25s var(--t), color .25s var(--t), border-color .25s var(--t);
}

body a[href*="3d/index.html"]:not(.btn):hover {
    background: var(--paper) !important;
    color: var(--ink) !important;
    border-color: var(--ink) !important;
}

/* forms */
body input, body textarea, body select {
    width: 100%;
    padding: .8rem 1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 0;
    color: var(--ink);
    font-family: var(--display);
    font-size: .95rem;
    transition: border-color .25s var(--t);
}

body input::placeholder, body textarea::placeholder { color: var(--muted); }

body input:focus, body textarea:focus, body select:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: none;
}

body label {
    display: block;
    margin-bottom: .4rem;
    font-family: var(--mono);
    font-size: .66rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--muted);
}

body form p, .form-status { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* page headers on the inner pages: a compact strip, not a billboard */
header:not(.hero):not(.hero2) {
    position: relative;
    background: var(--paper) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--line);
    min-height: 0 !important;
    height: auto !important;
    padding: clamp(5.5rem, 11vw, 8rem) var(--gut) clamp(2.25rem, 4.5vw, 3rem) !important;
    text-align: center;
}

header:not(.hero):not(.hero2) > .absolute,
header:not(.hero):not(.hero2) .floating-ring,
header:not(.hero):not(.hero2) .floating-ring-2,
header:not(.hero):not(.hero2) .floating-glow,
header:not(.hero):not(.hero2) .particle,
header:not(.hero):not(.hero2) .scroll-indicator { display: none !important; }

header:not(.hero):not(.hero2) div:has(.floating-image) { width: 90px; height: 90px; margin: 0 auto 1.5rem; }

header:not(.hero):not(.hero2) img.floating-image {
    width: 90px !important;
    height: 90px !important;
    padding: 0;
    border: 1px solid var(--ink) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

header:not(.hero):not(.hero2) h1 { font-size: clamp(1.9rem, 4.6vw, 3.2rem) !important; color: var(--ink) !important; }
header:not(.hero):not(.hero2) p { font-size: .95rem !important; color: var(--muted) !important; }

/* the research BibTeX modal keeps its markup, loses its colour */
#bibtex-modal { background: rgba(0, 0, 0, .62) !important; }
#bibtex-modal > div { background: var(--paper) !important; border: 1px solid var(--ink); }
#bibtex-modal .border-gray-700 { border-color: var(--line) !important; }

/* legacy carousel classes, in case older markup is still around */
.infinite-carousel-container { overflow: hidden; }
.infinite-carousel { display: flex; gap: 1rem; will-change: transform; }
.infinite-carousel .carousel-item { flex: 0 0 auto; }

.scroll-btn {
    padding: .5rem .75rem;
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    transition: border-color .25s var(--t);
}

.scroll-btn:hover { border-color: var(--ink); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .nav-links { display: none !important; }
    .hamburger { display: inline-flex !important; }
    .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
    .index-list a, .index-list .row { grid-template-columns: 2.5rem minmax(0, 1fr); }
    .index-list .m { grid-column: 2; }
    .section-head h2 { order: 3; width: 100%; }
        .hero h1 { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal { opacity: 1; transform: none; }
    .marquee-track { animation: none; }
}

@media print {
    #background-animation, #progress, #to-top, .theme-toggle, nav, footer, .site-nav, .site-footer { display: none !important; }
    body { background: #fff; color: #000; }
}

/* bullet list inside a project card (projects.html, featured builds) */
.feature-points { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.feature-points li { padding: .5rem 0 .5rem 1.2rem; border-bottom: 1px solid var(--line); position: relative; font-size: .92rem; color: var(--ink-2); }
.feature-points li::before { content: ""; position: absolute; left: 0; top: 1.05rem; width: 6px; height: 6px; background: var(--accent); }

