/* ============================================
   SSETTL.com — Styles
   Legal-document metaphor, diagonal architecture
   ============================================ */

/* --- Custom Properties (Palette) --- */
:root {
    --deep-ground: #0f172a;        /* Judicial Ink */
    --primary-surface: #faf6f0;    /* Aged Parchment */
    --secondary-surface: #f0e9df;  /* Warm Linen */
    --accent-warm: #b8860b;        /* Burnished Brass */
    --accent-cool: #1e3a5f;        /* Barrister Navy */
    --text-primary: #1c1917;       /* Warm Black */
    --text-secondary: #6b7280;     /* Counsel Gray */
    --highlight: #8b2500;          /* Seal Red */
    --border-rule: #d4c9b8;        /* Parchment Shadow */

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --font-accent: 'Archivo Narrow', 'Arial Narrow', sans-serif;
    --font-monogram: 'Cormorant SC', 'Palatino', serif;

    --diagonal-offset: 10vh;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    background-color: var(--primary-surface);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Paper Texture Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    filter: url(#paper-texture);
    opacity: 0.03;
    background: var(--text-primary);
    mix-blend-mode: multiply;
}

/* --- SVG Filters (hidden) --- */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ============================================
   MONOGRAM NAVIGATION TRIGGER
   ============================================ */
.monogram-trigger {
    position: fixed;
    top: 2rem;
    left: 2rem;
    z-index: 1000;
    width: 48px;
    height: 60px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--deep-ground);
    transition: color 0.3s ease;
    padding: 0;
}

.monogram-trigger:hover {
    color: var(--accent-warm);
}

.monogram-svg {
    width: 100%;
    height: 100%;
}

.monogram-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: monogramDraw 2s ease-out forwards;
    transition: fill 0.6s ease 2s;
    fill: transparent;
}

.monogram-path-1 {
    animation-delay: 0s;
}

.monogram-path-2 {
    animation-delay: 0.4s;
}

.monogram-path.drawn {
    fill: var(--deep-ground);
}

@keyframes monogramDraw {
    to {
        stroke-dashoffset: 0;
    }
}

/* ============================================
   SIDE NAVIGATION
   ============================================ */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    pointer-events: none;
}

.side-nav.open {
    pointer-events: auto;
}

.side-nav-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.side-nav.open .side-nav-overlay {
    opacity: 1;
}

.side-nav-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 360px;
    max-width: 85vw;
    height: 100%;
    background: var(--primary-surface);
    border-right: 1px solid var(--border-rule);
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
}

.side-nav.open .side-nav-panel {
    transform: translateX(0);
}

.side-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-rule);
}

.side-nav-label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
}

.side-nav-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.side-nav-close:hover {
    color: var(--text-primary);
}

.side-nav-list {
    list-style: none;
}

.side-nav-list li {
    margin-bottom: 1.5rem;
}

.side-nav-link {
    font-family: var(--font-accent);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    transition: color 0.2s ease;
}

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

.side-nav-link.active {
    color: var(--highlight);
}

.side-nav-num {
    font-family: var(--font-monogram);
    font-size: 1.1rem;
    color: var(--accent-warm);
    min-width: 2rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-surface);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--diagonal-offset)), 0 100%);
    z-index: 10;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(4rem, 12vw, 14rem);
    letter-spacing: -0.03em;
    color: var(--deep-ground);
    line-height: 1;
    clip-path: inset(0 100% 0 0);
    animation: heroReveal 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s forwards;
}

@keyframes heroReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

.hero-seal {
    position: absolute;
    bottom: 15%;
    right: 10%;
    opacity: 0.08;
    z-index: 1;
}

/* ============================================
   THE SEAL MOTIF
   ============================================ */
.seal {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seal-outer {
    width: 200px;
    height: 200px;
    border: 2px solid var(--accent-warm);
    animation: sealRotate 60s linear infinite;
}

.seal-middle {
    width: 150px;
    height: 150px;
    border: 1.5px solid var(--accent-warm);
}

.seal-inner {
    width: 100px;
    height: 100px;
    border: 1px solid var(--accent-warm);
    background: radial-gradient(circle, transparent 45%, var(--accent-warm) 46%, var(--accent-warm) 47%, transparent 48%);
}

.seal-accent .seal-middle {
    border-color: var(--border-rule);
}

.seal-accent .seal-inner {
    border-color: var(--border-rule);
    background: radial-gradient(circle, transparent 45%, var(--border-rule) 46%, var(--border-rule) 47%, transparent 48%);
}

@keyframes sealRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.seal-outer:hover {
    animation-duration: 3s;
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-section {
    position: relative;
    width: 100%;
    min-height: 90vh;
    display: flex;
    align-items: center;
    padding: 8rem 0;
    z-index: 5;
}

.section-resolution {
    background-color: var(--secondary-surface);
    clip-path: polygon(0 0, 100% var(--diagonal-offset), 100% calc(100% - var(--diagonal-offset)), 0 100%);
    margin-top: calc(var(--diagonal-offset) * -1);
    padding-top: calc(8rem + var(--diagonal-offset));
    padding-bottom: calc(8rem + var(--diagonal-offset));
}

.section-authority {
    background-color: var(--primary-surface);
    clip-path: polygon(0 var(--diagonal-offset), 100% 0, 100% 100%, 0 calc(100% - var(--diagonal-offset)));
    margin-top: calc(var(--diagonal-offset) * -1);
    padding-top: calc(8rem + var(--diagonal-offset));
    padding-bottom: calc(8rem + var(--diagonal-offset));
}

.section-precedent {
    background-color: var(--secondary-surface);
    clip-path: polygon(0 0, 100% var(--diagonal-offset), 100% calc(100% - var(--diagonal-offset)), 0 100%);
    margin-top: calc(var(--diagonal-offset) * -1);
    padding-top: calc(8rem + var(--diagonal-offset));
    padding-bottom: calc(8rem + var(--diagonal-offset));
}

.section-finality {
    background-color: var(--deep-ground);
    clip-path: polygon(0 var(--diagonal-offset), 100% 0, 100% 100%, 0 100%);
    margin-top: calc(var(--diagonal-offset) * -1);
    padding-top: calc(8rem + var(--diagonal-offset));
    color: var(--primary-surface);
}

.section-finality .section-number {
    color: var(--accent-warm);
}

.section-finality .section-title {
    color: var(--primary-surface);
}

.section-finality .section-body {
    color: var(--secondary-surface);
}

.section-finality .panel-border {
    border-color: rgba(212, 201, 184, 0.2);
    outline-color: rgba(212, 201, 184, 0.2);
}

.section-finality .rule {
    background-color: rgba(212, 201, 184, 0.15);
}

.section-finality .margin-annotation {
    color: rgba(212, 201, 184, 0.4);
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ============================================
   DOCUMENT PANELS
   ============================================ */
.document-panel {
    max-width: 680px;
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.panel-left {
    margin-right: auto;
    transform: translateX(-40px);
}

.panel-right {
    margin-left: auto;
    transform: translateX(40px);
}

.document-panel.visible {
    opacity: 1;
    transform: translateX(0);
}

.panel-border {
    position: relative;
    padding: 3rem;
    border: 1px solid var(--border-rule);
    outline: 1px solid var(--border-rule);
    outline-offset: -8px;
}

/* --- Section Numbers --- */
.section-number {
    font-family: var(--font-monogram);
    font-size: 3.5rem;
    font-weight: 600;
    color: var(--accent-warm);
    line-height: 1;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.6;
}

/* --- Section Titles --- */
.section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: -0.03em;
    color: var(--deep-ground);
    line-height: 1.15;
    margin-bottom: 2rem;
}

/* --- Ruled Lines --- */
.ruled-lines {
    display: flex;
    flex-direction: column;
    gap: calc(1.125rem * 1.8);
    margin-bottom: 2rem;
}

.rule {
    display: block;
    width: 100%;
    height: 1px;
    background-color: var(--border-rule);
}

/* --- Section Body Text --- */
.section-body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-body:last-of-type {
    margin-bottom: 0;
}

/* --- Margin Annotations --- */
.margin-annotation {
    position: absolute;
    font-family: var(--font-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    opacity: 0;
    transition: opacity 0.3s ease-out 0.2s;
}

.document-panel.visible .margin-annotation {
    opacity: 0.6;
}

.annotation-top-right {
    top: 1rem;
    right: 1.5rem;
}

.annotation-top-left {
    top: 1rem;
    left: 1.5rem;
}

.annotation-bottom-right {
    bottom: 1rem;
    right: 1.5rem;
}

.annotation-bottom-left {
    bottom: 1rem;
    left: 1.5rem;
}

/* --- Section Seal Accents --- */
.section-seal-accent {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.06;
    pointer-events: none;
}

.section-seal-right {
    left: auto;
    right: 5%;
}

/* ============================================
   FOOTER COLOPHON
   ============================================ */
.colophon {
    background-color: var(--deep-ground);
    padding: 3rem 2rem 4rem;
    text-align: center;
}

.colophon-rule {
    border: none;
    border-top: 1px solid rgba(212, 201, 184, 0.3);
    max-width: 200px;
    margin: 0 auto 2rem;
}

.colophon-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.colophon-domain {
    font-family: var(--font-monogram);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--border-rule);
}

.colophon-separator {
    color: rgba(212, 201, 184, 0.3);
    font-size: 0.8rem;
}

.colophon-date {
    font-family: var(--font-monogram);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    color: var(--border-rule);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    :root {
        --diagonal-offset: 6vh;
    }

    .monogram-trigger {
        top: 1rem;
        left: 1rem;
        width: 36px;
        height: 48px;
    }

    .side-nav-panel {
        width: 300px;
        padding: 2rem 1.5rem;
    }

    .content-section {
        min-height: auto;
        padding: 6rem 0;
    }

    .section-resolution,
    .section-authority,
    .section-precedent {
        padding-top: calc(6rem + var(--diagonal-offset));
        padding-bottom: calc(6rem + var(--diagonal-offset));
    }

    .section-finality {
        padding-top: calc(6rem + var(--diagonal-offset));
    }

    .panel-border {
        padding: 2rem;
    }

    .section-number {
        font-size: 2.5rem;
    }

    .section-seal-accent {
        display: none;
    }

    .hero-seal {
        bottom: 10%;
        right: 5%;
    }

    .seal-outer {
        width: 140px;
        height: 140px;
    }

    .seal-middle {
        width: 105px;
        height: 105px;
    }

    .seal-inner {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .section-inner {
        padding: 0 1rem;
    }

    .panel-border {
        padding: 1.5rem;
        outline-offset: -5px;
    }

    .colophon-content {
        flex-direction: column;
        gap: 0.5rem;
    }

    .colophon-separator {
        display: none;
    }
}
