/* --- 1. Variables & Global Reset --- */
:root {
    --c-ink: #1a1208;
    --c-paper: #f5f0e8;
    --c-green: #2E4A35;
    --c-green-dark: #1e3324;
    --c-brown: #8b4513;
    --c-border: rgba(46, 74, 53, 0.2);
    --c-surface: rgba(232, 223, 200, 0.4);

    --f-sans: 'Inter', sans-serif;
    --f-serif: 'Playfair Display', serif;
    --f-mono: 'DM Mono', monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--f-sans);
    background-color: var(--c-paper);
    color: var(--c-ink);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Fix: Moved the grid and mask to a pseudo-element behind the content */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    pointer-events: none;
    /* Lighter grid lines for better readability */
    background-image:
        linear-gradient(rgba(46, 74, 53, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(46, 74, 53, 0.07) 1px, transparent 1px);
    background-size: 80px 80px;
    background-position: center center;
    /* Fades out the edges of the grid, without touching the text */
    -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 100%);
}

h1, h2, h3, h4 { font-family: var(--f-serif); color: var(--c-green); font-weight: 800; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

/* --- 2. Typography & Utilities --- */
.eyebrow {
    font-family: var(--f-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--c-brown);
    display: block;
    margin-bottom: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    font-family: var(--f-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: 1px solid var(--c-green);
    background: transparent;
    color: var(--c-green);
    border-radius: 100px;
    transition: all 0.4s var(--ease);
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.btn:hover {
    background: var(--c-green);
    color: var(--c-paper);
}

.btn-solid {
    background: var(--c-green);
    color: var(--c-paper);
}

.btn-solid:hover {
    background: var(--c-brown);
    border-color: var(--c-brown);
}

/* --- 3. Floating Navigation --- */
.nav-wrapper {
    position: fixed;
    top: 2rem;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
    pointer-events: none;
}

nav {
    pointer-events: auto;
    background: rgba(245, 240, 232, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--c-border);
    padding: 0.8rem 1.5rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 3rem;
    box-shadow: 0 10px 40px rgba(26, 18, 8, 0.08);
    transition: all 0.4s var(--ease);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--f-serif);
    font-weight: 800;
    font-size: 1.4rem;
}

.brand img { height: 30px; width: auto; }
.brand .ai { color: var(--c-brown); font-style: italic; font-weight: 400; }

.nav-links {
    display: flex;
    gap: 2rem;
    font-family: var(--f-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-links a { position: relative; padding: 0.5rem 0; color: var(--c-ink); }
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 0; height: 1px;
    background: var(--c-brown); transition: width 0.3s var(--ease);
}
.nav-links a:hover::after { width: 100%; }

.nav-links a.highlight { color: var(--c-brown); font-weight: 500; }

.mobile-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--c-green); }

/* --- 4. Editorial Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 8rem;
    position: relative;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 2rem;
    flex-wrap: wrap;
    gap: 2rem;
}

.hero h1 {
    font-size: clamp(3.5rem, 8vw, 8rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.hero h1 .italic {
    font-style: italic;
    font-weight: 400;
    color: var(--c-brown);
    display: block;
    padding-left: 10%;
}

.hero-desc {
    max-width: 400px;
    font-size: 1.1rem;
    color: var(--c-ink);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* --- 5. Ticker Marquee --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    background: var(--c-green);
    color: var(--c-paper);
    padding: 1rem 0;
    border-top: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    transform: rotate(-1deg) scale(1.02);
    margin: 4rem 0 6rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.marquee {
    display: flex;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
    font-family: var(--f-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.marquee span { margin: 0 2rem; display: inline-flex; align-items: center; gap: 2rem; }
.marquee i { font-size: 0.6rem; color: var(--c-brown); }

@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* --- 6. Architectural Mission Grid --- */
.section-pad { padding: 8rem 0; }

.mission-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--c-border);
    border-left: 1px solid var(--c-border);
}

.mission-cell {
    padding: 4rem 3rem;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    background: rgba(250, 247, 241, 0.4);
    transition: background 0.4s ease;
    position: relative;
}

.mission-cell:hover { background: var(--c-surface); }

.cell-num {
    font-family: var(--f-mono);
    font-size: 3rem;
    color: rgba(139, 69, 19, 0.15);
    position: absolute;
    top: 1rem;
    right: 2rem;
    line-height: 1;
}

.mission-cell i {
    font-size: 1.5rem;
    color: var(--c-brown);
    margin-bottom: 2rem;
    display: block;
}

.mission-cell h3 { font-size: 2rem; margin-bottom: 1rem; }
.mission-cell p { font-size: 1.1rem; color: #4a4036; }

/* --- 7. Sticky Focus Section --- */
.focus-wrapper {
    display: flex;
    gap: 4rem;
    align-items: flex-start;
}

.focus-left {
    flex: 0 0 40%;
    position: sticky;
    top: 10rem;
}

.focus-left h2 { font-size: clamp(3rem, 5vw, 4.5rem); line-height: 1; margin-bottom: 1.5rem;}

.focus-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.focus-item {
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--c-border);
}

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

/* --- 7b. Products Hero (scoped separately from .hero, the landing hero) --- */
.products-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    padding-bottom: clamp(1.2rem, 2.6vh, 2rem);
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-bottom: 4rem;
}

.products-hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1;
}

.products-hero .tagline {
    font-family: var(--f-serif);
    font-style: italic;
    font-weight: 400;
    color: var(--c-brown);
    font-size: clamp(2.3rem, 2.6vh, 1.7rem);
    margin-top: clamp(0.3rem, 0.8vh, 0.5rem);
}

/* --- 7b. Products Grid --- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--c-border);
    border-left: 1px solid var(--c-border);
}

.product-card {
    padding: 3rem 2.5rem;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
    background: rgba(250, 247, 241, 0.4);
    transition: background 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.product-card:hover { background: var(--c-surface); }

.product-card i.product-icon {
    font-size: 1.5rem;
    color: var(--c-brown);
    margin-bottom: 1.5rem;
    display: block;
}

.product-card h3 { font-size: 1.9rem; margin-bottom: 1rem; }
.product-card p.product-desc { font-size: 1.05rem; color: #4a4036; margin-bottom: 1.5rem; }

.product-card ul { margin-bottom: 1.75rem; }
.product-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    font-size: 0.95rem;
    color: #4a4036;
    margin-bottom: 0.65rem;
}
.product-card ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--c-brown);
    margin-top: 0.5rem;
    flex-shrink: 0;
}

.product-tags { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: auto; }
.product-tag {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--c-border);
    border-radius: 100px;
    color: #4a4036;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.product-tag.coming-soon { opacity: 0.6; }

@media (max-width: 900px) {
    .products-grid { grid-template-columns: 1fr; }
}

.focus-item h3 { font-size: 2.2rem; margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem;}
.focus-item h3 i { font-size: 1.2rem; color: var(--c-brown); }
.focus-item p { font-size: 1.2rem; }

/* --- 8. Directory Resources --- */
.directory-list {
    border-top: 2px solid var(--c-green);
    margin-top: 3rem;
}

.dir-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--c-border);
    transition: all 0.3s var(--ease);
    cursor: pointer;
}

.dir-item:hover {
    padding-left: 2rem;
    padding-right: 2rem;
    background: var(--c-surface);
}

.dir-title { font-family: var(--f-serif); font-size: clamp(2rem, 4vw, 3.5rem); color: var(--c-green); font-weight: 600; transition: color 0.3s ease;}
.dir-item:hover .dir-title { color: var(--c-brown); }

.dir-meta { font-family: var(--f-mono); color: var(--c-ink); width: 30%; font-size: 0.9rem;}

.dir-icon { font-size: 1.5rem; color: var(--c-border); transition: all 0.3s ease; }
.dir-item:hover .dir-icon { color: var(--c-brown); transform: translateX(10px) rotate(-45deg); }


/* --- 9. Team (Editorial Portraits) --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    margin-top: 4rem;
}

.team-member {
    position: relative;
}

.team-img {
    width: 25%;
    aspect-ratio: 4/5;
    object-fit: cover;
    filter: grayscale(100%) sepia(20%) contrast(1.2);
    margin-bottom: 1.5rem;
    border: 1px solid var(--c-border);
    transition: filter 0.5s ease;
}

.team-member:hover .team-img { filter: grayscale(0%); }

.team-info h3 { font-size: 1.8rem; margin-bottom: 0.2rem; }
.team-info span { font-family: var(--f-mono); font-size: 0.85rem; color: var(--c-brown); text-transform: uppercase; }

/* --- 10. Footer --- */
footer {
    background: var(--c-green-dark);
    color: var(--c-paper);
    padding: 6rem 0 2rem;
    margin-top: 6rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-bottom: 4rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4rem;
}

.footer-grid h2 { color: var(--c-paper); font-size: 3rem; margin-bottom: 1rem; }
.footer-grid p { font-style: italic; opacity: 0.8; font-size: 1.2rem;}

.f-links { display: flex; flex-direction: column; gap: 1rem; font-family: var(--f-mono); text-transform: uppercase; font-size: 0.85rem;}
.f-links a { opacity: 0.7; transition: opacity 0.3s; }
.f-links a:hover { opacity: 1; color: var(--c-brown); }

.footer-bottom { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 0.75rem; opacity: 0.5; }

/* --- 11. Mobile / Responsive --- */
@media (max-width: 1024px) {
    .focus-wrapper { flex-direction: column; gap: 2rem; }
    .focus-left { position: static; }
    .dir-meta { display: none; }
}

@media (max-width: 768px) {
    nav { width: 100%; border-radius: 0; justify-content: space-between; padding: 1rem 1.5rem; }
    .nav-wrapper { top: 0; padding: 0; }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--c-paper);
        flex-direction: column;
        padding: 2rem;
        border-bottom: 1px solid var(--c-border);
        align-items: flex-start;
    }
    .nav-links.active { display: flex; }
    .mobile-toggle { display: block; }

    .hero { padding-top: 8rem; }
    .hero-top { flex-direction: column; align-items: flex-start; border-bottom: none; padding-bottom: 0;}

    .section-pad { padding: 4rem 0; margin-left: 1rem;}

    .mission-grid { grid-template-columns: 1fr; border-left: none; border-top: none; margin-left: 1rem;}
    .mission-cell, .focus-item { border-left: 1px solid var(--c-border); border-top: 1px solid var(--c-border); padding: 0.75rem 1rem; width: 100%;}

    footer { padding: 4rem 0 2rem; margin-top: 2rem; }

.footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 2.5rem;
    text-align: center; /* Centers the Tynrai logo and quote */
}

.f-links {
    /* !important overrides the inline HTML styles for mobile */
    align-items: center !important;
    text-align: center !important;
    gap: 1.2rem;
}

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

    .dir-item { padding: 0 2rem; height: 5rem; width: 100%; }


    .dir-item:hover { padding: 0 1rem; height: auto; width: 50%; }
    .btn { width: 100%; justify-content: center; }
}

/* --- Reveal Animation --- */
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s var(--ease); }
.reveal.active { opacity: 1; transform: translateY(0); }
