/* ========================================
   tanso.bar - Cottagecore Carbon Laboratory
   ======================================== */

/* Palette: #c4887a #3a3228 #e8d4b4 #6a8a5a #f4ede0 #d4a850 #4a4038 #d4c4a4 */
/* Fonts: Bebas Neue, Lora" (Google Fonts), Caveat */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(15px, 1.5vw, 18px);
    line-height: 1.8;
    color: #3a3228;
    background-color: #e8d4b4;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    letter-spacing: 0.04em;
}

.caveat-text {
    font-family: 'Caveat', cursive;
}

.section-title {
    font-size: clamp(28px, 5vw, 56px);
    color: #3a3228;
    text-align: center;
}

/* ========================================
   Hero Section
   ======================================== */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(160deg, #e8d4b4 0%, #d4c4a4 60%, #e8d4b4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    animation: heroFadeIn 1.5s ease-out 0.2s forwards;
}

@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Background crystal patterns */
.crystal-bg {
    position: absolute;
    opacity: 0.05;
    pointer-events: none;
}

.crystal-bg-1 {
    width: 400px;
    height: 400px;
    top: -50px;
    left: -80px;
}

.crystal-bg-2 {
    width: 350px;
    height: 350px;
    bottom: -40px;
    right: -60px;
}

/* Wildflower corner decorations */
.wildflower {
    position: absolute;
    width: 120px;
    height: 120px;
    pointer-events: none;
    z-index: 2;
}

.wildflower-tl {
    top: 20px;
    left: 20px;
}

.wildflower-tr {
    top: 20px;
    right: 20px;
    transform: scaleX(-1);
}

.wildflower-bl {
    bottom: 20px;
    left: 30px;
}

.wildflower-br {
    bottom: 20px;
    right: 30px;
    transform: scaleX(-1);
}

/* Wildflower bloom animation */
.flower-group {
    transform: scale(0);
    transform-origin: center;
    animation: bloomIn 0.8s ease-out forwards;
}

.flower-bloom-1 { animation-delay: 1.2s; }
.flower-bloom-2 { animation-delay: 1.6s; }
.flower-bloom-3 { animation-delay: 1.4s; }
.flower-bloom-4 { animation-delay: 1.8s; }
.flower-bloom-5 { animation-delay: 2.0s; }
.flower-bloom-6 { animation-delay: 1.5s; }

@keyframes bloomIn {
    0% { transform: scale(0) rotate(-20deg); opacity: 0; }
    60% { transform: scale(1.1) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* Hero molecular SVG */
#hero-molecule {
    position: absolute;
    width: clamp(200px, 30vw, 350px);
    height: auto;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.35;
}

#hero-molecule-right {
    position: absolute;
    width: clamp(160px, 22vw, 280px);
    height: auto;
    right: 5%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    opacity: 0.3;
}

/* Molecule stroke draw animation */
.mol-stroke {
    opacity: 0;
    animation: molDraw 0.6s ease-out forwards;
}

.mol-stroke-1 { animation-delay: 0.5s; }
.mol-stroke-2 { animation-delay: 0.9s; }
.mol-stroke-3 { animation-delay: 1.3s; }
.mol-stroke-4 { animation-delay: 1.7s; }

@keyframes molDraw {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SVG path stroke draw effect */
.molecule-draw path,
.molecule-draw line,
.molecule-draw polygon {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    animation: strokeDraw 2s ease-out forwards;
}

.molecule-draw circle {
    opacity: 0;
    animation: nodeAppear 0.5s ease-out 1.8s forwards;
}

.molecule-draw text {
    opacity: 0;
    animation: nodeAppear 0.5s ease-out 2s forwards;
}

@keyframes strokeDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes nodeAppear {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

#hero-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(64px, 12vw, 160px);
    font-weight: 400;
    color: #3a3228;
    letter-spacing: 0.08em;
    line-height: 1;
    opacity: 0;
    animation: titleReveal 1s ease-out 0.8s forwards;
}

@keyframes titleReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
        letter-spacing: 0.2em;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        letter-spacing: 0.08em;
    }
}

#hero-subtitle {
    font-size: clamp(18px, 2.5vw, 28px);
    color: #4a4038;
    margin-top: 12px;
    opacity: 0;
    animation: subtitleReveal 0.8s ease-out 1.4s forwards;
}

@keyframes subtitleReveal {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Dashboard Section
   ======================================== */
#dashboard {
    padding: 80px clamp(20px, 4vw, 60px) 60px;
    background: #e8d4b4;
}

#dashboard-header {
    text-align: center;
    margin-bottom: 50px;
}

#dashboard-header .annotation {
    font-size: clamp(16px, 2vw, 22px);
    color: #6a8a5a;
    margin-top: 8px;
}

/* Dashboard Grid */
#dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Panel base styles */
.panel {
    background: #f4ede0;
    border: 1px solid #d4c4a4;
    border-radius: 6px;
    padding: clamp(20px, 2.5vw, 32px);
    position: relative;
    transition: transform 200ms ease, filter 200ms ease, box-shadow 200ms ease;
    overflow: hidden;
}

.panel:hover {
    transform: scale(1.03);
    filter: brightness(1.05);
    box-shadow: 0 8px 30px rgba(58, 50, 40, 0.1);
    z-index: 2;
}

/* Hand-drawn border decoration via pseudo-element */
.panel::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px dashed #d4c4a4;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0.5;
}

/* Panel sizes */
.panel-large {
    grid-column: span 2;
}

.panel-medium {
    grid-column: span 1;
}

.panel-wide {
    grid-column: span 3;
}

.panel-small {
    grid-column: span 1;
}

/* Panel typography */
.panel-title {
    font-size: clamp(20px, 2.5vw, 30px);
    color: #3a3228;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
}

.panel-body {
    color: #4a4038;
    margin-bottom: 10px;
}

.panel-annotation {
    font-size: clamp(14px, 1.5vw, 18px);
    color: #6a8a5a;
    font-style: italic;
}

/* Panel corner flowers */
.panel-corner-flower {
    position: absolute;
    width: 30px;
    height: 30px;
    pointer-events: none;
    z-index: 1;
}

.panel-corner-tl {
    top: 6px;
    left: 6px;
}

.panel-corner-br {
    bottom: 6px;
    right: 6px;
    transform: rotate(180deg);
}

/* ========================================
   Panel-specific styles
   ======================================== */

/* Allotropes panel */
.allotrope-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.allotrope-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed #d4c4a4;
}

.allotrope-item:last-child {
    border-bottom: none;
}

.allotrope-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.allotrope-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 20px;
    letter-spacing: 0.04em;
    color: #3a3228;
    display: block;
}

.allotrope-note {
    font-size: 15px;
    color: #6a8a5a;
}

/* Graphene panel */
#graphene-svg {
    width: 100%;
    max-width: 280px;
    margin: 10px auto;
    display: block;
}

/* Carbon Cycle panel */
.cycle-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.cycle-step {
    font-family: 'Caveat', cursive;
    font-size: clamp(15px, 1.8vw, 20px);
    color: #3a3228;
    background: #e8d4b4;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #d4c4a4;
}

.cycle-arrow {
    color: #d4a850;
    font-size: 20px;
    font-weight: bold;
}

/* Journal panel */
.journal-entry {
    margin-bottom: 12px;
}

.journal-date {
    font-size: 17px;
    color: #d4a850;
    margin-bottom: 4px;
}

.journal-divider {
    margin: 8px 0;
}

.journal-divider svg {
    width: 100%;
    max-width: 200px;
    display: block;
    margin: 0 auto;
}

/* Carbon stats */
.carbon-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 20px;
    justify-content: center;
}

.carbon-stat {
    text-align: center;
    padding: 10px 16px;
    background: #e8d4b4;
    border-radius: 8px;
    border: 1px solid #d4c4a4;
    min-width: 100px;
}

.stat-number {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(24px, 3vw, 36px);
    color: #d4a850;
    display: block;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #6a8a5a;
}

/* ========================================
   Footer
   ======================================== */
#footer {
    padding: 40px 20px;
    text-align: center;
    background: linear-gradient(0deg, #d4c4a4 0%, #e8d4b4 100%);
    border-top: 1px dashed #d4c4a4;
}

.footer-flower {
    margin-bottom: 12px;
}

.footer-flower svg {
    width: 60px;
    height: 40px;
}

.footer-text {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 24px;
    color: #3a3228;
    letter-spacing: 0.06em;
}

.footer-annotation {
    font-size: 16px;
    color: #6a8a5a;
    margin-top: 4px;
}

/* Section break flower accent color */
.footer-flower svg circle {
    fill: #c4887a;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 900px) {
    #dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .panel-large {
        grid-column: span 2;
    }

    .panel-wide {
        grid-column: span 2;
    }

    .panel-small {
        grid-column: span 1;
    }

    #hero-molecule {
        width: 180px;
        opacity: 0.2;
        left: 2%;
    }

    #hero-molecule-right {
        width: 150px;
        opacity: 0.15;
        right: 2%;
    }

    .wildflower {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 600px) {
    #dashboard-grid {
        grid-template-columns: 1fr;
    }

    .panel-large,
    .panel-medium,
    .panel-wide,
    .panel-small {
        grid-column: span 1;
    }

    #hero-molecule,
    #hero-molecule-right {
        display: none;
    }

    .wildflower {
        width: 60px;
        height: 60px;
    }

    .carbon-stats {
        gap: 12px;
    }

    .carbon-stat {
        min-width: 80px;
        padding: 8px 10px;
    }

    .cycle-flow {
        gap: 4px;
    }

    .cycle-step {
        padding: 4px 10px;
        font-size: 14px;
    }
}

/* ========================================
   Panel entrance animation (JS-driven)
   ======================================== */
.panel {
    opacity: 0;
    transform: translateY(20px);
}

.panel.visible {
    animation: panelEnter 0.6s ease-out forwards;
}

@keyframes panelEnter {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}