/* ==========================================================
   gamelicens.ing -- Institutional Registry Design System
   Colors: #D4A017, #B8860B, #F5D061, #E8E2D6, #8A8272,
           #1E1E1E, #141414, #0A0A0A
   Fonts: Share Tech Mono, IBM Plex Mono, Space Mono, Inter
   ========================================================== */

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

html {
    scroll-behavior: smooth;
    font-variant-numeric: tabular-nums;
    scrollbar-width: thin;
    scrollbar-color: #D4A017 #0A0A0A;
}

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

/* --- Scroll Progress Bar (2px gold, fixed top) --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: #D4A017;
    z-index: 1000;
    transition: width 50ms linear;
    pointer-events: none;
}

/* --- Grid-Line Overlay (fixed SVG, z-index 1) --- */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-in;
}

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

/* --- GL Seal Watermark (fixed center, 3% opacity) --- */
#gl-seal {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease-in;
}

#gl-seal.visible {
    opacity: 0.03;
}

/* --- Rotating Watermark Grid (deepest layer, 2% opacity, 120s rotation) --- */
#watermark-grid {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.02;
    background-image:
        linear-gradient(#D4A017 1px, transparent 1px),
        linear-gradient(90deg, #D4A017 1px, transparent 1px);
    background-size: 200px 200px;
    animation: watermark-rotate 120s linear infinite;
}

@keyframes watermark-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Registry Plate Sections --- */
.registry-plate {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    background-color: #141414;
}

.registry-plate:nth-child(odd) {
    background-color: #0A0A0A;
}

/* Plate 001: always pure black */
#plate-001 {
    background-color: #0A0A0A;
}

/* Plate 005: special background */
#plate-005 {
    background-color: #0A0A0A;
}

.plate-inner {
    width: 680px;
    max-width: calc(100vw - 48px);
    position: relative;
    padding: 64px 0;
}

/* --- Plate Number (Inter, 10px, gold-gray, uppercase) --- */
.plate-number {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8A8272;
    margin-bottom: 16px;
}

/* --- Plate Rule (Horizontal Gold Lines, 1px #D4A017) --- */
.plate-rule {
    border: none;
    height: 1px;
    background-color: #D4A017;
    width: 100%;
    margin: 0;
}

.plate-rule-gold {
    margin-top: 48px;
}

/* Rule animation: draws from left to right */
.rule-animate {
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 400ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* --- Plate Title (Share Tech Mono, uppercase, gold) --- */
.plate-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #D4A017;
    margin-top: 32px;
    margin-bottom: 32px;
    text-align: left;
}

/* --- Plate Content --- */
.plate-content {
    position: relative;
}

.plate-content p {
    margin-bottom: 24px;
    text-align: left;
}

.plate-content p:last-child {
    margin-bottom: 0;
}

/* --- Registration Grid Background (8x8px cells, #D4A017 at 6% opacity) --- */
.registration-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(#D4A017 1px, transparent 1px),
        linear-gradient(90deg, #D4A017 1px, transparent 1px);
    background-size: 8px 8px;
    opacity: 0;
    transition: opacity 200ms ease-in;
    pointer-events: none;
    z-index: -1;
}

.registration-grid.visible {
    opacity: 0.06;
}

/* --- Plate 001: Hero Section --- */
.plate-001-content {
    text-align: left;
    padding: 64px 0;
}

.hero-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    letter-spacing: 0.14em;
    text-transform: lowercase;
    color: #D4A017;
    margin-bottom: 32px;
    min-height: 1.2em;
    position: relative;
    display: inline-block;
}

/* Typewriter caret (blinks at 530ms) */
.hero-title::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #D4A017;
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blink-caret 530ms steps(1) infinite;
}

.hero-title.typing-done::after {
    animation: blink-caret 530ms steps(1) infinite;
}

.hero-title.caret-hidden::after {
    display: none;
}

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

.hero-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.875rem, 1.1vw, 1rem);
    line-height: 1.85;
    color: #E8E2D6;
    max-width: 600px;
}

/* --- Data Reference Codes (Space Mono, gray) --- */
.data-ref {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.875rem);
    color: #8A8272;
    letter-spacing: 0.04em;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 160, 23, 0.15);
}

/* --- Icon Row --- */
.icon-row {
    display: flex;
    gap: 32px;
    margin: 40px 0;
    align-items: center;
    flex-wrap: wrap;
}

.icon {
    flex-shrink: 0;
}

.icon-48 {
    width: 48px;
    height: 48px;
}

.icon-96 {
    width: 96px;
    height: 96px;
}

.icon-24 {
    width: 24px;
    height: 24px;
}

/* --- Phase Blocks (Plate 003: Compliance Framework) --- */
.phase-block {
    display: flex;
    gap: 24px;
    margin: 32px 0;
    padding: 24px 0;
    border-bottom: 1px solid rgba(212, 160, 23, 0.1);
    align-items: flex-start;
}

.phase-block:last-of-type {
    border-bottom: none;
}

.phase-number {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.6rem);
    color: #D4A017;
    line-height: 1;
    flex-shrink: 0;
    min-width: 80px;
}

.phase-detail {
    flex: 1;
}

.phase-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #D4A017;
    margin-bottom: 12px;
}

.phase-detail p {
    color: #E8E2D6;
    margin-bottom: 0;
}

/* --- Stat Blocks (Plate 004: Registry Statistics) --- */
.stat-block {
    padding: 32px 0;
    border-bottom: 1px solid rgba(212, 160, 23, 0.1);
    text-align: left;
}

.stat-block:last-of-type {
    border-bottom: none;
}

.stat-value {
    display: block;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.6rem);
    color: #D4A017;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #8A8272;
    margin-top: 8px;
}

/* --- Certificate (Plate 005: double-rule border motif) --- */
.certificate-content {
    text-align: left;
}

.certificate-border {
    border: 1px solid #D4A017;
    padding: 4px;
    position: relative;
}

/* Corner gaps on outer border (4px short of corners) */
.certificate-border::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 5px;
    height: 5px;
    background-color: #0A0A0A;
}

.certificate-border::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 5px;
    height: 5px;
    background-color: #0A0A0A;
}

.certificate-border-inner {
    border: 1px solid #D4A017;
    padding: 64px 48px;
    position: relative;
    overflow: hidden;
}

/* Corner gaps on inner border (bottom corners) */
.certificate-border-inner::before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    width: 5px;
    height: 5px;
    background-color: #0A0A0A;
}

.certificate-border-inner::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 5px;
    height: 5px;
    background-color: #0A0A0A;
}

/* Certificate seal at 20% opacity */
.certificate-seal {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translate(-50%, -50%);
    opacity: 0.2;
    pointer-events: none;
}

.certificate-title {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #D4A017;
    margin-bottom: 32px;
    text-align: left;
    position: relative;
    z-index: 1;
}

.certificate-body {
    position: relative;
    z-index: 1;
}

.certificate-body p {
    margin-bottom: 20px;
    color: #E8E2D6;
}

.certificate-body strong {
    font-weight: 600;
    color: #D4A017;
}

.certificate-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(212, 160, 23, 0.2);
    position: relative;
    z-index: 1;
}

.cert-detail {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 0.9vw, 0.875rem);
    color: #8A8272;
    letter-spacing: 0.04em;
}

.registry-footer {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #8A8272;
    text-align: left;
    margin-top: 32px;
}

/* --- Fade-Reveal Animation System --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 300ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.fade-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for sequential reveals within a plate */
.plate-content .fade-reveal:nth-child(1) { transition-delay: 0ms; }
.plate-content .fade-reveal:nth-child(2) { transition-delay: 100ms; }
.plate-content .fade-reveal:nth-child(3) { transition-delay: 200ms; }
.plate-content .fade-reveal:nth-child(4) { transition-delay: 300ms; }
.plate-content .fade-reveal:nth-child(5) { transition-delay: 400ms; }
.plate-content .fade-reveal:nth-child(6) { transition-delay: 500ms; }
.plate-content .fade-reveal:nth-child(7) { transition-delay: 600ms; }
.plate-content .fade-reveal:nth-child(8) { transition-delay: 700ms; }
.plate-content .fade-reveal:nth-child(9) { transition-delay: 800ms; }
.plate-content .fade-reveal:nth-child(10) { transition-delay: 900ms; }
.plate-content .fade-reveal:nth-child(11) { transition-delay: 1000ms; }
.plate-content .fade-reveal:nth-child(12) { transition-delay: 1100ms; }

/* --- Interactive Element Hover States --- */
a {
    color: #D4A017;
    text-decoration: none;
    position: relative;
    transition: color 200ms ease;
}

a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #D4A017;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 200ms ease;
}

a:hover {
    color: #B8860B;
}

a:hover::after {
    transform: scaleX(1);
}

a:active {
    color: #F5D061;
}

/* --- Inline Emphasis --- */
strong, b {
    font-weight: 600;
}

em, i {
    font-style: italic;
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
    .plate-inner {
        width: calc(100vw - 48px);
    }
}

@media (max-width: 640px) {
    .plate-inner {
        padding: 48px 0;
    }

    .phase-block {
        flex-direction: column;
        gap: 12px;
    }

    .phase-number {
        min-width: auto;
    }

    .certificate-border-inner {
        padding: 32px 20px;
    }

    .icon-row {
        gap: 20px;
    }

    #gl-seal {
        width: 280px;
        height: 280px;
    }

    .certificate-seal {
        width: 220px;
        height: 220px;
    }

    .stat-value {
        font-size: clamp(1.6rem, 8vw, 2.4rem);
    }
}

/* --- Selection Style (gold on black) --- */
::selection {
    background-color: #D4A017;
    color: #0A0A0A;
}

/* --- Scrollbar Styling (thin gold on black) --- */
::-webkit-scrollbar {
    width: 4px;
}

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

::-webkit-scrollbar-thumb {
    background: #D4A017;
}
