/* ============================================
   xbom.wiki - Street-style + Scholarly Design
   ============================================ */

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

:root {
    --primary-neutral: #3d3d3d;
    --accent-rust: #8b6f47;
    --accent-mustard: #a89968;
    --accent-slate: #5a5a5a;
    --bg: #f8f7f2;
    --overlay: #e8e6df;
    --font-headline: 'Bebas Neue', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;
    --font-accent: 'Abril Fatface', serif;
}

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

body {
    background-color: var(--bg);
    color: var(--primary-neutral);
    font-family: var(--font-body);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* --- Skeleton Loading Overlay --- */
#skeleton-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10% 15%;
    gap: 24px;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#skeleton-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.skeleton-line {
    height: 3px;
    background: var(--overlay);
    border-radius: 1px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--accent-rust);
    animation: lineStroke 1.2s ease-out forwards;
}

.skeleton-line-1 { width: 80%; }
.skeleton-line-2 { width: 55%; margin-left: 20%; }
.skeleton-line-3 { width: 70%; }
.skeleton-line-4 { width: 40%; margin-left: 35%; }
.skeleton-line-5 { width: 65%; margin-left: 10%; }
.skeleton-line-6 { width: 50%; }
.skeleton-line-7 { width: 75%; margin-left: 5%; }
.skeleton-line-8 { width: 45%; margin-left: 25%; }

.skeleton-line-1::after { animation-delay: 0s; }
.skeleton-line-2::after { animation-delay: 0.1s; }
.skeleton-line-3::after { animation-delay: 0.2s; }
.skeleton-line-4::after { animation-delay: 0.3s; }
.skeleton-line-5::after { animation-delay: 0.4s; }
.skeleton-line-6::after { animation-delay: 0.5s; }
.skeleton-line-7::after { animation-delay: 0.6s; }
.skeleton-line-8::after { animation-delay: 0.7s; }

@keyframes lineStroke {
    0% { left: -100%; }
    100% { left: 0%; }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    overflow: hidden;
}

.hero-watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-nodes {
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding: 0 8% 12vh 8%;
    max-width: 720px;
}

.hero-title {
    font-family: var(--font-headline);
    font-size: 5.5rem;
    letter-spacing: -0.05em;
    line-height: 0.95;
    color: var(--primary-neutral);
    margin-bottom: 0.3em;
}

.hero-title-accent {
    color: var(--accent-rust);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--accent-slate);
    margin-bottom: 1em;
    max-width: 500px;
}

.hero-tagline {
    font-family: var(--font-accent);
    font-size: 1.35rem;
    color: var(--accent-mustard);
    line-height: 1.5;
    max-width: 480px;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    right: 8%;
    z-index: 1;
}

.scroll-line {
    display: block;
    width: 1px;
    height: 60px;
    background: var(--accent-rust);
    opacity: 0.5;
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.2; transform: scaleY(0.6); }
    50% { opacity: 0.6; transform: scaleY(1); }
}

/* --- Content Sections --- */
.content-section {
    padding: 10vh 8%;
    position: relative;
}

.section-grid {
    display: grid;
    gap: 3rem;
}

/* Grid: What Is XBOM */
.grid-what {
    grid-template-columns: 1fr;
    max-width: 1100px;
}

.grid-what .section-header {
    grid-column: 1;
}

.grid-what .section-body {
    max-width: 600px;
}

.grid-what .section-aside {
    justify-self: end;
    max-width: 500px;
}

/* Grid: Layers */
.grid-layers {
    grid-template-columns: 1fr;
    max-width: 1200px;
}

/* Grid: Why */
.grid-why {
    grid-template-columns: 1fr;
    max-width: 1100px;
}

/* Grid: Process */
.grid-process {
    grid-template-columns: 1fr;
    max-width: 900px;
}

/* Grid: Explore */
.grid-explore {
    grid-template-columns: 1fr;
    max-width: 1100px;
}

/* --- Section Headers --- */
.section-header {
    margin-bottom: 1rem;
}

.offset-left {
    text-align: left;
}

.offset-right {
    text-align: right;
    margin-left: auto;
}

.section-title {
    font-family: var(--font-headline);
    font-size: 4rem;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--primary-neutral);
    display: inline-block;
}

.title-underline {
    width: 60px;
    height: 3px;
    background: var(--accent-rust);
    margin-top: 0.5rem;
}

.offset-right .title-underline {
    margin-left: auto;
}

/* --- Body Text --- */
.body-text {
    font-family: var(--font-body);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    line-height: 1.7;
    color: var(--primary-neutral);
    margin-bottom: 1.2em;
}

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

.body-text em {
    font-style: italic;
    color: var(--accent-rust);
}

/* --- Pull Quote --- */
.pull-quote {
    font-family: var(--font-accent);
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--accent-slate);
    padding: 2rem 0;
    position: relative;
}

.quote-mark {
    color: var(--accent-mustard);
    font-size: 2.2rem;
    line-height: 0;
    vertical-align: -0.15em;
}

/* --- Layer Cards --- */
.layer-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
}

.layer-card {
    background: var(--overlay);
    padding: 2rem 1.5rem;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.layer-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-rust);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.layer-card:hover::before {
    transform: scaleX(1);
}

.layer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(61, 61, 61, 0.08);
}

.layer-number {
    font-family: var(--font-headline);
    font-size: 2.4rem;
    color: var(--accent-mustard);
    line-height: 1;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.layer-name {
    font-family: var(--font-headline);
    font-size: 1.8rem;
    letter-spacing: -0.03em;
    color: var(--primary-neutral);
    margin-bottom: 0.8rem;
}

.layer-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--accent-slate);
}

/* --- Why Blocks --- */
.why-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.why-block {
    background: var(--overlay);
    padding: 2.5rem 2rem;
    position: relative;
}

.why-block::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-mustard);
    transition: width 0.5s ease;
}

.why-block:hover::after {
    width: 100%;
}

.why-block-left {
    grid-column: 1;
}

.why-block-right {
    grid-column: 2;
}

.why-block-center {
    grid-column: 1 / -1;
    max-width: 700px;
    margin-left: 15%;
}

.why-heading {
    font-family: var(--font-headline);
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    color: var(--primary-neutral);
    margin-bottom: 0.8rem;
}

/* --- Process Flow --- */
.process-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.process-step {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2rem 0;
}

.step-marker {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.step-icon {
    width: 40px;
    height: 40px;
}

.step-content {
    flex: 1;
}

.step-title {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--primary-neutral);
    margin-bottom: 0.5rem;
}

.process-connector {
    width: 1px;
    height: 30px;
    background: var(--accent-slate);
    margin-left: 20px;
    opacity: 0.3;
}

/* --- Explore Entries --- */
.explore-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.explore-entry {
    padding: 2rem 1.5rem;
    border-left: 2px solid var(--accent-rust);
    transition: background 0.3s ease;
}

.explore-entry:hover {
    background: var(--overlay);
}

.explore-tag {
    font-family: var(--font-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-mustard);
    display: block;
    margin-bottom: 0.8rem;
}

.explore-heading {
    font-family: var(--font-headline);
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    color: var(--primary-neutral);
    margin-bottom: 0.8rem;
}

/* --- Watercolor Hover Effect on Interactive Elements --- */
.layer-card,
.why-block,
.explore-entry {
    position: relative;
    overflow: hidden;
}

.layer-card::after,
.explore-entry::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(139,111,71,0.15) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.5s ease, height 0.5s ease;
    pointer-events: none;
    z-index: 0;
}

.layer-card:hover::after,
.explore-entry:hover::after {
    width: 300px;
    height: 300px;
}

.layer-card > *,
.explore-entry > * {
    position: relative;
    z-index: 1;
}

/* --- Reveal Animations --- */
.reveal-section {
    opacity: 0;
    transform: translateY(20px) rotate(0.5deg) scale(0.98);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-section.visible {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
}

.reveal-card {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --- Footer --- */
#site-footer {
    padding: 8vh 8% 6vh;
    border-top: 1px solid var(--overlay);
}

.footer-content {
    max-width: 600px;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-logo {
    font-family: var(--font-headline);
    font-size: 2.4rem;
    letter-spacing: -0.05em;
    color: var(--primary-neutral);
}

.footer-logo-accent {
    font-family: var(--font-headline);
    font-size: 2.4rem;
    letter-spacing: -0.05em;
    color: var(--accent-rust);
}

.footer-description {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--accent-slate);
    line-height: 1.6;
}

.footer-divider {
    width: 40px;
    height: 2px;
    background: var(--accent-mustard);
    margin: 2rem 0;
}

.footer-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-slate);
    opacity: 0.7;
}

.footer-sep {
    margin: 0 0.5em;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .layer-cards {
        grid-template-columns: repeat(3, 1fr);
    }

    .explore-content {
        grid-template-columns: 1fr 1fr;
    }

    .hero-title {
        font-size: 4.2rem;
    }

    .section-title {
        font-size: 3.2rem;
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 0 6% 10vh 6%;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .hero-tagline {
        font-size: 1.15rem;
    }

    .content-section {
        padding: 8vh 6%;
    }

    .section-title {
        font-size: 2.8rem;
    }

    .layer-cards {
        grid-template-columns: 1fr 1fr;
    }

    .why-content {
        grid-template-columns: 1fr;
    }

    .why-block-center {
        margin-left: 0;
        max-width: 100%;
    }

    .explore-content {
        grid-template-columns: 1fr;
    }

    .pull-quote {
        font-size: 1.3rem;
    }

    .offset-right {
        text-align: left;
        margin-left: 0;
    }

    .offset-right .title-underline {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .layer-cards {
        grid-template-columns: 1fr;
    }

    .layer-card {
        padding: 1.5rem 1.2rem;
    }

    .process-step {
        gap: 1.2rem;
    }
}
