/* ============================================================
   gamelicense.info - Styles
   Corporate Regalia / Gold-on-Black / Institutional Authority
   ============================================================ */

/* === Color Reference ===
   Obsidian:         #0A0A0A  (primary background)
   Onyx Panel:       #111111  (secondary background)
   Sovereign Gold:   #C9A84C  (primary accent)
   Burnished Brass:  #A8872D  (secondary accent / hover)
   Pale Gold:        #E8D5A3  (body text)
   White Gold:       #F5EDDA  (critical labels)
   Ghost Gold:       #C9A84C at 4-6% opacity (grid substrate)
   Vermillion Seal:  #C0392B  (error / alert states)
   ============================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: #0A0A0A;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: #E8D5A3;
    background-color: #0A0A0A;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Background Grid Overlay === */
.grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1200ms ease-out;
    background-image:
        /* Major grid - 48px horizontal */
        repeating-linear-gradient(
            to right,
            rgba(201, 168, 76, 0.06) 0px,
            rgba(201, 168, 76, 0.06) 1px,
            transparent 1px,
            transparent 48px
        ),
        /* Major grid - 48px vertical */
        repeating-linear-gradient(
            to bottom,
            rgba(201, 168, 76, 0.06) 0px,
            rgba(201, 168, 76, 0.06) 1px,
            transparent 1px,
            transparent 48px
        ),
        /* Minor grid - 8px vertical baseline */
        repeating-linear-gradient(
            to bottom,
            rgba(201, 168, 76, 0.02) 0px,
            rgba(201, 168, 76, 0.02) 0.5px,
            transparent 0.5px,
            transparent 8px
        );
}

.grid-overlay.visible {
    opacity: 1;
}

.grid-overlay.intensify {
    background-image:
        repeating-linear-gradient(
            to right,
            rgba(201, 168, 76, 0.12) 0px,
            rgba(201, 168, 76, 0.12) 1px,
            transparent 1px,
            transparent 48px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(201, 168, 76, 0.12) 0px,
            rgba(201, 168, 76, 0.12) 1px,
            transparent 1px,
            transparent 48px
        ),
        repeating-linear-gradient(
            to bottom,
            rgba(201, 168, 76, 0.04) 0px,
            rgba(201, 168, 76, 0.04) 0.5px,
            transparent 0.5px,
            transparent 8px
        );
    transition: background-image 400ms ease-out;
}

/* === Floating GL Mark (top-left after intro) === */
.floating-mark {
    position: fixed;
    top: 24px;
    left: 24px;
    z-index: 100;
    opacity: 0;
    transform: translateY(-16px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
    pointer-events: none;
}

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

/* === Section Base === */
.section {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    overflow: hidden;
}

/* === Section Watermark === */
.section-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(15deg);
    font-family: 'Share Tech Mono', monospace;
    font-size: 400px;
    color: rgba(201, 168, 76, 0.03);
    pointer-events: none;
    z-index: 0;
    user-select: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

.section-watermark-final {
    color: rgba(201, 168, 76, 0.05);
}

/* === Section 1: The Seal === */
.section-seal {
    min-height: 100vh;
    background-color: #0A0A0A;
    flex-direction: column;
}

.seal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.gl-monogram {
    opacity: 0;
    animation: monogramFadeIn 1200ms ease-out 200ms forwards;
}

@keyframes monogramFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.monogram-svg {
    display: block;
}

/* Monogram ring draw-in effect */
.monogram-outer-ring {
    stroke-dasharray: 604;
    stroke-dashoffset: 604;
    animation: ringDraw 1200ms ease-out 200ms forwards;
}

.monogram-inner-ring {
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    animation: ringDraw 1200ms ease-out 400ms forwards;
}

@keyframes ringDraw {
    from {
        stroke-dashoffset: 604;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.tagline {
    margin-top: 48px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: #C9A84C;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    min-height: 1.5em;
    text-align: center;
}

.tagline-cursor {
    display: inline-block;
    animation: cursorBlink 800ms step-end infinite;
    color: #C9A84C;
    margin-left: 2px;
}

.tagline-cursor.hidden {
    display: none;
}

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

/* === Section Panels (2-5) === */
.section-panel {
    min-height: 100vh;
    padding: 96px 0;
}

.panel-inner {
    position: relative;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    border: 1px solid rgba(201, 168, 76, 0.2);
    background-color: #111111;
    padding: 48px;
    z-index: 1;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.panel-inner.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Gold corner accents on panels */
.panel-inner::before,
.panel-inner::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 24px;
    border-color: #C9A84C;
    border-style: solid;
    opacity: 0;
    transition: opacity 600ms ease-out 600ms;
}

.panel-inner::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.panel-inner::after {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

.panel-inner.revealed::before,
.panel-inner.revealed::after {
    opacity: 1;
}

/* Section number background */
.section-number-bg {
    position: absolute;
    top: 24px;
    right: 24px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 120px;
    color: rgba(201, 168, 76, 0.08);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* Panel icon */
.panel-icon {
    position: absolute;
    left: -80px;
    top: 48px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.panel-icon.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Panel content */
.panel-content {
    position: relative;
    z-index: 1;
}

/* Section rule */
.section-rule {
    width: 100%;
    height: 1px;
    background-color: rgba(201, 168, 76, 0.4);
    margin-bottom: 24px;
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition: opacity 600ms ease-out 150ms, transform 600ms ease-out 150ms;
}

.section-rule.revealed {
    opacity: 1;
    transform: scaleX(1);
}

/* Section label */
.section-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #A8872D;
    margin-bottom: 16px;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out 300ms, transform 600ms ease-out 300ms;
}

.section-label.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section title */
.section-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(1.6rem, 3.5vw, 2.8rem);
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #C9A84C;
    margin-bottom: 32px;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out 300ms, transform 600ms ease-out 300ms;
}

.section-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section body */
.section-body {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 600ms ease-out 450ms, transform 600ms ease-out 450ms;
}

.section-body.revealed {
    opacity: 1;
    transform: translateY(0);
}

.section-body p {
    margin-bottom: 24px;
    color: #E8D5A3;
}

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

.section-body strong,
.section-body em {
    color: #F5EDDA;
    font-weight: 500;
}

/* === Section 6: The Seal Redux === */
.section-seal-redux {
    min-height: 100vh;
    flex-direction: column;
    background-color: #0A0A0A;
}

.seal-redux-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 1200ms ease-out, transform 1200ms ease-out;
}

.seal-redux-content.revealed {
    opacity: 1;
    transform: translateY(0);
}

.gl-monogram-final {
    margin-bottom: 48px;
}

.monogram-svg-final {
    display: block;
}

.closing-statement {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1.1rem);
    color: #F5EDDA;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    text-align: center;
}

/* === Vermillion Seal - Error / Alert States === */
.alert-indicator {
    color: #C0392B;
}

.validation-warning {
    border-color: #C0392B;
    color: #C0392B;
}

/* === Grid pulse at section boundaries === */
.grid-overlay.pulse {
    animation: gridPulse 400ms ease-out;
}

@keyframes gridPulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 1;
        filter: brightness(2.5);
    }
    100% {
        opacity: 1;
        filter: brightness(1);
    }
}

/* === Hover states with Burnished Brass (#A8872D) === */
a {
    color: #C9A84C;
    text-decoration: none;
    transition: color 300ms ease-out;
}

a:hover {
    color: #A8872D;
}

/* === Mobile Adaptation (below 768px) === */
@media (max-width: 768px) {
    .panel-inner {
        max-width: calc(100vw - 48px);
        padding: 32px 24px;
    }

    .panel-icon {
        position: relative;
        left: 0;
        top: 0;
        margin-bottom: 24px;
    }

    .section-number-bg {
        font-size: 72px;
    }

    .section-watermark {
        font-size: 200px;
    }

    /* Hide minor grid lines on mobile, keep major grid only */
    .grid-overlay {
        background-image:
            repeating-linear-gradient(
                to right,
                rgba(201, 168, 76, 0.06) 0px,
                rgba(201, 168, 76, 0.06) 1px,
                transparent 1px,
                transparent 48px
            ),
            repeating-linear-gradient(
                to bottom,
                rgba(201, 168, 76, 0.06) 0px,
                rgba(201, 168, 76, 0.06) 1px,
                transparent 1px,
                transparent 48px
            );
    }

    .tagline {
        font-size: clamp(0.65rem, 3vw, 0.9rem);
        padding: 0 24px;
    }

    .section-panel {
        padding: 48px 0;
    }

    .closing-statement {
        padding: 0 24px;
        letter-spacing: 0.12em;
    }

    .floating-mark {
        top: 16px;
        left: 16px;
    }

    .floating-mark svg {
        width: 48px;
        height: 48px;
    }
}

/* === Selection color === */
::selection {
    background-color: rgba(201, 168, 76, 0.3);
    color: #F5EDDA;
}

/* === Scrollbar styling (webkit) === */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0A0A0A;
}

::-webkit-scrollbar-thumb {
    background: rgba(201, 168, 76, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(201, 168, 76, 0.5);
}
