/* ============================================
   licence.broker -- Memphis Dashboard Styles
   ============================================ */

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

:root {
    --deep-canopy: #1B4332;
    --moss-floor: #2D6A4F;
    --lichen-bright: #52B788;
    --memphis-coral: #E07A5F;
    --aurora-violet: #7B2D8E;
    --birch-cream: #FAF3E0;
    --warm-parchment: #F0E6D3;
    --charcoal-ink: #2B2B2B;
    --fog-gray: #A3A399;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    --font-accent: 'Bungee', Impact, sans-serif;

    --border-weight: 3px;
    --gutter: 24px;

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    color: var(--charcoal-ink);
    background-color: var(--birch-cream);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Typography --- */
.site-title {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 0;
}

.title-serif {
    font-family: var(--font-display);
    font-weight: 900;
    color: var(--deep-canopy);
}

.title-bungee {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    color: var(--deep-canopy);
}

.section-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.8rem);
    color: var(--deep-canopy);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.section-heading-light {
    color: var(--birch-cream);
}

.panel-label {
    font-family: var(--font-accent);
    font-weight: 400;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--fog-gray);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.panel-label-light {
    color: rgba(250, 243, 224, 0.7);
}

.briefing-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--charcoal-ink);
    margin-bottom: 1.25rem;
    max-width: 65ch;
}

.bar-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--birch-cream);
}

.meta-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--fog-gray);
}

.status-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--charcoal-ink);
    display: block;
    text-align: center;
    margin-top: 6px;
}

.pull-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: var(--birch-cream);
    border-left: 4px solid var(--memphis-coral);
    padding-left: 1.5rem;
    margin: 2rem 0;
    max-width: 50ch;
}

.aurora-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: rgba(250, 243, 224, 0.9);
    margin-bottom: 1.25rem;
    max-width: 60ch;
}

/* --- Header Bar --- */
.header-bar {
    position: relative;
    width: 100%;
    height: 64px;
    background:
        radial-gradient(circle 3px, #52B788 100%, transparent) 12px 8px,
        radial-gradient(circle 2px, #E07A5F 100%, transparent) 45px 22px,
        radial-gradient(circle 4px, #7B2D8E 100%, transparent) 78px 15px,
        radial-gradient(circle 2px, #2D6A4F 100%, transparent) 30px 35px;
    background-size: 100px 50px;
    background-color: var(--birch-cream);
    z-index: 10;
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 1.4s forwards;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--gutter);
}

.header-border-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--border-weight);
    background: var(--charcoal-ink);
    transform: scaleX(0);
    transform-origin: left;
    animation: drawHorizontal 0.4s ease-out 0.2s forwards;
}

/* --- Memphis Ornaments --- */
.memphis-triangle {
    width: 48px;
    height: 48px;
    background: var(--memphis-coral);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    position: relative;
    transform: rotate(15deg);
    flex-shrink: 0;
    transition: transform 0.4s var(--spring-ease);
}

.memphis-triangle::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--memphis-coral);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.header-triangle {
    width: 24px;
    height: 24px;
}

.memphis-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--aurora-violet);
    border: 2px solid var(--charcoal-ink);
    flex-shrink: 0;
}

/* --- Dashboard Body Grid --- */
.dashboard-body {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) 2fr;
    min-height: calc(100vh - 64px - 120px);
}

/* --- Left Panel: Registry --- */
.left-panel {
    position: relative;
    padding: var(--gutter);
    background: var(--warm-parchment);
    overflow-y: auto;
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 1.7s forwards;
}

.panel-border-left {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--border-weight);
    height: 100%;
    background: var(--charcoal-ink);
    transform: scaleY(0);
    transform-origin: top;
    animation: drawVertical 0.35s ease-out 0.6s forwards;
}

.registry-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.registry-bar {
    height: 36px;
    width: calc(var(--bar-width, 80) * 1%);
    background: linear-gradient(90deg, var(--deep-canopy), var(--moss-floor));
    border: 2px solid var(--charcoal-ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    transform: translateX(-110%);
    animation: slideInBar 0.5s var(--spring-ease) calc(1.8s + calc(var(--bar-delay) * 80ms)) forwards;
}

.bar-triangle {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: var(--memphis-coral);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    flex-shrink: 0;
}

/* --- Main Stage --- */
.main-stage {
    display: flex;
    flex-direction: column;
}

/* --- Briefing Panel --- */
.briefing-panel {
    position: relative;
    padding: var(--gutter) calc(var(--gutter) * 2);
    background: var(--warm-parchment);
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 1.55s forwards;
}

.briefing-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--border-weight);
    background: var(--charcoal-ink);
    transform: scaleX(0);
    transform-origin: left;
    animation: drawHorizontal 0.3s ease-out 0.95s forwards;
}

/* --- Zigzag Lines --- */
.zigzag-line {
    display: block;
    width: 200px;
    height: 16px;
    margin: 1.5rem 0;
    overflow: visible;
}

.zigzag-line polyline {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 0.8s ease-out;
}

.zigzag-line.animated polyline {
    stroke-dashoffset: 0;
}

/* --- Aurora Panel --- */
.aurora-panel {
    position: relative;
    flex: 1;
    min-height: 340px;
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 1.85s forwards;
}

.aurora-gradient {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 340px;
    background: linear-gradient(135deg, #1B4332 0%, #2D6A4F 30%, #52B788 50%, #7B2D8E 70%, #1B4332 100%);
    background-size: 200% 200%;
    animation: aurora-drift 12s ease-in-out infinite;
    overflow: hidden;
}

.aurora-curtain {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.2) 0px,
        rgba(255, 255, 255, 0.2) 1px,
        transparent 1px,
        transparent 60px
    );
    animation: curtain-drift 8s ease-in-out infinite alternate;
}

.aurora-overlay {
    position: absolute;
    inset: 0;
    background: rgba(250, 243, 224, 0.7);
    pointer-events: none;
}

.aurora-content {
    position: relative;
    z-index: 2;
    padding: var(--gutter) calc(var(--gutter) * 2);
}

.aurora-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--border-weight);
    background: var(--charcoal-ink);
    transform: scaleX(0);
    transform-origin: left;
    animation: drawHorizontal 0.3s ease-out 1.25s forwards;
}

/* --- Status Panel --- */
.status-panel {
    position: relative;
    padding: var(--gutter) calc(var(--gutter) * 2);
    background: var(--birch-cream);
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 2.0s forwards;
}

.status-circles {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.status-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--charcoal-ink);
    transition: transform 0.3s var(--spring-ease);
}

.status-circle.active {
    background-color: var(--circle-color, var(--lichen-bright));
}

.status-circle.inactive {
    background-color: var(--birch-cream);
}

.status-circle:hover {
    transform: scale(1.15);
}

.status-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--border-weight);
    background: var(--charcoal-ink);
}

/* --- Footer Shelf --- */
.footer-shelf {
    position: relative;
    width: 100%;
    height: 120px;
    background: var(--deep-canopy);
    opacity: 0;
    animation: fadeInPanel 0.5s var(--spring-ease) 2.15s forwards;
}

.footer-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--border-weight);
    background: var(--charcoal-ink);
    transform: scaleX(0);
    transform-origin: left;
    animation: drawHorizontal 0.4s ease-out 1.0s forwards;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--gutter);
}

.footer-ornaments {
    display: flex;
    align-items: center;
    gap: 32px;
}

.footer-triangle {
    width: 48px;
    height: 48px;
}

.footer-zigzag {
    width: 200px;
    height: 16px;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

/* --- Keyframe Animations --- */
@keyframes drawHorizontal {
    0% { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

@keyframes drawVertical {
    0% { transform: scaleY(0); }
    100% { transform: scaleY(1); }
}

@keyframes fadeInPanel {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInBar {
    0% {
        transform: translateX(-110%);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes aurora-drift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes curtain-drift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(30px); }
}

/* --- Responsive: Below 768px --- */
@media (max-width: 768px) {
    .dashboard-body {
        display: flex;
        flex-direction: column;
    }

    .left-panel {
        border-right: none;
        border-bottom: var(--border-weight) solid var(--charcoal-ink);
    }

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

    .header-content {
        padding: 0 16px;
    }

    .header-triangle {
        margin: 0 auto;
    }

    .site-title {
        font-size: clamp(1.6rem, 5vw, 2.8rem);
    }

    .title-bungee {
        font-size: clamp(1.6rem, 5vw, 2.8rem);
    }

    .briefing-panel,
    .aurora-content,
    .status-panel {
        padding: var(--gutter);
    }

    .status-circles {
        gap: 16px;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        justify-content: center;
        gap: 12px;
        padding: 16px;
    }

    .footer-meta {
        align-items: center;
        text-align: center;
    }

    .footer-ornaments {
        gap: 20px;
    }

    .pull-quote {
        font-size: clamp(1rem, 2vw, 1.5rem);
    }

    .aurora-gradient {
        min-height: 300px;
    }
}

/* --- Scrollbar Styling --- */
.left-panel::-webkit-scrollbar {
    width: 6px;
}

.left-panel::-webkit-scrollbar-track {
    background: var(--warm-parchment);
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--fog-gray);
    border-radius: 3px;
}

/* --- Selection --- */
::selection {
    background: var(--lichen-bright);
    color: var(--deep-canopy);
}
