/* cbdc.studio -- Design Language Implementation */

/* Custom Properties */
:root {
    --void-black: #0A0A0A;
    --charcoal: #1E1E1E;
    --graphite: #3A3A3A;
    --fog: #6B6B6B;
    --ash: #B0B0B0;
    --bone: #E8E8E3;
    --paper: #F5F5F0;
    --bright-white: #FAFAFA;

    --font-primary: 'Space Grotesk', sans-serif;
    --font-mono: 'Space Mono', monospace;

    --ease-mech: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: auto;
}

body {
    background-color: var(--paper);
    color: var(--graphite);
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.04em;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Section alternating backgrounds for rhythm */
.section-hero,
.section-architecture,
.section-contact {
    background-color: var(--paper);
}

.section-concepts,
.section-timeline {
    background-color: var(--bone);
}

/* Grid Sections */
.grid-section {
    padding: 10vh 8vw;
}

.section-hero {
    padding-top: 18vh;
}

.section-contact {
    padding-bottom: 18vh;
}

/* Grid Container */
.grid {
    display: grid;
    gap: 1px;
    background-color: var(--ash);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-1 {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin: 0 auto;
}

/* Cell Base */
.cell {
    background-color: var(--paper);
    aspect-ratio: 3 / 4;
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
    transition:
        transform 200ms var(--ease-mech),
        background-color 200ms var(--ease-mech),
        outline-color 200ms var(--ease-mech);
    cursor: default;
    outline: 0 solid transparent;
    --svg-stroke: var(--fog);
    --svg-node: var(--void-black);
}

.cell:hover {
    transform: scale(1.05);
    z-index: 10;
    background-color: var(--void-black);
    color: var(--paper);
    outline: 1px solid var(--void-black);
    outline-offset: -1px;
}

/* Concept cells in concepts section live on bone background */
.section-concepts .cell {
    background-color: var(--paper);
}

.section-timeline .cell {
    background-color: var(--paper);
}

/* Typography */
h1 {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--void-black);
    transition: color 200ms var(--ease-mech);
}

.cell:hover h1 {
    color: var(--paper);
}

h2 {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--void-black);
}

/* Section 1: Hero -- delayed instantaneous appearance */
.cell-hero h1 {
    opacity: 0;
}

.cell-hero.is-visible h1 {
    animation: appear 0s 1.2s forwards;
}

@keyframes appear {
    to {
        opacity: 1;
    }
}

/* Section 2: Concepts */
.cell-concept {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.concept-label {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--void-black);
    text-align: center;
    transition: color 200ms var(--ease-mech);
}

.cell-concept:hover .concept-label {
    color: var(--paper);
}

.cell-concept hr {
    width: 40px;
    height: 0;
    border: none;
    border-top: 1px solid var(--ash);
    margin-top: 1rem;
    transition: border-color 200ms var(--ease-mech);
}

.cell-concept:hover hr {
    border-top-color: var(--fog);
}

/* Section 3: Architecture */
.cell-architecture {
    padding: 1.5rem;
}

.cell-architecture svg {
    width: 80%;
    max-width: 140px;
    height: auto;
    display: block;
    shape-rendering: crispEdges;
}

.cell-architecture:hover {
    --svg-stroke: var(--ash);
    --svg-node: var(--paper);
}

.svg-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.08em;
    fill: var(--fog);
    transition: fill 200ms var(--ease-mech);
}

.cell-architecture:hover .svg-label {
    fill: var(--ash);
}

/* Section 4: Timeline */
.cell-timeline {
    aspect-ratio: auto;
    padding: 1.75rem 2.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    place-items: stretch;
}

.timeline-year {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    color: var(--fog);
    white-space: nowrap;
    transition: color 200ms var(--ease-mech);
}

.cell-timeline:hover .timeline-year {
    color: var(--ash);
}

.timeline-event {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    letter-spacing: 0.04em;
    line-height: 1.6;
    color: var(--graphite);
    transition: color 200ms var(--ease-mech);
}

.cell-timeline:hover .timeline-event {
    color: var(--paper);
}

/* Section 5: Contact */
.cell-contact {
    aspect-ratio: auto;
    padding: 3rem 2rem;
    place-items: center;
}

.contact-data {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.875rem;
    letter-spacing: 0.06em;
    color: var(--fog);
    transition: color 200ms var(--ease-mech);
}

.cell-contact:hover .contact-data {
    color: var(--ash);
}

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

/* Responsive: Mobile */
@media (max-width: 600px) {
    .grid-4,
    .grid-2 {
        grid-template-columns: 1fr;
    }

    .grid-section {
        padding: 8vh 4vw;
    }

    .cell-timeline {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}
