/* ============================================================
   renai.plus — Swiss Information Design System
   Palette: #1A1A14 / #F5F4EE / #D4380D / #0D72A8 / #7A5C0D / #CCCCBF / #6B6B5E / #E0E0DC
   Fonts: DM Sans, Space Grotesk" (Google Fonts), Inter" (Google Fonts), JetBrains Mono" (Google Fonts)
   International Typographic Style — the discipline of Josef Müller-Brockmann (strict modular grid)
   Inter's extreme legibility at text sizes makes dense scholarly passages comfortable to read across the full 9-column content zone.
   Space Grotesk's subtle quirks — the angled terminals give it intellectual character.
   Space Grotesk 600 at 48px. Behind the text, collage layers recede.
   JetBrains Mono 400 at 11px. Inter 400 at 14px for navigation.
   International Typographic Style rigor (strict modular grid, no rounded corners).
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: #F5F4EE;
    color: #1A1A14;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
    /* Hairline vertical rule columns via background gradient */
    background-image:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent calc((100% - 96px) / 12 - 1px),
            #E0E0DC calc((100% - 96px) / 12 - 1px),
            #E0E0DC calc((100% - 96px) / 12)
        );
    background-size: calc(100% - 96px) 100%;
    background-position: 48px 0;
    background-attachment: fixed;
}

/* --- Typography Scale --- */
/* 12 / 15 / 17 / 24 / 32 / 48 / 72 / 120px */

/* --- Color Variables --- */
:root {
    --ink: #1A1A14;
    --paper: #F5F4EE;
    --vermilion: #D4380D;
    --cyan: #0D72A8;
    --amber: #7A5C0D;
    --stone: #CCCCBF;
    --graphite: #6B6B5E;
    --rule: #E0E0DC;
    --header-h: 64px;
    --footer-h: 48px;
    --nav-w: 25%;  /* ~3 of 12 cols */
    --outer-margin: 48px;
    --gutter: 24px;
}

/* ============================================================
   HEADER BAND
   ============================================================ */
#header-band {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background-color: var(--ink);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 var(--outer-margin);
    overflow: hidden;
}

.header-domain {
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #ffffff;
    letter-spacing: -0.01em;
    white-space: nowrap;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

#header-wave {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============================================================
   PAGE LAYOUT — sticky nav + scrolling content
   ============================================================ */
#page-layout {
    display: flex;
    margin-top: var(--header-h);
    margin-bottom: var(--footer-h);
    min-height: calc(100vh - var(--header-h) - var(--footer-h));
    padding: 0 var(--outer-margin);
}

/* ============================================================
   NAVIGATION COLUMN (sticky, 3 cols)
   ============================================================ */
#nav-column {
    flex: 0 0 var(--nav-w);
    width: var(--nav-w);
    background-color: var(--paper);
    border-right: 1px solid var(--stone);
    position: sticky;
    top: var(--header-h);
    height: calc(100vh - var(--header-h) - var(--footer-h));
    padding: 48px 32px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    list-style: none;
}

.nav-brand {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 32px;
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 48px;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: var(--ink);
    text-decoration: none;
    padding: 8px 0 8px 16px;
    position: relative;
    transition: font-weight 150ms ease-out, color 150ms ease-out;
    letter-spacing: 0.01em;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 16px;
    background-color: var(--vermilion);
    transition: width 150ms ease-out;
}

.nav-link:hover,
.nav-link.active {
    font-weight: 600;
}

.nav-link:hover::before,
.nav-link.active::before {
    width: 4px;
}

.nav-wave-container {
    height: 48px;
    width: 100%;
    margin-top: auto;
    padding-right: 0;
    overflow: hidden;
}

#nav-wave {
    width: 100%;
    height: 100%;
}

/* ============================================================
   CONTENT ZONE (9 cols)
   ============================================================ */
#content-zone {
    flex: 1;
    min-width: 0;
    padding: 64px 0 64px 48px;
}

/* ============================================================
   HERO MODULE
   ============================================================ */
.hero-module {
    position: relative;
    min-height: calc(100vh - var(--header-h) - 64px);
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 64px;
}

.hero-collage-bg {
    position: absolute;
    inset: 0;
    perspective: 1200px;
    pointer-events: none;
    overflow: hidden;
}

/* Academic text fragments */
.collage-fragment {
    position: absolute;
    opacity: 0.15;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink);
    mix-blend-mode: multiply;
    max-width: 280px;
}

.fragment-1 {
    top: 20%;
    right: 5%;
    font-size: 24px;
    font-family: 'Space Grotesk', sans-serif;
    max-width: 400px;
    clip-path: polygon(0 0, 98% 2%, 100% 88%, 3% 100%);
    opacity: 0.12;
}

.fragment-2 {
    top: 55%;
    right: 8%;
    max-width: 320px;
    clip-path: polygon(2% 0, 100% 3%, 97% 97%, 0 100%);
    opacity: 0.13;
}

.fragment-3 {
    top: 10%;
    right: 30%;
    max-width: 260px;
    clip-path: polygon(0 5%, 95% 0, 100% 95%, 5% 100%);
    opacity: 0.10;
}

.fragment-4 {
    bottom: 15%;
    right: 20%;
    font-size: 20px;
    font-family: 'Space Grotesk', sans-serif;
    max-width: 380px;
    clip-path: polygon(3% 0, 100% 2%, 98% 98%, 0 100%);
    opacity: 0.11;
}

.hero-wave-svg {
    position: absolute;
    bottom: 20%;
    left: 0;
    right: 0;
    width: 100%;
    height: 120px;
}

.hero-char-bg {
    position: absolute;
    top: -80px;
    right: -20px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 500px;
    color: var(--stone);
    opacity: 0.08;
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Vermilion vertical rule */
.vermilion-rule {
    position: absolute;
    left: -24px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--vermilion);
}

.hero-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 48px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.hero-subtext {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.65;
    color: var(--graphite);
    max-width: 560px;
}

.hero-meta {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.meta-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 400;
    padding: 4px 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid currentColor;
}

.accent-vermilion {
    color: var(--vermilion);
    border-color: var(--vermilion);
}

.accent-cyan {
    color: var(--cyan);
    border-color: var(--cyan);
}

.accent-amber {
    color: var(--amber);
    border-color: var(--amber);
}

/* ============================================================
   WAVE DIVIDERS
   ============================================================ */
.wave-divider {
    width: 100%;
    height: 80px;
    margin: 48px 0;
    overflow: hidden;
}

.divider-wave-svg {
    width: 100%;
    height: 100%;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */
.content-section {
    margin-bottom: 64px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--stone);
}

.section-wave-glyph {
    width: 72px;
    height: 24px;
    flex-shrink: 0;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.accent-vermilion-text { color: var(--vermilion); }
.accent-cyan-text { color: var(--cyan); }
.accent-amber-text { color: var(--amber); }

/* ============================================================
   TILES GRID
   ============================================================ */
.tiles-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--gutter);
    margin-bottom: var(--gutter);
}

.tiles-grid-offset {
    margin-top: var(--gutter);
}

/* Column span classes */
.tile-3  { grid-column: span 3; }
.tile-4  { grid-column: span 4; }
.tile-6  { grid-column: span 6; }
.tile-12 { grid-column: span 12; }

/* ============================================================
   TILE COMPONENT (tilt-3d, preserve-3d)
   ============================================================ */
.tile {
    background-color: var(--paper);
    border: 1px solid var(--rule);
    border-radius: 0; /* No rounded corners */
    border-top-width: 2px;
    padding: 0;
    transition: transform 200ms ease-out, box-shadow 200ms ease-out;
    cursor: default;
    overflow: hidden;
    position: relative;
}

.tile:hover {
    transform: perspective(800px) rotateX(4deg) rotateY(-4deg) translateZ(8px);
    box-shadow: 4px 8px 24px rgba(26, 26, 20, 0.12);
}

/* Triadic border colors */
.border-vermilion { border-top-color: var(--vermilion); }
.border-cyan       { border-top-color: var(--cyan); }
.border-amber      { border-top-color: var(--amber); }

.tile-inner {
    position: relative;
    padding: 32px;
    height: 100%;
    min-height: 180px;
}

/* Background char layer */
.tile-bg-layer {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
    overflow: hidden;
}

.tile-char {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 180px;
    color: var(--stone);
    opacity: 0.08;
    line-height: 1;
    user-select: none;
    transform: translateY(20px);
}

/* Foreground content layer */
.tile-fg-layer {
    position: relative;
    z-index: 2;
}

.tile-wide {
    display: grid;
    grid-template-columns: 1fr;
}

.tile-body-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 16px;
    margin-bottom: 16px;
}

.tile-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.tile-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.65;
    color: var(--graphite);
    margin-bottom: 12px;
}

.tile-footnote {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: var(--graphite);
    opacity: 0.8;
    margin-top: 16px;
    letter-spacing: 0.01em;
}

/* ============================================================
   COLLAGE ZONES
   ============================================================ */
.collage-zone {
    position: relative;
    overflow: hidden;
    min-height: 320px;
    margin: 64px 0;
    background-color: var(--paper);
    border: 1px solid var(--rule);
}

.collage-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 320px;
}

.collage-piece {
    position: absolute;
    mix-blend-mode: multiply;
    filter: grayscale(20%);
}

/* Torn-paper clip-path shapes */
.piece-a1 {
    top: 16px;
    left: 5%;
    max-width: 45%;
    clip-path: polygon(0 3%, 97% 0, 100% 94%, 4% 100%);
    background: rgba(204, 204, 191, 0.25);
    padding: 20px 24px;
}

.piece-a2 {
    top: 40%;
    left: 50%;
    max-width: 40%;
    clip-path: polygon(2% 0, 100% 5%, 98% 95%, 0 100%);
    background: rgba(13, 114, 168, 0.06);
    padding: 24px 28px;
}

.piece-a3 {
    bottom: 20px;
    left: 10%;
    max-width: 38%;
    clip-path: polygon(0 5%, 96% 0, 100% 100%, 5% 95%);
    background: rgba(122, 92, 13, 0.07);
    padding: 16px 20px;
}

.piece-a4 {
    top: 30%;
    left: 2%;
    max-width: 35%;
    clip-path: polygon(3% 0, 100% 2%, 97% 97%, 0 100%);
    background: rgba(26, 26, 20, 0.04);
    padding: 16px 20px;
}

.piece-b1 {
    top: 20px;
    right: 5%;
    max-width: 48%;
    clip-path: polygon(3% 0, 100% 4%, 97% 96%, 0 100%);
    background: rgba(204, 204, 191, 0.3);
    padding: 20px 24px;
}

.piece-b2 {
    top: 45%;
    right: 50%;
    max-width: 36%;
    clip-path: polygon(0 2%, 97% 0, 100% 98%, 3% 100%);
    background: rgba(212, 56, 13, 0.05);
    padding: 24px 28px;
}

.piece-b3 {
    bottom: 24px;
    right: 8%;
    max-width: 44%;
    clip-path: polygon(2% 0, 100% 3%, 98% 97%, 0 100%);
    background: rgba(13, 114, 168, 0.06);
    padding: 16px 20px;
}

.collage-text-fragment {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink);
    opacity: 0.7;
    letter-spacing: 0.02em;
}

.collage-wave-svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    pointer-events: none;
}

.collage-char-big {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 320px;
    color: var(--stone);
    opacity: 0.08;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* ============================================================
   FOOTNOTE STRIP (persistent bottom)
   ============================================================ */
#footnote-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-h);
    background-color: var(--ink);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 var(--outer-margin);
    z-index: 100;
}

.footnote-wave-glyph {
    width: 48px;
    height: 16px;
    flex-shrink: 0;
}

.footnote-data {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 11px;
    color: var(--graphite);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.footnote-sep {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--graphite);
    opacity: 0.4;
}

/* ============================================================
   RESPONSIVE — 4 column mobile
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --outer-margin: 16px;
        --nav-w: 0px;
    }

    body {
        background-image: none;
    }

    #page-layout {
        flex-direction: column;
        padding: 0 var(--outer-margin);
    }

    #nav-column {
        position: relative;
        top: 0;
        height: auto;
        width: 100%;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--stone);
        padding: 24px 16px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        overflow: visible;
    }

    .nav-brand {
        width: 100%;
        font-size: 24px;
        margin-bottom: 16px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-links li {
        margin-bottom: 0;
    }

    .nav-link {
        font-size: 12px;
        padding: 6px 10px 6px 10px;
    }

    .nav-link::before {
        display: none;
    }

    .nav-wave-container {
        display: none;
    }

    #content-zone {
        padding: 32px 0;
    }

    .hero-module {
        min-height: 80vh;
    }

    .hero-heading {
        font-size: 32px;
    }

    .tiles-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tile-3, .tile-4 { grid-column: span 4; }
    .tile-6          { grid-column: span 4; }
    .tile-12         { grid-column: span 4; }

    .tile-body-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .hero-char-bg {
        font-size: 200px;
    }

    .collage-zone {
        min-height: 240px;
    }

    .collage-char-big {
        font-size: 180px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .tile-3 { grid-column: span 6; }
}

/* ============================================================
   SELECTION & LINKS
   ============================================================ */
::selection {
    background-color: var(--amber);
    color: var(--paper);
}

a {
    color: var(--cyan);
    text-decoration: underline;
    text-decoration-color: rgba(13, 114, 168, 0.4);
    text-underline-offset: 3px;
    transition: text-decoration-color 150ms ease;
}

a:hover {
    text-decoration-color: var(--cyan);
}

/* Horizontal rule override for content sections */
hr {
    border: none;
    border-top: 1px solid var(--stone);
    margin: 32px 0;
}
