/* W4SDI.com — night-shack / SDR waterfall theme */

:root {
  --bg: #0a0e12;
  --bg-panel: #0f151b;
  --bg-panel-raised: #131b22;
  --line: #1f2b33;
  --phosphor: #39ff9e;
  --phosphor-dim: #1f9c63;
  --amber: #ffb000;
  --amber-dim: #a86f00;
  --blue: #4fc3ff;
  --red: #ff5a5a;
  --text: #d9e6e8;
  --text-dim: #7f9499;
  --mono: 'Share Tech Mono', 'JetBrains Mono', 'Courier New', monospace;
  --sans: 'Titillium Web', system-ui, -apple-system, Segoe UI, sans-serif;
  --radius: 10px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(57, 255, 158, 0.08), transparent),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.015) 0px, rgba(255,255,255,0.015) 1px, transparent 1px, transparent 3px);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--mono); letter-spacing: 0.5px; margin: 0 0 8px; }
h2 { font-size: 1.7rem; color: var(--phosphor); text-transform: uppercase; }
h2 .mutecall { color: var(--text-dim); font-size: 0.6em; }
p { color: var(--text-dim); }

.section { padding: 64px 0; border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 32px; }
.section-head .kicker {
  display: inline-block;
  font-family: var(--mono);
  color: var(--amber);
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid var(--amber-dim);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 10px;
}

/* ---- nav ---- */
header.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,14,18,0.88);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; max-width: var(--maxw); margin: 0 auto; }
.navbar .call {
  font-family: var(--mono); font-weight: 700; font-size: 1.15rem; color: var(--phosphor);
  text-shadow: 0 0 10px rgba(57,255,158,0.5);
}
.navbar .call .dim { color: var(--text-dim); font-weight: 400; font-size: 0.75em; }
nav.links { display: flex; gap: 18px; flex-wrap: wrap; }
nav.links a {
  color: var(--text-dim); font-family: var(--mono); font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.5px;
}
nav.links a:hover, nav.links a.active { color: var(--phosphor); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); padding: 6px 10px; border-radius: 6px; font-family: var(--mono); }

/* ---- hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 90px 0 70px;
  border-bottom: 1px solid var(--line);
}
#waterfall { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.hero .wrap { position: relative; z-index: 2; }
.hero-callsign {
  font-family: var(--mono); font-size: clamp(3rem, 10vw, 6.5rem); font-weight: 700;
  color: var(--phosphor); line-height: 1; letter-spacing: 2px;
  text-shadow: 0 0 24px rgba(57,255,158,0.45), 0 0 2px rgba(57,255,158,0.8);
}
.hero-tagline { font-family: var(--mono); color: var(--amber); font-size: 1.1rem; margin-top: 10px; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.chip {
  font-family: var(--mono); font-size: 0.78rem; color: var(--text);
  border: 1px solid var(--line); background: var(--bg-panel-raised);
  border-radius: 999px; padding: 6px 14px;
}
.chip b { color: var(--blue); }
.hero-sub { max-width: 620px; margin-top: 20px; }

/* ---- panels/cards ---- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- solar / band conditions ---- */
.meter-label { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; }
.meter-value { font-family: var(--mono); font-size: 1.8rem; color: var(--phosphor); }
.meter-value small { font-size: 0.5em; color: var(--text-dim); }
.band-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); font-family: var(--mono); font-size: 0.85rem; }
.band-row:last-child { border-bottom: none; }
.cond-badge { padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; }
.cond-good { background: rgba(57,255,158,0.15); color: var(--phosphor); }
.cond-fair { background: rgba(255,176,0,0.15); color: var(--amber); }
.cond-poor { background: rgba(255,90,90,0.15); color: var(--red); }
.solar-updated { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); margin-top: 14px; }

/* ---- maps (leaflet containers) ---- */
.map-box { height: 420px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-box.short { height: 320px; }
.leaflet-container { background: #0a0e12 !important; font-family: var(--sans) !important; }
/* Standard OSM tiles are light by default — invert+rotate to a dark map to match the shack theme */
.map-tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.7); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg-panel-raised) !important; color: var(--text) !important; }
.leaflet-popup-content { font-family: var(--mono) !important; font-size: 0.82rem !important; }
.iss-icon { font-size: 20px; text-align: center; filter: drop-shadow(0 0 4px rgba(0,0,0,0.8)); }

/* Leaflet's default +/- buttons (26px) are too small to tap reliably on a phone */
@media (max-width: 760px) {
  .map-box { height: 320px; }
  .map-box.short { height: 280px; }
  .leaflet-touch .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; font-size: 20px; }
}

/* ---- buttons/forms ---- */
.btn {
  font-family: var(--mono); background: var(--bg-panel-raised); color: var(--phosphor);
  border: 1px solid var(--phosphor-dim); border-radius: 6px; padding: 9px 16px;
  cursor: pointer; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px;
}
.btn:hover { background: rgba(57,255,158,0.1); }
.btn.amber { color: var(--amber); border-color: var(--amber-dim); }
.btn.amber:hover { background: rgba(255,176,0,0.1); }
.btn.ghost { color: var(--text-dim); border-color: var(--line); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
input[type="text"], input[type="number"], input[type="file"] {
  font-family: var(--mono); background: var(--bg-panel-raised); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%;
}
input[type="range"] { width: 100%; }
label { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; display: block; margin-bottom: 6px; }

/* ---- morse trainer ---- */
.morse-output {
  font-family: var(--mono); font-size: 1.1rem; color: var(--amber); min-height: 2.6em;
  background: var(--bg-panel-raised); border-radius: 6px; padding: 12px; word-break: break-all;
  border: 1px solid var(--line);
}
.morse-stat { display: flex; gap: 22px; font-family: var(--mono); margin-top: 10px; }
.morse-stat span { color: var(--text-dim); font-size: 0.78rem; }
.morse-stat b { color: var(--phosphor); font-size: 1.1rem; display: block; }

/* ---- gear cards ---- */
.gear-card { display: flex; flex-direction: column; gap: 6px; }
.gear-card .role { font-family: var(--mono); color: var(--amber); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }
.gear-card .model { font-size: 1.1rem; font-weight: 600; color: var(--text); }
.gear-card .note { font-size: 0.88rem; }

/* ---- band plan table ---- */
table.bandplan { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 0.85rem; }
table.bandplan th, table.bandplan td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.bandplan th { color: var(--text-dim); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 1px; }
table.bandplan tr:hover td { background: rgba(57,255,158,0.03); }
.sat-row { cursor: pointer; }
.sat-row:hover td { background: rgba(79,195,255,0.08); }
.sat-row.active td { background: rgba(57,255,158,0.1); }
.sat-row.active td:first-child { color: var(--phosphor); font-weight: 700; }
.sat-row.active td:first-child::before { content: '▸ '; }

/* ---- qcodes ---- */
.qcode-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.qcode-item .code { font-family: var(--mono); color: var(--phosphor); font-weight: 700; min-width: 54px; }

/* ---- fact box ---- */
#fact-box { font-size: 1.05rem; min-height: 3em; }

/* ---- footer ---- */
footer { padding: 40px 0; text-align: center; }
footer .call { font-family: var(--mono); color: var(--phosphor); }
footer p { font-size: 0.82rem; }

/* ---- scanlines overlay for flavor ---- */
.crt-flicker { animation: flicker 6s infinite; }
@keyframes flicker { 0%,100% { opacity: 1; } 50% { opacity: 0.96; } }

/* ---- responsive nav ---- */
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  nav.links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg-panel); border-bottom: 1px solid var(--line);
    flex-direction: column; padding: 14px 20px; gap: 12px;
  }
  nav.links.open { display: flex; }
  header.site-nav { position: sticky; }
}

.live-tag {
  font-family: var(--mono); font-size: 0.68rem; color: var(--phosphor);
  border: 1px solid var(--phosphor-dim); padding: 2px 8px; border-radius: 4px; margin-left: 8px;
}

.sos-flash { animation: sosflash 0.4s 3; }
@keyframes sosflash { 0%,100% { background: var(--bg); } 50% { background: rgba(57,255,158,0.08); } }
