/* ==========================================================================
   rironbusou.com -- Isometric Vintage Armory
   Deep-Burgundy palette, horizontal-scroll, grain-overlay
   Fonts: "JetBrains Mono" (Google Fonts) precision headings.
   Body: "Lato" (Google Fonts)
   ========================================================================== */

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

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

body {
    background-color: #2A0A14;
    color: #E8D8C0;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100vh;
    width: 100vw;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    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;
}

/* --- Horizontal Scroll Container --- */
.scroll-container {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    height: 100vh;
    width: 100vw;
    -webkit-overflow-scrolling: touch;
}

.scroll-container::-webkit-scrollbar {
    height: 4px;
}

.scroll-container::-webkit-scrollbar-track {
    background: #2A0A14;
}

.scroll-container::-webkit-scrollbar-thumb {
    background: #8A7050;
    border-radius: 2px;
}

/* --- Panel (each section = 100vw) --- */
.panel {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.panel-inner {
    width: 100%;
    max-width: 900px;
    height: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.panel-inner::-webkit-scrollbar {
    width: 3px;
}

.panel-inner::-webkit-scrollbar-track {
    background: transparent;
}

.panel-inner::-webkit-scrollbar-thumb {
    background: #4A2030;
    border-radius: 2px;
}

/* --- Ornamental Border --- */
.ornamental-border {
    border: 2px solid #C4A055;
    border-image: repeating-linear-gradient(
        45deg,
        #C4A055 0px,
        #C4A055 2px,
        transparent 2px,
        transparent 6px,
        #8A7050 6px,
        #8A7050 8px,
        transparent 8px,
        transparent 12px
    ) 12;
    padding: 3rem;
    position: relative;
    background-color: rgba(42, 10, 20, 0.85);
}

/* Corner accents */
.ornamental-border::before,
.ornamental-border::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: #C4A055;
    border-style: solid;
}

.ornamental-border::before {
    top: 8px;
    left: 8px;
    border-width: 2px 0 0 2px;
}

.ornamental-border::after {
    bottom: 8px;
    right: 8px;
    border-width: 0 2px 2px 0;
}

/* --- Catalog Number --- */
.catalog-number {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #8A7050;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

/* --- Section Title --- */
.section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    color: #C4A055;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #C88A8A;
}

/* ==========================================================================
   Panel 1: Hero
   ========================================================================== */

.hero-content {
    text-align: center;
    padding: 2rem 0;
}

.hero-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    color: #C4A055;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-subtitle-line {
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C88A8A, transparent);
    margin: 1.5rem auto;
}

.hero-subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    font-weight: 700;
    color: #C88A8A;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    color: #E8D8C0;
    line-height: 1.7;
    max-width: 500px;
    margin: 0 auto;
    opacity: 0.8;
}

.panel-hero .catalog-number {
    text-align: center;
}

/* Scroll indicator */
.scroll-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 3rem;
}

.scroll-indicator-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #8A7050;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.scroll-indicator-arrow {
    font-size: 1.2rem;
    color: #C4A055;
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(8px); opacity: 0.5; }
}

/* ==========================================================================
   Panel 2: Arsenal Index (Catalog Grid)
   ========================================================================== */

.catalog-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.catalog-card {
    background-color: #3A1420;
    border: 1px solid #4A2030;
    padding: 1.5rem;
    position: relative;
    transition: border-color 0.3s ease;
}

.catalog-card:hover {
    border-color: #C4A055;
}

.card-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #8A7050;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.75rem;
}

.card-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #C4A055;
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.card-desc {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #E8D8C0;
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    color: #C88A8A;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-top: 1px solid #4A2030;
    padding-top: 0.75rem;
    display: block;
}

/* ==========================================================================
   Panel 3: Tactical Doctrine
   ========================================================================== */

.doctrine-columns {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.doctrine-entry {
    background-color: #3A1420;
    border-left: 3px solid #C4A055;
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    position: relative;
}

.doctrine-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #8A7050;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.5rem;
}

.doctrine-heading {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: #C4A055;
    margin-bottom: 0.75rem;
    letter-spacing: 0.03em;
}

.doctrine-text {
    font-family: 'Lato', sans-serif;
    font-size: 0.95rem;
    color: #E8D8C0;
    line-height: 1.7;
    opacity: 0.85;
}

/* ==========================================================================
   Panel 4: Field Manual
   ========================================================================== */

.manual-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.manual-item {
    background-color: #3A1420;
    border: 1px solid #4A2030;
    padding: 1.5rem;
    transition: border-color 0.3s ease;
}

.manual-item:hover {
    border-color: #C88A8A;
}

.manual-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #4A2030;
}

.manual-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    color: #C4A055;
    letter-spacing: 0.15em;
}

.manual-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.6rem;
    font-weight: 400;
    color: #8A7050;
    letter-spacing: 0.1em;
}

.manual-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #E8D8C0;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.manual-excerpt {
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    color: #E8D8C0;
    line-height: 1.7;
    opacity: 0.8;
}

/* ==========================================================================
   Panel 5: Archives
   ========================================================================== */

.archives-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2.5rem;
}

.archive-seal {
    width: 180px;
    height: 180px;
}

.seal-svg {
    width: 100%;
    height: 100%;
}

.archive-text {
    max-width: 550px;
}

.archive-statement {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    color: #E8D8C0;
    line-height: 1.7;
    margin-bottom: 2rem;
    opacity: 0.85;
}

.archive-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.archive-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 700;
    color: #8A7050;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.archive-divider {
    color: #4A2030;
}

/* ==========================================================================
   Skeleton-Loading Shimmer Animation
   ========================================================================== */

.skeleton-load {
    position: relative;
    overflow: hidden;
}

.skeleton-load.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #3A1420 25%, #4A2030 50%, #3A1420 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    z-index: 10;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .panel {
        padding: 1rem;
    }

    .ornamental-border {
        padding: 1.5rem;
    }

    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 3rem);
    }

    .archive-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
}
