/* FREQUENCITY OS — project atlas
   Self-contained stylesheet. No imports, no external fonts, no frameworks. */

:root {
  --bg: #0b1015;
  --bg-soft: #0f151c;
  --panel: #141c25;
  --panel-2: #1a2430;
  --ink: #e9eef3;
  --ink-dim: #a5b3c0;
  --ink-faint: #72808d;
  --line: #26323f;
  --accent: #5fc6de;        /* atlas cyan */
  --accent-soft: #97dcea;
  --accent-ink: #052730;
  --working: #63bd8b;
  --working-bg: #10281c;
  --working-line: #234a35;
  --experimental: #d6a553;
  --experimental-bg: #2a2110;
  --experimental-line: #4a3a1c;
  --archived: #93a0ab;
  --archived-bg: #1b222a;
  --public-line: #2e5d6b;
  --focus: #9fe2f0;
  --radius: 10px;
  --maxw: 1180px;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", Times, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--sans);
  background:
    radial-gradient(1100px 480px at 12% -8%, #12202b 0%, transparent 60%),
    radial-gradient(900px 420px at 88% -4%, #101a24 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
}

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 50;
  background: var(--panel-2);
  color: var(--ink);
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

code {
  font-family: var(--mono);
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: .9em;
}

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

.os-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 16, 21, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.os-header-inner {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.os-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .14em;
  font-weight: 850;
  font-size: .82rem;
}

.os-wordmark-f {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  letter-spacing: 0;
}

.os-wordmark-os {
  color: var(--accent);
  border: 1px solid var(--public-line);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: .68rem;
  letter-spacing: .18em;
}

.os-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.os-nav a {
  color: var(--ink-dim);
  text-decoration: none;
  font-size: .82rem;
  font-weight: 650;
}

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

/* ---------- Layout ---------- */

.os-view {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
  padding: 28px 0 76px;
  outline: none;
}

/* ---------- Hero ---------- */

.os-hero {
  padding: clamp(34px, 6vw, 68px) 0 30px;
  border-bottom: 1px solid var(--line);
}

.os-overline {
  color: var(--ink-faint);
  font-family: var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .7rem;
  font-weight: 800;
  margin: 0 0 14px;
}

.os-hero h1,
.os-detail h1,
.os-about h1,
.os-notfound h1,
.noscript-box h1 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.06;
  font-size: clamp(2rem, 5vw, 3.3rem);
  margin: 0 0 18px;
  max-width: 22ch;
}

.os-lede {
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.65;
  max-width: 62ch;
  margin: 0;
}

/* ---------- Controls (secondary to structure) ---------- */

.os-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

#search-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.os-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 340px);
}

.os-search-label {
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#project-search {
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 16px;
  width: 100%;
}

#project-search::placeholder { color: var(--ink-faint); }
#project-search:focus { border-color: var(--accent); }

.os-btn {
  font: inherit;
  font-weight: 750;
  font-size: .85rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.os-btn:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }

.os-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.os-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}

.os-pill:hover { border-color: var(--accent); color: var(--ink); }

.os-pill.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.os-pill-count {
  font-family: var(--mono);
  font-size: .72rem;
  background: rgba(0, 0, 0, .25);
  border-radius: 999px;
  padding: 1px 7px;
}

.os-pill.is-active .os-pill-count { background: rgba(255, 255, 255, .3); }

/* ---------- Groups ---------- */

.os-group { padding: 34px 0 8px; }

.os-group-head h2 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 6px;
}

.os-group-blurb {
  color: var(--ink-faint);
  margin: 0 0 20px;
  max-width: 68ch;
  font-size: .95rem;
}

/* ---------- Cards ---------- */

.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 14px;
}

.os-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.os-card:hover,
.os-card:focus-visible {
  background: var(--panel-2);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.os-card.is-featured { border-color: var(--public-line); }

.os-card.is-archived { background: var(--bg-soft); }

.os-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.os-card-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.os-card-tagline {
  color: var(--ink-dim);
  font-size: .92rem;
  line-height: 1.55;
}

.os-card-cta {
  margin-top: auto;
  padding-top: 8px;
  color: var(--accent-soft);
  font-size: .8rem;
  font-weight: 750;
}

/* ---------- Badges ---------- */

.os-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  width: fit-content;
}

.os-badge-working {
  color: var(--working);
  background: var(--working-bg);
  border: 1px solid var(--working-line);
}

.os-badge-experimental {
  color: var(--experimental);
  background: var(--experimental-bg);
  border: 1px solid var(--experimental-line);
}

.os-badge-archived {
  color: var(--archived);
  background: var(--archived-bg);
  border: 1px solid var(--line);
}

.os-badge-public {
  color: var(--accent-soft);
  background: transparent;
  border: 1px solid var(--public-line);
}

.os-badge-private {
  color: var(--ink-faint);
  background: transparent;
  border: 1px dashed var(--line);
}

/* ---------- Tech pills ---------- */

.os-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.os-tech-pill {
  border: 1px solid var(--line);
  color: var(--ink-faint);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: .68rem;
  font-family: var(--mono);
}

/* ---------- Detail ---------- */

.os-crumb { margin-bottom: 24px; }

.os-crumb a { text-decoration: none; font-size: .85rem; font-weight: 700; }

.os-detail-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.os-detail-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}

.os-detail-body p {
  max-width: 70ch;
  color: var(--ink-dim);
  margin: 0 0 1em;
}

.os-detail h2,
.os-about h2 {
  font-family: var(--mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-faint);
  margin: 30px 0 12px;
  font-weight: 800;
}

.os-link-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}

.os-no-links {
  color: var(--ink-faint);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-width: 62ch;
  margin: 0;
  font-size: .92rem;
}

.os-no-links strong { color: var(--ink-dim); }

.os-detail.is-archived .os-detail-body,
.os-detail.is-archived .os-lede { color: var(--ink-faint); }

/* ---------- About ---------- */

.os-about p,
.os-about li {
  max-width: 70ch;
  color: var(--ink-dim);
}

.os-about ul { padding-left: 1.2em; }

.os-about li { margin-bottom: .45em; }

.os-about li strong { color: var(--ink); }

.os-about-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.os-about-links a { font-weight: 700; text-decoration: none; }
.os-about-links a:hover { text-decoration: underline; }

/* ---------- Empty / not-found / noscript ---------- */

.os-empty {
  color: var(--ink-dim);
  padding: 34px 0;
  font-size: 1rem;
}

.os-notfound { padding: 44px 0; }

.noscript-box { padding: 34px 0; }

.noscript-box h2 {
  font-family: var(--mono);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--ink-faint);
  margin: 26px 0 8px;
}

.noscript-box p, .noscript-box li { color: var(--ink-dim); max-width: 68ch; }

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

.os-footer {
  width: min(var(--maxw), 100% - 40px);
  margin-inline: auto;
  border-top: 1px solid var(--line);
  padding: 24px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 10px 22px;
  flex-wrap: wrap;
  color: var(--ink-faint);
  font-size: .78rem;
}

.os-footer p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .os-header-inner,
  .os-view,
  .os-footer { width: min(100% - 28px, var(--maxw)); }

  .os-controls { flex-direction: column; align-items: stretch; }

  #search-form { width: 100%; }
  .os-search { width: 100%; flex: 1; }

  .os-grid { grid-template-columns: 1fr; }
}
