/* wing.cx shared shell — tokens, page chrome, and the pill/panel idiom.
   The homepage keeps its own inline CSS; this file dresses /ships and
   everything that lives under it. Keep the tokens below in sync with
   index.html if the palette ever moves. */

:root {
  --bg-top: #4a9ec8;
  --bg-bottom: #3681ab;

  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.78);
  --text-faint: rgba(255, 255, 255, 0.55);

  --pill-bg: rgba(0, 0, 0, 0.18);
  --pill-border: rgba(255, 255, 255, 0.12);
  --pill-bg-hover: rgba(0, 0, 0, 0.26);
  --border-strong: rgba(255, 255, 255, 0.25);

  --panel-bg: rgba(0, 0, 0, 0.16);
  --panel-bg-soft: rgba(0, 0, 0, 0.10);
  --ink: #111827;

  --ok: #6ee7b7;
  --warn: #fcd34d;
  --bad: #fca5a5;

  --radius-panel: 18px;
  --radius-pill: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Column layout so .page can absorb the leftover height and hold the footer
   at the bottom of the viewport. Without this a short page (e.g. /signals
   with one card) leaves the footer stranded mid-screen. */
body {
  background: var(--bg-bottom);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Fixed so the gradient doesn't stretch or tile on long, scrolling pages. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, var(--bg-top) 0%, var(--bg-bottom) 100%);
  z-index: -1;
}

a { color: inherit; }

/* ---------- Header ---------- */

/* Pinned, so navigation is reachable from anywhere on a long page without
   scrolling back to the top. Deliberately no background band: the items float
   over the page and each pill already carries its own translucent backing. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  width: 100%;
  padding: 1.75rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav-pill-center {
  display: flex;
  background: var(--pill-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-pill);
  padding: 4px 6px;
  align-items: center;
  gap: 4px;
}

.nav-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-item:hover { color: #ffffff; }

.nav-item.is-active {
  background: #ffffff;
  color: #1e293b;
}

.nav-item svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---------- Language toggle ---------- */

.lang-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-pill);
  padding: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-opt {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-opt:hover { color: #ffffff; }

.lang-opt.is-active {
  background: #ffffff;
  color: #1e293b;
}

/* ---------- Page shell ---------- */

.page {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 2.5rem 5rem 2.5rem;
  flex: 1 0 auto;
}

.breadcrumb {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-faint);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover { color: #ffffff; }

.page-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 0.75rem;
}

.page-lede {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 560px;
  margin-bottom: 2.5rem;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--panel-bg);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.5rem;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.9rem;
}

/* ---------- Buttons ---------- */

.btn-primary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-primary:hover:not(:disabled) {
  background: #ffffff;
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: #ffffff;
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--pill-bg-hover);
  border-color: var(--border-strong);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary svg,
.btn-primary svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ---------- Footer ---------- */

.site-footer {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2.5rem 3rem 2.5rem;
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-faint);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover { color: #ffffff; }


@media (max-width: 900px) {
  .site-header { padding: 1.25rem 1rem; gap: 0.5rem; }

  /* Kept visible: with a pinned header this is the way back, so hiding it
     would defeat the point. Trimmed down to fit instead. */
  .nav-pill-center { padding: 3px 4px; gap: 2px; }
  .nav-item { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

  .brand { font-size: 1.15rem; }
  .nav-actions { gap: 0.5rem; }
  .page { padding: 0.5rem 1.25rem 4rem 1.25rem; }
  .site-footer { padding: 0 1.25rem 2.5rem 1.25rem; }
  .panel { padding: 1.15rem; }
}

/* Below this width the three header groups no longer fit side by side.
   Navigation and the language switch keep their labels; the two links that
   also exist elsewhere on the page shrink to their icons. */
@media (max-width: 620px) {
  /* Only three things left up here - brand, nav, language - so one row is
     comfortable even with the longer Spanish labels. */
  .site-header { padding: 1rem 0.9rem; gap: 0.5rem; }
  .brand { font-size: 1.05rem; }

  .nav-pill-center { padding: 3px 4px; gap: 2px; }
  .nav-item { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
  .nav-item > span { display: none; }
  .nav-item svg { width: 16px; height: 16px; }

  .lang-opt { padding: 0.3rem 0.55rem; font-size: 0.72rem; }
}

/* ---------- Cards ----------
   The grid used by /ships and /signals. Same idiom either way: a status dot,
   a name, a description, optional tags, and an "open" affordance. Kept here
   rather than inline on each page so the two sections cannot drift apart. */

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

.card {
  background: var(--panel-bg);
  border: 1px solid var(--pill-border);
  border-radius: var(--radius-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.6rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all 0.2s ease;
}

a.card:hover {
  transform: translateY(-3px);
  background: var(--pill-bg-hover);
  border-color: var(--border-strong);
}

.card.is-empty {
  border-style: dashed;
  background: var(--panel-bg-soft);
  cursor: default;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 180px;
  color: var(--text-faint);
}

.card-status {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
}

.card-name {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.card-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
  flex-grow: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--pill-border);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
}

.card-open {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 0.5rem;
}

a.card:hover .card-open .arrow {
  display: inline-block;
  transform: translateX(3px);
}

.card-open .arrow { transition: transform 0.2s ease; }
