/* telomere.digital - Styles */
/* Palette: Deep Loam #1c1108, Fired Clay #2e1a0e, Oxidized Copper #c4956a, Burnt Umber #3b2313, Raw Sienna #5c3d24, Dopamine Orange #e8732a, Amber Glow #f5a623, Cadmium Red #c0392b */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    background: radial-gradient(ellipse at center, #1c1108 0%, #0f0a04 100%);
    color: #5c3d24;
    font-family: "Bitter", serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    letter-spacing: 0.005em;
    line-height: 1.72;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== GRID OVERLAY ===== */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 800ms ease;
}

.grid-overlay.visible {
    opacity: 1;
}

.grid-line-v {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: #c4956a;
    opacity: 0.4;
    transition: opacity 300ms ease;
}

.grid-line-h {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: #c4956a;
    opacity: 0.4;
    transition: opacity 300ms ease;
}

.grid-line-h.thick {
    height: 2px;
    background: #8b5e3c;
}

.grid-crosshair {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #e8732a;
    opacity: 0.6;
    transform: translate(-2px, -1px);
}

/* ===== MODULE INDEX SIDEBAR ===== */
.module-index {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    transition: opacity 600ms ease 1200ms;
}

.module-index.visible {
    opacity: 1;
}

.index-marker {
    width: 36px;
    height: 36px;
    border: 1px solid #c4956a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 300ms ease;
    background: #1c1108;
}

.index-marker span {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: #c4956a;
    text-transform: uppercase;
}

.index-marker:hover,
.index-marker.active {
    background: #2e1a0e;
    border-color: #e8732a;
}

.index-marker.active span {
    color: #e8732a;
}

/* ===== SECTIONS ===== */
.section {
    position: relative;
    z-index: 2;
    padding-left: 68px;
    padding-right: 24px;
}

/* ===== SECTION 1: GENESIS ===== */
.section-genesis {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 100px;
}

.genesis-content {
    max-width: 900px;
}

.genesis-title {
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    font-size: clamp(3rem, 7vw, 5.5rem);
    letter-spacing: 0.01em;
    line-height: 1.08;
    color: #c4956a;
    text-transform: uppercase;
    font-variant: small-caps;
    opacity: 0;
}

.genesis-title.animate {
    opacity: 1;
}

.genesis-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 200ms ease, transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.genesis-title .char.landed {
    opacity: 1;
    transform: translateY(0);
}

.genesis-subtitle {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b5e3c;
    margin-top: 24px;
    opacity: 0;
    transition: opacity 600ms ease;
}

.genesis-subtitle.visible {
    opacity: 1;
}

/* ===== GRID CONTAINERS ===== */
.grid-container {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
    max-width: 1400px;
    padding: 40px 0;
}

.grid-expansion {
    gap: 16px;
}

.grid-compression {
    gap: 10px;
}

.grid-terminal {
    gap: 6px;
    padding-bottom: 80px;
}

/* ===== MODULE BASE ===== */
.module {
    background: #2e1a0e;
    border: 1px solid #c4956a;
    padding: 24px;
    position: relative;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               box-shadow 350ms cubic-bezier(0.55, 0.085, 0.68, 0.53),
               background 300ms ease;
}

.module.in-view {
    opacity: 1;
    transform: translateY(0);
}

.module:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(89, 61, 35, 0.25);
    transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               box-shadow 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               background 300ms ease;
}

/* Noise texture overlay for modules */
.module::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ===== MODULE SIZES ===== */
.module-large {
    grid-column: span 8;
    min-height: 200px;
    padding: 32px;
}

.module-standard {
    grid-column: span 5;
    min-height: 200px;
}

.module-small {
    grid-column: span 3;
    min-height: 120px;
}

.module-small-compressed {
    grid-column: span 3;
    min-height: 100px;
    padding: 16px;
    background: #3a1f0f;
}

.module-micro {
    grid-column: span 2;
    min-height: 80px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.module-micro-terminal {
    grid-column: span 2;
    min-height: 60px;
    padding: 10px;
    background: #1c1108;
    border: 1px solid #c4956a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               box-shadow 350ms cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

.module-micro-terminal.in-view {
    opacity: 1;
    transform: translateY(0);
}

.module-micro-terminal:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(89, 61, 35, 0.25);
}

.module-final {
    grid-column: span 8;
    min-height: 160px;
    padding: 40px 32px;
    background: #0f0a04;
    border: 1px solid #c4956a;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               transform 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
               box-shadow 350ms cubic-bezier(0.55, 0.085, 0.68, 0.53);
}

.module-final.in-view {
    opacity: 1;
    transform: translateY(0);
}

.module-final:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 24px rgba(89, 61, 35, 0.25);
}

/* ===== TYPOGRAPHY ===== */
.module-label {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b5e3c;
    display: block;
    margin-bottom: 12px;
}

.module-headline {
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    letter-spacing: 0.01em;
    line-height: 1.08;
    color: #3b2313;
    text-transform: uppercase;
    font-variant: small-caps;
    margin-bottom: 16px;
}

.module-body {
    font-family: "Bitter", serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    letter-spacing: 0.005em;
    line-height: 1.72;
    color: #5c3d24;
}

.module-body-compressed {
    font-family: "Bitter", serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    letter-spacing: 0.005em;
    line-height: 1.55;
    color: #5c3d24;
}

.final-headline {
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    color: #c4956a;
    line-height: 1.2;
}

/* ===== DATA POINTS ===== */
.data-point {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.data-value {
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 2.5vw, 2rem);
    color: #e8732a;
    letter-spacing: 0.02em;
}

.data-desc {
    font-family: "Archivo", sans-serif;
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8b5e3c;
}

.micro-value {
    font-family: "Roboto Slab", serif;
    font-weight: 700;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    color: #c4956a;
}

.terminal-val {
    color: #c0392b;
}

/* ===== INLINE CHARTS ===== */
.sparkline-inline {
    display: block;
    width: 100px;
    height: 40px;
    margin-top: 16px;
}

.mini-chart {
    margin-top: 16px;
}

.mini-chart svg {
    width: 120px;
    height: 40px;
}

.compression-chart {
    display: block;
    width: 100%;
    height: 50px;
    margin: 8px 0;
}

.ring-gauge {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.ring-gauge svg {
    width: 60px;
    height: 60px;
}

.ring-gauge-small {
    display: flex;
    justify-content: center;
}

.ring-gauge-small svg {
    width: 40px;
    height: 40px;
}

/* ===== SECTION-SPECIFIC ===== */
.section-compression {
    padding-top: 40px;
}

.section-compression .grid-container {
    gap: 10px;
}

.section-terminal {
    padding-top: 40px;
    background: linear-gradient(to bottom, transparent 0%, #0f0a04 40%);
    min-height: 60vh;
}

.section-terminal .grid-container {
    gap: 6px;
}

.section-terminal .module-label {
    font-size: 0.6rem;
    margin-bottom: 4px;
}

/* ===== HORIZONTAL SEPARATORS ===== */
.section-expansion::before,
.section-compression::before,
.section-terminal::before {
    content: "";
    display: block;
    width: 100vw;
    height: 1px;
    background: #c4956a;
    opacity: 0.4;
    margin-left: -68px;
    margin-bottom: 24px;
}


/* Patina effect on hover-lifted modules */
.module:hover::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0.02;
    background-color: #4a6741;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .module-index {
        position: fixed;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        flex-direction: row;
        justify-content: center;
        padding: 8px;
        background: #1c1108;
        border-top: 1px solid #c4956a;
    }

    .section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .section-genesis {
        padding-left: 24px;
    }

    .grid-container {
        grid-template-columns: repeat(6, 1fr);
    }

    .module-large {
        grid-column: span 6;
    }

    .module-standard {
        grid-column: span 6;
    }

    .module-small,
    .module-small-compressed {
        grid-column: span 3;
    }

    .module-micro,
    .module-micro-terminal {
        grid-column: span 2;
    }

    .module-final {
        grid-column: span 6;
    }
}
