/* diplomatic.day -- A document, not a destination */

:root {
    --color-bg: #F3EBE0;
    --color-text-primary: #3E2C20;
    --color-text-body: #5D4437;
    --color-accent-line: #B8906E;
    --color-accent-deep: #8B6542;
    --color-gloss: #907860;
    --color-signal: #9C3D2A;
    --color-hover-surface: #EBE0D2;
    --color-register: #D4BFA6;
    --font-heading: 'Jost', sans-serif;
    --font-body: 'Source Sans 3', sans-serif;
    --font-gloss: 'DM Sans', sans-serif;
    --angle-vertex: 40deg;
    --scale-hover-standard: 1.04;
    --scale-hover-accent: 1.08;
    --scale-hover-signal: 1.12;
    --transition-compose: 350ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

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

html, body {
    background: var(--color-bg);
    color: var(--color-text-body);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.9;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    position: relative;
}

/* Cadastral Register -- ledger background */
.cadastral-register {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.register-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--color-register);
    opacity: 0.12;
}

/* Main document */
.document {
    position: relative;
    z-index: 1;
    width: 100%;
}

/* Section base */
.section {
    position: relative;
    width: 100%;
    padding: 7vh 0;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 700ms ease-out, transform 700ms ease-out;
}

.section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section header */
.section-header {
    position: relative;
    margin-left: 10vw;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.section-hairline {
    display: block;
    width: 100%;
    max-width: 80vw;
    height: 1px;
    background: var(--color-accent-line);
    opacity: 0.4;
    margin-bottom: 2rem;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--color-text-primary);
    font-size: clamp(1.3rem, 2.8vw, 2.2rem);
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
    cursor: default;
    transition: transform 300ms cubic-bezier(0.22, 0.61, 0.36, 1.0),
                letter-spacing 300ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
    transform-origin: left center;
    display: inline-block;
}

.section-heading:hover {
    transform: scale(1.02);
    letter-spacing: 0.07em;
}

/* Section body two-column structure */
.section-body {
    position: relative;
    display: grid;
    grid-template-columns: 10vw 58vw 8vw 18vw 6vw;
    grid-template-areas: ". main gap gloss .";
    width: 100%;
}

.main-column {
    grid-area: main;
    max-width: 36em;
}

.gloss-column {
    grid-area: gloss;
    font-family: var(--font-gloss);
    color: var(--color-gloss);
    font-size: 0.78rem;
    line-height: 1.45;
    letter-spacing: 0.015em;
}

.gloss-empty {
    min-height: 1px;
}

/* Body text */
.body-text {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.05vw, 1.125rem);
    line-height: 1.9;
    color: var(--color-text-body);
    margin-bottom: 1.75rem;
}

.body-text:last-child {
    margin-bottom: 0;
}

/* Subsections */
.subsection {
    position: relative;
    margin-bottom: 4rem;
    padding-top: 1rem;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-marker {
    margin-bottom: 1rem;
}

.subsection-heading {
    font-family: var(--font-heading);
    font-weight: 300;
    color: var(--color-text-primary);
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    text-transform: none;
}

/* Protocol marker (angular vertex glyph) */
.protocol-marker {
    display: inline-block;
    position: relative;
    width: 32px;
    height: 24px;
    margin-bottom: 1.5rem;
    transform-origin: left center;
    transition: transform 400ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
    cursor: default;
}

.protocol-marker .vertex-line {
    position: absolute;
    left: 0;
    background: var(--color-accent-deep);
    height: 1.5px;
    transform-origin: left center;
    transition: background-color 400ms cubic-bezier(0.22, 0.61, 0.36, 1.0),
                width 400ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

.protocol-marker .vertex-long {
    top: 8px;
    width: 24px;
    transform: rotate(0deg);
}

.protocol-marker .vertex-short {
    top: 8px;
    width: 16px;
    transform: rotate(-40deg);
    transform-origin: left center;
}

.protocol-marker:hover {
    transform: scale(1.08);
}

.protocol-marker:hover .vertex-line {
    background: var(--color-text-primary);
}

/* Reveal animation for vertex lines */
.protocol-marker.is-drawn .vertex-long {
    width: 24px;
}

.protocol-marker.is-drawn .vertex-short {
    width: 16px;
}

.protocol-marker:not(.is-drawn) .vertex-line {
    width: 0;
}

/* Vestibule */
.section-vestibule {
    min-height: 100vh;
    padding: 0;
    display: flex;
    align-items: flex-start;
}

.vestibule-stack {
    margin-left: 10vw;
    margin-top: 35vh;
    max-width: 70vw;
    transform: translateY(-3.5rem);
}

.vestibule-stack .protocol-marker {
    margin-bottom: 3.5rem;
}

.vestibule-stack .protocol-marker .vertex-line {
    background: var(--color-accent-line);
    height: 1.5px;
}

.domain-title {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    line-height: 1.1;
    margin-bottom: 2.5rem;
}

.epigraph {
    font-family: var(--font-body);
    font-size: clamp(1rem, 1.05vw, 1.125rem);
    color: var(--color-text-body);
    letter-spacing: 0.02em;
    font-style: normal;
}

/* Credentials -- main column only */
.section-credentials {
    min-height: 70vh;
}

/* Dossier */
.section-dossier {
    min-height: 130vh;
}

/* Aside -- inverted weight */
.section-aside {
    min-height: 50vh;
}

.section-body-inverted .main-column-quiet {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 30vh;
}

/* Pull passage with angle brackets */
.pull-passage {
    position: relative;
    padding: 3rem 3rem;
    max-width: 32em;
    margin: 0;
}

.pull-text {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: clamp(1.1rem, 1.6vw, 1.5rem);
    line-height: 1.55;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
    font-style: normal;
}

.bracket {
    position: absolute;
    width: 32px;
    height: 24px;
    pointer-events: none;
    transition: transform 400ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

.bracket .vertex-line {
    position: absolute;
    background: var(--color-accent-deep);
    height: 1.5px;
    transform-origin: left center;
    transition: width 400ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
}

.bracket-tl {
    top: 0;
    left: 0;
}

.bracket-tl .vertex-long {
    top: 0;
    left: 0;
    width: 24px;
    transform: rotate(0deg);
}

.bracket-tl .vertex-short {
    top: 0;
    left: 0;
    width: 16px;
    transform: rotate(40deg);
}

.bracket-br {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

.bracket-br .vertex-long {
    top: 0;
    left: 0;
    width: 24px;
    transform: rotate(0deg);
}

.bracket-br .vertex-short {
    top: 0;
    left: 0;
    width: 16px;
    transform: rotate(40deg);
}

.pull-passage:hover .bracket .vertex-long {
    width: 30px;
}

.pull-passage:hover .bracket .vertex-short {
    width: 22px;
}

/* Gloss column blocks */
.gloss-block {
    position: relative;
    margin-bottom: 3rem;
    padding-top: 0.5rem;
}

.gloss-block:last-child {
    margin-bottom: 0;
}

.gloss-block.is-staggered {
    transition-delay: 250ms;
}

.gloss-text {
    font-family: var(--font-gloss);
    font-size: 0.78rem;
    line-height: 1.45;
    letter-spacing: 0.015em;
    color: var(--color-gloss);
    margin-bottom: 0.35rem;
}

.gloss-text strong {
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Micro vertex (gloss column) */
.micro-vertex {
    display: inline-block;
    position: relative;
    width: 18px;
    height: 14px;
    margin-bottom: 0.6rem;
}

.micro-vertex .vertex-line {
    position: absolute;
    background: var(--color-accent-line);
    height: 1px;
    transform-origin: left center;
}

.micro-vertex .vertex-long {
    top: 6px;
    left: 0;
    width: 12px;
    transform: rotate(0deg);
}

.micro-vertex .vertex-short {
    top: 6px;
    left: 0;
    width: 8px;
    transform: rotate(-40deg);
}

/* Signal blocks (Oxide Red rectangles) */
.signal-block {
    display: block;
    width: 40px;
    height: 10px;
    background: var(--color-signal);
    margin: 1.5rem 0 2rem 0;
    transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1.0),
                background-color 500ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
    transform-origin: left center;
    cursor: default;
}

.signal-block:hover {
    transform: scale(1.12);
    background: var(--color-text-primary);
}

/* Section terminal vertex (downward arrow) */
.section-terminal {
    display: flex;
    justify-content: center;
    margin-top: 6rem;
    margin-bottom: 4rem;
}

.terminal-vertex {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 24px;
    transform: rotate(180deg);
}

.terminal-vertex .vertex-line {
    position: absolute;
    background: var(--color-accent-line);
    height: 1.5px;
    transform-origin: left center;
}

.terminal-vertex .vertex-long {
    top: 8px;
    left: 4px;
    width: 24px;
    transform: rotate(0deg);
}

.terminal-vertex .vertex-short {
    top: 8px;
    left: 4px;
    width: 16px;
    transform: rotate(-40deg);
}

/* Attestation */
.section-attestation {
    min-height: 60vh;
    padding: 8vh 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attestation-stack {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.attestation-domain {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.20em;
    text-transform: lowercase;
    color: var(--color-text-primary);
}

.attestation-year {
    font-family: var(--font-heading);
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 0.25em;
    color: var(--color-text-primary);
}

/* Seal vertex (large terminal mark) */
.seal-vertex {
    position: relative;
    display: inline-block;
    width: 96px;
    height: 64px;
    transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1.0);
    cursor: default;
}

.seal-vertex .vertex-line {
    position: absolute;
    background: var(--color-signal);
    height: 2px;
    transform-origin: left center;
}

.seal-vertex .vertex-long {
    top: 24px;
    left: 8px;
    width: 80px;
    transform: rotate(0deg);
}

.seal-vertex .vertex-short {
    top: 24px;
    left: 8px;
    width: 56px;
    transform: rotate(-40deg);
}

.seal-vertex:hover {
    transform: scale(1.08);
}

/* Stagger the gloss column animation */
.section.is-visible .gloss-column {
    animation: gloss-rise 700ms cubic-bezier(0.22, 0.61, 0.36, 1.0) 250ms backwards;
}

@keyframes gloss-rise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive collapse */
@media (max-width: 900px) {
    .section-body {
        grid-template-columns: 8vw 1fr 8vw;
        grid-template-areas:
            ". main ."
            ". gloss .";
        row-gap: 3rem;
    }

    .main-column {
        max-width: 100%;
    }

    .vestibule-stack {
        margin-left: 8vw;
        margin-top: 30vh;
    }

    .section-header {
        margin-left: 8vw;
    }

    .section-hairline {
        max-width: calc(100vw - 16vw);
    }
}

@media (max-width: 600px) {
    .domain-title {
        letter-spacing: 0.06em;
    }

    .pull-passage {
        padding: 2rem 1.5rem;
    }
}
