/* ========================================
   mores.dev — Brutalist Data Monolith
   ======================================== */

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

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

body {
    background-color: #1a1a1a;
    color: #c8c0b4;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Grid Veil Overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        repeating-linear-gradient(to right, #2b2b2b 0px, #2b2b2b 1px, transparent 1px, transparent 64px),
        repeating-linear-gradient(to bottom, #2b2b2b 0px, #2b2b2b 1px, transparent 1px, transparent 64px);
    pointer-events: none;
    z-index: 100;
    opacity: 0.3;
}

/* ========================================
   Datum Bar
   ======================================== */
.datum-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 24px;
    background: #2b2b2b;
    border-bottom: 2px solid #d4542a;
}

.datum-bar__wordmark {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.02em;
    color: #f5f0e8;
    line-height: 1;
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.datum-bar__suffix {
    color: #d4542a;
}

.datum-bar__timestamp {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: #d4542a;
}

.datum-bar__label {
    color: #7a7368;
    margin-right: 8px;
}

.datum-bar--footer {
    position: relative;
    border-bottom: none;
    border-top: 2px solid #d4542a;
    margin-top: 0;
    /* #a83820 deep sienna used for active/pressed states */
    /* #e0673f burnt orange light used for border highlights */
}

.datum-bar--footer .datum-bar__wordmark:hover {
    color: #e0673f;
}

.panel--primary:active {
    border-left-color: #a83820;
}

/* ========================================
   Norm Graph
   ======================================== */
.norm-graph-container {
    width: 100%;
    height: 120px;
    background: #1a1a1a;
    overflow: hidden;
    border-bottom: 2px solid #d4542a;
}

.norm-graph {
    width: 100%;
    height: 100%;
}

.norm-graph__line {
    stroke-linecap: square;
}

/* ========================================
   Grid Monolith
   ======================================== */
.grid-monolith {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: auto auto;
    gap: 4px;
    padding: 4px;
    position: relative;
    grid-template-areas:
        "thesis thesis norm norm norm norm data data"
        "thesis thesis case case case evidence evidence evidence";
}

.grid-monolith--lower {
    grid-template-areas:
        "methodology methodology taxonomy taxonomy taxonomy taxonomy data2 data2"
        "methodology methodology application application application signal signal signal";
}

/* Panel Base */
.panel {
    position: relative;
    overflow: hidden;
    border: 2px solid #d4542a;
    transition: transform 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.2s ease;
}

.panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(212, 84, 42, 0.15);
}

/* Panel Weights */
.panel--primary {
    background: #1a1a1a;
    border-left: 6px solid #d4542a;
    min-height: 400px;
}

.panel--secondary {
    background: #242424;
    min-height: 280px;
}

.panel--tertiary {
    background: #2b2b2b;
    min-height: 200px;
}

/* Grid Area Assignments */
[data-region="thesis"] { grid-area: thesis; }
[data-region="norm"] { grid-area: norm; }
[data-region="data"] { grid-area: data; }
[data-region="case"] { grid-area: case; }
[data-region="evidence"] { grid-area: evidence; }
[data-region="methodology"] { grid-area: methodology; }
[data-region="taxonomy"] { grid-area: taxonomy; }
[data-region="data2"] { grid-area: data2; }
[data-region="application"] { grid-area: application; }
[data-region="signal"] { grid-area: signal; }

/* Panel Content */
.panel__content {
    position: relative;
    z-index: 2;
    padding: 32px 24px;
}

.panel__label {
    display: block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: #7a7368;
    margin-bottom: 16px;
    text-transform: lowercase;
}

.panel__heading {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: -0.02em;
    color: #f5f0e8;
    line-height: 1.15;
    margin-bottom: 24px;
}

.panel__text {
    max-width: 62ch;
    margin-bottom: 16px;
    color: #c8c0b4;
    font-weight: 400;
}

.panel__text strong {
    font-weight: 600;
    color: #f5f0e8;
}

/* Panel List */
.panel__list {
    list-style: none;
    padding: 0;
}

.panel__list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(212, 84, 42, 0.2);
    font-size: 0.95rem;
}

.panel__list li:last-child {
    border-bottom: none;
}

/* Data Values */
.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    color: #d4542a;
    margin-right: 8px;
}

/* ========================================
   Panel Shapes (Background Geometry)
   ======================================== */
.panel__shape {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.08;
    background: #d4542a;
    clip-path: polygon(0% 0%, 60% 0%, 60% 50%, 100% 50%, 100% 100%, 0% 100%);
}

.panel__shape--rect {
    clip-path: polygon(10% 10%, 80% 10%, 80% 85%, 10% 85%);
}

.panel__shape--lshape {
    clip-path: polygon(0% 0%, 40% 0%, 40% 60%, 100% 60%, 100% 100%, 0% 100%);
}

.panel__shape--truncated {
    clip-path: polygon(20% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 30%);
}

/* ========================================
   Data Stats (Tertiary Panels)
   ======================================== */
.data-stat {
    margin-bottom: 24px;
}

.data-stat__value {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #d4542a;
    line-height: 1;
    margin-bottom: 4px;
}

.data-stat__label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #7a7368;
}

/* ========================================
   Evidence Bar
   ======================================== */
.evidence-bar {
    margin-top: 24px;
    background: #242424;
    height: 32px;
    position: relative;
    border: 1px solid #d4542a;
}

.evidence-bar__fill {
    height: 100%;
    background: #d4542a;
    transition: width 1.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.evidence-bar__label {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: #f5f0e8;
    white-space: nowrap;
}

/* ========================================
   Taxonomy Grid
   ======================================== */
.taxonomy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.taxonomy-item {
    padding: 16px;
    border: 1px solid rgba(212, 84, 42, 0.3);
    background: #1a1a1a;
}

.taxonomy-item__desc {
    display: block;
    font-size: 0.85rem;
    color: #7a7368;
    margin-top: 8px;
    line-height: 1.5;
}

/* ========================================
   Registry Entries
   ======================================== */
.registry-entry {
    padding: 16px 0;
    border-bottom: 1px solid rgba(212, 84, 42, 0.2);
}

.registry-entry__title {
    display: block;
    color: #f5f0e8;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 4px;
}

.registry-entry__meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: #7a7368;
}

/* ========================================
   Redaction
   ======================================== */
.redacted {
    background: #d4542a;
    color: #d4542a;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
    padding: 0 2px;
}

.redacted:hover {
    background: transparent;
    color: #f5f0e8;
}

/* ========================================
   Trench
   ======================================== */
.trench {
    width: 100%;
    height: 12px;
    background: #d4542a;
}

/* ========================================
   Construction Marks
   ======================================== */
.construction-mark {
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #7a7368;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
}

.construction-mark--tl { top: 8px; left: 8px; }
.construction-mark--tr { top: 8px; right: 8px; }
.construction-mark--center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.construction-mark--bl { bottom: 8px; left: 8px; }
.construction-mark--br { bottom: 8px; right: 8px; }

.construction-mark.is-visible {
    opacity: 1;
}

/* ========================================
   Responsive — Mobile
   ======================================== */
@media (max-width: 768px) {
    .grid-monolith,
    .grid-monolith--lower {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        grid-template-areas:
            "thesis"
            "norm"
            "data"
            "case"
            "evidence";
    }

    .grid-monolith--lower {
        grid-template-areas:
            "methodology"
            "taxonomy"
            "data2"
            "application"
            "signal";
    }

    .panel--primary,
    .panel--secondary {
        min-height: auto;
    }

    .taxonomy-grid {
        grid-template-columns: 1fr;
    }

    .datum-bar__wordmark {
        font-size: 1.5rem;
    }
}
