/* ============================================
   p9r.st - Victorian Exhibition Design
   Chrome-Metallic Palette | Organic-Flow Layout
   ============================================ */

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

:root {
    --onyx: #1A1A20;
    --burnished-chrome: #B8B8C0;
    --sterling-silver: #D8D8E0;
    --gilded-bronze: #C5963A;
    --ruby-wine: #6E1423;
    --oxidized-copper: #4A8B6F;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--onyx);
    color: var(--burnished-chrome);
    font-family: 'Crimson Text', Georgia, serif;
    font-size: 1.0625rem;
    line-height: 1.8;
    font-weight: 400;
    overflow-x: hidden;
}

/* === Typography === */
h1, h2, h3 {
    font-family: 'Poiret One', 'Didot', serif;
    color: var(--sterling-silver);
    font-weight: 400;
    letter-spacing: 0.06em;
}

/* === Hero Section === */
#hero {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--onyx);
}

.hero-frame {
    position: relative;
    width: min(90vw, 800px);
    height: min(70vh, 600px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ornamental-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* SVG Frame Styles */
.frame-rect {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1.5;
}

.frame-rect-inner {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 0.5;
    opacity: 0.5;
}

.flourish-stroke {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1.5;
    stroke-linecap: round;
}

.flourish-stroke-thin {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 0.8;
    stroke-linecap: round;
    opacity: 0.6;
}

.rosette {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
}

.rosette-petal {
    fill: var(--gilded-bronze);
    opacity: 0.3;
}

.rosette-center {
    fill: var(--gilded-bronze);
}

.scrollwork-line {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    opacity: 0.5;
}

/* Corner flourish hover glow */
.corner-flourish,
.midpoint-rosette {
    transition: filter 0.4s ease;
}

.corner-flourish:hover,
.midpoint-rosette:hover {
    filter: drop-shadow(0 0 6px rgba(197, 150, 58, 0.5));
}

.corner-flourish:hover .flourish-stroke,
.corner-flourish:hover .rosette {
    stroke-width: 2;
    transition: stroke-width 0.4s ease;
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.hero-title {
    font-family: 'Poiret One', 'Didot', serif;
    font-size: clamp(2.4rem, 5vw, 5rem);
    color: var(--sterling-silver);
    letter-spacing: 0.06em;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(197, 150, 58, 0.15);
}

.hero-subtitle {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnished-chrome);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-mouse {
    fill: none;
    stroke: var(--burnished-chrome);
    stroke-width: 1.5;
    opacity: 0.4;
}

.scroll-dot {
    fill: var(--gilded-bronze);
    animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(6px); }
}

@keyframes scrollDot {
    0%, 100% { opacity: 1; cy: 10; }
    50% { opacity: 0.3; cy: 20; }
}

/* === Content Sections === */
.content-section {
    padding: 6rem 2rem;
    position: relative;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Section Ornament Top */
.section-ornament-top {
    max-width: 600px;
    margin: 0 auto 3rem;
}

.section-divider-svg {
    width: 100%;
    height: 40px;
}

.ornament-path {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 1.5s ease;
}

.content-section.visible .ornament-path {
    stroke-dashoffset: 0;
}

.ornament-dot {
    fill: var(--gilded-bronze);
}

/* Section Frames */
.section-frame {
    max-width: 700px;
    position: relative;
    padding: 3rem 2.5rem;
}

/* Organic Frame 1 - Left weighted */
.section-left .section-frame {
    margin-left: 8%;
    margin-right: auto;
}

.organic-frame-1 {
    border: 1px solid var(--gilded-bronze);
    border-radius: 40% 60% 50% 50% / 30% 40% 60% 70%;
    background: linear-gradient(135deg, rgba(26, 26, 32, 0.95), rgba(26, 26, 32, 0.8));
    box-shadow:
        0 0 30px rgba(197, 150, 58, 0.05),
        inset 0 0 60px rgba(26, 26, 32, 0.5);
    transition: box-shadow 0.4s ease;
}

.organic-frame-1:hover {
    box-shadow:
        0 0 40px rgba(197, 150, 58, 0.1),
        inset 0 0 60px rgba(26, 26, 32, 0.5);
}

/* Organic Frame 2 - Right weighted */
.section-right .section-frame {
    margin-left: auto;
    margin-right: 8%;
}

.organic-frame-2 {
    border: 1px solid var(--gilded-bronze);
    border-radius: 60% 40% 55% 45% / 50% 35% 65% 50%;
    background: linear-gradient(225deg, rgba(26, 26, 32, 0.95), rgba(26, 26, 32, 0.8));
    box-shadow:
        0 0 30px rgba(197, 150, 58, 0.05),
        inset 0 0 60px rgba(26, 26, 32, 0.5);
    transition: box-shadow 0.4s ease;
}

.organic-frame-2:hover {
    box-shadow:
        0 0 40px rgba(197, 150, 58, 0.1),
        inset 0 0 60px rgba(26, 26, 32, 0.5);
}

/* Section Numbers - Roman Numerals */
.section-number {
    display: block;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gilded-bronze);
    margin-bottom: 0.75rem;
}

/* Section Headings */
.section-heading {
    font-size: clamp(1.4rem, 2.5vw, 2.4rem);
    margin-bottom: 1.5rem;
    color: var(--sterling-silver);
}

/* Section Body */
.section-body p {
    margin-bottom: 1.2rem;
    color: var(--burnished-chrome);
}

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

/* Drop Caps */
.drop-cap {
    float: left;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: 0.1em;
    padding-top: 0.05em;
    color: var(--ruby-wine);
    font-weight: 700;
}

/* === Section II - Victorian Device === */
.section-illustration {
    text-align: center;
    margin-bottom: 2rem;
}

.victorian-device {
    width: 160px;
    height: 64px;
}

.device-path {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    transition: stroke-width 0.4s ease;
}

.device-path-center {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1.5;
}

.device-center {
    fill: var(--gilded-bronze);
    opacity: 0.4;
}

.device-line {
    stroke: var(--gilded-bronze);
    stroke-width: 1;
}

.device-dot {
    fill: var(--gilded-bronze);
}

.victorian-device:hover .device-path {
    stroke-width: 1.5;
}

.victorian-device:hover {
    filter: drop-shadow(0 0 8px rgba(197, 150, 58, 0.4));
}

/* === Section III - Interlude === */
.section-interlude {
    text-align: center;
    padding: 8rem 2rem;
}

.interlude-divider {
    max-width: 700px;
    margin: 0 auto 3rem;
}

.interlude-divider-bottom {
    margin: 3rem auto 0;
}

.scrollwork-divider {
    width: 100%;
    height: 60px;
}

.scrollwork-petal {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 2s ease;
}

.section-interlude.visible .scrollwork-petal {
    stroke-dashoffset: 0;
}

.scrollwork-center {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1.5;
}

.scrollwork-center-inner {
    fill: var(--gilded-bronze);
}

.scrollwork-line-h {
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    opacity: 0.5;
}

.scrollwork-end-dot {
    fill: var(--gilded-bronze);
    opacity: 0.5;
}

/* Blockquote */
.interlude-quote {
    font-family: 'Poiret One', 'Didot', serif;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    font-style: italic;
    color: var(--sterling-silver);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
    letter-spacing: 0.03em;
}

.interlude-quote cite {
    display: block;
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnished-chrome);
    margin-top: 1.5rem;
    opacity: 0.7;
}

/* === Footer === */
#footer {
    text-align: center;
    padding: 4rem 2rem 3rem;
    border-top: 1px solid rgba(197, 150, 58, 0.15);
}

.footer-border {
    max-width: 400px;
    margin: 0 auto 2rem;
}

.footer-ornament {
    width: 100%;
    height: 40px;
}

.footer-orn-petal {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 0.8;
    opacity: 0.6;
}

.footer-orn-center {
    fill: none;
    stroke: var(--gilded-bronze);
    stroke-width: 1;
    opacity: 0.6;
}

.footer-orn-center-inner {
    fill: var(--gilded-bronze);
    opacity: 0.4;
}

.footer-orn-line {
    stroke: var(--gilded-bronze);
    stroke-width: 0.8;
    opacity: 0.4;
}

.footer-orn-dot {
    fill: var(--gilded-bronze);
    opacity: 0.4;
}

.footer-domain {
    font-family: 'Cinzel', 'Times New Roman', serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--burnished-chrome);
    opacity: 0.6;
    margin-bottom: 1rem;
}

.footer-fleuron {
    font-size: 1.5rem;
    color: var(--gilded-bronze);
    opacity: 0.4;
    line-height: 1;
}

/* === Links === */
a {
    color: var(--oxidized-copper);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gilded-bronze);
}

/* === Responsive === */
@media (max-width: 768px) {
    .hero-frame {
        width: 95vw;
        height: 80vh;
    }

    .section-left .section-frame,
    .section-right .section-frame {
        margin-left: auto;
        margin-right: auto;
        max-width: 90vw;
    }

    .section-frame {
        padding: 2rem 1.5rem;
    }

    .organic-frame-1 {
        border-radius: 20% 30% 25% 25%;
    }

    .organic-frame-2 {
        border-radius: 30% 20% 28% 22%;
    }

    .content-section {
        padding: 4rem 1rem;
    }

    .drop-cap {
        font-size: 2.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .section-frame {
        padding: 1.5rem 1.2rem;
    }

    .organic-frame-1,
    .organic-frame-2 {
        border-radius: 15% 20% 18% 18%;
    }
}
