/* =============================================
   tanso.wiki -- Bauhaus Carbon Encyclopedia
   ============================================= */

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

:root {
    --cream: #F5ECD8;
    --indigo: #1A1A3A;
    --red: #C83030;
    --gold: #B8A868;
    --mid: #8A8AA0;
    --font-display: 'Cormorant Garamond', serif;
    --font-body: 'Lora', serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    color: var(--indigo);
    background: var(--cream);
    overflow-x: hidden;
}

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

/* === Sections (Full-Bleed) === */
.section {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.section--cream {
    background-color: var(--cream);
    color: var(--indigo);
}

.section--indigo {
    background-color: var(--indigo);
    color: var(--cream);
}

.section__content {
    max-width: 800px;
    width: 100%;
    padding: 4vh 2rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.section__content--closing {
    position: relative;
    min-height: 80vh;
    justify-content: center;
}

/* === Section Markers (Roman Numerals) === */
.section-marker {
    width: 64px;
    height: 64px;
    border: 2px solid var(--indigo);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.section-marker--light {
    border-color: var(--cream);
}

.section-marker__numeral {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* === Hero === */
#hero {
    min-height: 100vh;
}

.hero__title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 10vw, 7rem);
    font-weight: 700;
    color: var(--indigo);
    text-align: center;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--mid);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* === Section Headings === */
.section__heading {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.15;
}

.section__heading--light {
    color: var(--cream);
}

/* === Bauhaus Geometric Compositions === */
.bauhaus-composition {
    position: relative;
    width: 240px;
    height: 200px;
    margin: 0 auto 3rem;
}

/* Hero composition */
.bauhaus-composition--hero {
    width: 300px;
    height: 240px;
}

.bauhaus-composition--hero .shape--circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: var(--indigo);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.bauhaus-composition--hero .shape--triangle {
    width: 0;
    height: 0;
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 100px solid var(--red);
    position: absolute;
    bottom: 0;
    left: 20px;
}

.bauhaus-composition--hero .shape--rectangle {
    width: 80px;
    height: 120px;
    background-color: var(--gold);
    position: absolute;
    bottom: 0;
    right: 20px;
}

/* Section 2 composition */
.bauhaus-composition--section2 {
    width: 200px;
    height: 160px;
    margin-bottom: 2.5rem;
}

.bauhaus-composition--section2 .shape--circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--cream);
    background: transparent;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.bauhaus-composition--section2 .shape--rectangle {
    width: 60px;
    height: 40px;
    background-color: var(--red);
    position: absolute;
    bottom: 20px;
    left: 20px;
}

.bauhaus-composition--section2 .shape--triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 50px solid var(--gold);
    position: absolute;
    bottom: 10px;
    right: 20px;
}

/* Section 3 composition */
.bauhaus-composition--section3 {
    width: 220px;
    height: 180px;
    margin-bottom: 2.5rem;
}

.bauhaus-composition--section3 .shape--rectangle {
    width: 40px;
    height: 140px;
    background-color: var(--indigo);
    position: absolute;
    top: 0;
    left: 20px;
}

.bauhaus-composition--section3 .shape--circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: var(--red);
    position: absolute;
    top: 20px;
    right: 10px;
}

.bauhaus-composition--section3 .shape--triangle {
    width: 0;
    height: 0;
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 70px solid var(--gold);
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* Closing composition */
.bauhaus-composition--closing {
    width: 200px;
    height: 180px;
    margin-bottom: 2rem;
}

.bauhaus-composition--closing .shape--circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--cream);
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.bauhaus-composition--closing .shape--triangle {
    width: 0;
    height: 0;
    border-left: 35px solid transparent;
    border-right: 35px solid transparent;
    border-bottom: 60px solid var(--red);
    position: absolute;
    bottom: 10px;
    left: 10px;
}

.bauhaus-composition--closing .shape--rectangle {
    width: 50px;
    height: 80px;
    background-color: var(--gold);
    position: absolute;
    bottom: 0;
    right: 20px;
}

/* === Geometric Border Pattern === */
.geometric-border {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 3rem;
}

.geometric-border__circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--indigo);
    flex-shrink: 0;
}

.geometric-border__line {
    width: 40px;
    height: 2px;
    background-color: var(--indigo);
    flex-shrink: 0;
}

/* === Card Grid === */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
    perspective: 1000px;
}

/* === Card-Flip === */
.card {
    height: 320px;
    cursor: pointer;
    perspective: 1000px;
}

.card__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.card.is-flipped .card__inner {
    transform: rotateY(180deg);
}

.card__front,
.card__back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    border: 2px solid var(--cream);
}

/* Dark section cards */
.card__front {
    background-color: rgba(26, 26, 58, 0.6);
}

.card__back {
    background-color: rgba(26, 26, 58, 0.85);
    transform: rotateY(180deg);
}

/* Light section cards */
.card--light .card__front {
    background-color: rgba(245, 236, 216, 0.5);
    border-color: var(--indigo);
}

.card--light .card__back {
    background-color: rgba(245, 236, 216, 0.85);
    border-color: var(--indigo);
    transform: rotateY(180deg);
}

.card--light .card__number,
.card--light .card__term {
    color: var(--indigo);
}

.card--light .card__definition {
    color: var(--indigo);
}

.card__geometric {
    margin-bottom: 1.5rem;
}

.card__number {
    font-family: var(--font-display);
    font-size: 0.875rem;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 0.75rem;
}

.card__term {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cream);
    text-align: center;
}

.card__definition {
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--cream);
    text-align: center;
}

.card__back .card__number {
    margin-bottom: 1rem;
}

/* === Small shapes for cards === */
.shape--small.shape--gold {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--gold);
}

.shape--small.shape--red {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 34px solid var(--red);
}

.shape--small.shape--cream-solid {
    width: 30px;
    height: 30px;
    background-color: var(--cream);
}

.shape--small.shape--mid {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--mid);
}

.shape--small.shape--indigo {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 34px solid var(--indigo);
}

/* === Closing Section === */
.closing__title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--cream);
    text-align: center;
    margin-bottom: 0.5rem;
}

.closing__text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--mid);
    text-align: center;
    letter-spacing: 0.1em;
}

/* === Vintage Frame === */
.vintage-frame {
    position: absolute;
    top: 2rem;
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
    pointer-events: none;
}

.vintage-frame__border {
    position: absolute;
    background-color: var(--gold);
    opacity: 0.3;
}

.vintage-frame__border--top {
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
}

.vintage-frame__border--bottom {
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
}

.vintage-frame__border--left {
    top: 20px;
    bottom: 20px;
    left: 0;
    width: 1px;
}

.vintage-frame__border--right {
    top: 20px;
    bottom: 20px;
    right: 0;
    width: 1px;
}

.vintage-frame__corner {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.3;
}

.vintage-frame__corner--tl {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.vintage-frame__corner--tr {
    top: 0;
    right: 0;
    border-width: 1px 1px 0 0;
}

.vintage-frame__corner--bl {
    bottom: 0;
    left: 0;
    border-width: 0 0 1px 1px;
}

.vintage-frame__corner--br {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
}

/* === Responsive === */
@media (max-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .card {
        height: 280px;
    }

    .bauhaus-composition--hero {
        width: 220px;
        height: 180px;
    }

    .bauhaus-composition--hero .shape--circle {
        width: 90px;
        height: 90px;
    }

    .bauhaus-composition--hero .shape--triangle {
        border-left-width: 45px;
        border-right-width: 45px;
        border-bottom-width: 75px;
    }

    .bauhaus-composition--hero .shape--rectangle {
        width: 60px;
        height: 90px;
    }

    .section-marker {
        width: 52px;
        height: 52px;
    }

    .section-marker__numeral {
        font-size: 1.25rem;
    }

    .geometric-border__line {
        width: 24px;
    }

    .vintage-frame {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
    }
}
