/* lake.cam — public site. Mobile-first, no framework.
   Light by default; dark is an explicit opt-in via the header toggle (persisted in
   localStorage, applied by an inline head script — see layouts/app.blade.php —
   so there's no flash of the wrong theme on load). */
:root {
    --bg: #f4f8fb;
    --bg-2: #ffffff;
    --card: #ffffff;
    --line: #e2eaf1;
    --line-strong: #cdd9e4;
    --text: #0e1a26;
    --muted: #5a6b7a;
    --accent: #0891b2;
    --accent-2: #0e7490;
    --accent-soft: rgba(8, 145, 178, .1);
    --live: #e11d48;
    --grad-a: #06b6d4;
    --grad-b: #0ea5e9;
    --hero-glow-1: rgba(14, 165, 233, .14);
    --hero-glow-2: rgba(13, 148, 136, .12);
    --scrim: linear-gradient(180deg, rgba(6, 16, 26, 0) 45%, rgba(6, 16, 26, .78) 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 30, 45, .05), 0 8px 24px rgba(15, 30, 45, .06);
    --shadow-lg: 0 2px 4px rgba(15, 30, 45, .06), 0 16px 40px rgba(15, 30, 45, .12);
    --header-bg: rgba(255, 255, 255, .82);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0b131d;
    --bg-2: #121d2a;
    --card: #131f2c;
    --line: #223141;
    --line-strong: #31445a;
    --text: #e8eff6;
    --muted: #8ea1b3;
    --accent: #22d3ee;
    --accent-2: #67e8f9;
    --accent-soft: rgba(34, 211, 238, .12);
    --live: #fb7185;
    --grad-a: #0891b2;
    --grad-b: #0369a1;
    --hero-glow-1: rgba(14, 165, 233, .12);
    --hero-glow-2: rgba(45, 212, 191, .08);
    --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 48px rgba(0, 0, 0, .5);
    --header-bg: rgba(11, 19, 29, .8);
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transition: background-color .2s ease, color .2s ease;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header — utility strip above the brand/nav row ---------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: var(--header-bg);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    border-bottom: 1px solid var(--line);
}
.utility-bar { border-bottom: 1px solid var(--line); }
.utility-inner {
    display: flex; align-items: center; justify-content: flex-start; gap: 12px;
    min-height: 34px; font-size: .8rem; color: var(--muted);
}
.theme-toggle {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: 0;
    color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer; padding: 4px 0;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 14px; height: 14px; }
.icon-moon { display: inline; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: inline; }
.account-link { color: var(--muted); font-size: .8rem; }
.account-link:hover { color: var(--text); text-decoration: none; }
.utility-sep { color: var(--line-strong); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand {
    display: inline-flex; align-items: center; gap: 9px;
    font-weight: 800; font-size: 1.3rem; color: var(--text); letter-spacing: -.02em;
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }
.brand-logo {
    width: 34px; height: 34px; border-radius: 30%; flex: none; display: block;
    background: #fff; border: 1px solid var(--line);
    box-shadow: 0 1px 4px rgba(15, 30, 45, .12);
}
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
    color: var(--muted); font-size: .93rem; font-weight: 550;
    padding: 8px 13px; border-radius: 999px;
}
.site-nav a:hover, .site-nav a.active { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.site-nav a.nav-cta {
    color: #fff; background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    font-weight: 650;
}
.site-nav a.nav-cta:hover { filter: brightness(1.08); color: #fff; }

.main { padding: 26px 20px 64px; }

/* ---------- Hero ---------- */
.hero {
    position: relative; overflow: hidden;
    margin: 6px 0 30px; padding: 44px 34px 40px;
    border: 1px solid var(--line); border-radius: 22px;
    background:
        radial-gradient(52% 90% at 12% 0%, var(--hero-glow-1), transparent 70%),
        radial-gradient(46% 80% at 88% 100%, var(--hero-glow-2), transparent 70%),
        var(--bg-2);
    box-shadow: var(--shadow);
}
.hero-grid { display: flex; align-items: center; justify-content: space-between; gap: 34px; }
.hero-copy { min-width: 0; }
.hero-logo {
    flex: none; width: 208px; height: 208px; display: block;
    background: #fff; border: 1px solid var(--line); border-radius: 32px;
    box-shadow: var(--shadow-lg);
}
@media (max-width: 880px) { .hero-logo { display: none; } }
.hero-kicker {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
    color: var(--accent-2); background: var(--accent-soft);
    padding: 5px 12px; border-radius: 999px; margin: 0 0 14px;
}
.hero-title {
    font-size: clamp(1.9rem, 4.5vw, 2.9rem);
    line-height: 1.12; margin: 0 0 10px; letter-spacing: -.035em; font-weight: 800;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-lead { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.13rem); margin: 0 0 22px; max-width: 640px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 20px; }
@media (max-width: 600px) { .hero { padding: 28px 20px 26px; border-radius: 18px; } }
.hero-stat { display: flex; flex-direction: column; }
.hero-stat b { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .8rem; color: var(--muted); }

.hero-search { position: relative; max-width: 460px; }
.hero-search svg {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.hero-search input {
    width: 100%; padding: 13px 16px 13px 42px; font: inherit; font-size: .98rem;
    color: var(--text); background: var(--bg); border: 1px solid var(--line-strong);
    border-radius: 999px; transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft); background: var(--bg-2);
}

/* ---------- Lake chips ---------- */
.chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 0 20px;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: none; padding: 7px 15px; border-radius: 999px; font-size: .86rem; font-weight: 600;
    color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
    white-space: nowrap;
}
.chip:hover { color: var(--accent-2); border-color: var(--accent); text-decoration: none; }

/* ---------- Featured camera ---------- */
.featured { position: relative; display: block; margin-bottom: 34px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
.featured .thumb { aspect-ratio: 16 / 7; }
@media (max-width: 700px) { .featured .thumb { aspect-ratio: 16 / 9; } }
.featured .thumb::after { content: ""; position: absolute; inset: 0; background: var(--scrim); }
.feat-meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 22px 24px; color: #fff; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.feat-name { font-size: clamp(1.25rem, 3vw, 1.7rem); font-weight: 800; letter-spacing: -.02em; margin: 0; text-shadow: 0 1px 8px rgba(0,0,0,.5); }
.feat-lake { display: block; font-size: .92rem; opacity: .85; margin-top: 2px; }
.feat-label { position: absolute; top: 14px; right: 14px; z-index: 2; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(8, 20, 32, .6); backdrop-filter: blur(6px); padding: 5px 11px; border-radius: 999px; }
.play-badge {
    flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
    color: #fff; background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    box-shadow: 0 4px 18px rgba(0, 0, 0, .35); transition: transform .15s ease;
}
.play-badge svg { width: 20px; height: 20px; margin-left: 3px; }
.featured:hover .play-badge { transform: scale(1.08); }
.featured:hover { text-decoration: none; }
.featured:hover .thumb img { transform: scale(1.03); }

/* ---------- Camera grid ---------- */
.lake-group { margin-bottom: 38px; scroll-margin-top: 120px; }
.lake-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.lake-name {
    font-size: 1.05rem; font-weight: 750; letter-spacing: -.01em; color: var(--text); margin: 0;
}
.lake-count { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.cam-card {
    position: relative; display: block; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
    color: var(--text); box-shadow: var(--shadow);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.cam-card:hover {
    transform: translateY(-3px); border-color: var(--accent);
    box-shadow: var(--shadow-lg); text-decoration: none;
}
.thumb {
    aspect-ratio: 16 / 9; position: relative; overflow: hidden;
    background: linear-gradient(120deg, #0c1c29, #12303f);
}
.thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .35s ease;
}
.cam-card:hover .thumb img { transform: scale(1.05); }
.cam-meta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.cam-text { display: flex; flex-direction: column; min-width: 0; }
.cam-name { font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cam-lake { color: var(--muted); font-size: .84rem; display: inline-flex; align-items: center; gap: 4px; }
.cam-lake svg { width: 11px; height: 11px; flex: none; }
.cam-go { margin-left: auto; color: var(--muted); flex: none; transition: transform .16s ease, color .16s ease; }
.cam-go svg { width: 16px; height: 16px; display: block; }
.cam-card:hover .cam-go { color: var(--accent); transform: translateX(3px); }

.live-pill {
    position: absolute; top: 10px; left: 10px; z-index: 2;
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(10, 18, 28, .68); backdrop-filter: blur(6px);
    color: #fff; font-size: .67rem; font-weight: 700;
    letter-spacing: .06em; padding: 4px 9px 4px 7px; border-radius: 999px;
}
.live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--live);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, .3); animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

.no-results { display: none; color: var(--muted); padding: 30px 0; text-align: center; }
.page-title { font-size: 1.55rem; margin: 6px 0 4px; letter-spacing: -.025em; font-weight: 750; }
.lead { color: var(--muted); margin: 0 0 24px; }
.empty { color: var(--muted); }

/* ---------- Camera page ---------- */
.breadcrumb { margin: 0 0 12px; font-size: .88rem; }
.breadcrumb a { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.breadcrumb a:hover { color: var(--accent-2); text-decoration: none; }
.cam-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.cam-head .page-title { margin: 0; }
.cam-sub { color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.cam-sub svg { width: 13px; height: 13px; }
.live-inline {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; color: var(--live);
    border: 1px solid currentColor; padding: 3px 9px 3px 7px; border-radius: 999px;
}
.cam-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
    color: var(--text); background: var(--bg-2); border: 1px solid var(--line);
    padding: 7px 13px; border-radius: 999px; transition: border-color .15s ease, color .15s ease;
}
.btn-chip:hover { border-color: var(--accent); color: var(--accent-2); text-decoration: none; }
.btn-chip svg { width: 13px; height: 13px; }

.player {
    position: relative; margin: 14px 0 18px; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line); background: #000; box-shadow: var(--shadow-lg);
}
.player video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; }
.player-status {
    position: absolute; left: 12px; bottom: 12px; font-size: .85rem; padding: 6px 12px;
    border-radius: 999px; background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); color: #fff;
}
.player-status:empty { display: none; }
.player-status.connecting { color: #fde68a; }
.player-status.error { color: #fca5a5; }

.cam-body { display: grid; gap: 18px; max-width: 780px; }
.cam-desc { color: var(--text); margin: 0; }
.timelapse { margin-top: 34px; }
.timelapse h2 { font-size: 1.15rem; letter-spacing: -.015em; margin: 0 0 4px; }
.timelapse .lead { margin-bottom: 14px; font-size: .92rem; }
.tl-bar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.tl-bar label { font-size: .88rem; font-weight: 600; color: var(--muted); }
.tl-bar select {
    font: inherit; font-size: .92rem; color: var(--text); background: var(--bg-2);
    border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 14px;
    max-width: 320px;
}
.tl-bar select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.timelapse video {
    width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
    background: #000; box-shadow: var(--shadow); display: block;
}

/* ---------- Forms ---------- */
.form, .form-narrow { max-width: 580px; display: grid; gap: 16px; margin-top: 8px; }
.form label, .form-narrow label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--text); }
.form label em { color: var(--muted); font-style: normal; font-weight: 400; }
.form input, .form textarea, .form-narrow input {
    width: 100%; padding: 12px 14px; font: inherit; font-weight: 400; color: var(--text);
    background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form textarea:focus, .form-narrow input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.guidance {
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: var(--radius-sm); padding: 13px 15px; font-size: .9rem; color: var(--text);
}
.btn, button.btn {
    justify-self: start; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 24px; font: inherit; font-size: .95rem; font-weight: 650; cursor: pointer;
    color: #fff; background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
    border: 0; border-radius: var(--radius-sm); text-align: center;
    box-shadow: 0 2px 10px rgba(8, 145, 178, .3);
    transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.07); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-block { display: flex; width: 100%; }
.btn-ghost { background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-2); filter: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; justify-self: stretch; }
.divider { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--muted); font-size: .78rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.flash { padding: 12px 15px; border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .93rem; }
.flash-ok { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.flash-err { background: rgba(225, 29, 72, .08); border: 1px solid rgba(225, 29, 72, .4); }
.flash-err ul { margin: 0; padding-left: 18px; }

/* ---------- Auth card ---------- */
.auth-wrap { max-width: 400px; margin: 5vh auto 0; }
.auth-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 18px;
    padding: 30px; box-shadow: var(--shadow-lg);
}
.auth-card h1 { font-size: 1.35rem; margin: 0 0 4px; letter-spacing: -.02em; }
.auth-card .lead { margin-bottom: 20px; font-size: .92rem; }
.btn-google {
    background: var(--bg-2); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none;
}
.btn-google:hover { border-color: var(--accent); filter: none; }
.btn-google svg { width: 17px; height: 17px; flex: none; }

/* ---------- Static content pages ---------- */
.prose { max-width: 720px; }
.prose h2 { font-size: 1.15rem; margin: 28px 0 8px; letter-spacing: -.015em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: var(--text); }
.prose ul { padding-left: 20px; }
.prose .updated { color: var(--muted); font-size: .85rem; margin-top: -4px; }

/* ---------- Map page ---------- */
.map-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 6px 0 16px; }
.map-search { min-width: 260px; flex: 1; max-width: 380px; }
.lake-map {
    height: min(68vh, 680px); min-height: 380px;
    border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); z-index: 1;
}
.hint-line { color: var(--muted); font-size: .85rem; margin: 10px 0 0; }
:root[data-theme="dark"] .leaflet-tile { filter: brightness(.7) contrast(1.05) saturate(.85); }
:root[data-theme="dark"] .leaflet-container { background: #0b131d; }

.cam-dot {
    display: block; width: 16px; height: 16px; border-radius: 50%;
    background: #64748b; border: 2.5px solid #fff;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, .35), 0 1px 4px rgba(0, 0, 0, .4);
    transition: box-shadow .3s ease, background-color .3s ease;
}
.cam-dot.online {
    background: #16a34a;
    box-shadow: 0 0 0 5px rgba(22, 163, 74, .35), 0 0 14px 4px rgba(22, 163, 74, .55);
}
.cam-dot.offline {
    background: #dc2626;
    box-shadow: 0 0 0 5px rgba(220, 38, 38, .35), 0 0 14px 4px rgba(220, 38, 38, .5);
}

.map-tooltip { border: 0 !important; background: var(--card) !important; color: var(--text) !important; border-radius: 12px !important; box-shadow: var(--shadow-lg) !important; padding: 0 !important; overflow: hidden; }
.map-tooltip::before { display: none; }
.map-tip { display: flex; flex-direction: column; width: 220px; }
.map-tip img { width: 220px; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.map-tip b { padding: 8px 12px 0; font-size: .92rem; }
.map-tip span { padding: 0 12px 10px; color: var(--muted); font-size: .8rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); padding: 34px 0 30px; margin-top: 20px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 24px; }
.footer-brand { display: flex; flex-direction: column; gap: 6px; max-width: 320px; }
.footer-brand .brand { font-size: 1.1rem; }
.footer-tag { color: var(--muted); font-size: .85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--muted); font-size: .88rem; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
