/* =============================================
   gamelicensor.info — Bureaucratic Noir
   Color Palette:
   - Bureau Charcoal:    #1E2228
   - Dossier Slate:      #2A2F37
   - Filing Gray:        #383C42
   - Archive Silver:     #C9CDD4
   - Index Pewter:       #8B9299
   - Specimen Sage:      #6B8F71
   - Seal Brass:         #A89060
   - Perforated Edge:    #4A4E54
   - Redaction Crimson:  #8B3A3A
   ============================================= */

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

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

body {
    background-color: #1E2228;
    color: #C9CDD4;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.1vw, 1.15rem);
    line-height: 1.72;
    overflow-x: hidden;
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    position: sticky;
    top: 0;
    left: 0;
    width: 280px;
    min-width: 280px;
    height: 100vh;
    background-color: #383C42;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(200, 200, 200, 0.08) 1px, transparent 1px),
        linear-gradient(175deg, rgba(255, 255, 255, 0.03) 0%, transparent 50%, rgba(0, 0, 0, 0.05) 100%);
    background-size: 3px 3px, 100% 100%;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid #4A4E54;
    transform: translateX(-280px);
    opacity: 0;
    transition: transform 0.8s ease-out, opacity 0.6s ease-out;
    overflow: hidden;
}

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

.sidebar-header {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #4A4E54;
}

.sidebar-seal-icon {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.sidebar-seal-icon:hover {
    opacity: 1;
}

.sidebar-nav-items {
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex: 1;
}

/* Navigation tabs styled as file folder tabs */
.nav-tab {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #383C42;
    clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 100%, 0 100%);
    color: #C9CDD4;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease, border-left 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.nav-tab:hover {
    transform: translateX(6px) scale(1.02);
    background-color: #4A4E54;
}

.nav-tab.active {
    transform: translateX(12px);
    border-left: 3px solid #6B8F71;
    background-color: #4A4E54;
}

.tab-label {
    font-weight: 400;
    text-transform: uppercase;
}

.tab-ref {
    color: #8B9299;
    font-size: 0.65rem;
}

/* Root connectors between nav items */
.root-connector {
    display: flex;
    justify-content: center;
    opacity: 0.6;
}

/* Sidebar fern decoration */
.sidebar-fern {
    padding: 20px;
    display: flex;
    justify-content: center;
    margin-top: auto;
    opacity: 0.5;
}

/* === MOBILE TOGGLE === */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    background: #2A2F37;
    border: 1px solid #4A4E54;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    cursor: pointer;
    padding: 6px;
    transition: background-color 0.3s ease;
}

.mobile-toggle:hover {
    background: #383C42;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 34, 40, 0.8);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    min-width: 0;
}

/* === SECTIONS === */
.section {
    position: relative;
}

/* === SECTION: THE SEAL === */
.section-seal {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1E2228;
    overflow: hidden;
}

.seal-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.seal-emblem {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.seal-emblem.visible {
    opacity: 1;
}

/* Emblem SVG stroke animation */
.emblem-svg .emblem-outer-ring,
.emblem-svg .emblem-inner-ring,
.emblem-svg .emblem-controller,
.emblem-svg .emblem-vine {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2.4s ease-out;
}

.seal-emblem.animate .emblem-outer-ring,
.seal-emblem.animate .emblem-inner-ring,
.seal-emblem.animate .emblem-controller,
.seal-emblem.animate .emblem-vine {
    stroke-dashoffset: 0;
}

.seal-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.2rem, 5.5vw, 4.8rem);
    letter-spacing: 0.12em;
    line-height: 1.18;
    text-transform: uppercase;
    color: #C9CDD4;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.seal-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.seal-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #8B9299;
    opacity: 0;
    transition: opacity 0.5s ease;
}

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

.typewriter-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid #8B9299;
    animation: typewriter-cursor 0.8s step-end infinite;
}

@keyframes typewriter-cursor {
    0%, 100% { border-color: #8B9299; }
    50% { border-color: transparent; }
}

.typewriter-text.done {
    border-right-color: transparent;
    animation: none;
}

/* === PERFORATED DIVIDERS === */
.perforated-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 40px 72px;
    position: relative;
    border-top: 2px dashed #4A4E54;
    border-bottom: 2px dashed #4A4E54;
    margin: 0;
}

.punch-hole {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #4A4E54;
    background: #1E2228;
    flex-shrink: 0;
}

/* === SECTION: THE REGISTRY === */
.section-registry {
    padding: 80px 72px;
    background-color: #1E2228;
    max-width: 100%;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    letter-spacing: 0.12em;
    line-height: 1.18;
    text-transform: uppercase;
    color: #C9CDD4;
    margin-bottom: 12px;
}

.section-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: #8B9299;
}

.stamp-divider {
    margin-bottom: 24px;
    opacity: 0.7;
    filter: blur(0.5px);
}

.stamp-medium {
    transform: rotate(-12deg);
}

/* Registry cards */
.registry-cards {
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 680px;
    margin: 0 auto;
}

.registry-card {
    position: relative;
    background-color: #2A2F37;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(200, 200, 200, 0.06) 1px, transparent 1px),
        linear-gradient(175deg, rgba(255, 255, 255, 0.02) 0%, transparent 50%, rgba(0, 0, 0, 0.04) 100%);
    background-size: 3px 3px, 100% 100%;
    border: 1px solid #6B7280;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.12);
    padding: 32px 28px 28px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.registry-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-tab {
    position: absolute;
    top: -1px;
    left: 20px;
    background-color: #383C42;
    clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 100%, 0 100%);
    padding: 4px 14px;
    border: 1px solid #6B7280;
    border-bottom: none;
    transform: translateY(-100%);
}

.card-ref {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: #8B9299;
}

.card-content {
    position: relative;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #C9CDD4;
    margin-bottom: 16px;
    line-height: 1.3;
}

.card-description {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1vw, 1.05rem);
    line-height: 1.72;
    color: #C9CDD4;
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.meta-date,
.meta-code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #8B9299;
}

/* Redaction marks */
.redaction-mark {
    display: inline-block;
    position: relative;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    color: transparent;
    margin-top: 14px;
    padding: 2px 6px;
    user-select: none;
}

.redaction-mark::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #8B3A3A;
    opacity: 0.7;
}

/* Card watermark */
.card-watermark {
    position: absolute;
    bottom: 12px;
    right: 12px;
    pointer-events: none;
}

/* === SECTION: THE SPECIMEN CABINET === */
.section-specimen {
    padding: 80px 64px;
    background-color: #2A2F37;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 48px;
    max-width: 900px;
    width: 100%;
    margin-top: 20px;
}

.specimen-frame {
    border: 1px solid #4A4E54;
    padding: 32px 20px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    background-color: rgba(42, 47, 55, 0.5);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-frame.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-drawing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

/* Specimen SVG stroke animation */
.specimen-svg .specimen-stroke {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1.8s ease-out;
}

.specimen-frame.animate .specimen-stroke {
    stroke-dashoffset: 0;
}

.specimen-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    color: #A89060;
    text-transform: uppercase;
}

.specimen-classification {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.85rem;
    color: #8B9299;
}

/* === SECTION: THE ARCHIVE STAMP === */
.section-stamp {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1E2228;
    padding: 80px 72px;
    position: relative;
    overflow: hidden;
}

/* Faded document texture behind stamp section */
.section-stamp::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 28px,
            rgba(74, 78, 84, 0.08) 28px,
            rgba(74, 78, 84, 0.08) 29px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 100px,
            rgba(74, 78, 84, 0.04) 100px,
            rgba(74, 78, 84, 0.04) 101px
        );
    pointer-events: none;
}

.stamp-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    position: relative;
    z-index: 1;
}

.archive-stamp {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Archive stamp SVG stroke animation */
.archive-stamp-svg .stamp-outer-ring {
    stroke-dasharray: 720;
    stroke-dashoffset: 720;
    transition: stroke-dashoffset 1.2s ease-out;
}

.archive-stamp-svg .stamp-inner-ring {
    stroke-dasharray: 640;
    stroke-dashoffset: 640;
    transition: stroke-dashoffset 0.8s ease-out 1.2s;
}

.archive-stamp.animate .stamp-outer-ring {
    stroke-dashoffset: 0;
}

.archive-stamp.animate .stamp-inner-ring {
    stroke-dashoffset: 0;
}

.archive-stamp.animate .stamp-text {
    animation: stamp-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 2s forwards;
}

.archive-stamp.animate .stamp-subtext {
    animation: stamp-bounce-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 2.3s forwards;
}

@keyframes stamp-bounce-in {
    0% {
        opacity: 0;
        transform: rotate(-12deg) scale(1.3);
    }
    100% {
        opacity: 1;
        transform: rotate(-12deg) scale(1);
    }
}

/* Stamp ink pulse */
.stamp-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(168, 144, 96, 0.06) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
}

.archive-stamp.animate .stamp-pulse {
    animation: ink-pulse 2s ease-out 2.6s forwards;
}

@keyframes ink-pulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

.closing-statement {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.2rem;
    color: #C9CDD4;
    line-height: 1.6;
    max-width: 480px;
}

.closing-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: #8B9299;
}

.closing-directive {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    color: #6B7280;
    margin-top: 8px;
}

/* === BOUNCE ENTER ANIMATION === */
@keyframes bounce-enter {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    60% {
        opacity: 1;
        transform: translateY(-6px);
    }
    80% {
        transform: translateY(3px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === GINKGO WATERMARK (pseudo-element behind body text) === */
.section-registry::after {
    content: '';
    position: absolute;
    bottom: 100px;
    right: 10%;
    width: 200px;
    height: 260px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 160'%3E%3Cpath d='M60 150 L60 90' stroke='%236B8F71' stroke-width='1.5' fill='none'/%3E%3Cpath d='M60 90 C30 70 15 50 25 30 C30 22 40 18 50 22 C55 24 58 30 60 40' stroke='%236B8F71' stroke-width='1' fill='none'/%3E%3Cpath d='M60 90 C90 70 105 50 95 30 C90 22 80 18 70 22 C65 24 62 30 60 40' stroke='%236B8F71' stroke-width='1' fill='none'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.04;
    pointer-events: none;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        transform: translateX(-280px);
        z-index: 150;
    }

    .sidebar.visible {
        transform: translateX(0);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        opacity: 1;
    }

    .mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        width: 100%;
    }

    .section-registry {
        padding: 60px 32px;
    }

    .section-specimen {
        padding: 60px 24px;
    }

    .specimen-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }

    .section-stamp {
        padding: 60px 32px;
    }

    .perforated-divider {
        padding: 30px 32px;
        gap: 40px;
    }
}

@media (max-width: 640px) {
    .section-registry {
        padding: 48px 20px;
    }

    .section-specimen {
        padding: 48px 16px;
    }

    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: 320px;
    }

    .registry-cards {
        gap: 28px;
    }

    .registry-card {
        padding: 28px 20px 24px;
    }

    .section-stamp {
        padding: 48px 20px;
        min-height: 50vh;
    }

    .perforated-divider {
        gap: 28px;
        padding: 24px 20px;
    }

    .seal-title {
        letter-spacing: 0.06em;
    }

    .closing-statement {
        font-size: 1rem;
    }
}

/* === SIDEBAR ON DESKTOP: ANIMATION DELAY FOR ENTRY === */
@media (min-width: 1025px) {
    .sidebar {
        position: sticky;
    }

    .sidebar-overlay {
        display: none !important;
    }

    .mobile-toggle {
        display: none !important;
    }
}
