/* ===========================================
   scire.dev -- Botanical Code Laboratory
   =========================================== */

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

:root {
    --bg: #F0F5E8;
    --bg-card: #F8FAF5;
    --text-heading: #1A2A1A;
    --text-body: #4A3A2A;
    --accent-moss: #4A8A4A;
    --accent-amber: #D4A843;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --magnetic-x: 0px;
    --magnetic-y: 0px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-body);
    background-color: var(--bg);
    overflow-x: hidden;
    position: relative;
}

/* --- Grain Overlay --- */
.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Circuit Lines --- */
.circuit-line {
    position: relative;
    height: 1px;
    background: var(--accent-moss);
    opacity: 0.2;
    margin: 0 auto;
}

.circuit-line--header {
    width: 100%;
}

.circuit-line--section {
    width: 80%;
    max-width: 900px;
    margin-top: 4rem;
}

.circuit-line--footer {
    width: 60%;
    max-width: 600px;
    margin-bottom: 2rem;
}

.circuit-line::before,
.circuit-line::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-moss);
}

.circuit-line::before {
    left: 0;
}

.circuit-line::after {
    right: 0;
}

/* --- Header --- */
.site-header {
    padding: 1.5rem 2rem 0;
    position: relative;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-node {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-moss);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.logo-dot {
    color: var(--accent-amber);
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-moss);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--accent-moss);
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Section Markers --- */
.section-marker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.node-dot {
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-moss);
}

.circuit-connector {
    display: inline-block;
    width: 40px;
    height: 1px;
    background: var(--accent-moss);
    opacity: 0.4;
}

.marker-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-moss);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- Hero Section --- */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
    position: relative;
}

.hero-content {
    flex: 1;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-body);
    max-width: 480px;
    margin-bottom: 2.5rem;
}

.hero-visual {
    flex: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
}

.botanical-circuit {
    width: 100%;
    max-width: 360px;
    height: auto;
}

.cta-button {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--bg-card);
    background: var(--accent-moss);
    padding: 0.8rem 2rem;
    text-decoration: none;
    letter-spacing: 0.04em;
    border: 1px solid var(--accent-moss);
    transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background: transparent;
    color: var(--accent-moss);
}

/* --- Z-Pattern Layout --- */
.z-left .section-inner,
.z-left .hero-content {
    text-align: left;
}

.z-right .section-inner {
    text-align: right;
}

.z-right .section-marker {
    justify-content: flex-end;
}

.z-right .section-body {
    margin-left: auto;
}

/* --- Sections --- */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.2;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.section-body {
    font-size: 1.05rem;
    line-height: 1.8;
    max-width: 600px;
    margin-bottom: 3rem;
    color: var(--text-body);
}

/* --- Laboratory Feature Cards --- */
.lab-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: left;
}

.feature-card {
    background: var(--bg-card);
    padding: 2rem;
    position: relative;
    border: 1px solid rgba(74, 138, 74, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translate(var(--magnetic-x), var(--magnetic-y));
    box-shadow: 0 8px 32px rgba(26, 42, 26, 0.08);
}

.card-node {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-amber);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.card-circuit {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 1px;
    background: var(--accent-moss);
    opacity: 0.3;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
    margin-top: 0.5rem;
}

.card-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-body);
}

/* --- Cultivar Grid --- */
.cultivar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    text-align: left;
    margin-top: 1rem;
}

.cultivar-item {
    position: relative;
    padding-left: 1.5rem;
}

.cultivar-stem {
    position: absolute;
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-moss), var(--accent-amber));
    opacity: 0.3;
}

.cultivar-node {
    position: absolute;
    left: -3px;
    top: 0.5rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-moss);
}

.cultivar-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.cultivar-desc {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-body);
}

/* --- Garden Entries --- */
.garden-entries {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.garden-entry {
    background: var(--bg-card);
    padding: 2rem 2.5rem;
    position: relative;
    border: 1px solid rgba(74, 138, 74, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.garden-entry:hover {
    transform: translate(var(--magnetic-x), var(--magnetic-y));
    box-shadow: 0 6px 24px rgba(26, 42, 26, 0.06);
}

.entry-circuit {
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 1px;
    background: var(--accent-amber);
    opacity: 0.3;
}

.entry-date {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-moss);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 0.5rem;
}

.entry-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.entry-excerpt {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 0.75rem;
}

.entry-tag {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-amber);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(212, 168, 67, 0.3);
    padding: 0.2rem 0.6rem;
    display: inline-block;
}

/* --- Roots Section --- */
.roots-philosophy {
    margin-top: 1rem;
}

.roots-quote {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-heading);
    line-height: 1.6;
    max-width: 700px;
    margin-bottom: 3rem;
    position: relative;
    padding-left: 2rem;
    font-style: italic;
}

.quote-node {
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-amber);
}

.roots-values {
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
}

.value-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.value-node {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-moss);
    flex-shrink: 0;
}

.value-text {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-body);
    letter-spacing: 0.03em;
}

/* --- Footer --- */
.site-footer {
    padding: 3rem 2rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-node {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-moss);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-heading);
}

.footer-note {
    font-size: 0.8rem;
    color: var(--text-body);
    opacity: 0.6;
    letter-spacing: 0.04em;
}

/* --- Magnetic Target Utility --- */
.magnetic-target {
    will-change: transform;
}

/* --- Circuit Line Draw-On Animation --- */
@keyframes drawLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.circuit-line--section,
.circuit-line--header,
.circuit-line--footer {
    transform-origin: left;
    animation: drawLine 1.2s ease-out forwards;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero {
        flex-direction: column;
        min-height: auto;
        padding: 3rem 1.5rem;
        gap: 2rem;
    }

    .hero-visual {
        max-width: 260px;
    }

    .lab-features {
        grid-template-columns: 1fr;
    }

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

    .z-right .section-inner {
        text-align: left;
    }

    .z-right .section-marker {
        justify-content: flex-start;
    }

    .z-right .section-body {
        margin-left: 0;
    }

    .roots-values {
        gap: 1.5rem;
    }

    .main-nav {
        gap: 1rem;
    }
}

@media (max-width: 600px) {
    .site-header {
        padding: 1rem 1rem 0;
    }

    .header-inner {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .section {
        padding: 3rem 1.25rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
    }

    .garden-entry {
        padding: 1.5rem;
    }

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

    .roots-values {
        flex-direction: column;
        gap: 1rem;
    }
}
