:root {
    --midnight-herald: #0A1628;
    --parchment-vellum: #F4ECD8;
    --burnished-gold: #C9A84C;
    --tarnished-brass: #8A7D6B;
    --seal-ink: #2D2A26;
    --warm-ivory: #E8E2D6;
    --vert: #4A6741;
    --gules: #8B2E3B;
    --shield-edge: #D4C9B0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--midnight-herald);
    color: var(--warm-ivory);
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
}

/* Heraldic Sidebar */
#heraldic-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: 280px;
    height: 100vh;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    padding: 60px 20px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#heraldic-sidebar.visible {
    opacity: 1;
}

.sidebar-ornament {
    opacity: 0.3;
}

.sidebar-shield, .sidebar-lozenge {
    width: 60px;
    height: auto;
}

.sidebar-chevron {
    width: 40px;
    height: 20px;
    border-left: 1px solid var(--burnished-gold);
    border-bottom: 1px solid var(--burnished-gold);
    transform: rotate(-45deg);
    opacity: 0.4;
}

/* Shield Shape */
.shield-clip {
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    background: var(--midnight-herald);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 120px;
    width: 70vw;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.01);
    transition: opacity 0.6s ease-out, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shield-clip.visible {
    opacity: 1;
    transform: scale(1);
}

/* Section 1: Blazon Hero */
#blazon-hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--midnight-herald);
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    letter-spacing: 0.08em;
    color: var(--burnished-gold);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 30px;
}

.letter-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--burnished-gold);
    padding: 4px 6px;
    min-width: 1.1em;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease, border-color 0.5s ease;
}

.letter-box.visible {
    opacity: 1;
}

.letter-box.dot {
    border-color: transparent;
    padding: 4px 2px;
    min-width: 0.5em;
}

.chevron-divider {
    width: 300px;
    margin: 20px auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.chevron-divider.visible {
    opacity: 1;
}

.chevron-path {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
    transition: stroke-dashoffset 1.5s ease-out;
}

.chevron-path.drawn {
    stroke-dashoffset: 0;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--tarnished-brass);
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.8s ease 1.5s;
}

.hero-subtitle.visible {
    opacity: 1;
}

/* Chevron Border */
.chevron-border {
    width: 100%;
    height: 24px;
    overflow: hidden;
}

.chevron-border svg {
    width: 100%;
    height: 24px;
}

/* Quarter Sections */
.quarter-section {
    padding: 64px 0;
    position: relative;
}

.dark-field {
    background: var(--midnight-herald);
}

.light-field {
    background: var(--parchment-vellum);
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 20px, rgba(201,168,76,0.06) 20px, rgba(201,168,76,0.06) 21px),
        repeating-linear-gradient(-45deg, transparent, transparent 20px, rgba(201,168,76,0.06) 20px, rgba(201,168,76,0.06) 21px);
}

.quarter-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    max-width: 900px;
    padding: 48px 40px;
    margin-left: 10%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.quarter-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

.quarter-heading-panel {
    background: var(--midnight-herald);
    border: 2px solid var(--burnished-gold);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.panel-green {
    background: var(--vert);
}

.panel-red {
    background: var(--gules);
}

.panel-brass {
    background: var(--tarnished-brass);
}

.section-number {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 3rem;
    letter-spacing: 0.15em;
    color: var(--burnished-gold);
    opacity: 0.4;
    margin-bottom: 12px;
}

.dark-num {
    color: var(--midnight-herald);
}

.quarter-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-variant: small-caps;
    color: var(--burnished-gold);
    text-align: center;
    letter-spacing: 0.08em;
}

.dark-title {
    color: var(--midnight-herald);
}

/* Corner Ornaments */
.corner-ornament {
    position: absolute;
    width: 16px;
    height: 16px;
}

.corner-ornament.top-left {
    top: -1px;
    left: -1px;
    border-top: 2px solid var(--burnished-gold);
    border-left: 2px solid var(--burnished-gold);
}

.corner-ornament.top-left::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    background: var(--burnished-gold);
    transform: rotate(45deg);
}

.corner-ornament.bottom-right {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid var(--burnished-gold);
    border-right: 2px solid var(--burnished-gold);
}

.corner-ornament.bottom-right::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 4px;
    height: 4px;
    background: var(--burnished-gold);
    transform: rotate(45deg);
}

.body-text {
    color: var(--warm-ivory);
    margin-bottom: 16px;
}

.dark-text {
    color: var(--seal-ink);
}

code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    background: rgba(10, 22, 40, 0.06);
    padding: 2px 6px;
    color: var(--vert);
    border-radius: 2px;
}

.dark-field code {
    background: rgba(244, 236, 216, 0.08);
}

/* Heraldic List */
.heraldic-list {
    list-style: none;
    margin: 16px 0;
    padding-left: 24px;
}

.heraldic-item {
    position: relative;
    padding: 4px 0 4px 20px;
    color: var(--warm-ivory);
}

.heraldic-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 10px;
    transform: translateY(-50%);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
    background: var(--burnished-gold);
}

/* Charge Panel */
.charge-panel {
    clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 92%);
    background: var(--parchment-vellum);
    padding: 120px 40px;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.charge-inner {
    max-width: 700px;
}

.diamond-formation {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.diamond-row {
    display: flex;
    align-items: center;
    gap: 32px;
}

.diamond-term {
    border: 2px solid var(--burnished-gold);
    padding: 12px 24px;
    background: var(--parchment-vellum);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.diamond-term.visible {
    opacity: 1;
    transform: scale(1);
}

.term-text {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    letter-spacing: 0.12em;
    color: var(--seal-ink);
    text-transform: uppercase;
}

.crest-text {
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--gules);
}

/* Tincture Grid */
.tincture-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.tincture-swatch {
    padding: 20px 12px;
    text-align: center;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 50% 100%, 0 85%);
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.tincture-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 0.8rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--warm-ivory);
}

.tincture-hex {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: rgba(232, 226, 214, 0.7);
}

.dark-label {
    color: var(--seal-ink);
}

.dark-label.tincture-hex {
    color: rgba(45, 42, 38, 0.7);
}

/* Footer: Supporters */
.footer-section {
    background: var(--midnight-herald);
    padding: 80px 40px;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.supporters-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
    align-items: center;
    width: 100%;
}

.supporter {
    text-align: center;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.left-supporter {
    transform: translateX(-30%);
}

.right-supporter {
    transform: translateX(30%);
}

.supporter.visible {
    opacity: 1;
    transform: translateX(0);
}

.supporter-label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnished-gold);
    margin-bottom: 8px;
}

.supporter-text {
    font-family: 'Crimson Pro', Georgia, serif;
    font-size: 0.9rem;
    color: var(--tarnished-brass);
    line-height: 1.6;
}

.central-crest {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.central-crest.visible {
    opacity: 1;
}

.crest-graphic {
    width: 160px;
    height: auto;
}

.crest-element {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 0.8s ease-out;
}

.crest-element.drawn {
    stroke-dashoffset: 0;
}

.crest-monogram {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 48px;
    fill: var(--burnished-gold);
    text-anchor: middle;
    dominant-baseline: middle;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.crest-monogram.visible {
    opacity: 1;
}

.crest-motto {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--tarnished-brass);
    margin-top: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    #heraldic-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .shield-clip {
        width: 90vw;
    }

    .quarter-grid {
        grid-template-columns: 1fr;
        margin-left: 5%;
        padding: 32px 20px;
    }

    .supporters-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .tincture-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .diamond-row {
        flex-direction: column;
        gap: 16px;
    }

    .charge-panel {
        clip-path: none;
        padding: 60px 20px;
    }
}
