/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
ul, li { list-style: none; }
html { scroll-behavior: smooth; }

/* ─── TOKENS ─── */
:root {
    --ink:     #1A1410;
    --bark:    #2C1F14;
    --forest:  #2D4A2D;
    --moss:    #5A7A4A;
    --sawdust: #C4A882;
    --cream:   #F5F0E8;
    --white:   #FFFFFF;
    --nav-h:   64px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--white);
    color: var(--ink);
    overflow-x: hidden;
}

/* ─── NAV ─── */
nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px;
    z-index: 1000;
    transition: background 0.4s, box-shadow 0.4s;
}
nav.scrolled {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.nav-logo {
    font-size: 1rem; font-weight: 800;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--white);
    transition: color 0.4s;
}
nav.scrolled .nav-logo { color: var(--ink); }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
    font-size: 0.78rem; font-weight: 500;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: rgba(255,255,255,0.8);
    transition: color 0.3s;
}
nav.scrolled .nav-links a { color: var(--ink); }
.nav-links a:hover { color: var(--sawdust); }
nav.scrolled .nav-links a:hover { color: var(--moss); }

.nav-hamburger {
    display: none; cursor: pointer;
    width: 24px; height: 24px;
    flex-direction: column; justify-content: space-between;
}
.nav-hamburger span {
    display: block; width: 100%; height: 2px;
    background: var(--white);
    transition: background 0.4s, transform 0.3s, opacity 0.3s;
}
nav.scrolled .nav-hamburger span { background: var(--ink); }
.nav-hamburger.open span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* ─── HERO ─── */
#hero {
    width: 100%; height: 100vh;
    position: relative; overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0;
    background: url('../images/hero.jpg') center / cover no-repeat;
    filter: brightness(0.5);
    transform: scale(1.06);
    transition: transform 10s ease-out;
}
#hero.loaded .hero-bg { transform: scale(1); }

.hero-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: flex-end;
    padding: 0 8vw 10vh;
}
.hero-eyebrow {
    font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--sawdust); margin-bottom: 20px;
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}
#hero.loaded .hero-eyebrow { opacity: 1; transform: translateY(0); }

.hero-content h1 {
    font-size: clamp(2.8rem, 5.5vw, 6rem);
    font-weight: 800; line-height: 1.05;
    letter-spacing: -0.025em; color: var(--white);
    max-width: 18ch;
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.9s ease 0.4s, transform 0.9s ease 0.4s;
}
#hero.loaded .hero-content h1 { opacity: 1; transform: translateY(0); }

.hero-divider {
    width: 40px; height: 2px; background: var(--sawdust);
    margin: 28px 0;
    opacity: 0; transition: opacity 0.8s ease 0.7s;
}
#hero.loaded .hero-divider { opacity: 1; }

.hero-sub {
    font-size: 1.25rem; font-weight: 300; line-height: 1.75;
    color: rgba(255,255,255,0.65); max-width: 48ch;
    opacity: 0; transform: translateY(12px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}
#hero.loaded .hero-sub { opacity: 1; transform: translateY(0); }

/* ─── STATS ─── */
#stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--cream);
}
.stat-item {
    padding: 56px 48px;
    border-left: 1px solid rgba(44,31,20,0.1);
}
.stat-item:first-child { border-left: none; }
.stat-num {
    font-size: clamp(2.4rem, 4vw, 4rem);
    font-weight: 800; letter-spacing: -0.03em;
    color: var(--bark); line-height: 1;
}
.stat-num sup {
    font-size: 1.4rem; vertical-align: top;
    margin-top: 8px; display: inline-block;
    color: var(--moss);
}
.stat-desc {
    font-size: 0.85rem; font-weight: 400; line-height: 1.65;
    color: var(--bark); opacity: 0.55; margin-top: 12px;
}

/* ─── PROBLEM ─── */
#problem {
    height: 90vh; position: relative; overflow: hidden;
}
.problem-bg {
    position: absolute; inset: 0;
    background: url('../images/sawmill-waste.jpg') center / cover no-repeat;
    filter: brightness(0.4) saturate(0.7);
}
.problem-content {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    justify-content: center; padding: 0 8vw;
}
.problem-tag {
    font-size: 0.68rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--sawdust); margin-bottom: 28px;
}
.problem-content blockquote {
    font-size: clamp(1.4rem, 2.4vw, 2.6rem);
    font-weight: 300; font-style: italic;
    line-height: 1.55; color: var(--white); max-width: 28ch;
}
.problem-content blockquote strong {
    font-weight: 700; font-style: normal; color: var(--sawdust);
}

/* ─── SHARED SECTION HEADER ─── */
.sec-header {
    padding: 80px 8vw 0;
}
.sec-tag {
    font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--moss); margin-bottom: 14px;
}
.sec-tag.light { color: var(--sawdust); }
.sec-header h2 {
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 700; letter-spacing: -0.02em;
    line-height: 1.15; color: var(--bark);
}
.sec-header h2.light { color: var(--white); }
.sec-desc {
    font-size: clamp(0.95rem, 1.4vw, 1.1rem); font-weight: 300;
    letter-spacing: 0.01em; line-height: 1.5;
    color: var(--bark); opacity: 0.55; margin-top: 14px;
}

/* ─── INGREDIENTS (Material) ─── */
#ingredients { background: var(--white); padding-bottom: 80px; }
.ingredients-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 2px; background: rgba(44,31,20,0.12);
    margin: 48px 8vw 0;
}
.ingredient-card {
    background: var(--white); overflow: hidden;
    display: flex; flex-direction: column;
}
.ingredient-card img {
    width: 100%; aspect-ratio: 4/3; object-fit: cover;
    filter: saturate(0.75);
    transition: transform 0.6s ease, filter 0.6s ease;
}
.ingredient-card:hover img {
    transform: scale(1.04); filter: saturate(1);
}
.ingredient-meta {
    padding: 18px 24px;
    display: flex; align-items: baseline; gap: 10px;
}
.ingredient-num {
    font-size: 0.6rem; letter-spacing: 0.15em; font-weight: 600;
    color: var(--moss); min-width: 18px;
}
.ingredient-name {
    font-size: 0.78rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: var(--bark);
}
/* ─── APPLICATIONS ─── */
#applications { background: var(--cream); padding-bottom: 80px; }
.apps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 20px; padding: 48px 8vw 0;
}
.app-card {
    position: relative; overflow: hidden; aspect-ratio: 1/1;
}
.app-card img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.7s ease;
}
.app-card:hover img { transform: scale(1.05); }
.app-card::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(26,20,16,0.75) 0%, transparent 55%);
}
.app-label {
    position: absolute; bottom: 20px; left: 20px; right: 20px; z-index: 2;
}
.app-label h3 {
    font-size: 1.1rem; font-weight: 700; color: var(--white);
    letter-spacing: -0.01em;
}
.app-label span {
    font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase;
    color: rgba(255,255,255,0.5); margin-top: 4px; display: block;
}

/* ─── PERFORMANCE ─── */
#performance { background: var(--bark); padding-bottom: 80px; }
.perf-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 24px; padding: 48px 8vw 0;
}
.perf-card {
    border: 1px solid rgba(196,168,130,0.18);
    overflow: hidden;
}
.perf-card img {
    width: 100%; aspect-ratio: 16/9; object-fit: cover;
    filter: saturate(0.55) brightness(0.9);
    transition: filter 0.5s ease;
}
.perf-card:hover img { filter: saturate(1) brightness(1); }
.perf-meta {
    padding: 18px 24px;
    display: flex; align-items: center; gap: 10px;
}
.perf-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--moss); flex-shrink: 0;
}
.perf-label {
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--sawdust);
}

/* ─── AI SECTION ─── */
#ai { background: var(--white); padding: 80px 8vw; }
.ai-inner {
    display: grid; grid-template-columns: 2fr 3fr;
    gap: 56px; align-items: center;
}
.ai-text .sec-tag { color: var(--moss); margin-bottom: 14px; }
.ai-text h2 {
    font-size: clamp(1.6rem, 2.4vw, 2.4rem);
    font-weight: 700; letter-spacing: -0.02em;
    color: var(--bark); line-height: 1.15; margin-bottom: 24px;
}
.ai-text p {
    font-size: 0.88rem; font-weight: 300; line-height: 1.85;
    color: var(--bark); opacity: 0.65; margin-bottom: 12px;
}
.ai-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ai-photos img {
    width: 100%; height: auto;
}

/* ─── PARTNERS ─── */
#partner { background: var(--bark); padding: 64px 8vw; }
.partner-label {
    font-size: 0.65rem; letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--sawdust); text-align: center; margin-bottom: 40px;
}
.partner-logos {
    display: flex; justify-content: center;
    align-items: center; gap: 56px; flex-wrap: wrap;
}
.partner-logos a {
    opacity: 0.64;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.partner-logos a:hover { opacity: 1; transform: translateY(-3px); }
.partner-logos img { height: 36px; width: auto; }

/* ─── TEAM ─── */
#team { background: var(--white); padding: 80px 8vw; }
.team-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 32px; margin-top: 48px;
}
.team-card a {
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.team-avatar {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 4px;
    filter: grayscale(25%);
    transition: filter 0.4s ease, transform 0.4s ease;
}
.team-card a:hover .team-avatar {
    filter: grayscale(0%); transform: translateY(-4px);
}
.team-name {
    font-size: 0.82rem; font-weight: 600;
    color: var(--bark); text-align: center;
}
.team-role {
    font-size: 0.72rem; font-weight: 300; line-height: 1.6;
    color: var(--bark); opacity: 0.5; text-align: center;
}

/* ─── CONTACT ─── */
#contact {
    height: 100vh; padding: 0 8vw;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-align: center;
    position: relative; overflow: hidden;
}
.contact-video-bg {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 0;
}
.contact-overlay {
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}
#contact h2 {
    font-size: clamp(2rem, 4vw, 4.2rem);
    font-weight: 700; letter-spacing: -0.025em;
    color: var(--white); line-height: 1.1;
    max-width: 18ch; position: relative; z-index: 2;
}
#contact p {
    font-size: 0.95rem; font-weight: 300;
    color: rgba(255,255,255,0.55);
    margin: 24px 0 44px; max-width: 42ch;
    position: relative; z-index: 2;
}
.contact-btn {
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.2em;
    text-transform: uppercase; padding: 16px 44px;
    border: 1.5px solid rgba(255,255,255,0.55);
    color: var(--white);
    transition: all 0.3s ease;
    position: relative; z-index: 2;
}
.contact-btn:hover {
    background: var(--white); color: var(--forest);
    border-color: var(--white); transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* ─── FOOTER ─── */
footer {
    background: var(--ink); padding: 28px 40px;
    display: flex; justify-content: space-between; align-items: center;
}
.footer-logo {
    font-size: 0.85rem; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
    color: rgba(255,255,255,0.3);
}
.footer-copy {
    font-size: 0.72rem; color: rgba(255,255,255,0.2);
}

/* ─── SCROLL REVEAL ─── */
.reveal {
    opacity: 0; transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.d1 { transition-delay: 0.1s; }
.d2 { transition-delay: 0.2s; }
.d3 { transition-delay: 0.3s; }
.d4 { transition-delay: 0.4s; }
.d5 { transition-delay: 0.5s; }

/* ─── MOBILE ─── */
@media (max-width: 768px) {
    nav { padding: 0 24px; }
    .nav-hamburger { display: flex; }
    .nav-links {
        flex-direction: column; gap: 0;
        position: fixed; top: var(--nav-h); left: 0; right: 0;
        background: var(--white);
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
        max-height: 0; overflow: hidden;
        opacity: 0; pointer-events: none;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.25s ease;
    }
    .nav-links.open {
        max-height: 320px;
        opacity: 1; pointer-events: auto;
    }
    .nav-links li {
        padding: 0 24px;
        border-bottom: 1px solid rgba(44,31,20,0.07);
    }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a {
        color: var(--ink) !important;
        font-size: 1rem; padding: 20px 0;
        display: block;
    }
    .hero-content { padding: 0 6vw 10vh; }
    #stats { grid-template-columns: 1fr; }
    .stat-item {
        border-left: none;
        border-top: 1px solid rgba(44,31,20,0.1);
        padding: 36px 24px;
    }
    .stat-item:first-child { border-top: none; }
    .sec-header { padding: 60px 6vw 0; }
    .ingredients-grid { grid-template-columns: 1fr; margin: 40px 6vw 0; }
    .apps-grid { grid-template-columns: 1fr; gap: 16px; padding: 40px 6vw 0; }
    .perf-grid { grid-template-columns: 1fr; gap: 16px; padding: 40px 6vw 0; }
    .ai-inner { grid-template-columns: 1fr; gap: 40px; }
    #ai { padding: 60px 6vw; }
    .team-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .team-card:nth-child(-n+2), .team-card:nth-child(n+3) { grid-column: span 1; }
    #team { padding: 60px 6vw; }
    footer { padding: 24px; flex-direction: column; gap: 8px; text-align: center; }
}
