/* ==============================================
   monopole.tech — Cottagecore Tech Workshop
   Colors: #3A3040, #90B898, #B8A8C0, #FBF8F2,
           #7A7080, #5A5060, #F0E0E0
   Fonts:  Caveat, Nunito, Fira Code
   ============================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.9;
    color: #5A5060;
    background-color: #FBF8F2;
    overflow-x: hidden;
    position: relative;
}

/* ---- Generative Background Canvas ---- */
#generative-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

/* ---- Cross-Stitch Background Pattern ---- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.06;
    background-image:
        linear-gradient(45deg, #B8A8C0 25%, transparent 25%),
        linear-gradient(-45deg, #B8A8C0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #B8A8C0 75%),
        linear-gradient(-45deg, transparent 75%, #B8A8C0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

/* ============================
   HERO SECTION
   ============================ */
#hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.hero-inner {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeIn 1.2s ease-out 0.3s forwards;
}

.hero-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 4rem);
    color: #3A3040;
    letter-spacing: 0.04em;
    line-height: 1.2;
    animation: gentleBounce 3s ease-in-out 1.5s infinite;
}

.hero-tagline {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: clamp(1.1rem, 2.5vw, 1.6rem);
    color: #7A7080;
    margin-top: 0.5rem;
    opacity: 0;
    animation: taglineFade 1s ease-out 1s forwards;
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    opacity: 0;
    animation: scrollHintIn 1s ease-out 2s forwards, scrollFloat 2s ease-in-out 3s infinite;
}

@keyframes heroFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes scrollHintIn {
    to { opacity: 0.6; }
}

@keyframes scrollFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================
   BROKEN-GRID WORKSHOP
   ============================ */
#workshop {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem 8rem;
    max-width: 1200px;
    margin: 0 auto;
}

.broken-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(60px, auto);
    gap: 1.5rem;
}

/* ---- Card base ---- */
.card {
    position: relative;
    background: rgba(251, 248, 242, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    overflow: visible;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.4s ease, box-shadow 0.3s ease;
}

.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    box-shadow: 0 8px 30px rgba(58, 48, 64, 0.1);
}

/* ---- Cross-stitch card borders ---- */
.card-border {
    position: absolute;
    inset: -4px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 4px,
            #F0E0E0 4px,
            #F0E0E0 5px,
            transparent 5px,
            transparent 9px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 4px,
            #F0E0E0 4px,
            #F0E0E0 5px,
            transparent 5px,
            transparent 9px
        );
    background-size: 9px 100%, 100% 9px;
    background-position: 0 0, 0 0;
    background-repeat: repeat-y, repeat-x;
}

.card.visible .card-border {
    opacity: 1;
}

.card-content {
    padding: 2rem 2.2rem;
}

/* Card placement — broken grid offsets */
.card-1 {
    grid-column: 1 / 7;
    grid-row: 1 / 3;
}

.card-2 {
    grid-column: 7 / 13;
    grid-row: 1 / 3;
    margin-top: 2rem;
}

.card-3 {
    grid-column: 2 / 8;
    grid-row: 3 / 5;
    margin-top: -1rem;
}

.card-4 {
    grid-column: 8 / 13;
    grid-row: 3 / 5;
    margin-top: 1rem;
}

.card-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    color: #3A3040;
    margin-bottom: 0.8rem;
    position: relative;
    display: inline-block;
}

/* Underline-draw interaction on headings */
.card-heading::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #90B898;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card:hover .card-heading::after {
    transform: scaleX(1);
}

/* Code snippets */
.code-snippet {
    margin-top: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(58, 48, 64, 0.04);
    border-radius: 4px;
    border-left: 3px solid #90B898;
}

.code-snippet code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #7A7080;
    display: block;
    line-height: 1.8;
}

/* Craft list */
.craft-list {
    list-style: none;
    margin-top: 1rem;
}

.craft-list li {
    padding: 0.3rem 0;
    color: #5A5060;
}

.craft-icon {
    color: #90B898;
    margin-right: 0.5rem;
}

/* Tags */
.tag-cluster {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    color: #7A7080;
    background: rgba(184, 168, 192, 0.15);
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    border: 1px solid rgba(184, 168, 192, 0.3);
    transition: background 0.3s ease, color 0.3s ease;
}

.tag:hover {
    background: rgba(144, 184, 152, 0.2);
    color: #3A3040;
}

/* Quilt pattern */
.quilt-pattern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-top: 1rem;
    max-width: 180px;
}

.quilt-square {
    width: 100%;
    padding-top: 100%;
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.quilt-square:hover {
    transform: scale(1.1) rotate(2deg);
}

.sq-1 { background: #F0E0E0; }
.sq-2 { background: #B8A8C0; }
.sq-3 { background: #90B898; }
.sq-4 { background: #90B898; opacity: 0.6; }
.sq-5 { background: #3A3040; opacity: 0.2; }
.sq-6 { background: #F0E0E0; }
.sq-7 { background: #B8A8C0; opacity: 0.5; }
.sq-8 { background: #F0E0E0; }
.sq-9 { background: #90B898; opacity: 0.4; }

/* Floral connectors */
.floral-connector {
    position: absolute;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 1s ease;
}

.floral-connector.visible {
    opacity: 1;
}

.fc-1 {
    width: 120px;
    top: 35%;
    left: 48%;
    transform: translateX(-50%);
}

.fc-2 {
    width: 80px;
    top: 60%;
    right: 8%;
}

/* ============================
   PHILOSOPHY SECTION
   ============================ */
#philosophy {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem;
    background: linear-gradient(180deg, transparent 0%, rgba(240, 224, 224, 0.2) 50%, transparent 100%);
}

.philosophy-inner {
    max-width: 960px;
    margin: 0 auto;
}

.section-heading {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #3A3040;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background: #90B898;
    margin: 0.5rem auto 0;
    border-radius: 1px;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.philosophy-item {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.philosophy-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.philosophy-icon {
    display: inline-block;
    width: 50px;
    height: 50px;
    margin-bottom: 1rem;
}

.philosophy-icon svg {
    width: 100%;
    height: 100%;
}

.philosophy-item h3 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: #3A3040;
    margin-bottom: 0.5rem;
}

.philosophy-item p {
    font-weight: 300;
    color: #5A5060;
    line-height: 1.8;
}

/* ============================
   WORKSHOP BENCH SECTION
   ============================ */
#workshop-bench {
    position: relative;
    z-index: 1;
    padding: 6rem 2rem 8rem;
}

.bench-inner {
    max-width: 1000px;
    margin: 0 auto;
}

.bench-intro {
    text-align: center;
    color: #7A7080;
    font-weight: 300;
    margin-bottom: 3rem;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
}

.bench-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.bench-card {
    position: relative;
    background: rgba(251, 248, 242, 0.9);
    border: 1px solid rgba(184, 168, 192, 0.25);
    border-radius: 4px;
    padding: 2rem 1.8rem 1.5rem;
    transition: transform 0.4s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.bench-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.bench-card:hover {
    transform: translateY(-4px) rotate(0.5deg);
    box-shadow: 0 10px 30px rgba(58, 48, 64, 0.08);
}

/* Pin decoration */
.bench-card-pin {
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #F0E0E0;
    border: 2px solid #B8A8C0;
    box-shadow: 0 2px 4px rgba(58, 48, 64, 0.15);
}

.bc-1 { transform: rotate(-0.8deg); }
.bc-2 { transform: rotate(0.5deg); margin-top: 1rem; }
.bc-3 { transform: rotate(-0.3deg); margin-top: -0.5rem; }

.bc-1.visible { transform: translateY(0) rotate(-0.8deg); }
.bc-2.visible { transform: translateY(0) rotate(0.5deg); margin-top: 1rem; }
.bc-3.visible { transform: translateY(0) rotate(-0.3deg); margin-top: -0.5rem; }

.bench-card h3 {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    color: #3A3040;
    margin-bottom: 0.6rem;
}

.bench-card p {
    font-weight: 300;
    color: #5A5060;
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

.bench-status {
    font-family: 'Caveat', cursive;
    font-size: 0.95rem;
    padding: 0.2rem 0.8rem;
    border-radius: 20px;
    display: inline-block;
}

.status-active {
    background: rgba(144, 184, 152, 0.15);
    color: #90B898;
    border: 1px solid rgba(144, 184, 152, 0.3);
}

.status-growing {
    background: rgba(184, 168, 192, 0.15);
    color: #B8A8C0;
    border: 1px solid rgba(184, 168, 192, 0.3);
}

.status-bloom {
    background: rgba(240, 224, 224, 0.3);
    color: #7A7080;
    border: 1px solid rgba(240, 224, 224, 0.5);
}

/* Gingham pattern on bench card borders */
.bench-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0.3;
    background:
        repeating-linear-gradient(
            0deg,
            #F0E0E0 0px,
            #F0E0E0 2px,
            transparent 2px,
            transparent 6px
        ),
        repeating-linear-gradient(
            90deg,
            #F0E0E0 0px,
            #F0E0E0 2px,
            transparent 2px,
            transparent 6px
        );
    background-size: 6px 6px;
    z-index: -1;
}

/* ============================
   FOOTER
   ============================ */
#footer {
    position: relative;
    z-index: 1;
    padding: 3rem 2rem;
    background: #3A3040;
}

.footer-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: #FBF8F2;
}

.footer-note {
    font-weight: 300;
    font-size: 0.85rem;
    color: #7A7080;
    margin-top: 0.3rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: #B8A8C0;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1.5px;
    background: #90B898;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.footer-link:hover {
    color: #FBF8F2;
}

.footer-link:hover::after {
    transform: scaleX(1);
}

.footer-seed {
    display: flex;
    align-items: center;
}

.seed-icon {
    width: 30px;
    height: 30px;
    animation: seedSpin 12s linear infinite;
}

@keyframes seedSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================
   LINK UNDERLINE-DRAW GLOBAL
   ============================ */
a {
    position: relative;
    text-decoration: none;
    color: #90B898;
    background-image: linear-gradient(#90B898, #90B898);
    background-size: 0% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.3s ease;
}

a:hover {
    background-size: 100% 1.5px;
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
    .broken-grid {
        grid-template-columns: 1fr;
    }

    .card-1,
    .card-2,
    .card-3,
    .card-4 {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 0;
    }

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

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

    .bc-2 { margin-top: 0; }
    .bc-3 { margin-top: 0; }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .floral-connector {
        display: none;
    }
}

@media (max-width: 600px) {
    .card-content {
        padding: 1.5rem;
    }

    .bench-card {
        padding: 1.5rem 1.2rem 1.2rem;
    }
}
