/* ============================================================
   RF Lab — rflab.io
   Dark RF/tech theme. No build step, no external requests.
   ============================================================ */

:root {
  /* surfaces */
  --bg:       #070a0e;
  --bg-2:     #0b1117;
  --panel:    #101820;
  --panel-2:  #14202a;
  --line:     rgba(255, 255, 255, .08);
  --line-2:   rgba(255, 255, 255, .15);

  /* text */
  --text:     #e6edf5;
  --muted:    #93a1b1;
  --muted-2:  #5f6b78;

  /* signal accents */
  --signal:      #2de2a6;
  --signal-glow: rgba(45, 226, 166, .35);
  --cyan:        #38c7e6;
  --amber:       #ffb454;
  --violet:      #a78bfa;
  --rose:        #f472b6;
  --red:         #ff5d6c;

  --grad: linear-gradient(90deg, var(--signal), var(--cyan));

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  --wrap: 1120px;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

.mono { font-family: var(--font-mono); }

/* ---- Background canvas + grain ---- */
#bg-waterfall {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;   /* fallback */
  height: 100lvh;  /* stable on mobile: ignores address-bar show/hide so it never snaps while scrolling */
  z-index: -2;
  opacity: .22;
}
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(45,226,166,.10), transparent 60%),
    radial-gradient(100% 60% at 100% 0%, rgba(56,199,230,.06), transparent 55%);
  mix-blend-mode: screen;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--signal); color: #04130d; padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Nav
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.nav.is-scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* ===== Site announcement ticker (injected by main.js) ===== */
.ticker { position: relative; z-index: 40; overflow: hidden; background: color-mix(in srgb, var(--amber) 13%, var(--bg-2)); border-bottom: 1px solid color-mix(in srgb, var(--amber) 32%, transparent); }
.ticker__track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; animation: ticker-scroll 30s linear infinite; }
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__msg { display: inline-flex; align-items: center; gap: .45rem; padding: .52rem 2.4rem; font-size: .84rem; line-height: 1.25; color: var(--amber); text-decoration: none; font-weight: 600; }
.ticker__msg strong { color: #ffe0b0; }
.ticker__msg b { color: #fff; font-weight: 700; }
.ticker__msg:hover { text-decoration: underline; text-underline-offset: 2px; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; white-space: normal; width: 100%; justify-content: center; }
  .ticker__msg + .ticker__msg { display: none; }
  .ticker__msg { padding: .5rem 3rem; text-align: center; }
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; position: relative; }

.brand { display: inline-flex; align-items: center; gap: .3rem; font-weight: 800; letter-spacing: .04em; }
.brand__mark {
  display: block;
  width: 36px; height: 36px;            /* framed icon is square */
  background: url(../img/logo-framed.svg) center / contain no-repeat;
  color: transparent; font-size: 0;     /* hide the literal "RF" text fallback */
}
.brand__word { font-size: 1.55rem; line-height: 1; color: var(--text); }

/* Real logo swaps in here once a high-res, transparent, light version is provided */
.brand__logo { height: 30px; width: auto; display: block; }

.nav__links { display: flex; align-items: center; gap: 1.4rem; flex: 1; justify-content: center; }
.nav__sep { width: 1px; height: 20px; background: var(--line-2); align-self: center; flex: none; }
/* Desktop: center the links across the full nav, pin brand far-left + Join CTA far-right */
.nav__inner > .brand { position: absolute; left: 0; top: 0; bottom: 0; margin-block: auto; height: max-content; }
.nav__links .btn--join,
.nav__links .embed-fs--nav { position: absolute; right: 0; top: 0; bottom: 0; margin-block: auto; height: max-content; }
.nav__links > a:not(.btn) {
  color: var(--muted); font-size: .95rem; font-weight: 500;
  position: relative; padding: .25rem 0;
}
.nav__links > a:not(.btn):hover { color: var(--text); }
.nav__links > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--grad); transition: width .25s;
}
.nav__links > a:not(.btn):hover::after { width: 100%; }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; padding: 8px; }
.nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: .25s; }
.nav__toggle span + span { margin-top: 6px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Tools dropdown ---- */
.nav__tools { position: relative; display: flex; align-items: center; }
.nav__toolsbtn { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 0; cursor: pointer; color: var(--muted); font-family: inherit; font-size: .95rem; font-weight: 500; padding: .25rem 0; }
.nav__toolsbtn:hover, .nav__tools:focus-within .nav__toolsbtn, .nav__tools.is-open .nav__toolsbtn { color: var(--text); }
.nav__toolsbtn .caret { transition: transform .2s; }
.nav__tools:hover .nav__toolsbtn .caret, .nav__tools.is-open .nav__toolsbtn .caret { transform: rotate(180deg); }
.nav__tools::after { content: ""; position: absolute; top: 100%; left: -12px; right: -12px; height: 12px; }  /* hover bridge */
.nav__toolsmenu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  display: flex; flex-direction: column; min-width: 200px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: .4rem;
  box-shadow: 0 24px 48px -24px #000;
  opacity: 0; visibility: hidden; transition: opacity .18s ease, transform .18s ease; z-index: 60;
}
.nav__tools:hover .nav__toolsmenu, .nav__tools:focus-within .nav__toolsmenu, .nav__tools.is-open .nav__toolsmenu {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav__toolsmenu a { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .8rem; border-radius: 8px; color: var(--muted); font-size: .92rem; }
.nav__toolsmenu a::after { content: none; }  /* cancel the underline hover from base nav links */
.nav__toolsmenu a:hover, .nav__toolsmenu a[aria-current="page"] { background: rgba(255,255,255,.05); color: var(--text); }

/* Beta / status badge */
.badge { display: inline-block; font-family: var(--font-mono); font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #04130d; background: var(--amber); padding: .18em .45em; border-radius: 5px; line-height: 1; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 600; font-size: .95rem;
  padding: .7rem 1.15rem; border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--text); cursor: pointer;
  transition: transform .15s, box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--grad); color: #04130d; border-color: transparent; box-shadow: 0 6px 24px -8px var(--signal-glow); }
.btn--primary:hover { box-shadow: 0 10px 34px -6px var(--signal-glow); }
.btn--ghost { background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--signal); color: var(--text); }
.btn--lg { padding: .95rem 1.6rem; font-size: 1.05rem; border-radius: 12px; }

/* "Keying up" the TX indicator on the Join button */
.tx-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; opacity: .55; transition: .2s;
}
.btn--join:hover .tx-dot,
.btn--join:focus-visible .tx-dot {
  opacity: 1;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 25%, transparent);
  animation: keyup 1s ease-in-out infinite;
}
@keyframes keyup { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 8%, transparent); } }

/* ============================================================
   Hero
   ============================================================ */
.hero { position: relative; padding: clamp(2.5rem, 6.5vw, 4rem) 0 clamp(1.4rem, 3.5vw, 2.25rem); overflow: hidden; }
/* Fade the waterfall + mesh smoothly into the page instead of a hard edge */
/* The waterfall fade now lives on .showcase so it runs continuously past the
   tool cards instead of darkening mid-hero and letting the waterfall reappear. */
#mesh { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .9; }
.hero__inner { position: relative; z-index: 1; text-align: center; max-width: 820px; }

.eyebrow {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.live { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); }
.live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.hero__title {
  margin: 1.2rem 0 0;
  font-size: clamp(2.1rem, 6vw, 3.85rem);
  line-height: 1.04; font-weight: 800; letter-spacing: -.02em;
}
.hero__title span { display: inline-block; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero__sub { margin: 1.4rem auto 0; max-width: 640px; font-size: clamp(1.02rem, 2.4vw, 1.2rem); color: var(--muted); }

.hero__cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; margin-top: 2.2rem; }

.morse { display: inline-flex; align-items: center; gap: .5rem; margin-top: 2.6rem; color: var(--muted-2); font-family: var(--font-mono); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; cursor: help; }
.morse__led { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); box-shadow: none; transition: background .08s, box-shadow .08s; }
.morse__led.on { background: var(--amber); box-shadow: 0 0 12px var(--amber); }

/* ============================================================
   Tools showcase (home) — blurred-screenshot link cards
   ============================================================ */
.showcase {
  padding: clamp(1rem, 3vw, 1.75rem) 0 clamp(3rem, 7vw, 4.75rem);
  position: relative; z-index: 1;
  /* Continue the waterfall through the tools, then fade it fully to bg just
     below the cards — one smooth fade, no mid-page band. */
  background: linear-gradient(to bottom, transparent 0%, transparent 32%, var(--bg) 92%);
}
.showcase__eyebrow { text-align: center; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 1.2rem; }
.showcase__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

.toolcard {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 224px; display: flex; align-items: flex-end;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); /* opaque base so the waterfall never bleeds through */
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
/* The screenshot layer: blurred + scaled so the blur never shows soft edges.
   Drop a real screenshot in via inline --shot; if it's missing or fails to
   load, the accent gradient underneath shows through. The page blurs it for you. */
.toolcard__shot {
  content: ""; position: absolute; inset: -8%; z-index: -2;
  background-image: var(--shot, none),
    linear-gradient(140deg, color-mix(in srgb, var(--c) 48%, var(--panel)), var(--bg-2) 78%);
  background-size: cover; background-position: center;
  filter: blur(2px) saturate(1.1); transform: scale(1.05);
  opacity: .92; transition: filter .35s, opacity .35s, transform .45s;
}
.toolcard::after { /* legibility wash — light up top, darker behind the text */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg) 6%, transparent) 0%,
    color-mix(in srgb, var(--bg) 42%, transparent) 52%,
    color-mix(in srgb, var(--bg) 86%, transparent) 100%);
}
.toolcard__edge { position: absolute; inset: 0 0 auto 0; height: 3px; z-index: 1; background: var(--c); opacity: .9; }
.toolcard__body { position: relative; z-index: 1; padding: 1.35rem; display: flex; flex-direction: column; gap: .3rem; width: 100%; }
.toolcard__tag { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.toolcard__name { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.toolcard__desc { color: var(--muted); font-size: .92rem; }
.toolcard__go { margin-top: .55rem; font-family: var(--font-mono); font-size: .8rem; color: var(--c); display: inline-flex; gap: .35rem; transition: gap .2s; }

.toolcard:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 22px 50px -26px var(--c); }
.toolcard:hover .toolcard__shot { filter: blur(0.5px) saturate(1.2); opacity: 1; transform: scale(1.01); }
.toolcard:hover .toolcard__go { gap: .7rem; }
.toolcard:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

@media (max-width: 820px) {
  .showcase__grid { grid-template-columns: 1fr; }
  .toolcard { min-height: 168px; }
}
@media (prefers-reduced-motion: reduce) {
  .toolcard, .toolcard__shot, .toolcard__go { transition: none; }
}

/* Secondary tool link — slim bar under the showcase cards (for external tools
   that live on their own subdomain rather than an embed page here). */
.toolmore {
  margin-top: 1rem;
  display: flex; align-items: center; gap: 1.1rem;
  padding: 1rem 1.35rem;
  border: 1px solid var(--line); border-left: 3px solid var(--c);
  border-radius: var(--radius);
  background: var(--bg-2);
  text-decoration: none; color: var(--text);
  transition: transform .2s, border-color .2s, box-shadow .2s, background .2s;
}
.toolmore__tag { flex: 0 0 auto; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--c); }
.toolmore__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.toolmore__name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.toolmore__ext { color: var(--c); font-size: .9em; }
.toolmore__desc { color: var(--muted); font-size: .9rem; }
.toolmore__go { flex: 0 0 auto; font-family: var(--font-mono); font-size: .8rem; color: var(--c); display: inline-flex; gap: .35rem; transition: gap .2s; }
.toolmore:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 18px 40px -28px var(--c); background: var(--panel); }
.toolmore:hover .toolmore__go { gap: .7rem; }
.toolmore:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }

@media (max-width: 560px) {
  .toolmore { flex-wrap: wrap; gap: .45rem .9rem; }
  .toolmore__go { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .toolmore, .toolmore__go { transition: none; }
}

/* ============================================================
   Sections
   ============================================================ */
/* Opaque so the fixed waterfall canvas only shows behind the (transparent) hero */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; background: var(--bg); position: relative; }
.section--alt { background: var(--bg-2); }

.section__head { max-width: 640px; margin-bottom: 2rem; }
.kicker { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }
.section__head h2 { margin: .7rem 0 .6rem; font-size: clamp(1.8rem, 4.5vw, 2.7rem); letter-spacing: -.02em; line-height: 1.1; }
.section__head p { margin: 0; color: var(--muted); font-size: 1.08rem; }

/* ---- Cards grid ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card {
  position: relative; display: flex; flex-direction: column;
  padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .25s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--c, var(--signal)); opacity: .9; }
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c, var(--signal)) 50%, var(--line)); box-shadow: 0 18px 40px -22px var(--c, var(--signal)); }
.card__tag { align-self: flex-start; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--c, var(--signal)); border: 1px solid color-mix(in srgb, var(--c, var(--signal)) 35%, transparent); padding: .2rem .55rem; border-radius: 6px; }
.card h3, .card h4 { margin: .9rem 0 .4rem; font-size: 1.25rem; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.card__go { margin-top: 1.1rem; font-family: var(--font-mono); font-size: .82rem; color: var(--c, var(--signal)); opacity: .85; transition: gap .2s; }
.card:hover .card__go { opacity: 1; }
.card--soft { background: rgba(255,255,255,.015); }

/* ---- Guides ---- */
.guides__inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
.guides__copy h2 { margin: .7rem 0 .8rem; font-size: clamp(1.8rem, 4.5vw, 2.7rem); letter-spacing: -.02em; }
.guides__copy > p { color: var(--muted); font-size: 1.08rem; }
.guides__list { list-style: none; margin: 1.6rem 0; padding: 0; display: grid; gap: .75rem; }
.guides__list li { display: flex; align-items: center; gap: .7rem; color: var(--text); }
.guides__list .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 8px var(--signal-glow); flex: none; }
.guides__soon { display: inline-flex; align-items: center; gap: .55rem; font-size: .92rem; color: var(--muted); }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 0 var(--amber); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--amber) 60%, transparent); } 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.terminal { border: 1px solid var(--line); border-radius: var(--radius); background: #0a1015; overflow: hidden; box-shadow: 0 30px 60px -30px #000; }
.terminal__bar { display: flex; gap: .45rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.02); }
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--muted-2); }
.terminal__bar span:nth-child(1) { background: #ff5f57; }
.terminal__bar span:nth-child(2) { background: #febc2e; }
.terminal__bar span:nth-child(3) { background: #28c840; }
.terminal__body { margin: 0; padding: 1.2rem 1.3rem; font-family: var(--font-mono); font-size: .86rem; line-height: 1.75; color: var(--text); overflow-x: auto; }
.c-muted { color: var(--muted-2); }
.c-sig { color: var(--signal); }
.c-amber { color: var(--amber); }
.cursor { animation: blink 1.1s step-end infinite; color: var(--signal); }

/* ---- Stats + vibe ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2.5rem; }
.stat { text-align: center; padding: 1.4rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.stat b { display: block; font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.vibe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.vibe__item { padding: 1.6rem; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--bg-2)); }
.vibe__item h3 { margin: 0 0 .5rem; font-size: 1.2rem; }
.vibe__item p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---- Latest updates / news feed (home) ---- */
.feed { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.feed__item { position: relative; padding: 0 0 .95rem 1.9rem; border-left: 1px solid var(--line); margin-left: .4rem; }
.feed__item:last-child { border-left-color: transparent; padding-bottom: 0; }
.feed__item::before { content: ""; position: absolute; left: -5px; top: .3rem; width: 10px; height: 10px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal-glow); }
.feed__top { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; flex-wrap: wrap; }
.feed__date { font-family: var(--font-mono); font-size: .76rem; color: var(--muted-2); }
.feed__tag { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; padding: .18em .5em; border-radius: 5px; font-weight: 700; line-height: 1; }
.feed__tag--new { color: #04130d; background: var(--signal); }
.feed__tag--upd { color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); }
.feed__tag--tool { color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 45%, transparent); }
.feed__item h3 { margin: 0 0 .15rem; font-size: 1.02rem; }
.feed__item h3 a { color: var(--text); }
.feed__item h3 a:hover { color: var(--signal); }
.feed__item p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }

/* ---- Final CTA ---- */
.cta-band { padding: clamp(2.5rem, 6vw, 4rem) 0; text-align: center; position: relative; background: var(--bg); }
.notfound { min-height: 72vh; display: grid; place-items: center; }
.cta-band::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 120% at 50% 0%, rgba(45,226,166,.10), transparent 60%); pointer-events: none; }
.cta-band__inner { position: relative; }
.cta-band h2 { font-size: clamp(2rem, 6vw, 3.4rem); letter-spacing: -.02em; margin: 0 0 .6rem; }
.cta-band p { color: var(--muted); font-size: 1.1rem; margin: 0 0 2rem; }

/* ============================================================
   Footer
   ============================================================ */
.footer { border-top: 1px solid var(--line); padding: 2.25rem 0; background: var(--bg-2); }
.footer__inner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: center; }
.footer__brand p { margin: .5rem 0 0; color: var(--muted-2); font-family: var(--font-mono); font-size: .82rem; letter-spacing: .06em; }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer__links a { color: var(--muted); font-size: .92rem; }
.footer__links a:hover { color: var(--signal); }
.footer__legal { grid-column: 1 / -1; margin: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted-2); font-size: .85rem; }
.footer__legal .mono { color: var(--muted-2); }

/* ============================================================
   Sub-pages (legal, etc.)
   ============================================================ */
.page-head { padding: clamp(2rem, 5vw, 3.25rem) 0 1.25rem; }

/* Back link (sub-topic pages, top-left of the page head) */
.backlink { display: flex; width: fit-content; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: 1.64rem; line-height: 1; color: var(--muted); margin-bottom: .8rem; }
.backlink span { transition: transform .2s; }
.backlink:hover { color: var(--signal); }
.backlink:hover span { transform: translateX(-3px); }

/* Sub-topic pages run tighter vertically */
/* Compact inner pages (topic + guide): shorter page-head &amp; tighter rhythm. Home hero is separate. */
.topic .page-head, .guide .page-head { padding: clamp(.45rem, 1.2vw, .8rem) 0 .5rem; }
.topic .page-head .backlink { margin-bottom: .3rem; }
.topic .page-head h1, .guide .page-head h1 { font-size: clamp(1.55rem, 3.6vw, 2.05rem); line-height: 1.05; margin: .1rem 0 .25rem; }
.topic .page-head .lead, .guide .page-head .lead { margin: .4rem 0 0; font-size: clamp(.96rem, 1.8vw, 1.05rem); line-height: 1.45; }
.topic .section, .guide .section { padding: clamp(1.5rem, 3.5vw, 2.4rem) 0; }
.topic .cta-band, .guide .cta-band { padding: clamp(1.8rem, 4vw, 2.75rem) 0; }
.page-head h1 { font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.02em; margin: .6rem 0 .5rem; }
.page-head .updated { color: var(--muted); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; margin: 0; }
.prose { max-width: 760px; color: #c2ccd8; }
.prose h2 { color: var(--text); margin: 2.4rem 0 .7rem; font-size: 1.3rem; letter-spacing: -.01em; }
.prose h2:first-of-type { margin-top: 0; }
.prose p { margin: 0 0 1rem; }
.prose ul { margin: 0 0 1.2rem; padding-left: 1.25rem; }
.prose li { margin: .4rem 0; }
.prose li::marker { color: var(--signal); }
.prose a { color: var(--signal); }
.prose a:hover { text-decoration: underline; }
.prose strong { color: var(--text); }

/* ============================================================
   Topic pages
   ============================================================ */
.page-head .lead { margin: 1rem 0 0; max-width: 660px; color: var(--muted); font-size: clamp(1.05rem, 2.4vw, 1.25rem); }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec { background: var(--panel); padding: 1.1rem 1.2rem; }
.spec b { display: block; font-size: 1.02rem; color: var(--text); margin-top: .15rem; }
.spec span { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--signal); }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }
.steps > li { counter-increment: step; position: relative; padding-left: 3.4rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; color: #04130d; background: var(--grad); border-radius: 9px; box-shadow: 0 0 16px var(--signal-glow); }
.steps h3 { margin: .15rem 0 .3rem; font-size: 1.12rem; }
.steps p { margin: 0; color: var(--muted); }
.steps a { color: var(--signal); }
.steps a:hover { text-decoration: underline; }

.topic-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.note { margin-top: 1.2rem; font-size: .9rem; color: var(--muted-2); }

/* Tool-guide sub-groups (per tool, on the Tools page) */
.toolgroup { margin-top: 2.6rem; }
.toolgroup:first-of-type { margin-top: 1.6rem; }
.toolgroup__title { display: flex; align-items: center; gap: .6rem; margin: 0 0 1.1rem; font-size: 1.2rem; letter-spacing: -.01em; color: var(--text); }
.toolgroup__title::before { content: ""; width: 11px; height: 11px; border-radius: 3px; background: var(--c, var(--signal)); box-shadow: 0 0 12px var(--c, var(--signal)); flex: none; }

/* ============================================================
   Embedded app page (CoreScope)
   ============================================================ */
.embed-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.embed-page .nav { position: static; }
.embed-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.embed-bar { display: flex; align-items: center; gap: .85rem; padding: .55rem clamp(1rem, 4vw, 1.5rem); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.embed-bar .live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); animation: blink 2.4s ease-in-out infinite; }
.embed-bar strong { font-size: .92rem; }
.embed-bar .sep { color: var(--muted); font-size: .9rem; margin-right: auto; }
.btn--sm { padding: .45rem .8rem; font-size: .85rem; }
.embed-frame { flex: 1; min-height: 0; background: #0a0f14; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* "Open this tool full screen" pill — sits in the nav (replaces Join on tool pages) */
.embed-fs {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem .75rem; border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); color: var(--text);
  font-size: .85rem; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: border-color .2s, background .2s, transform .2s;
}
.embed-fs:hover { border-color: var(--signal); background: color-mix(in srgb, var(--bg) 86%, transparent); transform: translateY(-1px); }
.embed-fs:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.embed-fs__icon { width: 15px; height: 15px; flex: none; color: var(--signal); }
.embed-fs b { color: var(--signal); font-weight: 700; }
.embed-fs__arrow { color: var(--signal); font-family: var(--font-mono); }
.nav__links a[aria-current="page"] { color: var(--text); }
@media (max-width: 560px) { .embed-bar .sep { display: none; } }

/* ---- Resource link grid ---- */
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .8rem; }
.linkcard { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .95rem 1.15rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .2s, transform .2s, box-shadow .2s; }
.linkcard:hover { border-color: var(--signal); transform: translateY(-2px); box-shadow: 0 12px 30px -20px var(--signal-glow); }
.linkcard__txt { display: flex; flex-direction: column; }
.linkcard__name { font-weight: 600; color: var(--text); }
.linkcard__desc { color: var(--muted); font-size: .84rem; }
.linkcard__arrow { color: var(--signal); font-family: var(--font-mono); flex: none; transition: transform .2s; }
.linkcard:hover .linkcard__arrow { transform: translate(2px, -2px); }

/* Inline code */
code { font-family: var(--font-mono); font-size: .9em; background: rgba(255,255,255,.06); padding: .12em .42em; border-radius: 5px; color: var(--signal); }

/* Keyboard key */
kbd { font-family: var(--font-mono); font-size: .82em; line-height: 1; padding: .18em .42em; border-radius: 5px; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text); white-space: nowrap; }

/* Multi-line code / filter cheat-sheet block */
pre.code { font-family: var(--font-mono); font-size: .84rem; line-height: 1.7; background: #0a0f14; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 10px; padding: 1rem 1.15rem; overflow-x: auto; color: #c2ccd8; margin: 1.4rem 0; white-space: pre; }
pre.code code { background: none; padding: 0; color: inherit; font-size: inherit; }
pre.code .t { color: var(--signal); }              /* the thing you type */
pre.code .c { color: var(--muted-2); }             /* a comment / annotation */
/* Monospace cells inside guide tables (filter expressions) */
.gtable .mono, .gtable code { white-space: nowrap; }

/* Key/value spec list (used on Connect cards) */
.kv { list-style: none; margin: 1.1rem 0 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.kv li:first-child { border-top: 0; padding-top: 0; }
.kv .k { color: var(--muted); font-size: .9rem; flex: none; }
.kv .v { font-family: var(--font-mono); color: var(--text); text-align: right; word-break: break-word; }

/* Callout / note box */
.callout { display: block; padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 10px; background: rgba(255,180,84,.05); color: var(--muted); font-size: .92rem; margin-top: 1.6rem; }
.callout strong { color: var(--text); }
.subhead { font-size: 1.15rem; margin: 0 0 .4rem; color: var(--text); }

/* ---- Guide tables ---- */
.tablewrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.gtable { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .95rem; }
.gtable th, .gtable td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.gtable thead th { color: var(--signal); font-family: var(--font-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.02); }
.gtable tbody th { color: var(--text); font-weight: 600; white-space: nowrap; }
.gtable td { color: var(--muted); }
.gtable tbody tr:last-child th, .gtable tbody tr:last-child td { border-bottom: 0; }

/* ---- ID usage legend ---- */
.idlegend { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; margin: 1.3rem 0; padding: 0; list-style: none; }
.idlegend li { display: flex; align-items: center; gap: .55rem; font-size: .92rem; color: var(--muted); }
.idlegend b { color: var(--text); font-weight: 600; }
.idkey { width: 20px; height: 20px; border-radius: 5px; flex: none; border: 1px solid rgba(255,255,255,.14); }
.idkey--avail { background: #2e9e44; }
.idkey--deployed { background: #2f6fe0; }
.idkey--conflict { background: #e0394b; }
.idkey--reserved { background: #3a3f46; }

/* ---- Inline live embed (e.g. a MeshMapper widget inside a guide) ---- */
.liveframe { margin: 1.6rem 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0a0f14; }
.liveframe__bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); background: var(--bg-2); font-size: .85rem; color: var(--muted); }
.liveframe__bar .live__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 10px var(--signal); flex: none; animation: blink 2.4s ease-in-out infinite; }
.liveframe__bar .sep { margin-left: auto; white-space: nowrap; }
.liveframe__bar a { color: var(--signal); }
.liveframe iframe { display: block; width: 100%; height: 540px; border: 0; }

/* ---- Figure / screenshot in a guide ---- */
.guide-figure { margin: 1.6rem auto; max-width: 560px; }
.guide-figure img, .guide-figure video { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #0d1117; }
.guide-figure figcaption { margin-top: .65rem; font-size: .85rem; color: var(--muted-2); text-align: center; }
.guide-figure figcaption a { color: var(--signal); }
/* Float a figure beside the text to save vertical space */
.guide-figure--float { float: right; max-width: 300px; margin: .25rem 0 .9rem 1.5rem; }
.prose:has(.guide-figure--float) { display: flow-root; }
@media (max-width: 680px) { .guide-figure--float { float: none; max-width: 100%; margin: 1.4rem auto; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
  .guides__inner { grid-template-columns: 1fr; gap: 2rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .vibe { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav__toggle { display: block; }
  .nav__sep { display: none; }
  .nav__links {
    position: fixed; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem;
    transform: translateY(-130%); transition: transform .3s; pointer-events: none;
  }
  .nav__links.is-open { transform: translateY(0); pointer-events: auto; }
  .nav__links > a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: 1rem; justify-content: center; }
  /* undo the desktop centering pins on mobile */
  .nav__inner > .brand { position: static; height: auto; }
  .nav__links .btn--join,
  .nav__links .embed-fs--nav { position: static; height: auto; margin: 1rem 0 0; }
  /* Tools becomes a labeled group in the mobile menu */
  .nav__tools { flex-direction: column; align-items: stretch; }
  .nav__tools::after { display: none; }
  .nav__toolsbtn { padding: .9rem 0 .4rem; justify-content: flex-start; pointer-events: none; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); border-top: 1px solid var(--line); margin-top: .4rem; }
  .nav__toolsbtn .caret { display: none; }
  .nav__toolsmenu { position: static; opacity: 1; visibility: visible; transform: none; min-width: 0; background: none; border: 0; box-shadow: none; padding: 0 0 0 .25rem; }
  .nav__toolsmenu a { padding: .75rem 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
