/* ============================
   diplomatic.boo - Styles
   ============================ */

:root {
    --parchment: #f4e8c1;
    --aged: #e8dcc8;
    --faded: #d4cbb8;
    --sepia: #6b5b4e;
    --umber: #4a3f35;
    --ghost: #a8b4c0;
    --archive-red: #9c4a3d;
    --void: #1e1a16;
    --rule: #8b7d6b;

    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'EB Garamond', serif;
    --font-meta: 'Commissioner', sans-serif;
    --font-sig: 'Dancing Script', cursive;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-snap-type: y proximity; }

body {
    background: var(--parchment);
    color: var(--umber);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.85;
    overflow-x: hidden;
}

/* Grain overlay */
.grain-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.03;
    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 type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* Fold lines */
.fold-lines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 5;
}

.fold-h {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--rule);
    opacity: 0.12;
}

.fold-v {
    position: absolute;
    top: 0;
    height: 100%;
    width: 1px;
    background: var(--rule);
    opacity: 0.12;
}

::selection { background: var(--sepia); color: var(--parchment); }

/* ============================
   The Seal (Hero)
   ============================ */
.seal-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
}

.hero-seal { margin-bottom: 2rem; }

.seal-wreath, .seal-inner, .seal-quill {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
}

.seal-wreath { transition: stroke-dashoffset 1.5s ease; }
.seal-inner { transition: stroke-dashoffset 1s ease 1s; }
.seal-quill { transition: stroke-dashoffset 1s ease 1.5s; }
.seal-ghost { transition: opacity 0.8s ease 2.5s; }

.hero-seal.drawn .seal-wreath,
.hero-seal.drawn .seal-inner,
.hero-seal.drawn .seal-quill { stroke-dashoffset: 0; }
.hero-seal.drawn .seal-ghost { opacity: 0.3; }

.site-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 64px;
    letter-spacing: 0.18em;
    font-variant: small-caps;
    color: var(--sepia);
    opacity: 0;
    transition: opacity 3s ease 1s;
}

.seal-section.active .site-title { opacity: 1; }

/* ============================
   The Preamble
   ============================ */
.preamble {
    min-height: 80vh;
    background: linear-gradient(180deg, var(--parchment), var(--aged), var(--faded));
    padding: 8rem 20px;
    display: flex;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
}

.preamble-column {
    max-width: 600px;
    border-left: 1px solid rgba(139, 125, 107, 0.3);
    padding-left: 32px;
    counter-reset: clause;
}

.clause {
    display: flex;
    gap: 16px;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.clause.visible { opacity: 1; }

.clause-num {
    font-family: var(--font-display);
    font-weight: 300;
    font-style: italic;
    font-size: 28px;
    color: var(--sepia);
    flex-shrink: 0;
    width: 40px;
}

.clause-text {
    color: var(--umber);
    line-height: 1.85;
}

/* Spectral Annotations */
.spectral-annotation {
    position: absolute;
    font-family: var(--font-meta);
    font-style: italic;
    font-size: 13px;
    color: var(--ghost);
    opacity: 0.2;
    letter-spacing: 0.04em;
    background-image: linear-gradient(var(--ghost), var(--ghost));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: background-size 0.8s ease;
}

.spectral-annotation.underlined {
    background-size: 100% 1px;
}

.ann-1 { left: 5%; top: 20%; }
.ann-2 { right: 5%; bottom: 20%; }

/* ============================
   The Articles
   ============================ */
.articles {
    min-height: 100vh;
    padding: 8rem 20px;
    scroll-snap-align: start;
}

.articles-dual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.article {
    margin-bottom: 3rem;
}

.article-divider {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.article-heading {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(20px, 2.5vw, 28px);
    font-variant: small-caps;
    letter-spacing: 0.1em;
    color: var(--sepia);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-text {
    color: var(--umber);
    line-height: 1.85;
}

.articles-ghost {
    transform: translateY(20px);
}

.ghost-block {
    margin-bottom: 3rem;
    padding-top: 3.5rem;
}

.ghost-text {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.85;
    color: var(--umber);
    opacity: 0.15;
}

/* ============================
   The Signatures
   ============================ */
.signatures {
    min-height: 60vh;
    padding: 8rem 20px;
    position: relative;
    scroll-snap-align: start;
}

.signature-block {
    position: absolute;
    padding: 20px;
    opacity: 0.4;
    filter: blur(1px);
    transition: opacity 0.6s ease-in-out, filter 0.6s ease-in-out;
    cursor: default;
}

.signature-block:hover {
    opacity: 0.9;
    filter: blur(0px);
    transition-duration: 0.6s;
}

.signature-block:not(:hover) {
    transition-duration: 1.2s;
}

.sig-name {
    font-family: var(--font-sig);
    font-size: 28px;
    color: var(--sepia);
    display: block;
    margin-bottom: 4px;
}

.sig-title {
    font-family: var(--font-meta);
    font-weight: 300;
    font-size: 13px;
    color: var(--rule);
    letter-spacing: 0.06em;
    display: block;
}

.sig-date {
    font-family: var(--font-meta);
    font-weight: 300;
    font-size: 12px;
    color: var(--rule);
    opacity: 0.6;
    display: block;
    margin-top: 4px;
}

.wax-seal-frag {
    position: absolute;
}

.wax-seal-frag:hover svg {
    transform: scale(1.08);
    transition: transform 0.4s ease;
}

/* ============================
   The Archive Stamp
   ============================ */
.archive-stamp {
    min-height: 40vh;
    background: var(--void);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    scroll-snap-align: start;
}

.stamp-border {
    border: 2px dashed var(--rule);
    padding: 24px 40px;
    text-align: center;
    max-width: 400px;
}

.stamp-text {
    font-family: var(--font-meta);
    font-weight: 500;
    font-size: 24px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--archive-red);
    display: block;
    margin-bottom: 8px;
    min-height: 30px;
}

.stamp-ref {
    font-family: var(--font-meta);
    font-weight: 300;
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--rule);
    opacity: 0.6;
    display: block;
}

/* ============================
   Mobile
   ============================ */
@media (max-width: 768px) {
    .articles-dual { grid-template-columns: 1fr; }
    .articles-ghost { display: none; }
    .fold-lines { display: none; }
    .signature-block {
        position: relative;
        left: auto !important;
        top: auto !important;
        margin-bottom: 2rem;
        transform: none !important;
    }
    .spectral-annotation { display: none; }
    .site-title { font-size: 36px; letter-spacing: 0.1em; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 2px; }
