/* =====================================================================
   Official WSJT-X website — modern stylesheet
   Design system grounded in the WSJT-X "Wide Graph" waterfall:
   spectral colormap (navy -> cyan -> green -> amber -> red), an
   instrument-panel hero, and IBM Plex Mono decode readouts.
   ===================================================================== */

:root {
  /* ---- waterfall colormap (the spectral accent set) ---- */
  --abyss:   #0a1430;   /* noise floor / darkest waterfall */
  --panel:   #0f1d44;   /* lifted instrument panel */
  --deep:    #15306b;   /* low signal */
  --cyan:    #28d3ec;   /* signal emerging — primary accent on dark */
  --green:   #46e08a;   /* solid decode */
  --amber:   #f6b53f;   /* strong signal */
  --red:     #f0604d;   /* peak — used sparingly */

  /* ---- light content surfaces ---- */
  --paper:   #f4f6fb;   /* cool near-white (deliberately not cream) */
  --card:    #ffffff;
  --ink:     #0b1733;   /* primary text on paper */
  --muted:   #56678a;   /* secondary text */
  --line:    #e2e7f1;   /* hairlines / card borders */
  --accent-ink: #0b6f86;/* accessible teal for links/accents on paper */

  /* ---- type ---- */
  --display: "Space Grotesk", system-ui, sans-serif;
  --body:    "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- rhythm ---- */
  --maxw:    1080px;
  --section: clamp(3.5rem, 7vw, 6rem);
  --radius:  14px;
  --shadow:  0 1px 2px rgba(11, 23, 51, .04), 0 12px 30px -18px rgba(11, 23, 51, .25);
}

/* --------------------------- reset / base --------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 3px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0; }
p { margin: 0; }

/* ----------------------------- layout ------------------------------ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section) 0; }
.section--tight { padding: calc(var(--section) * .6) 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.eyebrow--ondark { color: var(--cyan); }

.section-head { max-width: 46ch; margin-bottom: 2.4rem; }
.section-head h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); letter-spacing: -.01em; }
.section-head p { color: var(--muted); margin-top: .6rem; }

/* ----------------------------- header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244, 246, 251, .82);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand .tag {
  font-family: var(--mono); font-weight: 500; font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent-ink) 35%, transparent);
  border-radius: 999px; padding: .15rem .5rem; margin-left: .15rem;
}
.nav { margin-left: auto; display: flex; gap: 1.4rem; flex-wrap: wrap; }
.nav a { font-size: .95rem; color: var(--muted); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 600; }

/* ----------------------------- buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--body); font-weight: 600; font-size: .98rem; line-height: 1.2;
  min-height: 48px; padding: 0 1.4rem; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: linear-gradient(120deg, var(--cyan), var(--green)); color: #04121a; box-shadow: 0 10px 24px -12px rgba(40, 211, 236, .8); }
.btn-ghost { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.28); }
.btn-ghost:hover { border-color: var(--cyan); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }

/* ------------------------------ hero ------------------------------- */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 120% at 80% -10%, var(--deep) 0%, var(--abyss) 55%);
  color: #eaf0ff;
  border-bottom: 1px solid #07102a;
}
.hero .container { position: relative; z-index: 2; padding-top: clamp(3rem, 6vw, 5rem); padding-bottom: clamp(3rem, 6vw, 5rem); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 4vw, 3.5rem); align-items: center; }
.hero h1 {
  font-size: clamp(2.5rem, 5.6vw, 3.9rem);
  font-weight: 700; letter-spacing: -.025em; line-height: 1.02;
  color: #fff;
}
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero .lede { margin-top: 1.25rem; font-size: 1.125rem; color: #b9c6e6; max-width: 42ch; }
.hero .cta-row { margin-top: 2rem; display: flex; gap: .85rem; flex-wrap: wrap; }
.release-meta { margin-top: 1rem; font-family: var(--mono); font-size: .82rem; color: #9fb0d6; }
.release-meta b { color: #fff; font-weight: 600; }
.release-meta .ver { color: var(--cyan); }

/* ---- Wide Graph waterfall (generated PNG) + Band Activity panel ---- */
.widegraph-img {
  display: block; width: 100%; height: auto;
  border: 1px solid #1b2c59; border-bottom: none; border-radius: 12px 12px 0 0;
}
.bandwin {
  background: var(--panel); border: 1px solid #1b2c59; border-radius: 0 0 12px 12px;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.7);
  font-family: var(--mono);
}
.bandwin__bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem .8rem; border-bottom: 1px solid #1b2c59;
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #8aa0cf;
}
.bandwin__bar .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.bandwin__rows { margin: 0; padding: .45rem 0; list-style: none; }
.decode { display: grid; grid-template-columns: 4.2rem 2.6rem 2.4rem 3.4rem auto; gap: .5rem; align-items: baseline;
  padding: .2rem .9rem; font-size: .82rem; color: #c7d4f1; white-space: nowrap; }
.decode .db { text-align: right; color: var(--cyan); }
.decode .msg { color: #e9f0ff; overflow: hidden; text-overflow: ellipsis; }
.decode .sync { color: #5e6f9c; }
.decode--head { color: #6d80ac; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; padding-top: .5rem; padding-bottom: .35rem; }
.decode--head .db { color: #6d80ac; }
.decode--weak { background: linear-gradient(90deg, rgba(40,211,236,.10), transparent); border-left: 2px solid var(--cyan); }
.decode--weak .db { color: #fff; font-weight: 600; }
.bandwin__note { font-family: var(--body); font-size: .78rem; color: #8aa0cf; padding: .5rem .95rem .85rem; border-top: 1px solid #1b2c59; }
.bandwin__note b { color: var(--cyan); font-weight: 600; }

/* --------------------------- official strip ------------------------ */
.official {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--cyan);
  border-radius: var(--radius); padding: 1.5rem 1.7rem; box-shadow: var(--shadow);
}
.official h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.official p { color: var(--muted); }
.official .verified { font-family: var(--mono); font-size: .8rem; color: var(--accent-ink); margin-top: .7rem; }

/* ---------------------------- card grids --------------------------- */
.grid { display: grid; gap: 1.1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* outcomes strip ("what operators do with it") */
.outcome { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--sig, var(--cyan));
  border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow); }
.outcome h3 { font-size: 1.05rem; }
.outcome p { color: var(--muted); margin-top: .5rem; font-size: .95rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow); transition: transform .14s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); }
.card h3 { font-size: 1.2rem; }
.card h3 .role { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); margin-top: .35rem; }
.card p { color: var(--muted); margin-top: .7rem; font-size: .98rem; }
.card .more { display: inline-block; margin-top: .9rem; font-weight: 600; font-size: .92rem; }

/* link cards (get started) */
.linkcard { display: block; }
.linkcard:hover { text-decoration: none; }
.linkcard .k { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); }
.linkcard h3 { margin-top: .35rem; font-size: 1.15rem; color: var(--ink); }
.linkcard p { color: var(--muted); margin-top: .45rem; font-size: .95rem; }

/* ----------------------------- modes ------------------------------- */
.modes { display: flex; flex-wrap: wrap; gap: .55rem; }
.chip {
  font-family: var(--mono); font-size: .85rem; font-weight: 500;
  padding: .4rem .7rem; border-radius: 8px;
  background: #eef2fa; border: 1px solid var(--line); color: var(--ink);
  display: inline-flex; align-items: center; gap: .45rem;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sig, var(--cyan)); }

/* ----------------------------- footer ------------------------------ */
.site-footer { background: var(--abyss); color: #aebbdc; }
.site-footer .container { padding-top: 3rem; padding-bottom: 3rem; display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; align-items: center; }
.site-footer .brand { color: #fff; }
.site-footer a { color: var(--cyan); }
.site-footer .legal { font-size: .85rem; color: #7f90bb; }
.site-footer .spacer { margin-left: auto; }
.site-footer .flinks { display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .92rem; }
.site-footer .flinks a { color: #c7d4f1; }

/* --------------------------- content pages ------------------------- */
/* Lightweight page header for the non-home pages (reserve the waterfall
   hero for index.html — spend the boldness once). */
.page-head { background: linear-gradient(180deg, #0a1430, #11214c); color: #fff; }
.page-head .container { padding-top: clamp(2.4rem, 5vw, 3.6rem); padding-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); letter-spacing: -.02em; }
.page-head p { color: #b9c6e6; margin-top: .6rem; max-width: 52ch; }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.35rem; margin: 2.2rem 0 .7rem; }
.prose p { margin-top: .9rem; color: #33405e; }
.prose ul { margin: .8rem 0; padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.dl-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .96rem; }
.dl-table th, .dl-table td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); }
.dl-table th { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.dl-table code { font-family: var(--mono); font-size: .9rem; }
.note { background: #eef2fa; border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.2rem; color: var(--muted); font-size: .95rem; }

/* --------------------------- responsive ---------------------------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .nav { gap: 1rem; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .site-header .container { flex-wrap: wrap; min-height: 0; padding-top: .7rem; padding-bottom: .7rem; }
  .nav { margin-left: 0; width: 100%; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .btn { width: 100%; }
  .decode { grid-template-columns: 3.6rem 2.2rem 3rem auto; }
  .decode .dt, .decode--head .dt { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}
