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

:root {
    --plum: #8b78a0;
    --deep-bg: #1a1520;
    --coral: #ff6b4a;
    --teal: #00e5c8;
    --charcoal: #2d2a26;
    --warm-gold: #c4a87a;
    --parchment: #f0e8d8;
    --gold-accent: #d4a843;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--parchment);
    background: var(--deep-bg);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === TEXTURE BED (fixed noise bg) === */
.texture-bed {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139,120,160,0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(255,107,74,0.05) 0%, transparent 50%),
        var(--deep-bg);
}

.texture-bed::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    opacity: 0.5;
}

/* === ANNOTATION LAYER === */
.annotation-layer {
    position: fixed;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.annotation {
    position: absolute;
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(0.7rem, 1.2vw, 1rem);
    color: var(--warm-gold);
    opacity: 0;
    transition: opacity 0.8s ease;
    white-space: nowrap;
}

.annotation.visible {
    opacity: 0.35;
}

/* === WORKBENCH (main content) === */
.workbench {
    position: relative;
    z-index: 5;
    max-width: 900px;
    margin: 0 auto;
    padding: 6vh 5vw 12vh;
    display: flex;
    flex-direction: column;
    gap: 6vh;
}

/* === CARDS === */
.card {
    position: relative;
    background: rgba(45, 42, 38, 0.7);
    border: 1.5px solid rgba(196, 168, 122, 0.25);
    border-radius: 2px;
    transform: rotate(var(--card-rotate, 0deg));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.card:nth-child(odd) { --card-rotate: -0.4deg; }
.card:nth-child(even) { --card-rotate: 0.6deg; }

.card:hover {
    transform: rotate(0deg);
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.card-inner {
    padding: clamp(2rem, 5vw, 4rem);
}

/* === TORN EDGES === */
.torn-edge {
    position: absolute;
    left: 0;
    right: 0;
    height: 12px;
    overflow: hidden;
    pointer-events: none;
}

.torn-edge-top {
    top: -6px;
    background: url("data:image/svg+xml,%3Csvg width='200' height='12' viewBox='0 0 200 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 12 Q10 2 20 8 Q30 0 40 6 Q50 2 60 10 Q70 0 80 7 Q90 3 100 9 Q110 1 120 8 Q130 4 140 10 Q150 0 160 7 Q170 3 180 9 Q190 1 200 6 L200 12 Z' fill='%232d2a26' opacity='0.7'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 12px;
}

.torn-edge-bottom {
    bottom: -6px;
    background: url("data:image/svg+xml,%3Csvg width='200' height='12' viewBox='0 0 200 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0 Q10 10 20 4 Q30 12 40 6 Q50 10 60 2 Q70 12 80 5 Q90 9 100 3 Q110 11 120 4 Q130 8 140 2 Q150 12 160 5 Q170 9 180 3 Q190 11 200 6 L200 0 Z' fill='%232d2a26' opacity='0.7'/%3E%3C/svg%3E") repeat-x;
    background-size: 200px 12px;
}

/* === HERO === */
.card-hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(26,21,32,0.9), rgba(45,42,38,0.8));
    border-color: rgba(196,168,122,0.4);
}

.card-hero .card-inner {
    text-align: center;
    position: relative;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(3rem, 10vw, 7rem);
    line-height: 1.1;
    color: var(--parchment);
    letter-spacing: -0.02em;
}

.hero-title .dot {
    color: var(--coral);
}

.hero-subtitle {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--warm-gold);
    margin-top: 1.5rem;
    opacity: 0.85;
}

.pigment-smear {
    position: absolute;
    width: 120px;
    height: 40px;
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.4;
    pointer-events: none;
}

.smear-coral {
    background: var(--coral);
    top: -30px;
    right: -20px;
    transform: rotate(-15deg);
}

.smear-gold {
    background: var(--gold-accent);
    bottom: -20px;
    left: -10px;
    transform: rotate(10deg);
}

/* === SECTION HEADINGS === */
.section-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    color: var(--parchment);
    margin-bottom: 2rem;
    position: relative;
    display: inline-block;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--coral);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.card:hover .section-heading::after,
.card.in-view .section-heading::after {
    transform: scaleX(1);
}

/* === MANIFESTO === */
.manifesto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-top: 1rem;
}

.manifesto-item {
    text-align: center;
}

.manifesto-item h3 {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.3rem;
    color: var(--coral);
    margin: 1rem 0 0.5rem;
}

.manifesto-item p {
    font-size: 0.95rem;
    color: rgba(240,232,216,0.75);
    line-height: 1.7;
}

.sketch-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.hand-drawn-svg {
    width: 100%;
    height: 100%;
}

/* === LIFECYCLE === */
.lifecycle-stages {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    margin-top: 1rem;
}

.stage {
    display: grid;
    grid-template-columns: 60px 4px 1fr;
    grid-template-rows: auto auto;
    gap: 0 1.5rem;
    align-items: start;
    opacity: 0.5;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stage.revealed {
    opacity: 1;
    transform: translateX(0);
}

.stage-number {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--teal);
    grid-row: 1 / 3;
    text-align: center;
    line-height: 1;
}

.stage-bar {
    grid-row: 1 / 3;
    width: 4px;
    height: 100%;
    min-height: 60px;
    background: linear-gradient(to bottom, var(--teal), transparent);
    border-radius: 2px;
}

.stage h3 {
    font-family: 'Permanent Marker', cursive;
    font-size: 1.1rem;
    color: var(--gold-accent);
    margin-bottom: 0.3rem;
}

.stage p {
    font-size: 0.9rem;
    color: rgba(240,232,216,0.7);
    line-height: 1.7;
}

/* === MATERIALS === */
.materials-collage {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 1rem;
}

.material-swatch {
    position: relative;
    padding: 1.5rem;
    border: 1px dashed rgba(196,168,122,0.3);
    border-radius: 2px;
    cursor: pointer;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.material-swatch:hover {
    border-color: var(--warm-gold);
    transform: rotate(0deg) scale(1.02);
}

.material-swatch:nth-child(1) { transform: rotate(-1deg); }
.material-swatch:nth-child(2) { transform: rotate(0.8deg); }
.material-swatch:nth-child(3) { transform: rotate(0.5deg); }
.material-swatch:nth-child(4) { transform: rotate(-0.7deg); }

.swatch-color {
    width: 100%;
    height: 60px;
    border-radius: 2px;
    margin-bottom: 0.8rem;
    position: relative;
    overflow: hidden;
}

.swatch-color::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 4px,
        rgba(255,255,255,0.05) 4px,
        rgba(255,255,255,0.05) 8px
    );
}

.swatch-label {
    font-family: 'Permanent Marker', cursive;
    font-size: 0.95rem;
    color: var(--parchment);
    display: block;
}

.swatch-note {
    font-family: 'Caveat', cursive;
    font-size: 0.85rem;
    color: var(--warm-gold);
    opacity: 0.7;
    display: block;
    margin-top: 0.2rem;
}

/* === PULL QUOTE === */
.card-quote {
    background: transparent;
    border: none;
    text-align: center;
    padding: 4vh 0;
}

.pull-quote {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    color: var(--teal);
    line-height: 1.5;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.pull-quote::before,
.pull-quote::after {
    font-size: 3em;
    color: var(--coral);
    opacity: 0.3;
    line-height: 0;
    vertical-align: middle;
}

.pull-quote::before { content: '"'; margin-right: 0.1em; }
.pull-quote::after { content: '"'; margin-left: 0.1em; }

/* === ACTION === */
.action-text {
    font-size: 1.05rem;
    color: rgba(240,232,216,0.8);
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 2rem;
}

.action-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.action-step {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border: 1.5px solid rgba(0,229,200,0.3);
    border-radius: 2px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.action-step:hover {
    border-color: var(--teal);
    background: rgba(0,229,200,0.05);
}

.step-num {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: var(--teal);
}

.action-step span:last-child {
    font-family: 'Permanent Marker', cursive;
    font-size: 0.95rem;
    color: var(--parchment);
}

/* === BOTTOM TAB NAVIGATION === */
.tab-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 4px;
    padding: 0 1rem;
}

.tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(70px, 12vw, 110px);
    height: 40px;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.tab:hover {
    transform: translateY(-4px);
}

.tab.active {
    transform: translateY(-6px);
}

.tab-shape {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.tab.active .tab-shape path {
    fill: var(--charcoal);
    stroke: var(--coral);
}

.tab-label {
    position: relative;
    z-index: 1;
    font-family: 'Permanent Marker', cursive;
    font-size: clamp(0.6rem, 1vw, 0.8rem);
    color: var(--warm-gold);
    text-transform: lowercase;
}

.tab.active .tab-label {
    color: var(--coral);
}

/* === SCROLL REVEAL ANIMATIONS === */
.card {
    opacity: 0;
    transform: translateY(30px) rotate(var(--card-rotate, 0deg));
    transition: opacity 0.7s ease, transform 0.7s ease, box-shadow 0.4s ease;
}

.card.in-view {
    opacity: 1;
    transform: translateY(0) rotate(var(--card-rotate, 0deg));
}

.card.in-view:hover {
    transform: rotate(0deg);
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .workbench {
        padding: 4vh 4vw 14vh;
        gap: 4vh;
    }

    .materials-collage {
        grid-template-columns: 1fr;
    }

    .action-steps {
        flex-direction: column;
    }

    .tab-nav {
        gap: 2px;
    }

    .tab {
        width: 60px;
        height: 35px;
    }

    .manifesto-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
