/* ============================================
   prototype.rs - Dark Forge Aesthetic
   Palette: Gold-Black-Luxury
   ============================================ */

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

html {
    scroll-behavior: smooth;
    background: #0A0A0A;
    color-scheme: dark;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: #E0DCD4;
    background: #0A0A0A;
    overflow-x: hidden;
    position: relative;
}

/* --- Circuit Trace Background Layer --- */
.circuit-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.circuit-svg {
    width: 100%;
    height: 300vh;
    position: absolute;
    top: 0;
    left: 0;
}

.trace-line {
    stroke: #D4A843;
    stroke-width: 1;
    fill: none;
    opacity: 0.15;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: traceDraw 4s ease-out forwards;
}

.trace-node {
    fill: #D4A843;
    opacity: 0;
    animation: nodeAppear 0.5s ease-out forwards;
}

/* Stagger trace animations */
.trace-h1 { animation-delay: 0.2s; }
.trace-v1 { animation-delay: 0.5s; }
.trace-h2 { animation-delay: 0.8s; }
.trace-h3 { animation-delay: 0.3s; }
.trace-v2 { animation-delay: 0.7s; }
.trace-h4 { animation-delay: 1.0s; }
.trace-h5 { animation-delay: 1.2s; }
.trace-v3 { animation-delay: 1.5s; }
.trace-h6 { animation-delay: 1.8s; }
.trace-v4 { animation-delay: 2.1s; }
.trace-h7 { animation-delay: 2.4s; }
.trace-h8 { animation-delay: 2.7s; }
.trace-v5 { animation-delay: 3.0s; }
.trace-h9 { animation-delay: 3.3s; }
.trace-v6 { animation-delay: 3.6s; }
.trace-h10 { animation-delay: 3.9s; }
.trace-v7 { animation-delay: 4.2s; }

.trace-node:nth-child(15) { animation-delay: 0.5s; }
.trace-node:nth-child(16) { animation-delay: 0.8s; }
.trace-node:nth-child(17) { animation-delay: 0.7s; }
.trace-node:nth-child(18) { animation-delay: 1.0s; }
.trace-node:nth-child(19) { animation-delay: 1.5s; }
.trace-node:nth-child(20) { animation-delay: 1.8s; }
.trace-node:nth-child(21) { animation-delay: 2.1s; }
.trace-node:nth-child(22) { animation-delay: 2.4s; }
.trace-node:nth-child(23) { animation-delay: 3.0s; }
.trace-node:nth-child(24) { animation-delay: 3.3s; }
.trace-node:nth-child(25) { animation-delay: 3.6s; }
.trace-node:nth-child(26) { animation-delay: 4.2s; }
.trace-node:nth-child(27) { animation-delay: 3.9s; }
.trace-node:nth-child(28) { animation-delay: 4.5s; }

@keyframes traceDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes nodeAppear {
    to {
        opacity: 0.3;
    }
}

/* --- Geometric Decoration Layer --- */
.geo-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.geo-rect {
    position: absolute;
    border: 1px solid #D4A843;
    opacity: 0.05;
}

.geo-rect-1 {
    width: 200px;
    height: 120px;
    top: 15%;
    left: 5%;
    transform: rotate(-3deg);
}

.geo-rect-2 {
    width: 150px;
    height: 80px;
    top: 30%;
    right: 8%;
    transform: rotate(2deg);
}

.geo-rect-3 {
    width: 250px;
    height: 100px;
    top: 50%;
    left: 10%;
    transform: rotate(-1deg);
}

.geo-rect-4 {
    width: 180px;
    height: 140px;
    top: 65%;
    right: 12%;
    transform: rotate(4deg);
}

.geo-rect-5 {
    width: 120px;
    height: 90px;
    top: 80%;
    left: 20%;
    transform: rotate(-2deg);
}

.geo-rect-6 {
    width: 160px;
    height: 60px;
    top: 10%;
    right: 25%;
    transform: rotate(1deg);
}

/* --- Primary Content Layer (z-index: 2) --- */
.hero,
main,
.site-footer {
    position: relative;
    z-index: 2;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-content {
    text-align: center;
    max-width: 900px;
}

.hero-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hero-mark {
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #D4A843;
    display: block;
    line-height: 1;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 700;
    color: #E0DCD4;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.hero-dot {
    color: #D4A843;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: #E0DCD4;
    opacity: 0.6;
    margin-bottom: 2rem;
    letter-spacing: 0.05em;
}

.hero-trace-accent {
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #D4A843, transparent);
    margin: 0 auto;
}

/* --- Section Shared Styles --- */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 2rem;
}

.section-heading {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.75rem, 3.5vw, 3rem);
    font-weight: 700;
    color: #D4A843;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: #D4A843;
    margin-top: 0.75rem;
}

/* --- Forge Cards Section --- */
.forge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.forge-card {
    background: #1A1A1E;
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(212, 168, 67, 0.1);
    transition: border-color 0.3s ease;
}

.forge-card:hover {
    border-color: rgba(212, 168, 67, 0.3);
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.05);
}

.card-accent-line {
    width: 40px;
    height: 2px;
    background: #D4A843;
    margin-bottom: 1.5rem;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #E0DCD4;
    margin-bottom: 0.75rem;
}

.card-text {
    font-size: 0.9rem;
    color: #E0DCD4;
    opacity: 0.7;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.card-code {
    background: #0A0A0A;
    border: 1px solid rgba(212, 168, 67, 0.15);
    padding: 1rem 1.25rem;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #E0DCD4;
    opacity: 0.85;
}

.code-keyword {
    color: #E8734A;
}

.code-fn {
    color: #D4A843;
}

.code-type {
    color: #D4A843;
}

.code-param {
    color: #E0DCD4;
}

/* --- Pipeline Section --- */
.section-pipeline {
    background: linear-gradient(180deg, transparent 0%, rgba(26, 26, 30, 0.3) 50%, transparent 100%);
}

.pipeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.pipeline-stage {
    display: grid;
    grid-template-columns: 80px 60px 1fr;
    align-items: start;
    padding: 2rem 0;
    position: relative;
}

.pipeline-stage:not(:last-child) {
    border-bottom: 1px solid rgba(212, 168, 67, 0.08);
}

.stage-number {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: #D4A843;
    opacity: 0.4;
    line-height: 1;
    padding-top: 0.15rem;
}

.stage-connector {
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, #D4A843, rgba(212, 168, 67, 0.1));
    margin: 0 auto;
    position: relative;
    min-height: 60px;
}

.stage-connector::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 7px;
    height: 7px;
    background: #D4A843;
}

.stage-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #E0DCD4;
    margin-bottom: 0.5rem;
}

.stage-text {
    font-size: 0.9rem;
    color: #E0DCD4;
    opacity: 0.6;
    line-height: 1.7;
    max-width: 600px;
}

/* --- Showcase Section --- */
.showcase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.showcase-item {
    background: #1A1A1E;
    border: 1px solid rgba(212, 168, 67, 0.1);
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.showcase-item:hover {
    border-color: rgba(212, 168, 67, 0.3);
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.05);
}

.showcase-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.showcase-lang {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #E8734A;
}

.showcase-name {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
    color: #D4A843;
}

.showcase-body {
    padding: 1.5rem;
}

.showcase-desc {
    font-size: 0.9rem;
    color: #E0DCD4;
    opacity: 0.65;
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.showcase-stats {
    display: flex;
    gap: 1.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #E0DCD4;
    opacity: 0.4;
}

.stat-value {
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-pass {
    color: #D4A843;
}

/* --- Footer --- */
.site-footer {
    padding: 4rem 2rem;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-trace {
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #8B6914, transparent);
    margin: 0 auto 2rem;
}

.footer-text {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    color: #E0DCD4;
    opacity: 0.5;
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-size: 0.8rem;
    color: #8B6914;
    opacity: 0.4;
}

/* --- Fade Reveal Animation --- */
.fade-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* --- Responsive --- */
@media (max-width: 900px) {
    .forge-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .pipeline-stage {
        grid-template-columns: 60px 40px 1fr;
    }

    .stage-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .hero-brand {
        flex-direction: column;
        gap: 0.5rem;
    }

    .section-inner {
        padding: 4rem 1.25rem;
    }

    .pipeline-stage {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stage-number {
        font-size: 1.25rem;
        opacity: 0.3;
    }

    .stage-connector {
        display: none;
    }
}
