/* ============================================
   licensor.directory - Styles
   Victorian Licensing Bureau meets Pastoral Romance
   ============================================
   Design Notes:
   - Interaction patterns: Intersection Observer at threshold for headings
   - Maximum viewport-relative scale for hero display
   - The formal elegance of a Victorian licensing document electrified
     by contemporary neon creates a visual collision that is genuinely
     unprecedented in this collection -- "Playfair Display" (Google Fonts),
     "Source Serif 4" (Google Fonts)
   ============================================ */

/* --- Custom Properties --- */
:root {
    /* Palette */
    --parchment-cream: #f5f0e8;
    --dusk-lavender: #e8e0f0;
    --deep-ink: #1a1423;
    --plum-shadow: #3d2944;
    --warm-graphite: #2e2530;
    --electric-fuchsia: #ff2d8a;
    --acid-chartreuse: #c8ff00;
    --uv-violet: #8b5cf6;
    --muted-sage: #7a8b6d;
    --blush-mist: #e0d0d8;

    /* Dynamic background hue (updated by JS) */
    --bg-hue: 40;

    /* Typography sizes */
    --hero-size: clamp(2.8rem, 6vw, 5.5rem);
    --heading-size: clamp(1.6rem, 3vw, 2.8rem);
    --subheading-size: clamp(1.2rem, 2.2vw, 1.8rem);
    --body-size: clamp(1rem, 1.4vw, 1.15rem);

    /* Spacing */
    --margin-h: 8vw;
    --margin-v: 6vh;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: hsl(var(--bg-hue), 20%, 95%);
    color: var(--warm-graphite);
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: var(--body-size);
    font-weight: 400;
    line-height: 1.72;
    overflow-x: hidden;
}

/* --- Fixed Navigation Bar --- */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--margin-h);
    background: rgba(245, 240, 232, 0);
    backdrop-filter: blur(0px);
    z-index: 100;
    transition: background 0.5s ease, backdrop-filter 0.5s ease;
}

#top-bar.scrolled {
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(12px);
}

.nav-domain {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.15em;
    font-variant: small-caps;
    color: var(--deep-ink);
    opacity: 0;
    transition: opacity 0.5s ease;
}

#top-bar.scrolled .nav-domain {
    opacity: 1;
}

.nav-index {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-sage);
    text-decoration: none;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#top-bar.scrolled .nav-index {
    opacity: 1;
}

.nav-index::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--electric-fuchsia);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-index:hover::after {
    width: 100%;
}

/* --- Split Screen Layout --- */
.split-screen {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.panel-left {
    flex: 1;
    background: var(--parchment-cream);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--margin-v) var(--margin-h);
}

.panel-right {
    flex: 1;
    background: var(--dusk-lavender);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Gradient divider between panels */
.panel-left::after {
    content: '';
    position: absolute;
    top: 0;
    right: -12px;
    width: 24px;
    height: 100%;
    background: linear-gradient(to right, var(--parchment-cream), var(--dusk-lavender));
    z-index: 2;
    pointer-events: none;
}

/* Subtle hills background pattern on left panel */
.panel-left.panel-registry::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background:
        radial-gradient(ellipse 120% 30% at 20% 100%, rgba(122,139,109,0.02) 0%, transparent 70%),
        radial-gradient(ellipse 100% 25% at 60% 100%, rgba(122,139,109,0.02) 0%, transparent 70%),
        radial-gradient(ellipse 80% 20% at 90% 100%, rgba(122,139,109,0.02) 0%, transparent 70%);
    pointer-events: none;
}

/* --- Hero Section --- */
.hero-text {
    padding-top: 38.2%;
    padding-left: 38.2%;
    position: relative;
}

.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: var(--hero-size);
    color: var(--deep-ink);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 0.2em;
}

.hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: calc(var(--hero-size) * 0.5);
    letter-spacing: 0.15em;
    font-variant: small-caps;
    color: var(--deep-ink);
}

/* Wax Seal */
.hero-object {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.wax-seal {
    width: clamp(180px, 22vw, 320px);
    height: clamp(180px, 22vw, 320px);
    animation: slowRotate 60s linear infinite;
    filter: drop-shadow(0 0 40px rgba(255, 45, 138, 0.15));
}

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

@keyframes slowRotate {
    from { transform: rotateY(0deg); }
    to { transform: rotateY(360deg); }
}

/* --- Interstitial Zones --- */
.interstitial {
    height: 20vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: linear-gradient(180deg, var(--parchment-cream) 0%, var(--dusk-lavender) 50%, var(--parchment-cream) 100%);
}

.ornament {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.4em;
    color: var(--uv-violet);
    opacity: 0.7;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.ornament.pulse {
    animation: ornamentPulse 800ms ease-out forwards;
}

@keyframes ornamentPulse {
    0% { opacity: 0.4; transform: scale(0.95); color: var(--uv-violet); }
    50% { opacity: 1; transform: scale(1.1); color: var(--acid-chartreuse); }
    100% { opacity: 0.7; transform: scale(1); color: var(--uv-violet); }
}

/* Seal watermarks */
.seal-watermark {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        transparent 30%,
        rgba(122, 139, 109, 0.03) 31%,
        transparent 32%,
        rgba(122, 139, 109, 0.02) 45%,
        transparent 46%,
        rgba(122, 139, 109, 0.02) 60%,
        transparent 61%,
        rgba(122, 139, 109, 0.01) 75%,
        transparent 76%
    );
    pointer-events: none;
}

/* --- Directory Entries --- */
.directory-entry {
    min-height: 80vh;
}

.entry-content {
    max-width: 540px;
    padding-left: 38.2%;
}

.entry-meta {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-sage);
    display: block;
    margin-bottom: 1.5rem;
}

.entry-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: var(--heading-size);
    color: var(--deep-ink);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

/* Underline-draw animation */
.underline-draw {
    background-image: linear-gradient(var(--electric-fuchsia), var(--electric-fuchsia));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    padding-bottom: 4px;
    transition: background-size 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.underline-draw.drawn {
    background-size: 100% 2px;
}

/* Drop cap */
.drop-cap {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-style: italic;
    font-size: 3.5em;
    float: left;
    line-height: 0.8;
    margin-right: 0.1em;
    margin-top: 0.05em;
    color: var(--uv-violet);
}

.entry-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: var(--body-size);
    font-weight: 400;
    line-height: 1.72;
    color: var(--warm-graphite);
    margin-bottom: 1.5rem;
}

/* Engraved line border on entry content */
.entry-content::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 38.2%;
    right: var(--margin-h);
    height: 0;
    border-top: 1px solid var(--blush-mist);
    border-bottom: 1px solid var(--blush-mist);
    padding-top: 1px;
}

.entry-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.category-tag {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: var(--subheading-size);
    color: var(--plum-shadow);
    letter-spacing: 0.03em;
    position: relative;
    cursor: default;
}

.category-tag::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--electric-fuchsia);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.category-tag:hover::after {
    width: 100%;
}

/* --- Floating 3D Objects --- */
.entry-object {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.floating-object {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.floating-object.visible {
    opacity: 1;
    transform: translateY(0);
}

.object-svg {
    width: clamp(150px, 18vw, 260px);
    height: auto;
    animation: slowRotate 60s linear infinite;
    filter: drop-shadow(0 8px 24px rgba(26, 20, 35, 0.1));
}

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--acid-chartreuse);
    z-index: 100;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(200, 255, 0, 0.4);
}

/* --- Footer Interstitial --- */
.interstitial-final {
    height: 40vh;
    gap: 1.5rem;
}

.footer-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: var(--subheading-size);
    color: var(--plum-shadow);
    letter-spacing: 0.03em;
    text-align: center;
}

.footer-domain {
    font-family: 'DM Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted-sage);
}

/* --- Divider Gradient Color Shift (managed by JS via class) --- */
.panel-left::after {
    transition: background 1s ease;
}

/* --- Responsive: Single Column below 768px --- */
@media (max-width: 768px) {
    .split-screen {
        flex-direction: column;
    }

    .panel-left,
    .panel-right {
        flex: none;
        width: 100%;
    }

    .panel-left {
        min-height: 60vh;
        padding: 4rem 6vw;
    }

    .panel-right {
        min-height: 50vh;
    }

    .panel-left::after {
        display: none;
    }

    .hero-text {
        padding-top: 30%;
        padding-left: 10%;
    }

    .entry-content {
        padding-left: 10%;
        max-width: 100%;
    }

    .entry-content::before {
        left: 10%;
    }

    :root {
        --margin-h: 6vw;
        --margin-v: 4vh;
    }

    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: clamp(1.1rem, 5vw, 1.8rem);
    }

    .wax-seal {
        width: clamp(140px, 40vw, 220px);
        height: clamp(140px, 40vw, 220px);
    }

    .object-svg {
        width: clamp(120px, 35vw, 200px);
    }

    .interstitial {
        height: 15vh;
    }

    .directory-entry {
        min-height: auto;
    }

    #top-bar {
        padding: 0 6vw;
    }
}

/* --- Selection Color --- */
::selection {
    background: rgba(139, 92, 246, 0.2);
    color: var(--deep-ink);
}

/* --- Smooth scroll for entry content --- */
.panel-registry .entry-content {
    position: relative;
}

/* Link styling */
a {
    color: var(--uv-violet);
    text-decoration: none;
    position: relative;
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--electric-fuchsia);
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:hover::after {
    width: 100%;
}

/* --- Hanging punctuation for pull quotes --- */
blockquote {
    text-indent: -0.4em;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-style: italic;
    font-size: var(--subheading-size);
    color: var(--plum-shadow);
    border-left: 2px solid var(--electric-fuchsia);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

/* --- Perspective for 3D rotation --- */
.wax-seal,
.object-svg {
    perspective: 800px;
    transform-style: preserve-3d;
}
