/* ============================================================
   v2.css — shared design system
   Linked by every page running the v2 redesign.
   Page-specific styles stay inline on each page.
   ============================================================ */

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    --ink:        #07060c;
    --ink-soft:   #11101a;
    --parchment:  #e8dcc4;
    --parchment-2:#c9b896;
    --gold:       #ecd540;
    --gold-soft:  #d4b850;
    --amber:      #ffb266;
    --blood:      #8b1a2c;
    --matrix:     #4a90ff;
    --matrix-dim: rgba(74, 144, 255, 0.35);
    --ghost:      #d4d4d4;
    --rule:       rgba(232, 220, 196, 0.18);
    --rule-strong:rgba(232, 220, 196, 0.45);

    --font-display: "Newsreader", "Times New Roman", serif;   /* Civitype retired 2026-09-29 */
    --font-body:    "Colfax-Light", "Helvetica Neue", system-ui, sans-serif;
    --font-medium:  "Colfax-Medium", "Helvetica Neue", system-ui, sans-serif;
    --font-mono:    "JetBrains Mono", "Courier New", monospace;

    --ease-breathe: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-engrave: cubic-bezier(0.65, 0, 0.35, 1);
}

@font-face {
    font-family: "Colfax-Light";
    src: url("/assets/fonts/colfax-font/Colfax-Light.otf") format("opentype");
    font-display: swap;
}
@font-face {
    font-family: "Colfax-Medium";
    src: url("/assets/fonts/colfax-font/Colfax-Medium.otf") format("opentype");
    font-display: swap;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--ink);
    color: var(--ghost);
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--matrix); text-decoration: none; transition: color 0.4s var(--ease-breathe); }
a:hover { color: var(--gold); }

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

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.06;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.9  0 0 0 0 0.86  0 0 0 0 0.77  0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ============================================================
   AMBIENT BACKGROUND — engraved rays + glyph-rain canvas
   Markup: <div class="ambient"><svg class="rays">…</svg><canvas class="glyph-rain" id="glyphRain"/></div>
   ============================================================ */
.ambient {
    position: fixed;
    inset: 0;
    z-index: -10;
    pointer-events: none;
    overflow: hidden;
}
.rays {
    position: absolute;
    top: -5%;
    left: -5%;
    /* Explicit width/height needed: SVG with viewBox 0 0 100 100 has an
       intrinsic 1:1 aspect ratio that otherwise wins on tall viewports
       and squashes the element into a square (rays would cut off mid-screen on mobile). */
    width: 110%;
    height: 110%;
    opacity: 0.35;
    animation: breathe 18s ease-in-out infinite;
}
.rays line { stroke: var(--matrix); stroke-width: 1; }
@keyframes breathe {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(1.04); }
}
canvas.glyph-rain {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.22;
    mix-blend-mode: screen;
}
.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 40%, transparent 0%, transparent 45%, rgba(7,6,12,0.85) 100%);
    pointer-events: none;
}

/* ============================================================
   HEADER — sticky, low-noise, gold logo + parchment nav
   ============================================================ */
header.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 36px;
    background: linear-gradient(180deg, rgba(7,6,12,0.85), transparent);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: background 0.5s var(--ease-breathe);
}
header.site-header.scrolled {
    background: rgba(7,6,12,0.78);
    border-bottom: 1px solid var(--rule);
}
.logo {
    font-family: var(--font-display);
    font-size: 44px;
    color: var(--gold);
    letter-spacing: -7px;
    text-shadow: 0 0 6px rgba(236, 213, 64, 0.35), 0 0 18px rgba(236, 213, 64, 0.12);
    transition: text-shadow 0.6s var(--ease-breathe);
}
.logo:hover {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(236, 213, 64, 0.65), 0 0 28px rgba(236, 213, 64, 0.25);
}
nav.site-nav {
    display: flex;
    gap: 32px;
    align-items: center;
}
nav.site-nav a {
    color: var(--parchment);
    font-family: var(--font-body);
    font-size: 15px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    padding: 4px 0;
}
nav.site-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.45s var(--ease-engrave);
}
nav.site-nav a:hover { color: var(--gold); }
nav.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
nav.site-nav a.is-current { color: var(--gold); }
nav.site-nav a.is-current::after { transform: scaleX(1); }

/* ============================================================
   FOOTER
   ============================================================ */
footer.site-footer {
    text-align: center;
    padding: 40px 32px 60px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--parchment-2);
    opacity: 0.7;
    border-top: 1px solid var(--rule);
}

/* ============================================================
   CONTAINER + SECTION TITLES
   ============================================================ */
.container {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 32px;
    position: relative;
}
.container--wide { max-width: 1100px; }

.section-head { margin-bottom: 36px; }
.section-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    display: inline-block;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--rule-strong);
    margin-bottom: 20px;
}
.section-eyebrow .dot { color: var(--parchment-2); margin: 0 0.6em; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 6vw, 88px);
    line-height: 0.95;
    letter-spacing: -0.05em;
    color: var(--parchment);
    margin: 0;
}

/* ============================================================
   SCROLL LIST — used on the homepage Tableaux for news/conferences
   ============================================================ */
.scroll {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.scroll li {
    position: relative;
    padding: 18px 22px 18px 60px;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: linear-gradient(135deg, rgba(232,220,196,0.02), transparent);
    transition: border-color 0.5s var(--ease-breathe), background 0.5s var(--ease-breathe), transform 0.5s var(--ease-breathe);
}
.scroll li::before {
    content: "§";
    position: absolute;
    left: 22px; top: 14px;
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--gold-soft);
    opacity: 0.7;
}
.scroll li:hover {
    border-color: var(--rule-strong);
    background: linear-gradient(135deg, rgba(232,220,196,0.05), rgba(74,144,255,0.02));
    transform: translateX(4px);
}
.scroll li .date {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--parchment-2);
    margin-bottom: 6px;
}

/* ============================================================
   CHAPTER RULE — between sections
   ============================================================ */
.chapter-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 120px auto 80px;
    max-width: 720px;
    padding: 0 24px;
    color: var(--gold-soft);
}
.chapter-rule .line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rule-strong));
}
.chapter-rule .line.right {
    background: linear-gradient(90deg, var(--rule-strong), transparent);
}
.chapter-rule .ornament {
    margin: 0 24px;
    font-family: var(--font-display);
    font-size: 28px;
    letter-spacing: -4px;
    opacity: 0.85;
}

/* ============================================================
   SCRYING SURFACE — ambient glyph oracle in the right margin
   Markup: <aside class="scrying" id="scrying"><div class="scrying-row">…</div>×N</aside>
   ============================================================ */
.scrying {
    position: fixed;
    top: 50%;
    right: 40px;
    transform: translateY(-50%);
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--gold-soft);
    letter-spacing: 0.45em;
    line-height: 2.2;
    text-align: right;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 1.8s var(--ease-breathe);
    text-shadow: 0 0 12px rgba(236, 213, 64, 0.45), 0 0 4px rgba(236, 213, 64, 0.25);
}
.scrying.visible { opacity: 0.55; }
.scrying-row { display: block; }
.scrying .glyph {
    display: inline-block;
    transition: opacity 0.7s var(--ease-breathe);
    margin-right: 0.2em;
}
@media (max-width: 1024px) { .scrying { display: none; } }

/* ============================================================
   REVEAL ON SCROLL
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1.1s var(--ease-breathe), transform 1.1s var(--ease-breathe);
}
.reveal.in { opacity: 1; transform: translateY(0); }

/* ============================================================
   PAGE HERO — used on inner pages (articles, papers, projects)
   Markup:
     <section class="page-hero">
       <img src="…" alt="…">
       <div class="page-hero-overlay">
         <span class="page-hero-eyebrow">Volume I · …</span>
         <h1 class="page-hero-title">Title</h1>
         <div class="page-hero-rule"></div>
         <p class="page-hero-tagline">Tagline.</p>
       </div>
     </section>
   ============================================================ */
.page-hero {
    position: relative;
    min-height: 60vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-hero img {
    position: absolute;
    inset: -6%;
    width: 112%;
    height: 112%;
    object-fit: cover;
    filter: grayscale(20%) contrast(1.05) brightness(0.55);
    transform: scale(1.02);
    animation: heroBreathe 28s ease-in-out infinite alternate;
}
@keyframes heroBreathe {
    to { transform: scale(1.1) translate(-1%, -0.5%); }
}
.page-hero::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(180deg, rgba(7,6,12,0.85) 0%, transparent 35%, transparent 70%, rgba(7,6,12,1) 100%),
        radial-gradient(ellipse at 50% 60%, rgba(7,6,12,0) 0%, rgba(7,6,12,0.65) 100%);
}
.page-hero-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 140px 32px 60px;
    max-width: 1100px;
}
.page-hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--gold);
    display: inline-block;
}
.page-hero-eyebrow .dot { color: var(--parchment-2); margin: 0 0.6em; }
.page-hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 7vw, 110px);
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--parchment);
    margin: 24px 0 0;
    text-shadow: 0 0 22px rgba(232, 220, 196, 0.18), 0 0 60px rgba(0,0,0,0.6);
}
.page-hero-rule {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 30px auto 22px;
    animation: drawRule 1.6s 0.8s var(--ease-engrave) forwards;
    max-width: 360px;
}
@keyframes drawRule { to { width: 60%; } }
.page-hero-tagline {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--parchment);
    font-size: clamp(15px, 1.3vw, 19px);
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* ============================================================
   REGISTER LIST — used on listing pages (Articles, projects)
   Markup:
     <ul class="register">
       <li class="register-item">
         <div class="register-date">18 Jun 2025</div>
         <div class="register-content">
           <h3><a href="…">Title</a></h3>
           <p>Description.</p>
         </div>
       </li>
     </ul>
   ============================================================ */
.register {
    list-style: none;
    padding: 0;
    margin: 0;
}
.register-item {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 32px;
    padding: 28px 0;
    border-bottom: 1px solid var(--rule);
    transition: padding 0.5s var(--ease-breathe), border-color 0.5s var(--ease-breathe);
    align-items: start;
}
.register-item:first-child { border-top: 1px solid var(--rule); }
.register-item:hover {
    padding-left: 14px;
    border-bottom-color: var(--rule-strong);
}
.register-date {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    padding-top: 8px;
    white-space: nowrap;
}
.register-content h3 {
    font-family: var(--font-medium);
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.3;
    letter-spacing: -0.005em;
    color: var(--parchment);
    margin: 0 0 10px;
    font-weight: normal;
}
.register-content h3 a {
    color: inherit;
    transition: color 0.4s var(--ease-breathe);
}
.register-content h3 a:hover { color: var(--gold); }
.register-content p {
    color: var(--ghost);
    margin: 0;
    line-height: 1.5;
    font-size: 16px;
}
.register-year {
    font-family: var(--font-medium);
    font-size: clamp(40px, 4vw, 56px);
    color: var(--gold-soft);
    letter-spacing: 0.02em;
    margin: 70px 0 14px;
    line-height: 1;
    opacity: 0.85;
    text-align: right;
    font-weight: normal;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 14px;
}
.register-year:first-of-type { margin-top: 0; }

/* ============================================================
   ARTICLE PROSE — used for paper writeups and content pages
   Markup: <div class="container article-prose reveal">…</div>
   ============================================================ */
.article-prose {
    color: var(--ghost);
    line-height: 1.7;
    font-size: 17px;
}
.article-prose .meta {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--parchment-2);
    margin: 0 0 32px;
    display: block;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--rule);
}
.article-prose .meta .dot { color: var(--gold); margin: 0 0.6em; }
.article-prose p.lede {
    font-family: var(--font-medium);
    font-size: clamp(20px, 2vw, 24px);
    line-height: 1.4;
    color: var(--parchment);
    margin: 0 0 28px;
    letter-spacing: -0.005em;
}
.article-prose p {
    margin: 0 0 20px;
    color: var(--ghost);
}
.article-prose h2 {
    font-family: var(--font-medium);
    font-size: clamp(24px, 2.6vw, 36px);
    line-height: 1.25;
    letter-spacing: -0.005em;
    color: var(--parchment);
    margin: 64px 0 20px;
    font-weight: normal;
}
.article-prose h3 {
    font-family: var(--font-medium);
    font-size: clamp(20px, 2vw, 24px);
    color: var(--gold);
    margin: 40px 0 14px;
    letter-spacing: 0.01em;
    font-weight: normal;
}
.article-prose a {
    color: var(--matrix);
    border-bottom: 1px solid rgba(74, 144, 255, 0.25);
    transition: color 0.4s var(--ease-breathe), border-color 0.4s var(--ease-breathe);
}
.article-prose a:hover {
    color: var(--gold);
    border-bottom-color: var(--gold);
}
.article-prose img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 36px auto;
    border-radius: 2px;
}
.article-prose figure {
    margin: 36px 0;
    text-align: center;
}
.article-prose figure img { margin: 0 auto 12px; }
.article-prose figcaption {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--parchment-2);
}
.article-prose iframe {
    max-width: 100%;
    width: 100%;
    display: block;
    margin: 32px auto;
    border: 1px solid var(--rule);
    background: var(--ink-soft);
}
.article-prose ol, .article-prose ul {
    margin: 0 0 24px;
    padding-left: 28px;
    color: var(--ghost);
}
.article-prose li {
    margin-bottom: 10px;
    line-height: 1.6;
}
.article-prose blockquote {
    margin: 32px 0;
    padding: 18px 28px;
    border-left: 2px solid var(--gold-soft);
    font-family: var(--font-display);
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.3;
    color: var(--parchment);
    font-style: italic;
    letter-spacing: -0.01em;
}
.article-prose hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rule-strong), transparent);
    margin: 48px auto;
    max-width: 60%;
}
.article-prose .download-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0 32px;
}
.article-prose .download {
    display: inline-block;
    padding: 11px 20px;
    border: 1px solid var(--rule-strong);
    border-bottom: 1px solid var(--rule-strong);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--parchment);
    border-radius: 2px;
    transition: all 0.4s var(--ease-breathe);
}
.article-prose .download:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(236, 213, 64, 0.05);
}
.article-prose .poem-stanza {
    margin: 0 0 24px;
    font-family: var(--font-display);
    font-size: clamp(20px, 2vw, 26px);
    line-height: 1.4;
    color: var(--parchment);
    letter-spacing: -0.005em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    header.site-header { padding: 16px 20px; }
    nav.site-nav { gap: 20px; }
    nav.site-nav a { font-size: 12px; letter-spacing: 0.06em; }
    .container { padding: 0 22px; }
    body { font-size: 16px; }

    .chapter-rule { margin: 80px auto 50px; }

    .page-hero { min-height: 50vh; }
    .page-hero-overlay { padding: 100px 22px 50px; }
    .page-hero-tagline { font-size: 16px; }

    .register-item {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 22px 0;
    }
    .register-date { padding-top: 0; font-size: 10px; }
    .register-year { font-size: 42px; margin: 40px 0 10px; }
}

@media (max-width: 480px) {
    header.site-header { padding: 14px 14px; }
    .logo { font-size: 36px; letter-spacing: -6px; }
    nav.site-nav { gap: 14px; }
    nav.site-nav a { font-size: 11px; letter-spacing: 0.05em; }
    .container { padding: 0 18px; }
    .section-title { font-size: clamp(36px, 13vw, 56px); }
    .scroll li { padding-left: 50px; }
    .scroll li::before { left: 18px; font-size: 24px; }
    footer.site-footer { letter-spacing: 0.18em; padding: 30px 18px 50px; }
    .page-hero-title { font-size: clamp(36px, 12vw, 56px); }
    .register-content h3 { font-size: 20px; }
    .register-content p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .rays { opacity: 0.5; }
    canvas.glyph-rain { display: none; }
    .reveal { opacity: 1; transform: none; }
    .page-hero-rule { width: 60%; }
}

/* ============================================================
   PER-PAGE PALETTES
   Override --matrix (and its dim variant) on a body class to shift
   the ambient rays, links, and tinted accents away from the default
   matrix-blue. Gold + parchment stay the same so the brand reads
   consistently across articles.
   ============================================================ */
body.palette-emerald {
    --matrix:     #4dffa6;
    --matrix-dim: rgba(77, 255, 166, 0.42);
}
body.palette-amber {
    --matrix:     #ffbf52;
    --matrix-dim: rgba(255, 191, 82, 0.42);
}
body.palette-violet {
    --matrix:     #b89dff;
    --matrix-dim: rgba(184, 157, 255, 0.42);
}
body.palette-rose {
    --matrix:     #ff85bd;
    --matrix-dim: rgba(255, 133, 189, 0.42);
}
