/* ============ UFO Intel — alien theme, mobile-first, WCAG-AA ============ */
:root {
  --bg: #05070d;
  --bg-2: #0b0f1a;
  --panel: rgba(13, 18, 30, .88);
  --panel-solid: #0d121e;
  --ink: #eaf1ff;
  --muted: #99a6c6;
  --accent: #5dff9b;      /* alien green */
  --accent-2: #36e0ff;    /* cyan */
  --alert: #ff3b6b;       /* urgency / report */
  --alert-ink: #fff;
  --line: rgba(120, 140, 180, .18);
  --radius: 14px;
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  --maxw: 1140px;
  --font: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(54, 224, 255, .10), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(93, 255, 155, .08), transparent 55%),
    var(--bg);
  line-height: 1.55;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { line-height: 1.1; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 4vw, 2.4rem); font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
main { flex: 1 0 auto; }

/* ---- accessibility helpers ---- */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent); color: #04210f; padding: .6rem 1rem; border-radius: 0 0 8px 0; font-weight: 600;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- header / nav ---- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(5, 7, 13, .72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  transition: background .2s;
}
.site-header.scrolled { background: rgba(5, 7, 13, .94); }
.header-inner { display: flex; align-items: center; gap: 1rem; height: 62px; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 700; font-size: 1.2rem; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); filter: drop-shadow(0 0 6px rgba(93, 255, 155, .6)); display: flex; }
.brand-accent { color: var(--accent); }

.primary-nav { display: flex; align-items: center; gap: 1.4rem; margin-left: auto; }
.primary-nav a { color: var(--ink); font-weight: 500; }
.primary-nav a:hover { color: var(--accent); text-decoration: none; }

.nav-toggle { display: none; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.2rem; border-radius: 999px; font-weight: 700; font-size: 1rem;
  border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .2s, background .2s;
  min-height: 46px;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-alert { background: var(--alert); color: var(--alert-ink); box-shadow: 0 0 0 0 rgba(255, 59, 107, .5); animation: pulse 3s infinite; }
.btn-alert:hover { background: #ff5780; }
.btn-primary { background: var(--accent); color: #04210f; }
.btn-primary:hover { background: #80ffb4; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.1rem; min-height: 54px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 107, .45); } 70% { box-shadow: 0 0 0 12px rgba(255, 59, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 107, 0); } }

/* ---- hero ---- */
.hero { position: relative; overflow: hidden; padding: clamp(2.5rem, 8vw, 5.5rem) 0 clamp(2rem, 6vw, 4rem); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; margin-bottom: 1rem; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.hero h1 .glow { color: var(--accent); text-shadow: 0 0 24px rgba(93, 255, 155, .5); }
.hero .lede { font-size: clamp(1.05rem, 2.4vw, 1.3rem); color: var(--muted); max-width: 42ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-stats { display: flex; gap: 1.8rem; margin-top: 2rem; flex-wrap: wrap; }
.hero-stats .stat b { display: block; font-size: 1.8rem; color: var(--ink); }
.hero-stats .stat span { color: var(--muted); font-size: .85rem; }

.hero-map-preview {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); aspect-ratio: 4 / 3;
  background:
    radial-gradient(420px 220px at 70% 20%, rgba(54,224,255,.18), transparent 60%),
    radial-gradient(360px 200px at 20% 80%, rgba(93,255,155,.18), transparent 60%), #0b0f1a;
}
.hero-map-preview .map-fill { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.hero-map-link {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: flex-end; justify-content: center;
  padding: 1rem; text-decoration: none;
}
.hero-map-link:hover { text-decoration: none; }
.hero-map-cta {
  display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; color: var(--ink);
  background: rgba(5, 7, 13, .78); border: 1px solid var(--accent); border-radius: 999px;
  padding: .5rem .95rem; backdrop-filter: blur(6px); box-shadow: var(--shadow);
}
.hero-map-link:hover .hero-map-cta { background: var(--accent); color: #04210f; }
/* maplibre's attribution stays legible on the dark preview */
.hero-map-preview .maplibregl-ctrl-attrib { background: rgba(5,7,13,.6); }

/* ---- sections / cards ---- */
.section { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }
.cards { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card .ic { width: 28px; height: 28px; color: var(--accent); margin-bottom: .6rem; }
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; }

/* ---- map page ---- */
body.map-page { height: 100dvh; overflow: hidden; }
.map-shell { position: relative; height: calc(100dvh - 62px); }
#map { position: absolute; inset: 0; background: var(--bg-2); }
/* maplibre's stylesheet loads after ours, so force contrast with specificity + !important. */
.maplibregl-popup .maplibregl-popup-content {
  background: var(--panel-solid) !important; color: var(--ink) !important;
  border: 1px solid var(--accent); border-radius: 10px; font-family: var(--font);
  padding: .8rem .9rem; box-shadow: var(--shadow); line-height: 1.4;
}
.maplibregl-popup .maplibregl-popup-content strong { color: #fff; }
.maplibregl-popup .maplibregl-popup-content a { color: var(--accent) !important; font-weight: 700; display: inline-block; margin-top: .3rem; }
.maplibregl-popup .maplibregl-popup-content .pop-media { color: var(--accent-2); display: inline-block; margin: .2rem 0; }
.maplibregl-popup-close-button { color: var(--ink) !important; font-size: 1.2rem; padding: 0 .4rem; }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--panel-solid) !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--panel-solid) !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--panel-solid) !important; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--panel-solid) !important; }

.map-controls { position: absolute; z-index: 5; top: 1rem; left: 1rem; right: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; pointer-events: none; }
.map-controls > * { pointer-events: auto; }
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: .5rem .9rem; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem;
  cursor: pointer; backdrop-filter: blur(8px); min-height: 40px;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); color: #04210f; border-color: var(--accent); font-weight: 700; }
.chip select { background: transparent; border: 0; color: inherit; font: inherit; outline: none; }
.chip select option { background: var(--panel-solid); color: var(--ink); }

.map-locate {
  position: absolute; z-index: 5; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #04210f;
  border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow);
}
.map-locate svg { width: 24px; height: 24px; }
.map-count {
  position: absolute; z-index: 5; left: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .9rem;
  font-size: .85rem; color: var(--muted); backdrop-filter: blur(8px);
}
.map-count b { color: var(--accent); }

/* ---- forms ---- */
.field { display: block; margin-bottom: 1.1rem; }
.field > span { display: block; font-weight: 600; margin-bottom: .35rem; }
.req { color: var(--alert); }
input[type=text], input[type=email], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; padding: .8rem .9rem; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font: inherit; min-height: 48px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(93, 255, 155, .2); }
.field-error { color: var(--alert); font-size: .85rem; display: block; margin-top: .3rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-hint { color: var(--muted); font-size: .85rem; }

/* disclosure / notice */
.notice {
  display: flex; gap: .7rem; align-items: flex-start; padding: .9rem 1rem; border-radius: 12px;
  background: rgba(54, 224, 255, .08); border: 1px solid rgba(54, 224, 255, .3); color: var(--ink); font-size: .92rem;
}
.notice svg { flex: none; width: 20px; height: 20px; color: var(--accent-2); margin-top: 2px; }

/* form result */
.form-result { padding: .9rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.form-result.ok { background: rgba(93, 255, 155, .12); border: 1px solid rgba(93, 255, 155, .4); }
.form-result.err { background: rgba(255, 59, 107, .12); border: 1px solid rgba(255, 59, 107, .4); }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--line); background: rgba(5, 7, 13, .6); padding: 1.6rem 0; margin-top: 3rem; }
.footer-inner { display: flex; flex-direction: column; gap: .8rem; }
.foot-disclosure { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem; margin: 0; }
.foot-disclosure svg { color: var(--accent-2); flex: none; }
.foot-links { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot-links a { color: var(--ink); font-size: .9rem; }
.foot-copy { color: var(--muted); font-size: .8rem; margin: 0; }

/* ---- generic content pages ---- */
.prose { max-width: 70ch; }
.prose h2 { margin-top: 2rem; }
.prose p, .prose li { color: var(--muted); }
.page-head { padding: clamp(2rem, 6vw, 3.5rem) 0 1rem; }

/* ---- responsive ---- */
@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 3rem; }
}
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; margin-left: auto;
    background: transparent; border: 0; cursor: pointer; padding: 10px;
  }
  .nav-toggle span { width: 26px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .primary-nav {
    position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--panel-solid); border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem;
    transform: translateY(-120%); transition: transform .25s ease; margin-left: 0;
  }
  .primary-nav.open { transform: translateY(0); }
  .primary-nav a { padding: .9rem .2rem; border-bottom: 1px solid var(--line); }
  .primary-nav .btn-alert { margin-top: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- report form ---- */
.report-form { margin-top: 1.4rem; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem .4rem; margin-bottom: 1.2rem; background: var(--panel); }
.step legend, .step > summary { font-weight: 700; font-size: 1.15rem; padding: 0 .4rem; }
.step > summary { cursor: pointer; list-style: none; padding: .4rem; display: flex; align-items: center; gap: .6rem; }
.step > summary::-webkit-details-marker { display: none; }
.step-optional[open] > summary { margin-bottom: .8rem; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #04210f; font-size: .9rem; }
.muted-tag { color: var(--muted); font-weight: 500; font-size: .85rem; }
.report-map { height: 280px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin-bottom: .6rem; }
.loc-actions { margin-bottom: .4rem; }
.report-pin { width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--alert); border: 2px solid #fff; box-shadow: 0 0 12px rgba(255,59,107,.7); }
.radio-row { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.radio-row legend { font-weight: 600; padding: 0 .3rem; }
.radio-row label { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1rem; }

/* ---- sighting detail ---- */
.back-link { display: inline-block; margin-bottom: 1rem; color: var(--muted); }
.sighting-head { margin-bottom: 1.2rem; }
.badge { display: inline-block; padding: .25rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 700; }
.badge-shape { background: rgba(93,255,155,.15); color: var(--accent); border: 1px solid rgba(93,255,155,.4); }
.muted { color: var(--muted); }
.media-gallery { display: grid; gap: 1rem; margin: 1.2rem 0; }
.media-item { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.media-item img, .media-item video { width: 100%; height: auto; display: block; }
.attribution { padding: .5rem .8rem; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); }
.attribution a { color: var(--accent-2); }
.sighting-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem 1.4rem; margin: 1.4rem 0; padding: 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sighting-facts div { display: flex; flex-direction: column; }
.sighting-facts dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; }
.sighting-facts dd { margin: 0; font-weight: 600; }
.sighting-desc { margin: 1.4rem 0; }
.sighting-desc p { color: var(--ink); }
.sighting-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0; }
.source-note { font-size: .85rem; }

/* ---- range slider ---- */
input[type=range] { width: 100%; accent-color: var(--accent); height: 40px; }

/* ---- map fallback (WebGL/CDN failure) ---- */
.map-fallback { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .8rem; text-align: center; padding: 2rem;
  background: radial-gradient(600px 320px at 50% 30%, rgba(54,224,255,.12), transparent 60%), var(--bg-2); color: var(--ink); }
.map-fallback p { max-width: 42ch; color: var(--muted); margin: 0; }
