/* hil.st — Botanical Voltage */

:root {
    --parchment: #f5ece0;
    --deep-bark: #1e140e;
    --dark-earth: #3d2b1f;
    --mahogany: #7a3318;
    --copper: #c4622a;
    --ember: #e87635;
    --gold: #d4a13a;
    --sage: #8a7e6a;
    --teal: #4a7c6f;
    --verdigris: #5fa08e;
    --spine-width: clamp(320px, 55vw, 720px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--parchment);
    color: var(--deep-bark);
    font-family: 'Newsreader', serif;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Grain Overlay */
#grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: multiply;
}

#grain-overlay svg {
    width: 100%;
    height: 100%;
}

/* Spine System */
.spine {
    width: var(--spine-width);
    margin: 0 auto;
    position: relative;
}

/* Growth Plates */
.growth-plate {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 2rem;
    overflow: hidden;
}

/* Title Sequence */
#title-sequence {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#site-title {
    font-family: 'Fraunces', serif;
    font-size: clamp(3.2rem, 9vw, 7.5rem);
    font-weight: 900;
    font-variation-settings: 'SOFT' 100, 'WONK' 1;
    letter-spacing: -0.02em;
    color: var(--deep-bark);
    text-align: center;
}

#site-title .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: letterReveal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

#site-title .letter[data-index="0"] { animation-delay: 0s; }
#site-title .letter[data-index="1"] { animation-delay: 0.1618s; }
#site-title .letter[data-index="2"] { animation-delay: 0.2618s; }
#site-title .letter[data-index="3"] { animation-delay: 0.4236s; }
#site-title .letter[data-index="4"] { animation-delay: 0.5854s; }
#site-title .letter[data-index="5"] { animation-delay: 0.7472s; }

.subtitle {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(0.75rem, 1.2vw, 1rem);
    font-weight: 300;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--sage);
    text-align: center;
    margin-top: 1.5rem;
    opacity: 0;
    animation: fadeIn 1s 1.2s ease forwards;
}

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

/* Botanical Floats */
.botanical-float {
    position: absolute;
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.float-left {
    left: 5%;
    top: 20%;
}

.float-right {
    right: 5%;
    bottom: 20%;
}

.fern-svg {
    width: 80px;
    height: auto;
}

.stem-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: drawStem 2s 0.5s ease forwards;
}

.frond {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: drawFrond 1s ease forwards;
    animation-delay: calc(1.5s + var(--frond-index, 0) * 0.15s);
}

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

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

/* Section Headings */
.section-heading {
    font-family: 'Fraunces', serif;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    font-variation-settings: 'SOFT' 80, 'WONK' 1;
    line-height: 1.05;
    color: var(--dark-earth);
    margin-bottom: 2rem;
}

/* Body Text */
.body-text {
    font-family: 'Newsreader', serif;
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.8;
    color: var(--dark-earth);
    max-width: 540px;
    opacity: 0.9;
}

/* Specimen Grid */
.specimen-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.specimen-card {
    background: rgba(30, 20, 14, 0.03);
    border: 1px solid rgba(61, 43, 31, 0.12);
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.specimen-card:hover {
    border-color: var(--copper);
    background: rgba(212, 161, 58, 0.04);
}

.specimen-number {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--sage);
    position: absolute;
    top: 0.8rem;
    left: 1rem;
}

.card-svg {
    width: 60px;
    height: 60px;
    margin: 0.5rem auto;
}

.specimen-label {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--dark-earth);
    margin-top: 1rem;
    text-transform: uppercase;
}

/* Lightning */
.lightning-container {
    margin-top: 3rem;
    height: 150px;
    position: relative;
}

.lightning-svg {
    width: 100%;
    height: 100%;
}

.lightning-bolt {
    opacity: 0;
    filter: drop-shadow(0 0 4px var(--gold));
}

.lightning-bolt.flash {
    opacity: 1;
    animation: lightningFlash 0.15s ease-out forwards;
}

@keyframes lightningFlash {
    0% { opacity: 1; }
    50% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Root System / Footer */
.root-links {
    display: flex;
    gap: 2.5rem;
    margin: 2rem 0;
}

.root-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-earth);
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

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

.root-link:hover {
    color: var(--copper);
}

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

.root-network {
    margin: 2rem 0;
    opacity: 0.6;
}

.roots-svg {
    width: 200px;
    height: auto;
}

.root-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

.root-path.drawn {
    animation: drawRoot 2s ease forwards;
}

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

.footer-mark {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--sage);
    margin-top: 3rem;
}

/* Specimen floats */
.specimen-svg {
    width: 60px;
    height: auto;
}

.specimen {
    opacity: 0;
    transition: opacity 1s ease, transform 1s ease;
}

.specimen.visible {
    opacity: 0.7;
}

/* Grain breathing animation */
@keyframes grainBreathe {
    0%, 100% { opacity: 0.06; }
    50% { opacity: 0.1; }
}

#grain-overlay svg rect {
    animation: grainBreathe 4s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 600px) {
    .specimen-grid {
        grid-template-columns: 1fr;
    }

    .root-links {
        flex-direction: column;
        gap: 1.2rem;
    }

    .botanical-float {
        display: none;
    }
}
