/* gamelicen.se - Decommissioned Patent Office Aesthetic */
/* Colors: #0d1a2d, #1a2744, #3d4f6b, #b8c4d6, #b8926a, #e8dcc8, #080e18, #4a7c6b, #7a8599, #556b8a */

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0d1a2d;
    color: #b8c4d6;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    overflow-x: hidden;
}

/* Grain Overlay */
.grain-overlay::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* Top Rule */
.top-rule {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #7a8599;
    z-index: 100;
}

.site-name {
    position: fixed;
    top: 10px;
    left: 20px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #7a8599;
    text-transform: uppercase;
    z-index: 100;
}

/* Filing Spine */
.filing-spine {
    position: fixed;
    left: 0;
    top: 0;
    width: 60px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    z-index: 90;
    padding-left: 12px;
}

.spine-marker {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spine-code {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.02em;
    color: #556b8a;
    transition: color 0.4s ease;
    white-space: nowrap;
}

.spine-bar {
    display: block;
    width: 0;
    height: 2px;
    background-color: #b8926a;
    transition: width 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spine-marker.active .spine-code {
    color: #b8926a;
}

.spine-marker.active .spine-bar {
    width: 20px;
}

/* Drawer Sections */
.drawer {
    min-height: 100vh;
    position: relative;
    padding-left: 80px;
    padding-right: 40px;
    display: flex;
    align-items: center;
}

.drawer-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

/* Drawer Tab - file folder tab effect */
.drawer-tab {
    width: 100%;
    height: 12px;
    background-color: #1a2744;
    margin-bottom: 24px;
}

/* Diagonal Decorative Dividers */
.drawer::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 80px;
    right: 40px;
    height: 1px;
    background: linear-gradient(90deg, #3d4f6b 0%, #3d4f6b 30%, transparent 100%);
}

/* F-Pattern Rules */
.f-rule {
    border: none;
    height: 1px;
    background-color: #3d4f6b;
    margin-bottom: 24px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.f-rule.visible {
    transform: scaleX(1);
}

/* ===== DRAWER 1 - Cover Sheet ===== */
.drawer-1 {
    min-height: 100vh;
    justify-content: center;
}

.cover-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(3.5rem, 8vw, 7rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e8dcc8;
    line-height: 1;
    margin-bottom: 32px;
    text-shadow: 1px 1px 0 rgba(26, 39, 68, 0.35);
}

.cover-subtitle {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: #7a8599;
    min-height: 1.5em;
    position: relative;
}

.cover-subtitle .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #b8926a;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 530ms step-end infinite;
}

.cover-subtitle .cursor.fade-out {
    animation: cursorFadeOut 800ms ease forwards;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes cursorFadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ===== DRAWER 2 - Index ===== */
.drawer-2 {
    min-height: 80vh;
}

.drawer-2-layout {
    display: flex;
    gap: 5%;
}

.index-summary {
    flex: 0 0 40%;
}

.index-entries {
    flex: 0 0 55%;
}

.index-entry {
    display: flex;
    align-items: baseline;
    padding: 10px 0;
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.index-entry.visible {
    opacity: 1;
    transform: translateY(0);
}

.index-symbol {
    color: #b8926a;
    margin-right: 12px;
    flex-shrink: 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
}

.index-label {
    color: #b8c4d6;
    flex-shrink: 0;
}

.index-leader {
    flex: 1;
    border-bottom: 1px dotted #556b8a;
    margin: 0 8px;
    min-width: 20px;
    align-self: baseline;
    position: relative;
    top: -4px;
}

.index-page {
    color: #7a8599;
    flex-shrink: 0;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
}

/* ===== DRAWER 3 - Body of Evidence ===== */
.drawer-3 {
    min-height: 120vh;
    align-items: flex-start;
    padding-top: 80px;
    padding-bottom: 80px;
}

.evidence-block {
    max-width: 680px;
    border: 1px solid #3d4f6b;
    padding: 0 32px 32px;
    margin-bottom: 48px;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.evidence-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.evidence-block-1 {
    margin-left: 0;
}

.evidence-block-2 {
    margin-left: 15%;
}

.evidence-block-3 {
    margin-left: 5%;
}

.evidence-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #e8dcc8;
    margin-bottom: 16px;
    text-shadow: 1px 1px 0 rgba(26, 39, 68, 0.35);
}

.evidence-heading:hover {
    text-shadow: 3px 3px 0 rgba(26, 39, 68, 0.35);
    transition: text-shadow 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.body-text {
    margin-bottom: 20px;
    color: #b8c4d6;
}

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

/* ===== DRAWER 4 - Annotations ===== */
.drawer-4 {
    min-height: 100vh;
    align-items: flex-start;
    padding-top: 80px;
    padding-bottom: 80px;
}

.drawer-4-layout {
    display: flex;
    gap: 40px;
    position: relative;
}

.annotations-margin {
    flex: 0 0 200px;
    position: sticky;
    top: 120px;
    align-self: flex-start;
}

.margin-note {
    font-family: 'Source Serif 4', serif;
    font-style: italic;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #b8926a;
    padding: 12px 0;
    border-left: 2px solid #3d4f6b;
    padding-left: 12px;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.margin-note.visible {
    opacity: 1;
    transform: translateX(0);
}

.note-symbol {
    color: #b8926a;
    font-style: normal;
    font-weight: 600;
}

.annotations-body {
    flex: 1;
    max-width: 680px;
}

/* ===== DRAWER 5 - The Seal ===== */
.drawer-5 {
    min-height: 80vh;
    justify-content: center;
}

.drawer-5-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.seal-container {
    margin-bottom: 40px;
}

.seal-ring {
    width: 180px;
    height: 180px;
    border: 3px solid #b8926a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0.7;
    filter: url(#seal-distort);
}

.seal-ring::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid #b8926a;
}

.seal-ring::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(184, 146, 106, 0.4);
}

.seal-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.seal-text-top,
.seal-text-bottom {
    font-family: 'Barlow Semi Condensed', sans-serif;
    font-weight: 500;
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #b8926a;
}

.seal-domain {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: 2.5rem;
    color: #b8926a;
    line-height: 1;
    letter-spacing: 0.08em;
}

.seal-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e8dcc8;
    margin-bottom: 24px;
    text-shadow: 1px 1px 0 rgba(26, 39, 68, 0.35);
}

.seal-closing {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: #7a8599;
    min-height: 1.5em;
}

.seal-closing .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #b8926a;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 530ms step-end infinite;
}

.seal-closing .cursor.fade-out {
    animation: cursorFadeOut 800ms ease forwards;
}

.redaction-bar {
    width: 200px;
    height: 3px;
    background-color: #3d4f6b;
    margin-top: 40px;
}

/* Typewriter shared styles */
.typewriter .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #b8926a;
    margin-left: 2px;
    vertical-align: text-bottom;
    animation: blink 530ms step-end infinite;
}

.typewriter .cursor.fade-out {
    animation: cursorFadeOut 800ms ease forwards;
}

/* Spring animation for drawer content entry */
@keyframes springIn {
    0% {
        opacity: 0;
        transform: translateY(40px);
    }
    60% {
        opacity: 1;
        transform: translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .filing-spine {
        display: none;
    }

    .drawer {
        padding-left: 24px;
        padding-right: 24px;
    }

    .drawer::after {
        left: 24px;
        right: 24px;
    }

    .drawer-2-layout {
        flex-direction: column;
        gap: 40px;
    }

    .index-summary {
        flex: none;
    }

    .index-entries {
        flex: none;
    }

    .drawer-4-layout {
        flex-direction: column;
    }

    .annotations-margin {
        flex: none;
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }

    .margin-note {
        flex: 1 1 45%;
    }

    .evidence-block-1,
    .evidence-block-2,
    .evidence-block-3 {
        margin-left: 0;
    }

    .cover-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .seal-ring {
        width: 140px;
        height: 140px;
    }

    .seal-domain {
        font-size: 2rem;
    }
}

/* SVG filter for seal distortion - hidden */
svg.filters {
    position: absolute;
    width: 0;
    height: 0;
}
