/* ========================================
   double-standard.xyz - Styles
   Palette: Analogous Marble
   Typography: Commissioner
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    /* Background Duality */
    --bg-public: #F4F2F0;
    --bg-private: #EDEAED;
    --card-surface-a: #FAF8F6;
    --card-surface-b: #F0EDEF;

    /* Text */
    --text-primary-public: #2C2A35;
    --text-primary-private: #3A3545;
    --text-body: #4A4757;
    --text-micro: #7D7A8A;
    --text-footnote: #9895A3;
    --text-mono: #5E5B6B;

    /* Accent Duality */
    --accent-public: #6B5B8A;
    --accent-private: #8A6B7A;
    --interactive-active: #8B7AAF;
    --interactive-hover: #AF8B9F;

    /* Marble Vein */
    --vein-lavender: #C4B8D1;
    --vein-warm: #D1C4B8;

    /* Grain */
    --grain-subtle: 0.035;
    --grain-noticeable: 0.065;

    /* Typography */
    --font-family: "Commissioner", sans-serif;
}
/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    font-weight: 350;
    color: var(--text-body);
    background-color: var(--bg-public);
    line-height: 1.72;
    letter-spacing: 0.01em;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    overflow-x: hidden;
}

/* --- Page Wrapper Fade-in --- */
.page-wrapper {
    opacity: 0;
    animation: pageFadeIn 200ms ease-out forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: var(--grain-subtle);
    background-image: url("data:image/svg+xml,%3Csvg viewBox="0 0 256 256" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noise)" opacity="0.5"/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}
/* --- Marble Grain Texture --- */
.marble-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(196, 184, 209, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(209, 196, 184, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 80%, rgba(196, 184, 209, 0.08) 0%, transparent 60%);
}

.marble-grain-b {
    background-image:
        radial-gradient(ellipse at 70% 40%, rgba(209, 196, 184, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 70%, rgba(196, 184, 209, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 60% 20%, rgba(209, 196, 184, 0.08) 0%, transparent 60%);
}

.marble-grain-heavy {
    opacity: 1.8;
}
/* --- Navigation --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--bg-public);
    z-index: 1000;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    padding: 0 40px;
    max-width: 1440px;
    margin: 0 auto;
}

.nav-domain {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    color: var(--text-primary-public);
}

.nav-link {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-micro);
    text-decoration: none;
    transition: color 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-link:hover {
    color: var(--accent-public);
}

.nav-double-border {
    position: relative;
    height: 4px;
}

.nav-double-border::before,
.nav-double-border::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
}

.nav-double-border::before {
    top: 0;
    background-color: rgba(44, 42, 53, 0.3);
}

.nav-double-border::after {
    top: 3px;
    background-color: rgba(44, 42, 53, 0.15);
}
/* --- Section Dividers --- */
.section-divider {
    position: relative;
    height: 4px;
    margin: 0 40px;
}

.pediment-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    margin: 0 40px;
}

.pediment-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, var(--vein-lavender), var(--vein-warm));
}

.pediment-divider::after {
    content: "";
    position: relative;
    width: 12px;
    height: 12px;
    background-color: var(--bg-public);
    border: 1px solid var(--vein-lavender);
    transform: rotate(45deg);
    z-index: 2;
}

.pediment-divider-small {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    margin: 24px 0;
}

.pediment-divider-small::before {
    content: "";
    position: absolute;
    left: 20%;
    right: 20%;
    top: 50%;
    height: 1px;
    background: linear-gradient(to right, var(--vein-lavender), var(--vein-warm));
}

.pediment-divider-small::after {
    content: "";
    position: relative;
    width: 8px;
    height: 8px;
    background-color: var(--bg-private);
    border: 1px solid var(--vein-warm);
    transform: rotate(45deg);
    z-index: 2;
}
/* --- Double Rule --- */
.double-rule {
    position: relative;
    height: 7px;
    margin: 32px 0;
}

.double-rule::before,
.double-rule::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
}

.double-rule::before {
    top: 0;
    background-color: var(--vein-lavender);
}

.double-rule::after {
    top: 4px;
    background-color: var(--vein-warm);
}

/* --- Zone: Premise (Hero) --- */
.zone {
    position: relative;
    overflow: hidden;
}

.zone-premise {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 64px;
}

.premise-bg-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background-color: var(--bg-public);
    z-index: 0;
}

.premise-bg-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background-color: var(--bg-private);
    z-index: 0;
}

.premise-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 40px;
}
.premise-headline {
    font-family: var(--font-family);
    font-weight: 700;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text-primary-public);
    margin-bottom: 24px;
}

.typewriter-cursor {
    font-weight: 100;
    color: var(--interactive-active);
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.premise-subtitle {
    font-family: var(--font-family);
    font-weight: 350;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--text-body);
    line-height: 1.72;
    opacity: 0;
    transition: opacity 400ms ease-out;
}

.premise-subtitle.visible {
    opacity: 1;
}
/* --- Zone: Standards (Card Grid) --- */
.zone-standards {
    background-color: var(--bg-public);
    padding: 80px 40px;
    padding-top: 40px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1200px;
    margin: 40px auto 0;
}

/* Cards */
.card {
    position: relative;
    padding: 32px;
    border-radius: 2px;
    transition: all 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(30px);
}

.card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1), transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.card-standard {
    min-height: 380px;
    background-color: var(--card-surface-a);
}

.card-extended {
    min-height: 520px;
    background-color: var(--card-surface-b);
}

/* Fluted edge border */
.card {
    border-left: 3px solid transparent;
    border-image: repeating-linear-gradient(
        to bottom,
        var(--vein-lavender) 0px, var(--vein-lavender) 8px,
        transparent 8px, transparent 12px
    ) 3;
}

.card:hover .marble-grain,
.card:hover {
    --grain-local: var(--grain-noticeable);
}
/* Card Double Rule */
.card-double-rule {
    position: relative;
    height: 7px;
    margin-bottom: 20px;
}

.card-double-rule::before,
.card-double-rule::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
}

.card-double-rule::before {
    top: 0;
    background-color: var(--vein-lavender);
}

.card-double-rule::after {
    top: 4px;
    background-color: var(--vein-warm);
}

/* Card Inner (Bifurcated) */
.card-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.card-left {
    flex: 5;
}

.card-right {
    flex: 7;
    text-align: right;
}

.card-label {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-micro);
}

.card-headline {
    font-family: var(--font-family);
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary-public);
}

.card-body {
    font-family: var(--font-family);
    font-weight: 350;
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.72;
    color: var(--text-body);
    flex: 1;
}

.card-footnote-ref {
    display: block;
    text-align: right;
    margin-top: 16px;
}

.card-footnote-ref a {
    color: var(--interactive-active);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-footnote-ref a:hover {
    color: var(--interactive-hover);
}
/* --- Zone: Measure (Typewriter) --- */
.zone-measure {
    min-height: 60vh;
    background-color: var(--bg-private);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.measure-content {
    position: relative;
    z-index: 2;
    max-width: 640px;
    width: 100%;
    text-align: center;
}

.typewriter-block {
    min-height: 120px;
}

.typewriter-statement {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.5;
    color: var(--text-primary-public);
    margin-bottom: 24px;
    min-height: 2.5em;
}

.typewriter-contradiction {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: clamp(1.1rem, 1.8vw, 1.4rem);
    line-height: 1.5;
    color: var(--text-primary-private);
    min-height: 2.5em;
}

.tw-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    vertical-align: text-bottom;
    animation: blink 530ms step-end infinite;
    margin-left: 2px;
}

.tw-cursor-a {
    background-color: var(--accent-public);
    color: transparent;
}

.tw-cursor-b {
    background-color: var(--accent-private);
    color: transparent;
}

.tw-cursor.hidden {
    display: none;
}

.typewriter-statement.faded,
.typewriter-contradiction.faded {
    opacity: 0.4;
    transition: opacity 800ms ease;
}
/* --- Zone: Record (Timeline) --- */
.zone-record {
    background-color: var(--bg-public);
    padding: 80px 40px;
}

.record-column {
    max-width: 720px;
    margin: 40px auto 0;
    position: relative;
    z-index: 2;
}

.record-entry {
    display: flex;
    gap: 24px;
    padding: 32px 0;
    opacity: 0;
    transform: translateY(20px);
}

.record-entry.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1), transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

.record-official,
.record-actual {
    flex: 1;
}

.record-official {
    text-align: left;
}

.record-actual {
    text-align: right;
}

.record-label {
    display: block;
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-micro);
    margin-bottom: 12px;
}

.record-text {
    font-family: var(--font-family);
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.72;
}

.record-text-serif {
    font-weight: 500;
    color: var(--text-primary-public);
}

.record-text-sans {
    font-weight: 350;
    color: var(--text-primary-private);
}

.record-divider-vertical {
    position: relative;
    width: 7px;
    flex-shrink: 0;
}

.record-divider-vertical::before,
.record-divider-vertical::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
}

.record-divider-vertical::before {
    left: 0;
    background-color: var(--vein-lavender);
}

.record-divider-vertical::after {
    left: 4px;
    background-color: var(--vein-warm);
}
/* --- Zone: Footnote --- */
.zone-footnote {
    min-height: 40vh;
    background-color: var(--bg-public);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
}

.footnote-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
    text-align: left;
}

.footnote-sup {
    font-family: var(--font-family);
    font-weight: 300;
    font-size: 1.2rem;
    color: var(--interactive-active);
    display: block;
    margin-bottom: 16px;
}

.footnote-text {
    font-family: var(--font-family);
    font-weight: 300;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.72;
    color: var(--text-footnote);
}

.footnote-copyright {
    font-family: var(--font-family);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: var(--text-micro);
}
/* --- Responsive --- */
@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .card-standard {
        min-height: 340px;
    }

    .card-extended {
        min-height: 460px;
    }
}

@media (max-width: 768px) {
    .nav-inner {
        padding: 0 20px;
    }

    .zone-standards {
        padding: 60px 20px;
    }

    .zone-measure {
        padding: 60px 20px;
    }

    .zone-record {
        padding: 60px 20px;
    }

    .zone-footnote {
        padding: 60px 20px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-standard,
    .card-extended {
        min-height: auto;
    }

    .card-inner {
        flex-direction: column;
        gap: 8px;
    }

    .card-right {
        text-align: left;
    }

    .card::after {
        content: "";
        position: absolute;
        left: 15%;
        right: 15%;
        top: 50%;
        height: 1px;
        background: linear-gradient(to right, var(--vein-lavender), transparent, var(--vein-warm));
        pointer-events: none;
    }

    .record-entry {
        flex-direction: column;
        gap: 16px;
    }

    .record-actual {
        text-align: left;
    }

    .record-divider-vertical {
        width: 100%;
        height: 7px;
    }

    .record-divider-vertical::before,
    .record-divider-vertical::after {
        top: auto;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        height: 1px;
    }

    .record-divider-vertical::before {
        top: 0;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
    }

    .record-divider-vertical::after {
        top: 4px;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
    }

    .pediment-divider,
    .section-divider {
        margin: 0 20px;
    }

    .premise-content {
        padding: 0 20px;
    }
}
