/* ============================================================
   archaic.studio — Seapunk Classicism
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-ocean: #080F14;
    --teal-ink: #1A3A4A;
    --electric-teal: #00E8D1;
    --pale-seafoam: #E0F7F4;
    --muted-teal: #A8C8C4;
    --magenta-pulse: #D4167E;
    --warm-bronze: #B8860B;
    --abyssal-black: #040A0E;

    --font-heading: 'Barlow Condensed', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--deep-ocean);
    color: var(--pale-seafoam);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Circuit-trace background pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(to right, var(--teal-ink) 1px, transparent 1px),
        linear-gradient(to bottom, var(--teal-ink) 1px, transparent 1px);
    background-size: 60px 60px;
    opacity: 0.05;
}

/* SVG filters (hidden) */
.svg-filters {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* --- Navigation --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 48px;
    background: rgba(8, 15, 20, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0.18em;
    color: var(--pale-seafoam);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.18em;
    color: var(--muted-teal);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.nav-link:hover {
    color: var(--electric-teal);
    text-shadow: 0 0 12px rgba(0, 232, 209, 0.4);
}

/* --- Title Plinth --- */
.title-plinth {
    position: relative;
    width: 100%;
    height: 80vh;
    background-color: var(--abyssal-black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 48px;
}

.circuit-traces-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.trace {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    opacity: 0.7;
}

.trace.animated {
    animation: trace-draw 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes trace-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.via-hole {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.via-hole.visible {
    opacity: 1;
    animation: via-pulse 3s ease-in-out infinite;
}

@keyframes via-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.plinth-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.plinth-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 72px;
    letter-spacing: 0.3em;
    color: var(--pale-seafoam);
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.6s ease, letter-spacing 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.plinth-title.revealed {
    opacity: 1;
    letter-spacing: 0.14em;
}

.plinth-subtitle {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.12em;
    color: var(--muted-teal);
    margin-top: 16px;
    opacity: 0;
    transition: opacity 0.8s ease 0.4s;
}

.plinth-subtitle.revealed {
    opacity: 1;
}

.magenta-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 22, 126, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
}

.magenta-pulse.active {
    animation: magenta-ripple 1.2s ease-out forwards;
}

@keyframes magenta-ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 200vw;
        height: 200vw;
        opacity: 0;
    }
}

.plinth-divider {
    position: absolute;
    bottom: 40px;
    left: 50%;
    width: 0;
    height: 1px;
    background-color: var(--teal-ink);
    transform: translateX(-50%);
    z-index: 2;
}

.plinth-divider.active {
    animation: divider-draw 0.6s ease-out forwards;
}

@keyframes divider-draw {
    to {
        width: 80%;
    }
}

/* --- Specimen Grid --- */
.specimen-grid {
    position: relative;
    z-index: 1;
    padding: 60px 24px 80px;
    max-width: 1400px;
    margin: 0 auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* --- Specimen Card --- */
.specimen-card {
    position: relative;
    background-color: var(--deep-ocean);
    border: 1px solid var(--teal-ink);
    box-shadow: 0 0 24px rgba(0, 232, 209, 0.04);
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;

    /* Slide-reveal initial state */
    opacity: 0;
    transform: translateY(40px);
}

.specimen-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.3s ease,
        box-shadow 0.3s ease;
    transition-delay: var(--reveal-delay, 0ms);
}

.specimen-card:hover {
    border-color: var(--electric-teal);
    box-shadow: 0 0 40px rgba(0, 232, 209, 0.12);
}

/* Feature cards span 2 columns */
.feature-card {
    grid-column: span 2;
}

/* Card circuit SVG overlay */
.card-circuit {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.card-trace {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.specimen-card.revealed .card-trace {
    animation: card-trace-draw 0.8s ease-out 0.2s forwards;
    animation-delay: calc(var(--reveal-delay, 0ms) + 200ms);
}

.specimen-card:hover .card-trace {
    opacity: 1;
}

@keyframes card-trace-draw {
    to {
        stroke-dashoffset: 0;
    }
}

.card-via {
    opacity: 0.5;
    animation: via-pulse 3s ease-in-out infinite;
    transition: animation-duration 0.3s ease;
}

.specimen-card:hover .card-via {
    animation-duration: 1s;
}

/* Card inner content */
.card-inner {
    position: relative;
    z-index: 2;
    padding: 28px 24px 24px;
}

/* Card illustration */
.card-illustration {
    width: 100%;
    height: 180px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid rgba(26, 58, 74, 0.5);
    padding-bottom: 16px;
}

.feature-illustration {
    height: 220px;
}

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

/* Card metadata */
.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.meta-catalog {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--electric-teal);
}

.meta-date {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--warm-bronze);
}

.meta-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--magenta-pulse);
    border: 1px solid var(--magenta-pulse);
    padding: 2px 8px;
}

/* Card title */
.card-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.14em;
    color: var(--pale-seafoam);
    text-transform: uppercase;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* Card description */
.card-description {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    color: var(--muted-teal);
    margin-bottom: 16px;
}

/* Card coordinates */
.card-coords {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.coord {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--electric-teal);
    opacity: 0.7;
}

.coord-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: var(--muted-teal);
    opacity: 0.5;
}

/* Solder points */
.solder-point {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--warm-bronze);
    opacity: 0.4;
    z-index: 3;
    transition: opacity 0.3s ease;
}

.specimen-card:hover .solder-point {
    opacity: 0.7;
}

.solder-point.top-left { top: 6px; left: 6px; }
.solder-point.top-right { top: 6px; right: 6px; }
.solder-point.bottom-left { bottom: 6px; left: 6px; }
.solder-point.bottom-right { bottom: 6px; right: 6px; }

/* --- Section Headers --- */
.section-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 48px;
}

.header-line {
    flex: 1;
    height: 1px;
    background-color: var(--teal-ink);
}

.section-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.14em;
    color: var(--pale-seafoam);
    text-transform: uppercase;
    white-space: nowrap;
}

/* --- Process Section --- */
.process-section {
    position: relative;
    z-index: 1;
    padding: 80px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 32px;
}

.process-step {
    padding: 32px 24px;
    border: 1px solid var(--teal-ink);
    background-color: rgba(8, 15, 20, 0.6);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.process-step.revealed {
    opacity: 1;
    transform: translateY(0);
}

.step-number {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--electric-teal);
    display: block;
    margin-bottom: 16px;
}

.step-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 22px;
    letter-spacing: 0.14em;
    color: var(--pale-seafoam);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.step-text {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.65;
    color: var(--muted-teal);
}

/* --- Archive Section --- */
.archive-section {
    position: relative;
    z-index: 1;
    padding: 80px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.archive-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
    text-align: center;
}

.stat-item {
    padding: 32px 16px;
    border: 1px solid var(--teal-ink);
    background-color: rgba(8, 15, 20, 0.6);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.stat-value {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 36px;
    letter-spacing: 0.08em;
    color: var(--electric-teal);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted-teal);
    text-transform: uppercase;
}

/* --- Contact Section --- */
.contact-section {
    position: relative;
    z-index: 1;
    padding: 80px 24px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-inner {
    border: 1px solid var(--teal-ink);
    padding: 48px 40px;
    background-color: rgba(4, 10, 14, 0.6);
}

.contact-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.14em;
    color: var(--pale-seafoam);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.contact-text {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    color: var(--muted-teal);
    margin-bottom: 32px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.contact-detail {
    margin-bottom: 16px;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.14em;
    color: var(--muted-teal);
    display: block;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.contact-value {
    font-family: var(--font-mono);
    font-size: 14px;
    letter-spacing: 0.06em;
    color: var(--electric-teal);
}

.contact-circuit {
    margin-top: 32px;
}

.footer-trace {
    width: 100%;
    max-width: 400px;
    height: 20px;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    z-index: 1;
    padding: 32px 24px;
    border-top: 1px solid var(--teal-ink);
    text-align: center;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: var(--muted-teal);
    opacity: 0.6;
}

.footer-divider {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--teal-ink);
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .title-plinth {
        height: 60vh;
    }

    .plinth-title {
        font-size: 40px;
    }

    .plinth-subtitle {
        font-size: 11px;
    }

    .feature-card {
        grid-column: span 1;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-link {
        font-size: 13px;
        letter-spacing: 0.12em;
    }

    .card-title {
        font-size: 22px;
    }

    .card-illustration {
        height: 140px;
    }

    .feature-illustration {
        height: 160px;
    }

    .section-title {
        font-size: 22px;
    }

    .stat-value {
        font-size: 28px;
    }

    .contact-inner {
        padding: 32px 24px;
    }
}

@media (max-width: 420px) {
    .nav-links {
        gap: 10px;
    }

    .nav-link {
        font-size: 11px;
        letter-spacing: 0.08em;
    }

    .plinth-title {
        font-size: 32px;
    }

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

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .trace,
    .specimen-card,
    .process-step,
    .stat-item {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .trace {
        stroke-dashoffset: 0 !important;
    }

    .card-trace {
        stroke-dashoffset: 0 !important;
        animation: none !important;
    }

    .plinth-title {
        opacity: 1 !important;
        letter-spacing: 0.14em !important;
    }

    .plinth-subtitle {
        opacity: 1 !important;
    }

    .via-hole {
        opacity: 0.8 !important;
        animation: none !important;
    }

    .magenta-pulse {
        display: none;
    }

    .plinth-divider {
        width: 80% !important;
        animation: none !important;
    }
}
