/* ==========================================================================
   PolarWx — site-wide stylesheet
   Theming: every color comes from a variable below. Pages and future
   sections should use these variables rather than hard-coded colors so
   light/dark mode works everywhere for free.
   ========================================================================== */

/* Figtree variable font, self-hosted (weights 300-900) */
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Figtree';
    font-style: normal;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-0303, U+0305-0307, U+0309-0327, U+032A-0FFF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Figtree';
    font-style: italic;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-italic-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Figtree';
    font-style: italic;
    font-weight: 300 900;
    font-display: swap;
    src: url('../fonts/figtree-italic-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0300-0303, U+0305-0307, U+0309-0327, U+032A-0FFF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f6f8fb;
    --bg-card: #ffffff;
    --bg-header: rgba(255, 255, 255, 0.85);
    --text: #1e2733;
    --text-muted: #5b6b7d;
    --accent: #1668c7;
    --accent-hover: #0f549f;
    --accent-soft: #e3eefb;
    --border: #dbe3ec;
    --shadow: 0 1px 3px rgba(16, 34, 56, 0.08), 0 4px 16px rgba(16, 34, 56, 0.06);
    --hero-gradient: linear-gradient(135deg, #e8f1fb 0%, #f6f8fb 60%);
}

[data-theme="dark"] {
    --bg: #0e141c;
    --bg-card: #171f2a;
    --bg-header: rgba(14, 20, 28, 0.85);
    --text: #e4ebf3;
    --text-muted: #94a3b8;
    --accent: #5aa2ee;
    --accent-hover: #82b9f3;
    --accent-soft: #1c2c40;
    --border: #263344;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
    --hero-gradient: linear-gradient(135deg, #13202f 0%, #0e141c 60%);
}

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

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

/* The site was designed/reviewed at 90% browser zoom; scale the root so
   100% zoom matches that look (rem-based sizes all follow). */
html {
    scroll-behavior: smooth;
    font-size: 90%;
    /* Stop iOS Safari from inflating text when the viewport width jumps
       (e.g. portrait <-> landscape) — keeps font sizes stable. */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.25s ease, color 0.25s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* --- Header --------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    padding: 0 1.25rem;
    height: 54px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}
.brand:hover { color: var(--accent); }
.brand:hover .brand-page { color: var(--text-muted); }
.brand-icon { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.brand-name { font-weight: 700; }
.brand-page {
    display: none;
    font-weight: 400;
    font-size: 0.7rem;
    letter-spacing: 0;
    color: var(--text-muted);
    opacity: 0.75;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.nav-link {
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 0.4rem; }

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* Theme toggle shows the icon of the mode you'd switch to */
.icon-moon { display: none; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

.menu-btn { display: none; }

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

.site-main { flex: 1; width: 100%; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-narrow {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.container-wide {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

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

.hero {
    background:
        url('../img/tpv.png') center / cover no-repeat,
        var(--hero-gradient);
    border-bottom: 1px solid var(--border);
    padding: 4.5rem 0 4rem;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.hero .subtitle {
    font-size: 1.28rem;
    color: color-mix(in srgb, var(--text-muted) 45%, var(--text));
    max-width: 620px;
    margin: 0 auto;
}

.btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    margin-left: 0.5rem;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* --- Cards / sections ------------------------------------------------------ */

.section { padding: 3.5rem 0; }

.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.4rem;
}

.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
a.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 4px 8px rgba(16, 34, 56, 0.10), 0 12px 32px rgba(16, 34, 56, 0.14);
}

/* Full-opacity image band on top, fading softly into the card body. */
.card-media {
    height: 200px;
    background: var(--card-bg-img) center / cover no-repeat;
    transition: transform 0.35s ease;
}
.card-media::after {
    content: "";
    display: block;
    height: 100%;
    background: linear-gradient(to bottom, transparent 55%, var(--bg-card));
}
/* Dark mode: dim the image band (~0.6 effective opacity) so it doesn't glare. */
[data-theme="dark"] .card-media::after {
    background: linear-gradient(to bottom,
        rgba(23, 31, 42, 0.4) 0%,
        rgba(23, 31, 42, 0.4) 55%,
        var(--bg-card) 100%);
}
a.card:hover .card-media { transform: scale(1.05); }

/* Keep the zoomed image clipped inside the rounded card. */
.card { position: relative; }
.card-media { position: relative; z-index: 0; }
.card-body { position: relative; z-index: 1; padding: 0.75rem 2rem 2.25rem; }

.card-tropics  { --card-bg-img: url('../img/melissa.jpg'); }
.card-models   { --card-bg-img: url('../img/models.png'); }
.card-products { --card-bg-img: url('../img/snow.png'); }

.card h3 { font-size: 1.35rem; margin-bottom: 0.45rem; }
.card p { color: var(--text-muted); font-size: 1.05rem; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* --- Prose (about page & other text-heavy pages) --------------------------- */

/* --- About page ----------------------------------------------------------- */

/* Image floats left; text wraps beside it, then widens below its bottom edge. */
.about-body { margin-top: 1rem; }

.about-photo {
    float: left;
    width: min(420px, 46%);
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin: 0.4rem 2.25rem 1.25rem 0;
}

@media (max-width: 800px) {
    .about-photo {
        float: none;
        width: 100%;
        max-width: 520px;
        margin: 0 0 1.5rem;
    }
}

.about-contact {
    clear: both;
    border-top: 1px solid var(--border);
    margin-top: 2.5rem;
    padding-top: 0.5rem;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 2.5rem;
}
.prose .contact-list { margin: 0; }
.contact-list li { margin: 0; font-size: 1.05rem; color: var(--text-muted); }

/* Vertical only — must not clobber .container's horizontal padding. */
.prose { padding-top: 3rem; padding-bottom: 3rem; }
.prose h1 { font-size: 2.2rem; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.prose .lead { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 2rem; }
.prose h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; letter-spacing: -0.02em; }
.prose p { font-size: 1.1rem; margin-bottom: 1rem; }
.prose ul { margin: 0 0 1rem 1.4rem; }
.prose li { margin-bottom: 0.4rem; }

/* Author byline: name with its credentials tight beneath it. */
.prose .byline-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}
.prose .byline-meta {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- Placeholder (coming-soon sections) ------------------------------------ */

.placeholder {
    text-align: center;
    padding: 6rem 1.25rem;
}
.placeholder h1 { font-size: 2rem; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
.placeholder p { color: var(--text-muted); max-width: 480px; margin: 0 auto 1.5rem; }

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

.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.footer-nav { display: flex; gap: 1.25rem; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }

/* --- Mobile ------------------------------------------------------------------ */

@media (max-width: 720px) {
    .menu-btn { display: flex; }
    /* theme + hamburger pinned to the viewport's right edge */
    .header-actions { margin-left: auto; }
    /* PolarWx shifts up; a light page title sits beneath it */
    .brand { font-size: 1.05rem; }
    .brand-page { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 54px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem 1.25rem;
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    .nav-link { padding: 0.7rem 0.85rem; }

    .hero { padding: 3rem 0 2.75rem; }
    .btn-secondary { margin-left: 0; margin-top: 0.5rem; }
}
