/* ==========================================================================
   Understory Labs — Design System
   ========================================================================== */

/* --- Custom Properties -------------------------------------------------- */

:root {
    color-scheme: light dark;

    /* Typography */
    --font-display: 'Indie Flower', cursive;
    --font-body: 'Inter', sans-serif;

    /* Light mode colors */
    --color-bg: #FDFCF8;
    --color-bg-transparent: rgba(253, 252, 248, 0);
    --color-text: #3A3A2E;
    --color-heading: #31310C;
    --color-text-muted: #6B6B5A;
    --color-border: #E8E6DE;
    --color-card-bg: #F7F6F0;
    --color-link: #56B6E9;
    --color-link-hover: #3A9AD4;

    /* Brand */
    --color-gold: #FFC03C;
    --color-sky: #95CFE3;
    --color-blue: #56B6E9;
    --color-olive: #9A9924;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1A1A16;
        --color-bg-transparent: rgba(26, 26, 22, 0);
        --color-text: #D4D4C8;
        --color-heading: #CAC021;
        --color-text-muted: #9A9A8A;
        --color-border: #333328;
        --color-card-bg: #222218;
        --color-link: #95CFE3;
        --color-link-hover: #B5DFF0;
    }
}

/* --- Reset / Base ------------------------------------------------------- */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-link-hover);
}

/* --- Typography --------------------------------------------------------- */

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-heading);
    line-height: 1.2;
    margin: 0 0 var(--space-sm);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

p {
    margin: 0 0 var(--space-sm);
}

/* --- Layout ------------------------------------------------------------- */

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* --- Hero --------------------------------------------------------------- */

.hero {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-lg);
}

.hero-logomark {
    width: 120px;
    margin: 0 auto var(--space-md);
}

.hero h1 {
    margin-bottom: var(--space-xs);
}

.hero-tagline {
    font-family: var(--font-display);
    font-size: 1.375rem;
    color: var(--color-text);
    margin: 0;
}

/* --- Sections ----------------------------------------------------------- */

.section {
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--color-border);
}

.section p {
    max-width: 580px;
}

/* --- Product Cards ------------------------------------------------------ */

.products {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.product-card {
    padding: var(--space-md);
    background: var(--color-card-bg);
    border-radius: 12px;
    border: 1px solid var(--color-border);
}

.product-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.product-card p {
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}

.product-card .product-link {
    font-size: 0.9375rem;
    font-weight: 500;
}

.product-card .product-link::after {
    content: ' \2192';
}

.section-aside {
    margin-top: var(--space-md);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.section-aside a {
    color: var(--color-text-muted);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
    text-underline-offset: 0.2em;
}

.section-aside a:hover {
    color: var(--color-link);
    text-decoration-color: var(--color-link);
}

.badge-coming-soon {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gold);
    border: 1px solid var(--color-gold);
    border-radius: 4px;
    padding: 0.15em 0.5em;
    margin-left: 0.5em;
    vertical-align: middle;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
    padding: var(--space-lg) 0 var(--space-md);
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.site-footer a {
    color: var(--color-text-muted);
}

.site-footer a:hover {
    color: var(--color-link);
}

.footer-contact {
    font-size: 1rem;
    margin-bottom: var(--space-md);
}

.footer-contact a {
    color: var(--color-link);
}

.footer-meta {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.footer-meta span {
    white-space: nowrap;
}

/* --- Nav ---------------------------------------------------------------- */

.site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    max-width: 960px;
    margin: 0 auto;
    font-size: 0.875rem;
}

.site-nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-heading);
    text-decoration: none;
    font-family: var(--font-display);
    font-size: 1.05rem;
    transition: opacity 0.15s ease;
}

.site-nav-brand:hover {
    opacity: 0.7;
    color: var(--color-heading);
}

.site-nav-brand img {
    width: 28px;
    height: auto;
}

.site-nav-links {
    display: flex;
    gap: var(--space-sm);
}

.site-nav-links a {
    color: var(--color-text-muted);
}

.site-nav-links a:hover {
    color: var(--color-link);
}

/* --- Page content (about, privacy) -------------------------------------- */

.page-content {
    padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.page-content h1 {
    margin-bottom: var(--space-md);
}

.page-content p {
    max-width: 580px;
}

/* --- Page content (continued after photo break) ------------------------- */

.page-content-continued {
    padding-top: var(--space-lg);
}

/* --- Photo break (full-bleed + scroll reveal + gradient fade) ----------- */

.photo-break {
    position: relative;
    width: 100%;
    overflow: hidden;
    height: 70vh;
    min-height: 400px;
    max-height: 700px;
}

.photo-break img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    display: block;
}

/* Gradient fade: top and bottom edges melt into page background */
.photo-break::before,
.photo-break::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 1;
    pointer-events: none;
}

.photo-break::before {
    top: 0;
    background: linear-gradient(to bottom, var(--color-bg), var(--color-bg-transparent));
}

.photo-break::after {
    bottom: 0;
    background: linear-gradient(to top, var(--color-bg), var(--color-bg-transparent));
}

/* Scroll-driven reveal: fade in + slight scale as it enters viewport */
@supports (animation-timeline: view()) {
    .photo-break img {
        opacity: 0;
        scale: 1.04;
        animation: photoReveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 60%;
    }

    @keyframes photoReveal {
        from {
            opacity: 0;
            scale: 1.04;
        }
        to {
            opacity: 1;
            scale: 1;
        }
    }
}

/* Dark mode: soften the image */
@media (prefers-color-scheme: dark) {
    .photo-break img {
        filter: brightness(0.85);
    }
}

/* Reduce motion: disable scroll animation */
@media (prefers-reduced-motion: reduce) {
    .photo-break img {
        opacity: 1 !important;
        scale: 1 !important;
        animation: none !important;
    }
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .hero {
        padding: var(--space-lg) 0 var(--space-md);
    }

    .hero-logomark {
        width: 100px;
    }

    .section {
        padding: var(--space-md) 0;
    }

    .photo-break {
        height: 50vh;
        min-height: 280px;
    }

    .photo-break::before,
    .photo-break::after {
        height: 80px;
    }
}
