/* ══════════════════════════════════════════════
   I SPY SUN — HOMEPAGE STYLESHEET (styleh.css)
   ══════════════════════════════════════════════ */

:root {
    --bg-main: #f0f4f8;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --primary: #0284c7;
    --primary-light: #e0f2fe;
    --border: #cbd5e1;
    --safe-green: #059669;
    --warn-amber: #d97706;
    --alert-red: #dc2626;
    --font-hd: 'Orbitron', sans-serif;
    --font-body: 'Exo 2', sans-serif;
}

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

/* Force mobile browsers to respect horizontal limits */
html, body {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100vw;
    max-width: 100%;
}

body {
    background: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 400;
    position: relative;
    min-height: 100vh;
}

/* ── HEADER NAV ── */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 65px;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-logo { font-family: var(--font-hd); font-size: 20px; font-weight: 800; color: var(--primary); letter-spacing: 3px; text-decoration: none; }
.nav-logo span { color: var(--text-main); }
.nav-links { display: flex; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; transition: color 0.2s; }
.nav-links a:hover { color: var(--primary); }

/* ── HERO ── */
.hero {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 24px 40px;
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
    width: 100%;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    width: 100%;
}

.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: white; border: 1px solid var(--primary); border-radius: 30px;
    padding: 8px 20px; font-family: var(--font-hd); font-size: 11px;
    letter-spacing: 2px; color: var(--primary); margin-bottom: 28px;
    box-shadow: 0 4px 6px rgba(2, 132, 199, 0.1);
}
.hero-badge::before {
    content: ''; width: 8px; height: 8px; background: var(--safe-green);
    border-radius: 50%; animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

.hero h1 { font-family: var(--font-hd); font-size: clamp(32px, 6vw, 64px); font-weight: 900; line-height: 1.1; letter-spacing: -1px; color: var(--text-main); margin-bottom: 15px; }
.hero h1 .cyan { color: var(--primary); }
.hero-sub { font-size: clamp(16px, 2vw, 20px); color: var(--text-muted); font-weight: 500; margin-bottom: 48px; max-width: 700px; margin-left: auto; margin-right: auto; }

/* ── LIVE STATS BAR ── */
.stats-bar {
    display: flex; gap: 0; background: white; border: 1px solid var(--border);
    border-radius: 6px; overflow: hidden; margin-bottom: 56px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
}
.stat-item { flex: 1; padding: 20px 24px; text-align: center; border-right: 1px solid var(--border); }
.stat-item:last-child { border-right: none; }
.stat-num { font-family: var(--font-hd); font-size: 26px; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; color: var(--text-muted); }
.stat-item.green .stat-num { color: var(--safe-green); }
.stat-item.amber .stat-num { color: var(--warn-amber); }

/* ── WARNING TICKER ── */
.warning-banner {
    width: 100%; max-width: 900px;
    border: 1px solid #fca5a5; border-radius: 4px;
    background: #fef2f2; display: flex; align-items: center;
    gap: 16px; padding: 12px 20px; margin-bottom: 30px;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.1);
    box-sizing: border-box;
}
.warning-label { font-family: var(--font-hd); font-size: 11px; font-weight: 800; letter-spacing: 1px; color: var(--alert-red); white-space: nowrap; padding: 6px 12px; border: 2px solid var(--alert-red); border-radius: 4px; background: white; flex-shrink: 0; }

/* min-width: 0 fixes the Flexbox blowout */
.warning-text { font-size: 14px; font-weight: 500; color: #991b1b; overflow: hidden; white-space: nowrap; flex: 1; min-width: 0; }

.warning-ticker { display: inline-block; animation: ticker 140s linear infinite; }
@keyframes ticker { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* ── SECTION BASE ── */
section { padding: 80px 24px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }
.section-label { font-family: var(--font-hd); font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--primary); text-transform: uppercase; margin-bottom: 12px; }
.section-title { font-family: var(--font-hd); font-size: clamp(26px, 4vw, 42px); font-weight: 800; color: var(--text-main); line-height: 1.15; margin-bottom: 48px; }

/* ── HERO MAP ── */
.map-container { position: relative; width: 100%; max-width: 960px; margin: 0 auto; }
.map-frame { border: 1px solid var(--border); background: white; padding: 0; border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); overflow: hidden; }
#hero-map { width: 100%; height: 480px; }
.map-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; padding: 16px 20px; border-top: 1px solid var(--border); background: white; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.legend-name { font-family: var(--font-hd); font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--text-main); }
.legend-count { font-size: 11px; color: var(--text-muted); font-weight: 500; margin-left: 2px; }

/* ── MAP CALLOUTS ── */
.callout-wrapper { position: relative; pointer-events: none; }
.callout-dot { position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; background: var(--primary); border-radius: 50%; box-shadow: 0 0 8px var(--primary); }
.callout-line { position: absolute; height: 2px; background: var(--primary); }
.callout-text { position: absolute; background: white; border: 2px solid var(--primary); color: var(--primary); font-family: var(--font-hd); font-size: 10px; font-weight: 700; padding: 4px 8px; white-space: nowrap; letter-spacing: 1px; box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2); border-radius: 4px; }
.dir-ur .callout-line { left: 4px; top: 0px; width: 40px; transform-origin: left center; transform: rotate(-35deg); }
.dir-ur .callout-text { left: 34px; top: -34px; }
.dir-ul .callout-line { left: -2px; top: -2px; width: 40px; transform-origin: left center; transform: rotate(215deg); }
.dir-ul .callout-text { right: 35px; top: -34px; }
.dir-dr .callout-line { left: 2px; top: 2px; width: 40px; transform-origin: left center; transform: rotate(35deg); }
.dir-dr .callout-text { left: 34px; top: 12px; }
.dir-dl .callout-line { left: -2px; top: 2px; width: 40px; transform-origin: left center; transform: rotate(145deg); }
.dir-dl .callout-text { right: 35px; top: 12px; }

/* ── DATA GRID ── */
.data-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 15px; margin-bottom: 64px; }
.data-card { background: white; padding: 24px 20px; border-radius: 6px; border: 1px solid var(--border); box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: transform 0.2s, box-shadow 0.2s; }
.data-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: var(--primary); }
.data-icon { font-size: 32px; margin-bottom: 12px; display: block; }
.data-name { font-family: var(--font-hd); font-size: 13px; font-weight: 700; color: var(--primary); text-transform: uppercase; margin-bottom: 8px; }
.data-desc { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

/* ── WARNING CALLOUT ── */
.warning-callout {
    border: 2px solid var(--alert-red); border-radius: 6px;
    background: #fef2f2; padding: 40px;
    display: grid; grid-template-columns: auto 1fr;
    gap: 32px; align-items: center;
    margin-bottom: 80px;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.1);
}
.warning-icon-big { font-size: 64px; line-height: 1; }
.warning-callout h3 { font-family: var(--font-hd); font-size: 20px; font-weight: 800; color: #991b1b; margin-bottom: 10px; letter-spacing: 1px; }
.warning-callout p { font-size: 16px; color: var(--text-main); line-height: 1.7; font-weight: 500; }
.warnings-link-btn {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 20px;
    background: var(--alert-red); color: white;
    font-family: var(--font-hd); font-size: 11px; font-weight: 700;
    letter-spacing: 1.5px; padding: 12px 24px; border-radius: 4px;
    text-decoration: none; text-transform: uppercase;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 4px 12px rgba(220,38,38,0.25);
}
.warnings-link-btn:hover { background: #b91c1c; transform: translateY(-1px); }

/* ── SUN SECTION ── */
.sun-section { background: white; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 80px 24px; box-shadow: 0 10px 30px rgba(0,0,0,0.02); width: 100%; box-sizing: border-box; }
.sun-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.sun-info p { font-size: 16px; line-height: 1.7; color: var(--text-muted); margin-bottom: 16px; font-weight: 500; }
.use-case { display: flex; align-items: flex-start; gap: 15px; padding: 15px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-main); margin-bottom: 10px; }
.use-case-icon { font-size: 24px; }
.use-case-text { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.use-case-text strong { display: block; color: var(--text-main); font-size: 13px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.sun-widget { background: var(--bg-main); border: 1px solid var(--border); border-radius: 6px; padding: 30px; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
.sun-widget-header { font-family: var(--font-hd); font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--primary); margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.sun-widget-header a { color: var(--alert-red); text-decoration: none; font-weight: 800; transition: color 0.2s; }
.sun-widget-header a:hover { color: var(--primary); text-decoration: underline; }
#sun-map { width: 100%; height: 320px; border: 1px solid var(--border); margin-bottom: 20px; border-radius: 4px; }
.sun-controls { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-bottom: 20px; }
.sun-controls input[type="range"] { width: 100%; accent-color: var(--primary); cursor: pointer; }
.sun-btn { font-family: var(--font-hd); font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 10px 20px; border: none; border-radius: 4px; background: var(--primary); color: white; cursor: pointer; text-transform: uppercase; transition: background 0.2s; white-space: nowrap; }
.sun-btn:hover { background: var(--primary-light); color: var(--primary); }
.sun-readout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sun-data { background: white; border: 1px solid var(--border); padding: 15px; border-radius: 4px; text-align: center; }
.sun-data-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
.sun-data-val { font-family: var(--font-hd); font-size: 18px; color: var(--primary); font-weight: 800; }
.sun-time-display { font-family: var(--font-hd); font-size: 16px; font-weight: 800; color: var(--text-main); text-align: center; margin-bottom: 10px; }

/* ── LOCATIONS ── */
.region-block { margin-bottom: 20px; background: white; border: 1px solid var(--border); border-radius: 8px; padding: 25px; box-shadow: 0 4px 10px rgba(0,0,0,0.02); }
a.region-link-block { display: block; text-decoration: none; color: inherit; transition: all 0.2s; }
a.region-link-block:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 10px 25px rgba(2, 132, 199, 0.15); }
a.region-link-block .region-header { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
a.region-link-block:hover .region-name { color: var(--primary); }
.region-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--bg-main); }
.region-name { font-family: var(--font-hd); font-size: 18px; font-weight: 800; letter-spacing: 1px; color: var(--text-main); text-transform: uppercase; transition: color 0.2s; }
.region-count { font-size: 13px; font-weight: 500; color: var(--text-muted); }

/* ── FOOTER ── */
footer { border-top: 1px solid var(--border); background: white; padding: 40px 32px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 500; color: var(--text-muted); }
footer a { color: var(--primary); text-decoration: none; font-weight: 600; }
footer a:hover { text-decoration: underline; }

/* ── HAMBURGER ── */
.nav-hamburger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 5px; }
.nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--text-main); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── TABLET ── */
@media (max-width: 1024px) {
    .sun-inner { grid-template-columns: 1fr; }
    #hero-map { height: 380px; }
    .warning-callout { padding: 30px; gap: 24px; }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
    nav { padding: 0 16px; }
    .nav-hamburger { display: flex; }
    .nav-links { display: none; position: absolute; top: 65px; left: 0; right: 0; flex-direction: column; background: rgba(255,255,255,0.98); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 0; box-shadow: 0 8px 20px rgba(0,0,0,0.08); }
    .nav-links.open { display: flex; }
    .nav-links li { padding: 12px 0; border-bottom: 1px solid var(--border); }
    .nav-links li:last-child { border-bottom: none; }
    .nav-links a { font-size: 14px; }
    .hero { min-height: auto; padding: 85px 16px 32px; }
    .hero h1 { font-size: clamp(26px, 7vw, 42px); }
    .hero-badge { font-size: 9px; padding: 6px 14px; letter-spacing: 1.5px; }
    .hero-sub { font-size: 15px; margin-bottom: 32px; }

    /* Stats Bar wrap gracefully */
    .stats-bar { flex-wrap: wrap; width: 100%; box-sizing: border-box; }
    .stat-item { min-width: 48%; flex: 1 1 48%; border-right: none; border-bottom: 1px solid var(--border); }
    .stat-item:nth-child(odd) { border-right: 1px solid var(--border); }
    .stat-item:nth-last-child(-n+2) { border-bottom: none; }
    .stat-num { font-size: 22px; }

    /* Ticker stacked for mobile */
    .warning-banner { flex-direction: column; align-items: flex-start; padding: 12px 16px; width: 100%; box-sizing: border-box; }
    .warning-label { font-size: 10px; padding: 4px 8px; }
    .warning-text { width: 100%; min-width: 0; }

    #hero-map { height: 280px; }
    .map-legend { gap: 6px 16px; padding: 12px 14px; }
    .legend-name { font-size: 10px; }
    .legend-count { font-size: 10px; }
    section { padding: 48px 16px; width: 100%; box-sizing: border-box; }
    .section-title { font-size: clamp(22px, 5vw, 32px); margin-bottom: 32px; }
    .data-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .data-card { padding: 18px 14px; }
    .data-icon { font-size: 26px; margin-bottom: 8px; }
    .data-name { font-size: 11px; }
    .data-desc { font-size: 13px; }
    .warning-callout { grid-template-columns: 1fr; padding: 24px; gap: 16px; text-align: center; }
    .warning-icon-big { font-size: 48px; }
    .warning-callout h3 { font-size: 16px; }
    .warning-callout p { font-size: 14px; }
    .sun-section { padding: 48px 16px; width: 100%; box-sizing: border-box; }
    .sun-inner { grid-template-columns: 1fr; gap: 32px; }
    .sun-widget { padding: 20px; }
    .sun-widget-header { font-size: 9px; letter-spacing: 1px; word-break: break-word; white-space: normal; line-height: 1.6; }
    #sun-map { height: 260px; }
    .sun-readout { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .sun-data { padding: 10px 6px; }
    .sun-data-val { font-size: 15px; }
    .sun-data-label { font-size: 9px; }
    .sun-controls { grid-template-columns: 1fr auto auto; gap: 8px; }
    .sun-btn { padding: 10px 14px; font-size: 10px; }
    .region-block { padding: 18px; }
    .region-header { flex-direction: column; align-items: flex-start; gap: 6px; }
    .region-name { font-size: 16px; }
    .region-count { font-size: 12px; line-height: 1.4; }
    footer { flex-direction: column; gap: 16px; text-align: center; padding: 32px 16px; font-size: 12px; }
    .warnings-link-btn { font-size: 10px; padding: 10px 18px; }
}

/* ── SMALL PHONE ── */
@media (max-width: 420px) {
    .hero h1 { font-size: 24px; }
    .stats-bar { flex-direction: column; }
    .stat-item { min-width: 100%; border-right: none !important; border-bottom: 1px solid var(--border); }
    .stat-item:last-child { border-bottom: none; }
    .data-grid { grid-template-columns: 1fr; }
    .sun-readout { grid-template-columns: repeat(2, 1fr); }
    .sun-readout .sun-data:last-child { grid-column: span 2; }
    #hero-map { height: 220px; }
}
