/* HA3GX — amateur radio station theme */
:root {
  --bg-deep: #0a1220;
  --bg-card: #121c2e;
  --bg-card-hover: #182438;
  --accent: #f4a261;
  --accent-soft: #e9c46a;
  --cyan: #4ecdc4;
  --text: #e8eef7;
  --text-muted: #9fb0c8;
  --border: rgba(78, 205, 196, 0.18);
  --glow: rgba(244, 162, 97, 0.25);
  --font-sans: "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --radius: 14px;
  --nav-h: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.65;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(78, 205, 196, 0.12), transparent),
    radial-gradient(circle at 100% 100%, rgba(244, 162, 97, 0.06), transparent);
}

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

a:hover {
  color: var(--accent-soft);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #111;
  padding: 0.5rem 1rem;
  z-index: 9999;
}

.skip-link:focus {
  left: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 18, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
}

.brand .callsign {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.brand .grid {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.lang-switch {
  display: flex;
  gap: 0.2rem;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border);
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--accent);
  border-color: var(--border);
  background: rgba(244, 162, 97, 0.08);
}

.header-visitor-widget {
  position: fixed;
  left: 0.9rem;
  top: calc(var(--nav-h) + 0.55rem);
  transform: none;
  z-index: 90;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 1.1rem;
  padding: 0.35rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 28, 46, 0.96);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  font-size: 0.72rem;
  white-space: nowrap;
}

.header-visitor-widget b {
  color: var(--cyan);
  font-family: var(--font-mono);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.section {
  padding: 4rem 0 2rem;
  scroll-margin-top: calc(var(--nav-h) + 1rem);
}

.section-header {
  margin-bottom: 2rem;
}

.section-header h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: var(--text);
}

.section-header .lead {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 62ch;
}

.section-subtitle {
  margin: 2rem 0 0;
  font-size: 1.15rem;
  color: var(--accent-soft);
}

.hero {
  padding: 3.5rem 0 2rem;
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.2fr 0.8fr;
    padding-top: 4.5rem;
  }
}

.hero-text h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 0 0 40px var(--glow);
}

.hero-text .tagline {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.hero-text .subtitle {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.95rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.2rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e76f51);
  color: #1a1208;
  box-shadow: 0 4px 20px var(--glow);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--cyan);
}

.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(78, 205, 196, 0.03) 2px,
    rgba(78, 205, 196, 0.03) 4px
  );
  pointer-events: none;
}

.hero-card img {
  border-radius: 10px;
  margin-bottom: 1rem;
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.stat {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 0.75rem;
  text-align: center;
}

.stat .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  color: var(--cyan);
  font-weight: 700;
}

.stat .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.prose {
  max-width: 68ch;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.prose p strong,
.highlight {
  color: var(--text);
}

.card-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .card-grid.two {
    grid-template-columns: repeat(2, 1fr);
  }
  .card-grid.three {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  transition: background 0.2s, border-color 0.2s;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(244, 162, 97, 0.25);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--accent-soft);
}

.card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.quote-box {
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(244, 162, 97, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.gallery-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: zoom-in;
}

.gallery-item figcaption {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.guestbook-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 860px) {
  .guestbook-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.guestbook-form,
.guestbook-list-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
}

.guestbook-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.guestbook-field span {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.guestbook-field input,
.guestbook-field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0d1524;
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font-family: var(--font-sans);
}

.guestbook-field textarea {
  resize: vertical;
  min-height: 90px;
}

.guestbook-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.guestbook-status {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.guestbook-note {
  margin-top: 0.8rem;
  margin-bottom: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guestbook-list-wrap h3 {
  margin-top: 0;
  margin-bottom: 0.85rem;
  color: var(--accent-soft);
  font-size: 1rem;
}

.guestbook-list {
  display: grid;
  gap: 0.75rem;
  max-height: 460px;
  overflow: auto;
  padding-right: 0.25rem;
}

.guestbook-item {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0d1524;
}

.guestbook-item-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.guestbook-author {
  color: var(--accent-soft);
  font-weight: 600;
  font-size: 0.9rem;
}

.guestbook-date {
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.guestbook-text {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.guestbook-empty {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin: 0;
}

.guestbook-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.log-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.log-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.log-pill span {
  color: var(--cyan);
  font-weight: 700;
}

.log-pill-muted {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

.log-intro {
  margin-bottom: 1.25rem;
}

.log-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem 1rem;
  align-items: end;
  margin-bottom: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.log-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.log-field input,
.log-field select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.log-field input:focus,
.log-field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.log-clear {
  align-self: end;
  white-space: nowrap;
}

.log-result-count {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0.75rem;
}

.log-table-wrap {
  overflow: auto;
  max-height: min(70vh, 640px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.log-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elevated, #1a2332);
}

.log-table th {
  padding: 0.7rem 0.85rem;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.log-table th.sorted::after {
  content: " ↓";
  color: var(--cyan);
}

.log-table th.sorted[data-dir="asc"]::after {
  content: " ↑";
}

.log-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.log-table tbody tr:hover {
  background: rgba(0, 212, 255, 0.04);
}

.log-table tbody tr:last-child td {
  border-bottom: none;
}

.log-call {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.log-call:hover {
  text-decoration: underline;
}

.log-rst {
  color: var(--cyan);
}

.log-empty td {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.log-privacy {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.log-mobile-toggle {
  display: none;
  margin-bottom: 0.85rem;
}

.map-card {
  margin-top: 1.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.map-embed {
  display: block;
  width: 100%;
  height: min(52vh, 420px);
  border: 0;
}

.map-footer {
  padding: 1rem 1.25rem 1.15rem;
  border-top: 1px solid var(--border);
}

.map-caption {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.map-link {
  font-size: 0.88rem;
  color: var(--accent);
}

/* FT8 section */
.ft8-hw-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (min-width: 720px) {
  .ft8-hw-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.ft8-hw-card {
  display: grid;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.ft8-hw-card .ft8-shot-btn {
  aspect-ratio: 4/3;
}

.ft8-hw-card .ft8-shot-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ft8-hw-body {
  padding: 1.1rem 1.25rem 1.25rem;
}

.ft8-hw-body h4 {
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--cyan);
}

.ft8-hw-body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.ft8-sw-showcase {
  display: grid;
  gap: 1.75rem;
  margin-top: 1rem;
  padding: 1.35rem;
  background: linear-gradient(145deg, rgba(18, 28, 46, 0.95), rgba(10, 18, 32, 0.6));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}

@media (min-width: 900px) {
  .ft8-sw-showcase {
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.4fr);
    align-items: start;
  }
}

.ft8-sw-copy .prose {
  margin: 0 0 1rem;
}

.ft8-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.ft8-features li {
  position: relative;
  padding-left: 1.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.ft8-features li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.85rem;
}

.ft8-screens {
  display: grid;
  gap: 1.25rem;
}

.ft8-screen {
  margin: 0;
  background: #0d1524;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.ft8-screen-chrome {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #1a2438;
  border-bottom: 1px solid var(--border);
}

.ft8-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #3d4f6a;
}

.ft8-dot:nth-child(1) { background: #e76f51; }
.ft8-dot:nth-child(2) { background: #e9c46a; }
.ft8-dot:nth-child(3) { background: #4ecdc4; }

.ft8-screen-title {
  margin-left: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.ft8-shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: zoom-in;
}

.ft8-shot-btn img {
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.ft8-screen figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  line-height: 1.45;
}

.ft8-screen-map .ft8-shot-btn img {
  background: #111;
}

@media (max-width: 719px) {
  .ft8-hw-grid,
  .ft8-sw-showcase {
    margin-top: 0.75rem;
  }
}

@media (max-width: 720px) {
  .log-mobile-toggle {
    display: inline-flex;
  }

  .log-mobile-content {
    display: none;
  }

  #log.mobile-open .log-mobile-content {
    display: block;
  }

  .log-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .log-clear {
    grid-column: 1 / -1;
  }

  .log-table thead {
    display: none;
  }

  .log-table tr {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
  }

  .log-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0;
    border: none;
  }

  .log-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .log-table-wrap {
    max-height: none;
  }
}

address.contact-box {
  font-style: normal;
}

.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  max-width: 520px;
}

.contact-box .email-line {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  color: var(--accent);
  word-break: break-all;
}

.contact-box .email-line.muted {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.site-footer .callsign-footer {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.visitor-status {
  color: var(--text-muted);
  font-size: 0.69rem;
}

.mobile-visitor-widget {
  display: none;
  margin: 0.75rem auto 0.65rem;
  padding: 0.45rem 0.7rem;
  width: fit-content;
  max-width: 95%;
  align-items: center;
  justify-content: center;
  gap: 0.45rem 0.9rem;
  flex-wrap: wrap;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(18, 28, 46, 0.9);
  font-size: 0.78rem;
}

.mobile-visitor-widget b {
  color: var(--cyan);
  font-family: var(--font-mono);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-height: 90vh;
  max-width: 95vw;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: 1px solid #fff;
  color: #fff;
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
}

@media (max-width: 900px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(10, 18, 32, 0.98);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .site-nav.open {
    display: flex;
  }

  .lang-switch {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 0.5rem;
  }

  .header-visitor-widget {
    display: none;
  }

  .mobile-visitor-widget {
    display: inline-flex;
  }
}
