/* gamelicense.info — Bauhaus Greenhouse */
/* Colors: #c75b22 #d4943a #1b2a2f #b8c9a9 #f2ead3 #e8bf6a #3a3f47 #bf6a3d */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:root {
    --burnt-orange: #c75b22;
    --ochre: #d4943a;
    --charcoal-teal: #1b2a2f;
    --sage: #b8c9a9;
    --parchment: #f2ead3;
    --sodium: #e8bf6a;
    --iron: #3a3f47;
    --terra: #bf6a3d;
    --scroll-weight: 400;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Archivo', sans-serif;
    background-color: var(--charcoal-teal);
    color: var(--iron);
    overflow-x: hidden;
}

/* ========== GRID OVERLAY (Blueprint underlay) ========== */
.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(199,91,34,0.08) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(199,91,34,0.08) 1px, transparent 1px);
    background-size: calc(100% / 6) calc(100% / 8);
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.grid-overlay.visible {
    opacity: 1;
}

/* ========== SCENE 1: CANOPY ========== */
#canopy {
    position: relative;
    height: 100vh;
    background-color: var(--charcoal-teal);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.botanical-canopy {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    animation: canopyBreathe 6s ease-in-out infinite;
}

@keyframes canopyBreathe {
    0%, 100% { transform: scale(1.0); }
    50% { transform: scale(1.02); }
}

.botanical-canopy .stem {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 1.2s ease;
}

.botanical-canopy.animate .stem {
    stroke-dashoffset: 0;
}

.botanical-canopy .leaf {
    transform-origin: center;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.botanical-canopy.animate .leaf {
    opacity: 1;
}

.botanical-canopy .seed {
    animation: floatSeed 8s ease-in-out infinite;
}

.botanical-canopy .seed:nth-child(odd) {
    animation-delay: -3s;
}

@keyframes floatSeed {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-8px) translateX(5px); }
    50% { transform: translateY(-3px) translateX(-3px); }
    75% { transform: translateY(-10px) translateX(4px); }
}

.canopy-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.main-title {
    font-family: 'Archivo', sans-serif;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    font-weight: var(--scroll-weight);
    color: var(--parchment);
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.main-title .letter {
    display: inline-block;
    font-weight: 100;
    transition: font-weight 0.08s ease;
}

.main-title .letter.revealed {
    font-weight: 700;
}

.subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(0.9rem, 2vw, 1.3rem);
    color: var(--sage);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.subtitle.visible {
    opacity: 1;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    opacity: 0.6;
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 12; }
    50% { cy: 28; }
}

/* ========== SCENE 2: GRID GARDEN ========== */
#gridGarden {
    position: relative;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #c75b22 0%, #d4943a 35%, #b8c9a9 70%, #1b2a2f 100%);
    background-size: 200% 200%;
    background-position: 0% 0%;
}

.background-gradient {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(58,63,71,0.05) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(58,63,71,0.05) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.section-header h2 {
    font-family: 'Archivo', sans-serif;
    font-size: clamp(1.4rem, 3vw, 2.6rem);
    font-weight: var(--scroll-weight);
    color: var(--charcoal-teal);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.section-desc {
    font-family: 'Lora', serif;
    font-style: italic;
    color: var(--iron);
    margin-top: 0.5rem;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
}

.light-text h2 {
    color: var(--parchment);
}

.light-text .section-desc {
    color: var(--sage);
}

/* Masonry Grid */
.masonry-grid {
    columns: 3;
    column-gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

@media (max-width: 900px) {
    .masonry-grid { columns: 2; }
}

@media (max-width: 560px) {
    .masonry-grid { columns: 1; }
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color 0.3s ease;
}

.masonry-item.in-view {
    opacity: 1;
    transform: translateY(0);
}

.masonry-item.pulse {
    animation: pulseAttention 0.4s ease-out;
}

@keyframes pulseAttention {
    0% { transform: scale(1.0); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1.0); }
}

/* Card Square */
.card-square {
    background: var(--parchment);
    border: 1.5px solid var(--burnt-orange);
    padding: 1.5rem;
    position: relative;
    --mouse-x: 50%;
    --mouse-y: 50%;
}

.card-square::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mouse-x) var(--mouse-y), rgba(232,191,106,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.card-square:hover::before {
    opacity: 1;
}

.card-square:hover {
    border-color: var(--sodium);
}

.card-square h3 {
    font-family: 'Archivo', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--charcoal-teal);
    margin-bottom: 0.5rem;
}

.card-desc {
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    color: var(--iron);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.card-botanical {
    width: 100%;
    max-height: 120px;
}

.card-botanical .stem {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.2s ease;
}

.in-view .card-botanical .stem {
    stroke-dashoffset: 0;
}

/* Shape Icons */
.shape-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.circle-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--burnt-orange);
}

.triangle-icon {
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 16px solid var(--ochre);
}

.square-icon {
    width: 16px;
    height: 16px;
    border-radius: 0;
    background: var(--iron);
}

/* Concept Rectangle */
.concept-rect {
    background: rgba(184,201,169,0.6);
    backdrop-filter: blur(2px);
    padding: 1.8rem;
    border-left: 3px solid var(--ochre);
}

.concept-rect h3 {
    font-family: 'Archivo', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--charcoal-teal);
    margin-bottom: 0.75rem;
}

.concept-rect p {
    font-family: 'Lora', serif;
    font-size: 0.88rem;
    color: var(--iron);
    line-height: 1.65;
}

/* Key Term Circle */
.key-term-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: var(--burnt-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    cursor: default;
}

.term-text {
    font-family: 'Archivo', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--parchment);
    text-align: center;
    letter-spacing: 0.05em;
    transition: font-weight 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0.5rem;
}

.key-term-circle:hover .term-text {
    font-weight: 900;
}

/* ========== SCENE 3: PRESSED SPECIMENS ========== */
#pressedSpecimens {
    position: relative;
    min-height: 100vh;
    background-color: var(--parchment);
    padding: 6rem 2rem;
}

.paper-texture {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(58,63,71,0.03) 1px, transparent 1px),
        radial-gradient(circle at 60% 70%, rgba(58,63,71,0.02) 1px, transparent 1px),
        radial-gradient(circle at 80% 20%, rgba(58,63,71,0.03) 1px, transparent 1px),
        radial-gradient(circle at 40% 80%, rgba(58,63,71,0.02) 1px, transparent 1px);
    background-size: 6px 6px, 8px 8px, 5px 5px, 7px 7px;
    pointer-events: none;
}

#pressedSpecimens .section-header h2 {
    color: var(--charcoal-teal);
}

#pressedSpecimens .section-desc {
    color: var(--iron);
}

.specimens-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    perspective: 800px;
}

@media (max-width: 800px) {
    .specimens-grid { grid-template-columns: 1fr; max-width: 400px; }
}

.specimen {
    position: relative;
}

.specimen-card {
    background: var(--parchment);
    border: 1px solid rgba(58,63,71,0.15);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    transform-style: preserve-3d;
    box-shadow: 0 2px 4px rgba(27,42,47,0.1);
}

.specimen-card:hover {
    transform: translateZ(20px);
    box-shadow: 0 12px 24px rgba(27,42,47,0.3);
}

.specimen-svg {
    width: 100%;
    max-height: 280px;
    margin-bottom: 1rem;
}

.specimen-svg .stem {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    transition: stroke-dashoffset 1.2s ease;
}

.in-view .specimen-svg .stem {
    stroke-dashoffset: 0;
}

.specimen-label {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--iron);
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
}

.specimen-info {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.4s ease;
    opacity: 0;
}

.specimen-card:hover .specimen-info {
    max-height: 200px;
    opacity: 1;
}

.specimen-info p {
    font-family: 'Lora', serif;
    font-size: 0.85rem;
    color: var(--iron);
    line-height: 1.6;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(58,63,71,0.1);
}

/* ========== SCENE 4: ROOT SYSTEM ========== */
#rootSystem {
    background-color: var(--charcoal-teal);
    padding: 6rem 2rem;
    position: relative;
}

.root-network {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: block;
}

.root-line {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
    transition: stroke-dashoffset 1.5s ease;
}

#rootSystem.in-view .root-line {
    stroke-dashoffset: 0;
}

.root-node circle {
    transition: r 0.3s ease, stroke-width 0.3s ease;
}

.root-node:hover circle {
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(232,191,106,0.4));
}

.root-node text {
    pointer-events: none;
}

.root-description {
    max-width: 700px;
    margin: 3rem auto 0;
    text-align: center;
}

.root-description p {
    font-family: 'Lora', serif;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: var(--sage);
    line-height: 1.7;
    font-style: italic;
}

/* ========== FOOTER ========== */
.site-footer {
    background-color: var(--charcoal-teal);
    border-top: 1px solid rgba(199,91,34,0.2);
    padding: 2rem;
    text-align: center;
    position: relative;
}

.footer-text {
    font-family: 'Overpass Mono', monospace;
    font-size: 0.75rem;
    color: var(--sage);
    letter-spacing: 0.08em;
    margin-bottom: 1rem;
}

.bauhaus-shapes-footer {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
}

.shape-circle-sm {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--burnt-orange);
    display: inline-block;
}

.shape-triangle-sm {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 12px solid var(--ochre);
    display: inline-block;
}

.shape-square-sm {
    width: 12px;
    height: 12px;
    background: var(--iron);
    display: inline-block;
}

/* ========== BUILDING SILHOUETTES ========== */
body::before,
body::after {
    content: '';
    position: fixed;
    bottom: 0;
    width: 80px;
    height: 200px;
    background: var(--charcoal-teal);
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

body::before {
    left: 0;
    width: 60px;
    height: 280px;
    clip-path: polygon(0 100%, 0 20%, 30% 20%, 30% 0%, 70% 0%, 70% 20%, 100% 20%, 100% 100%);
}

body::after {
    right: 0;
    width: 80px;
    height: 240px;
    clip-path: polygon(0 100%, 0 30%, 50% 30%, 50% 10%, 80% 10%, 80% 0%, 100% 0%, 100% 100%);
}
