/* ============================================
   gamelicensor.info — Institutional Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #141414;
    --bg-tertiary: #1C1C1C;
    --accent-gold: #C9A84C;
    --accent-aged: #A68B3A;
    --accent-pale: #E8D5A3;
    --text-primary: #D4D0C8;
    --text-secondary: #8A8578;
    --divider-gold: rgba(201, 168, 76, 0.12);
    --error-crimson: #8B3A3A;
    --grid-opacity: 0.08;
    --grid-opacity-active: 0.12;
    --grid-opacity-section-boundary: 0.15;
    --column-width: 820px;
    --section-spacing: 120px;
    --subsection-spacing: 64px;
    --paragraph-spacing: 28px;
    --font-display: 'Share Tech Mono', monospace;
    --font-body: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* --- Grid Lines Background Layer --- */
.grid-lines-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 79px,
            rgba(201, 168, 76, var(--grid-opacity)) 79px,
            rgba(201, 168, 76, var(--grid-opacity)) 80px
        );
    transition: opacity 400ms ease;
}

/* Margin line - left edge of content column */
.grid-lines-layer::before {
    content: '';
    position: fixed;
    top: 0;
    left: max(calc((100vw - var(--column-width)) / 2), 48px);
    width: 1px;
    height: 100%;
    background-color: rgba(201, 168, 76, 0.08);
    pointer-events: none;
}

/* Right margin line */
.grid-lines-layer::after {
    content: '';
    position: fixed;
    top: 0;
    right: max(calc((100vw - var(--column-width)) / 2), 48px);
    width: 1px;
    height: 100%;
    background-color: rgba(201, 168, 76, 0.05);
    pointer-events: none;
}

/* --- Document Column --- */
.document-column {
    position: relative;
    z-index: 1;
    max-width: var(--column-width);
    margin: 0 auto;
    padding: 0 48px;
}

/* --- Sections --- */
.section {
    position: relative;
    padding-top: var(--section-spacing);
    padding-bottom: var(--section-spacing);
}

.section-header {
    padding-top: 80px;
    padding-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Ruling Lines --- */
.ruling-line {
    width: 100%;
    height: 1px;
    background-color: var(--accent-gold);
    opacity: 0.3;
    transform-origin: center center;
    transform: scaleX(0);
    transition: transform 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* Header ruling lines are immediately visible (seal does NOT fade) */
.ruling-line-header {
    transform: scaleX(1);
}

.ruling-line.visible {
    transform: scaleX(1);
}

.ruling-line-top {
    margin-bottom: 48px;
}

.ruling-line-bottom {
    margin-top: 48px;
}

/* --- Institutional Seal --- */
.seal-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
}

.institutional-seal {
    display: block;
}

.seal-text {
    font-family: var(--font-display);
    font-size: 9.5px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

.seal-container-small {
    padding: 16px 0;
}

.institutional-seal-small {
    opacity: 0.8;
}

/* --- Registration Marks --- */
.reg-mark {
    position: absolute;
    opacity: 0.3;
}

.reg-mark-tl {
    top: 24px;
    left: -20px;
}

.reg-mark-tr {
    top: 24px;
    right: -20px;
}

.reg-mark-bl {
    bottom: 24px;
    left: -20px;
}

.reg-mark-br {
    bottom: 24px;
    right: -20px;
}

/* --- Authority Statement Section --- */
.section-authority {
    padding-top: 80px;
}

.authority-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    text-align: left;
    margin-bottom: var(--paragraph-spacing);
}

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

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 16px;
    line-height: 1.3;
}

.section-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: var(--subsection-spacing);
}

/* --- Section Separators --- */
.section-separator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.separator-svg {
    width: 60%;
    max-width: 500px;
    height: 12px;
}

/* --- Credential Grid --- */
.section-credentials {
    padding-top: 80px;
}

.credential-entry {
    display: flex;
    gap: 32px;
    align-items: flex-start;
    padding: 32px 0;
}

.credential-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.3s ease;
}

.credential-entry:hover .credential-icon {
    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.25));
}

.credential-content {
    flex: 1;
}

.credential-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 8px;
    line-height: 1.3;
}

.credential-code {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 16px;
}

.credential-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

.credential-divider {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--accent-gold) 20%,
        var(--accent-gold) 80%,
        transparent
    );
    opacity: 0.15;
}

/* --- Process Timeline --- */
.section-process {
    padding-top: 80px;
}

.process-step {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    padding: 40px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}

.process-step:last-of-type {
    border-bottom: none;
}

.step-numeral {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--accent-gold);
    line-height: 1;
    flex-shrink: 0;
    min-width: 120px;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.step-content {
    flex: 1;
    padding-top: 12px;
}

.step-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1.2rem, 2.2vw, 1.6rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 16px;
    line-height: 1.3;
}

.step-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

/* --- Verification Section --- */
.section-verification {
    padding-top: 80px;
}

.verification-block {
    margin-bottom: var(--subsection-spacing);
}

.verification-block:last-child {
    margin-bottom: 0;
}

.verification-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.verification-icon svg {
    transition: filter 0.3s ease;
}

.verification-icon:hover svg {
    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.25));
}

.verification-details {
    background-color: var(--bg-secondary);
    padding: 40px;
    border: 1px solid rgba(201, 168, 76, 0.12);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 0;
    border-bottom: 1px solid rgba(201, 168, 76, 0.08);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.detail-value {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    letter-spacing: 0.04em;
    color: var(--accent-pale);
}

/* --- Jurisdiction Section --- */
.section-jurisdiction {
    padding-top: 80px;
}

.jurisdiction-grid {
    display: flex;
    flex-direction: column;
    gap: 48px;
    margin-top: var(--subsection-spacing);
}

.jurisdiction-item {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 32px;
    background-color: var(--bg-secondary);
    border: 1px solid rgba(201, 168, 76, 0.08);
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.jurisdiction-item:hover {
    border-color: rgba(201, 168, 76, 0.2);
    background-color: var(--bg-tertiary);
}

.jurisdiction-icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 48px;
    height: 48px;
    transition: filter 0.3s ease;
}

.jurisdiction-item:hover .jurisdiction-icon {
    filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.25));
}

.jurisdiction-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.3rem);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-gold);
    line-height: 1.3;
}

.jurisdiction-desc {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.75;
    letter-spacing: 0.02em;
    color: var(--text-primary);
}

/* --- Footer --- */
.section-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 80px;
}

.footer-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-jurisdiction {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-bottom: 24px;
    max-width: 600px;
}

.footer-ref {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(0.7rem, 0.9vw, 0.8rem);
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--accent-aged);
    margin-bottom: 32px;
}

/* --- Fade-Reveal Animations --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

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

/* Icon scale transition: icons fade in with scale 0.92 to 1.0 over 500ms */
.fade-reveal .credential-icon,
.fade-reveal .verification-icon,
.fade-reveal .jurisdiction-icon {
    transform: scale(0.92);
    transition: transform 500ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                filter 0.3s ease;
}

.fade-reveal.visible .credential-icon,
.fade-reveal.visible .verification-icon,
.fade-reveal.visible .jurisdiction-icon {
    transform: scale(1);
}

/* Large numerals: longer fade (900ms), greater travel (30px) */
.process-step .step-numeral {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 900ms cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 900ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.process-step.fade-reveal.visible .step-numeral {
    opacity: 0.9;
    transform: translateY(0);
}

/* Section separator SVG: draw from center outward */
.section-separator .separator-svg {
    opacity: 0;
    transition: opacity 600ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.section-separator.visible .separator-svg {
    opacity: 1;
}

/* Separator line draws from center outward */
.section-separator .separator-svg .separator-line {
    stroke-dasharray: 460;
    stroke-dashoffset: 460;
    transition: stroke-dashoffset 800ms cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.section-separator.visible .separator-svg .separator-line {
    stroke-dashoffset: 0;
}

/* --- Active Section Indicator (subtle grid brightening effect) --- */
.section.section-active {
    /* Active state is modulated via JS on the grid-lines layer */
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .document-column {
        padding: 0 24px;
    }

    .section {
        padding-top: 80px;
        padding-bottom: 80px;
    }

    .section-header {
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .credential-entry {
        flex-direction: column;
        gap: 16px;
    }

    .process-step {
        flex-direction: column;
        gap: 16px;
    }

    .step-numeral {
        min-width: auto;
    }

    .detail-row {
        flex-direction: column;
        gap: 8px;
    }

    .reg-mark {
        display: none;
    }

    .grid-lines-layer::before {
        left: 24px;
    }

    .grid-lines-layer::after {
        right: 24px;
    }

    .verification-details {
        padding: 24px;
    }

    .jurisdiction-item {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .document-column {
        padding: 0 16px;
    }

    .grid-lines-layer::before {
        left: 16px;
    }

    .grid-lines-layer::after {
        right: 16px;
    }
}
