/* ==========================================================================
   Project pages (projects/*.html) — same ink / ivory / antique-gold theme as the
   homepage, restyling the pages' existing Bootstrap markup and class names.
   Each page sets its own character on <body>:
     --accent     a hue taken from the project's figures (decorative only)
     data-bg      its living background (see project.js): smoke | pano
     data-hero    (SPGen) a still, blurred copy of --hero-img behind the hero instead
   Backgrounds are fixed to the viewport and move on their own clock, never with scrolling.
   Loaded after bootstrap.min.css so these rules win.
   ========================================================================== */

:root {
    --bg: #0e1215;
    --ink: #ebe6da;
    --ink-soft: #beb8ab;
    --ink-mute: #8d887e;
    --line: rgba(235, 230, 218, 0.10);
    --line-strong: rgba(235, 230, 218, 0.22);
    --gold: #c9a96a;
    --gold-bright: #e4cb94;
    --gold-dim: rgba(201, 169, 106, 0.14);
    --on-gold: #17130b;
    --accent: var(--gold-bright);

    --f-display: 'Cormorant Garamond', 'Cormorant', Garamond, 'Times New Roman', serif;
    --f-body: 'EB Garamond', Garamond, Georgia, 'Times New Roman', serif;
    --f-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', monospace;

    --ease: cubic-bezier(.22, .61, .36, 1);
    --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html { background: var(--bg); scrollbar-color: #2b3238 var(--bg); }

body {
    background: transparent !important;
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 18.5px;
    line-height: 1.7;
    padding-top: 84px;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-kerning: normal;
}

/* faint film grain, as on the homepage */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 100;
    pointer-events: none;
    opacity: .045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold); color: var(--on-gold); }

p, li { color: var(--ink-soft); }
b, strong { color: var(--ink); font-weight: 600; }
hr { border-top: 1px solid var(--line); }
.text-muted { color: var(--ink-mute) !important; }
.text-warning { color: var(--gold) !important; }

/* links: hairline that draws in from the left */
a {
    color: var(--ink);
    text-decoration: none;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: color .45s var(--ease), background-size .55s var(--ease);
}
a:hover, a:focus-visible { color: var(--gold-bright); text-decoration: none; background-size: 100% 1px; }
p a, li a, .author-block a, .caption a, .tagline a {
    background-image: linear-gradient(var(--gold), var(--gold)), linear-gradient(rgba(235, 230, 218, .28), rgba(235, 230, 218, .28));
    background-size: 0% 1px, 100% 1px;
    background-position: 0 100%, 0 100%;
}
p a:hover, li a:hover, .author-block a:hover, .caption a:hover, .tagline a:hover { background-size: 100% 1px, 100% 1px; }

code {
    padding: .08em .38em;
    border-radius: 3px;
    background: rgba(235, 230, 218, .07);
    color: var(--gold-bright);
    font-family: var(--f-mono);
    font-size: .82em;
}

/* ------------------------------------------------------------------ navbar */

.navbar.bg-custom-nav {
    padding: 14px 18px;
    background: rgba(14, 18, 21, .72) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
            backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid var(--line);
    box-shadow: none;
}
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: .6em;
    background: none;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.5rem;
    letter-spacing: .03em;
    color: #f4efe4 !important;
}
.navbar-brand::before {              /* the project's accent, as a small gilded diamond */
    content: '';
    width: 7px;
    height: 7px;
    background: var(--accent);
    transform: rotate(45deg);
    box-shadow: 0 0 10px var(--accent);
}
.navbar-dark .navbar-nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: none;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--ink-soft) !important;
    transition: color .45s var(--ease);
}
.navbar-dark .navbar-nav .nav-link::before {   /* "back" line that stretches on hover */
    content: '';
    width: 18px;
    height: 1px;
    background: currentColor;
    transition: width .55s var(--ease);
}
.navbar-dark .navbar-nav .nav-link:hover { color: var(--gold-bright) !important; }
.navbar-dark .navbar-nav .nav-link:hover::before { width: 40px; }
.navbar-dark .navbar-toggler { border-color: var(--line-strong); }

/* ------------------------------------------------------------------ hero */

.paper-title {
    margin: 1.6rem 0 1.5rem;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: clamp(2.05rem, 3.6vw, 3.15rem);
    line-height: 1.16;
    letter-spacing: .005em;
    color: #f6f1e7;
    text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}

.author-block { margin-bottom: .6rem; font-size: 1.15rem; line-height: 1.95; color: var(--ink-soft); }
.author-block a { color: #f4efe4; font-weight: 500; }
.author-block sup, .affiliation-block sup { color: var(--gold); font-size: .68em; margin-left: 1px; }
.affiliation-block { margin-bottom: 1.4rem; font-style: italic; font-size: 1.02rem; color: var(--ink-mute); }

/* institution marks as ivory silhouettes (brand colours vanish on ink) */
img[alt*="Logo"] {
    filter: brightness(0) invert(.9) sepia(.22);
    opacity: .82;
}

.venue-block {
    margin: 1.1rem 0 2rem;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--gold-bright);
}

/* Resource buttons — gold fill slides in (fill painted under the border: no seam) */
.btn-resource, .btn-resource.btn-hf {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    margin: 6px 4px;
    padding: .55em 1.35em .58em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background-color: transparent !important;
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-clip: border-box;
    background-position: 0 0;
    background-size: 0% 100%;
    box-shadow: none;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .06em;
    line-height: 1.3;
    color: var(--ink) !important;
    transition: background-size .6s var(--ease), color .5s var(--ease), border-color .5s var(--ease),
                transform .5s var(--ease), box-shadow .5s var(--ease);
}
.btn-resource i { color: var(--gold); transition: color .5s var(--ease); }
.btn-resource img { filter: saturate(.9); }
.btn-resource:hover, .btn-resource:focus-visible {
    color: var(--on-gold) !important;
    border-color: var(--gold);
    background-size: 100% 100%;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -16px rgba(201, 169, 106, .9);
}
.btn-resource:hover i, .btn-resource:focus-visible i { color: var(--on-gold); }

/* the key figure right under the hero */
.teaser-img {
    display: block;
    width: 100%;
    border: 1px solid rgba(201, 169, 106, .55);
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(255, 240, 210, .07), 0 30px 70px -34px rgba(0, 0, 0, 1);
    transition: border-color .8s var(--ease-out), box-shadow .8s var(--ease-out);
}
.teaser-img:hover { transform: none; border-color: rgba(228, 203, 148, .9); }

/* ------------------------------------------------------------------ sections */

h2 {
    position: static;
    left: auto;
    transform: none;
    display: block;
    margin: 5.2rem 0 2.2rem;
    text-align: center;
    font-family: var(--f-display);
    font-weight: 500;
    font-size: clamp(2rem, 3vw, 2.6rem);
    letter-spacing: .01em;
    color: #f4efe4;
}
h2::after {                          /* ornament: hairline — diamond — hairline */
    content: '';
    display: block;
    position: static;
    width: 132px;
    height: 9px;
    margin: 14px auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='9'%3E%3Cpath d='M0 4.5H56M76 4.5H132' stroke='%23c9a96a' stroke-opacity='.55'/%3E%3Cpath d='M66 .5L70 4.5L66 8.5L62 4.5Z' fill='%23c9a96a'/%3E%3C/svg%3E") center / contain no-repeat;
    border-radius: 0;
    opacity: 1;
}
h3 { font-family: var(--f-display); font-weight: 600; color: #f4efe4; }
h5 {
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 1.42rem;
    letter-spacing: .01em;
    color: #f4efe4;
}
h5 b { font-weight: 600; }

.text-justify { text-align: justify; hyphens: auto; }

.abstract-box {
    margin-bottom: 20px;
    padding: 30px 34px 22px;
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    border-radius: 2px;
    background: linear-gradient(100deg, var(--gold-dim), rgba(201, 169, 106, 0) 70%);
    box-shadow: none;
    text-align: justify;
}
.abstract-box p { font-size: 1.08rem; line-height: 1.78; color: var(--ink); }
.highlight-list { list-style: none; padding: 0; margin-top: 20px; text-align: left; }
.highlight-list li { margin-bottom: 12px; color: var(--ink-soft); }
.highlight-list i { color: var(--gold) !important; margin-right: 8px; }

/* figures sit in recessed, gilded wells (as on the homepage) */
.img-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
    padding: 0;
    border: 1px solid rgba(201, 169, 106, .5);
    border-radius: 4px;
    background: #0a0d10;
    box-shadow: 0 1px 0 rgba(255, 240, 210, .07), 0 -1px 0 rgba(0, 0, 0, .55);
    transition: border-color .8s var(--ease-out);
}
.img-container::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    box-shadow: inset 0 8px 14px -6px rgba(0, 0, 0, .7), inset 0 0 20px 1px rgba(0, 0, 0, .35),
                inset 0 -1px 0 rgba(255, 240, 210, .08);
}
.img-container:hover { border-color: rgba(228, 203, 148, .85); }
.img-container img, .img-container video { display: block; width: 100%; margin: 0 auto; border-radius: 0; background: #fff; }
.img-container video { background: #000; }
.img-container > .caption { margin: 0; padding: 14px 20px 18px; }
.img-fluid { border-radius: 0; }

.embed-responsive {
    border: 1px solid rgba(201, 169, 106, .5);
    border-radius: 4px !important;
    box-shadow: 0 30px 60px -34px rgba(0, 0, 0, 1) !important;
}

.caption {
    margin-top: 12px;
    text-align: center;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.07rem;
    line-height: 1.6;
    color: var(--ink-mute);
}
.caption b { color: var(--accent); font-style: normal; font-weight: 600; }

/* BibTeX */
.bibtex-box, pre.code-block {
    position: relative;
    margin-top: 16px;
    padding: 22px 24px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    border-radius: 3px;
    background: #0a0d10;
    color: #d8d1c2;
    font-family: var(--f-mono);
    font-size: .83rem;
    line-height: 1.65;
    text-align: left;
    scrollbar-color: #2b3238 transparent;
}
.bib-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: .25em .9em .28em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background-color: rgba(14, 18, 21, .8);
    background-image: linear-gradient(var(--gold), var(--gold));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-size: 0% 100%;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--ink-soft);
    cursor: pointer;
    transition: background-size .5s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
.bib-copy:hover, .bib-copy.is-done { color: var(--on-gold); border-color: var(--gold); background-size: 100% 100%; }

footer.text-muted p, footer p {
    margin-top: 2rem;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--ink-mute);
}

/* ------------------------------------------------------------------ dataset page components */

.dataset-section {
    margin-bottom: 28px;
    padding: 30px 32px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: linear-gradient(160deg, rgba(235, 230, 218, .035), rgba(235, 230, 218, 0) 60%);
    box-shadow: none;
}
.dataset-section h3 { margin-bottom: 6px; font-size: 1.7rem; }
.dataset-section .tagline { margin-bottom: 18px; font-style: italic; color: var(--ink-mute); }
h5.subhead {
    margin: 30px 0 10px;
    font-size: .82rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--accent);
}

.pill {
    display: inline-block;
    margin: 0 2px;
    padding: .18em .9em .2em;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .8rem;
    letter-spacing: .08em;
    color: var(--ink-soft);
}
.pill.cc { border-color: rgba(228, 203, 148, .5); color: var(--gold-bright); background: transparent; }

.stat-card {
    margin-bottom: 18px;
    padding: 24px 20px;
    border: 1px solid var(--line);
    border-left: 2px solid var(--gold);
    border-radius: 3px;
    background: linear-gradient(140deg, rgba(235, 230, 218, .05), rgba(235, 230, 218, 0) 70%);
    box-shadow: none;
    text-align: center;
}
.stat-card .stat-name {
    margin-bottom: 6px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .85rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
.stat-card .stat-figure {
    margin-bottom: 2px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: 2.3rem;
    line-height: 1.1;
    color: #f6f1e7;
}
.stat-card .stat-sub { font-size: .9rem; font-style: italic; color: var(--ink-mute); }
.stat-card.halo { border-left-color: #e0b04c; }
.stat-card.halo .stat-name { color: #e8c26f; }
.stat-card.haze { border-left-color: #8fb4cc; }
.stat-card.haze .stat-name { color: #a9c6d9; }

table.comp {
    width: 100%;
    overflow: hidden;
    border-collapse: collapse;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
}
table.comp th, table.comp td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
    text-align: center;
    color: var(--ink-soft);
}
table.comp th {
    background: rgba(201, 169, 106, .12);
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--gold-bright);
}
table.comp td.left { text-align: left; }
table.comp tr:last-child td { font-weight: 600; color: var(--ink); background: rgba(235, 230, 218, .04); }

/* ------------------------------------------------------------------ result stages (S4VY)
   A large recessed stage with a strip of case thumbnails below (switching crossfades),
   a query-driven grounding viewer, a flow diagram and a demo-video placeholder. */

.section-lede {
    max-width: 760px;
    margin: -1rem auto 2rem;
    text-align: center;
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1.15rem;
    color: var(--ink-mute);
}

.stage {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(201, 169, 106, .5);
    border-radius: 4px;
    background: #0a0d10;
    box-shadow: 0 1px 0 rgba(255, 240, 210, .07), 0 30px 70px -34px rgba(0, 0, 0, 1);
}
.stage video { display: block; width: 100%; height: auto; transition: opacity .45s var(--ease); }
.stage.is-swapping video { opacity: 0; }
.stage__labels {
    position: absolute;
    inset: 0 0 auto 0;
    display: flex;
    pointer-events: none;
}
.stage__labels span {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #f4efe4;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
    background: linear-gradient(rgba(10, 13, 16, .55), rgba(10, 13, 16, 0));
}
.stage__labels span + span { border-left: 1px solid rgba(201, 169, 106, .35); }
.stage__title {
    position: absolute;
    left: 12px;
    bottom: 12px;
    padding: .15em .8em .2em;
    border: 1px solid rgba(201, 169, 106, .5);
    border-radius: 999px;
    background: rgba(10, 13, 16, .72);
    font-family: var(--f-display);
    font-style: italic;
    font-size: 1rem;
    color: #f4efe4;
    pointer-events: none;
}

.thumbs {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #2b3238 transparent;
}
.thumb {
    flex: 1 1 0;
    min-width: 96px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: #0a0d10;
    cursor: pointer;
    text-align: left;
    transition: border-color .5s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease);
}
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; opacity: .62; filter: saturate(.8); transition: opacity .5s var(--ease), filter .5s var(--ease); }
.thumb span {
    display: block;
    padding: 6px 9px 7px;
    font-family: var(--f-display);
    font-weight: 600;
    font-size: .78rem;
    letter-spacing: .06em;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.thumb:hover { border-color: rgba(201, 169, 106, .55); transform: translateY(-2px); }
.thumb:hover img, .thumb.is-active img { opacity: 1; filter: none; }
.thumb.is-active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.thumb.is-active span { color: var(--gold-bright); }
.thumb:focus-visible { outline: 1px dashed var(--gold); outline-offset: 3px; }

/* several rows of case thumbnails */
.thumbs--grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
}
.thumbs--grid .thumb { min-width: 0; }
.stage__title--right { left: auto; right: 12px; top: 12px; bottom: auto; }

/* numbered language queries of the scene on stage: one per line, in the tour's order */
.queries {
    margin: 14px 0 2px;
    padding: 6px 18px;
    list-style: none;
    counter-reset: q;
    border: 1px solid var(--line);
    border-left: 2px solid var(--accent);
    border-radius: 3px;
    background: rgba(10, 13, 16, .82);
    transition: opacity .35s var(--ease);
}
.queries.is-swapping { opacity: 0; }
.queries li {
    counter-increment: q;
    display: grid;
    grid-template-columns: 1.8em minmax(0, 1fr);
    align-items: baseline;
    padding: 6px 0;
    font-family: var(--f-body);
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.45;
    color: var(--ink);
    text-align: left;
}
.queries li + li { border-top: 1px solid var(--line); }
.queries li::before {
    content: counter(q) '.';
    font-family: var(--f-display);
    font-style: normal;
    font-weight: 600;
    font-size: .92rem;
    color: var(--accent);
}

/* one row of thumbnails that slides left / right */
.slider { position: relative; margin-top: 16px; }
.thumbs--slider {
    display: flex;
    gap: 10px;
    margin: 0 44px;
    padding: 4px 2px 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.thumbs--slider::-webkit-scrollbar { display: none; }
.thumbs--slider .thumb { flex: 0 0 138px; min-width: 0; scroll-snap-align: start; }
.slider__btn {
    position: absolute;
    top: 50%;
    width: 34px;
    height: 34px;
    margin-top: -19px;
    border: 1px solid rgba(201, 169, 106, .6);
    border-radius: 50%;
    background: rgba(10, 13, 16, .85);
    color: var(--gold-bright);
    font-size: .8rem;
    cursor: pointer;
    transition: background-color .45s var(--ease), color .45s var(--ease), opacity .45s var(--ease), border-color .45s var(--ease);
}
.slider__btn--prev { left: 0; }
.slider__btn--next { right: 0; }
.slider__btn:hover { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
.slider__btn[disabled] { opacity: .25; pointer-events: none; }

/* method figure (inline SVG, drawn after the paper's Figure 2) */
.fig-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #2b3238 transparent; }
.fig-method { display: block; width: 100%; min-width: 860px; height: auto; font-family: var(--f-display); }
.fig-method .panel { fill: rgba(14, 18, 21, .82); stroke: rgba(235, 230, 218, .14); }
.fig-method .ptitle { fill: var(--gold-bright); font-size: 15px; font-weight: 600; letter-spacing: .24em; }
.fig-method .lbl { fill: #f1ece1; font-size: 19px; font-weight: 600; text-anchor: middle; }
.fig-method .sub { fill: var(--ink-mute); font-family: var(--f-body); font-style: italic; font-size: 14.5px; text-anchor: middle; }
.fig-method .sub.end { text-anchor: end; }
.fig-method .blbl { fill: #f1ece1; font-size: 19px; font-weight: 600; text-anchor: middle; }
.fig-method .blbl.hi { fill: var(--gold-bright); }
.fig-method .blbl.pk { fill: #efb8ea; }
.fig-method .blbl.sm { font-size: 16px; }
.fig-method .vlbl { fill: var(--gold-bright); font-size: 14px; font-weight: 600; letter-spacing: .12em; text-anchor: middle; }
.fig-method .clbl { fill: var(--ink-soft); font-family: var(--f-body); font-size: 14.5px; }
.fig-method .quote { fill: #f1ece1; font-family: var(--f-body); font-style: italic; font-size: 15px; text-anchor: middle; }
.fig-method .tag { fill: #fff; font-size: 12px; font-weight: 600; paint-order: stroke; stroke: rgba(0, 0, 0, .7); stroke-width: 3px; }
.fig-method .mark { font-size: 17px; font-weight: 600; text-anchor: middle; }
.fig-method .mark.yes { fill: var(--gold-bright); }
.fig-method .mark.no { fill: var(--ink-mute); }
.fig-method .blk { stroke-width: 1.4; }
.fig-method .blk.blue { fill: rgba(143, 180, 204, .12); stroke: rgba(143, 180, 204, .75); }
.fig-method .blk.gold { fill: rgba(201, 169, 106, .16); stroke: rgba(201, 169, 106, .85); }
.fig-method .blk.pink { fill: rgba(222, 148, 216, .13); stroke: rgba(222, 148, 216, .8); }
.fig-method .chip { fill: rgba(10, 13, 16, .9); stroke: rgba(235, 230, 218, .2); }
.fig-method .bubble { fill: rgba(10, 13, 16, .9); stroke: rgba(222, 148, 216, .6); }
.fig-method .frame rect { fill: none; stroke: rgba(235, 230, 218, .35); }
.fig-method .frame.dim image { opacity: .3; }
.fig-method .tok rect { fill: none; stroke: rgba(235, 230, 218, .6); }
.fig-method .q { stroke: rgba(0, 0, 0, .35); }
.fig-method .bx { fill: none; stroke: #7fe39a; stroke-width: 1.6; }
.fig-method .prompt-box { fill: none; stroke: #7fe39a; stroke-width: 2; }
.fig-method .prompt-pt { fill: #7fe39a; stroke: #0e1215; stroke-width: 1.5; }
.fig-method .tree path { fill: none; stroke: rgba(201, 169, 106, .6); stroke-width: 1.2; }
.fig-method .fl { fill: none; stroke: #c9a96a; stroke-width: 1.6; stroke-dasharray: 5 4; animation: fig-flow 1.4s linear infinite; }
.fig-method .fl.faint { stroke: rgba(201, 169, 106, .45); }
@keyframes fig-flow { to { stroke-dashoffset: -18; } }

/* demo video placeholder */
.demo-soon {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    aspect-ratio: 16 / 9;
    border: 1px dashed rgba(201, 169, 106, .55);
    border-radius: 4px;
    background: radial-gradient(90% 90% at 50% 50%, rgba(201, 169, 106, .08), rgba(10, 13, 16, .85));
    text-align: center;
}
.demo-soon i {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid rgba(201, 169, 106, .7);
    border-radius: 50%;
    color: var(--gold-bright);
    font-size: 1.1rem;
    animation: demo-breathe 3.2s ease-in-out infinite;
}
.demo-soon b { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; letter-spacing: .28em; text-transform: uppercase; color: var(--ink-soft); }
@keyframes demo-breathe { 50% { box-shadow: 0 0 0 10px rgba(201, 169, 106, .06), 0 0 30px rgba(201, 169, 106, .25); } }

/* resources that are not public yet */
.btn-resource.is-soon { pointer-events: none; opacity: .5; }
.btn-resource.is-soon::after {
    content: 'soon';
    margin-left: .2em;
    font-style: italic;
    font-size: .8em;
    letter-spacing: .04em;
    color: var(--ink-mute);
}

.paper-title .title-mark { color: var(--accent); }

@media (max-width: 767px) {
    .thumbs--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .thumbs--slider { margin: 0 36px; }
    .thumbs--slider .thumb { flex-basis: 112px; }
}

/* ------------------------------------------------------------------ living backgrounds
   Fixed to the viewport, animated on their own clock (never tied to scrolling).
   A soft ink wash on top keeps the text readable. */

.pp-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
}
.pp-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pp-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 95% at 50% 38%, rgba(14, 18, 21, 0) 35%, rgba(14, 18, 21, .6) 100%),
        linear-gradient(rgba(14, 18, 21, .28), rgba(14, 18, 21, .28));
}
.pp-bg--pano canvas { opacity: .42; }
.pp-bg--segfield::after { background: none; }
/* the segfield shader draws its own grain: a separate fixed grain layer over WebGL can mis-composite */
body[data-bg="segfield"]::after { display: none; }
.pp-bg--pano::after {
    background:
        linear-gradient(to bottom, rgba(14, 18, 21, .15), rgba(14, 18, 21, .55) 55%, rgba(14, 18, 21, .72)),
        radial-gradient(120% 95% at 50% 38%, rgba(14, 18, 21, 0) 40%, rgba(14, 18, 21, .6) 100%);
}
.pp-bg--smoke::after { background: radial-gradient(130% 100% at 50% 40%, rgba(14, 18, 21, 0) 45%, rgba(14, 18, 21, .5) 100%); }

/* SPGen keeps a still backdrop: its key figure blurred behind the hero (data-hero) */
body[data-hero] > section:first-of-type { position: relative; isolation: isolate; }
body[data-hero] > section:first-of-type::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: -84px;
    width: 100vw;
    height: calc(100% + 84px);
    transform: translateX(-50%);
    background: var(--hero-img, none) center 30% / cover no-repeat;
    filter: blur(56px) saturate(1.3) brightness(.62);
    opacity: .42;
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .75) 45%, transparent 92%);
            mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .75) 45%, transparent 92%);
    pointer-events: none;
}

/* smoke fallback when WebGL is unavailable: slow drifting glows */
.pp-bg--smoke-css .pp-bg__glow {
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(230, 180, 110, .18), rgba(230, 180, 110, 0));
    animation: pp-glow 48s ease-in-out infinite alternate;
}
.pp-bg--smoke-css .pp-bg__glow:nth-child(2) { left: 40%; top: 30%; background: radial-gradient(closest-side, rgba(130, 150, 180, .14), rgba(130, 150, 180, 0)); animation-duration: 62s; }
@keyframes pp-glow { from { transform: translate3d(-10%, -8%, 0) scale(1); } to { transform: translate3d(12%, 10%, 0) scale(1.2); } }

/* ------------------------------------------------------------------ page transitions
   Arrive: the page rises out of the ink the homepage faded into.
   Leave (back home / to a sibling page): fade to ink first. */

html.pp-js::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    background: var(--bg);
    opacity: 1;
    transition: opacity 1.05s cubic-bezier(.33, 0, .2, 1) .05s;
}
html.pp-js.pp-in::before { opacity: 0; }
html.pp-js.pp-out::before { opacity: 1; transition: opacity .55s cubic-bezier(.4, 0, .6, 1); }

.pp-js .pp-rise {
    opacity: 0;
    transform: translate3d(0, 22px, 0);
    transition: opacity 1.1s var(--ease-out) var(--d, 0s), transform 1.1s var(--ease-out) var(--d, 0s);
}
.pp-js .pp-in .pp-rise, .pp-js.pp-in .pp-rise { opacity: 1; transform: none; }

.pp-js .pp-reveal {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
}
.pp-js .pp-reveal.is-visible { opacity: 1; transform: none; }

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

@media (max-width: 767px) {
    body { font-size: 17px; padding-top: 72px; }
    /* keep wide tables inside the screen: tighter cells, and scroll sideways if still too wide */
    table.comp { display: block; overflow-x: auto; }
    table.comp th, table.comp td { padding: 7px 8px; font-size: .86rem; }
    table.comp th { letter-spacing: .08em; }
    h2 { margin-top: 3.8rem; }
    .abstract-box, .dataset-section { padding: 22px 20px; }
    .navbar-brand { font-size: 1.3rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
    .pp-js .pp-rise, .pp-js .pp-reveal { opacity: 1; transform: none; }
}
