/* ==============================================
   sim-ai.org - Zen Simulation Garden
   ============================================== */

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

:root {
    --warm-paper: #F5F0E8;
    --analog-cream: #EDE5D5;
    --copper-circuit: #C07850;
    --teal-future: #3A8888;
    --deep-ink: #1A1A28;
    --warm-gray: #5A5548;
    --faded-orange: #E8A868;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.75;
    color: var(--warm-gray);
    background-color: var(--warm-paper);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    color: var(--deep-ink);
}

/* ==============================================
   HERO SECTION
   ============================================== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--warm-paper);
    overflow: hidden;
}

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

.hero-curve path {
    fill: none;
    stroke: var(--faded-orange);
    stroke-width: 2;
    opacity: 0.12;
}

/* Collage fragments */
.collage-fragment {
    position: absolute;
    z-index: 2;
    opacity: 0.6;
}

.fragment-tl {
    top: 6%;
    left: 4%;
    width: 120px;
    height: 120px;
    clip-path: polygon(0% 2%, 95% 0%, 100% 5%, 98% 92%, 100% 100%, 3% 98%, 0% 95%);
    transform: rotate(-3deg);
}

.fragment-br {
    bottom: 8%;
    right: 5%;
    width: 140px;
    height: 100px;
    clip-path: polygon(2% 0%, 100% 3%, 97% 100%, 0% 97%);
    transform: rotate(2deg);
}

.fragment-tr {
    top: 10%;
    right: 8%;
    width: 100px;
    height: 100px;
    clip-path: polygon(5% 0%, 100% 2%, 98% 95%, 0% 100%);
    transform: rotate(1.5deg);
}

.collage-fragment svg {
    width: 100%;
    height: 100%;
}

/* Hero content */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

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

.hero-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: var(--warm-gray);
    margin-top: 1rem;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==============================================
   CARD GRID SECTION
   ============================================== */
#card-grid {
    position: relative;
    padding: 4rem 0;
    background-color: var(--warm-paper);
}

.grid-curve {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 960px;
    max-width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.grid-curve path {
    fill: none;
    stroke: var(--faded-orange);
    stroke-width: 2;
    opacity: 0.12;
}

.grid-container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- Zen Void (empty cell) --- */
.zen-void {
    position: relative;
    min-height: 80px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 8px,
        rgba(192, 120, 80, 0.03) 8px,
        rgba(192, 120, 80, 0.03) 9px
    );
    border-radius: 2px;
}

/* --- Cards --- */
.card {
    position: relative;
    background-color: var(--analog-cream);
    border-radius: 2px;
    box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 3px 5px 0 rgba(0, 0, 0, 0.12);
}

/* Torn edge effect via clip-path */
.card-collage-1 {
    clip-path: polygon(0% 1%, 3% 0%, 98% 2%, 100% 0%, 100% 97%, 97% 100%, 2% 99%, 0% 100%);
}

.card-collage-2 {
    clip-path: polygon(1% 0%, 100% 1%, 99% 3%, 100% 98%, 98% 100%, 0% 99%, 1% 97%, 0% 2%);
}

.card-collage-3 {
    clip-path: polygon(0% 0%, 97% 1%, 100% 0%, 99% 100%, 100% 98%, 2% 100%, 0% 97%);
}

.card-collage-4 {
    clip-path: polygon(2% 0%, 100% 2%, 98% 100%, 0% 99%, 1% 97%, 0% 3%);
}

.card-torn-edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.card-inner {
    position: relative;
    z-index: 1;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    cursor: pointer;
}

.card-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--deep-ink);
    line-height: 1.2;
}

.card-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-family: 'Work Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--copper-circuit);
    flex-shrink: 0;
    transition: transform 0.4s ease;
    user-select: none;
}

.card[data-expanded="true"] .card-toggle {
    transform: rotate(45deg);
}

.card-preview {
    font-size: 0.9rem;
    color: var(--warm-gray);
    margin-top: 0.5rem;
    opacity: 0.8;
}

.card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.card[data-expanded="true"] .card-content {
    /* max-height set by JS */
}

.card-content p {
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--warm-gray);
}

.card-notation {
    margin-top: 1rem;
    opacity: 0.7;
}

.card-notation svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

/* ==============================================
   WIDE SECTION
   ============================================== */
#wide-section {
    position: relative;
    padding: 4rem 0;
    background-color: var(--warm-paper);
}

.wide-curve {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 960px;
    max-width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.wide-curve path {
    fill: none;
    stroke: var(--faded-orange);
    stroke-width: 2;
    opacity: 0.12;
}

.wide-container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 3rem;
}

.wide-card {
    position: relative;
    background-color: var(--analog-cream);
    border-radius: 2px;
    box-shadow: 2px 3px 0 rgba(0, 0, 0, 0.08);
    clip-path: polygon(0% 1%, 2% 0%, 99% 0%, 100% 2%, 100% 98%, 98% 100%, 1% 100%, 0% 99%);
    overflow: hidden;
}

.wide-card-torn-edge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.wide-card-inner {
    position: relative;
    padding: 3rem;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Collage layers inside wide card */
.collage-layer {
    position: absolute;
    pointer-events: none;
}

.graph-paper {
    top: 10px;
    left: 10px;
    width: 200px;
    height: 150px;
    opacity: 0.5;
    clip-path: polygon(3% 0%, 100% 2%, 97% 98%, 0% 100%);
}

.graph-paper svg {
    width: 100%;
    height: 100%;
}

.circuit-sketch {
    bottom: 20px;
    right: 20px;
    width: 180px;
    height: 120px;
    opacity: 0.4;
    clip-path: polygon(0% 3%, 98% 0%, 100% 97%, 2% 100%);
}

.circuit-sketch svg {
    width: 100%;
    height: 100%;
}

.botanical-element {
    top: 20px;
    right: 180px;
    width: 100px;
    height: 140px;
    opacity: 0.35;
}

.botanical-element svg {
    width: 100%;
    height: 100%;
}

.wide-card-text {
    position: relative;
    z-index: 2;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.wide-card-title {
    font-family: 'Caveat', cursive;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 700;
    color: var(--deep-ink);
    margin-bottom: 1.5rem;
}

.wide-card-text p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--warm-gray);
}

/* ==============================================
   CLOSING SECTION
   ============================================== */
#closing {
    position: relative;
    padding: 6rem 0;
    background-color: var(--warm-paper);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0,
        transparent 8px,
        rgba(192, 120, 80, 0.03) 8px,
        rgba(192, 120, 80, 0.03) 9px
    );
    overflow: hidden;
}

.closing-curve {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 960px;
    max-width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.closing-curve path {
    fill: none;
    stroke: var(--faded-orange);
    stroke-width: 2;
    opacity: 0.12;
}

.closing-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem;
}

.closing-title {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--deep-ink);
    margin-bottom: 2rem;
}

.closing-disclosure {
    cursor: pointer;
}

.closing-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-family: 'Work Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--copper-circuit);
    transition: transform 0.4s ease;
    user-select: none;
}

.closing-disclosure[data-expanded="true"] .closing-toggle {
    transform: rotate(45deg);
}

.closing-statement {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.closing-disclosure[data-expanded="true"] .closing-statement {
    /* max-height set by JS */
}

.closing-statement p {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.75;
    color: var(--warm-gray);
}

/* ==============================================
   RESPONSIVE
   ============================================== */
@media (max-width: 680px) {
    .grid-container {
        grid-template-columns: 1fr;
        padding: 2rem 1.5rem;
    }

    .zen-void {
        display: none;
    }

    .wide-card-inner {
        padding: 2rem 1.5rem;
    }

    .graph-paper,
    .circuit-sketch,
    .botanical-element {
        display: none;
    }

    .collage-fragment {
        display: none;
    }

    #closing {
        padding: 4rem 0;
    }
}

@media (min-width: 681px) and (max-width: 960px) {
    .grid-container {
        padding: 3rem 2rem;
    }

    .wide-container {
        padding: 0 2rem;
    }
}