:root {
  --abyss: #01060d;
  --deep: #04121c;
  --coral: #ff7a59;
  --coral-soft: #ffab8f;
  --teal: #1ec8c8;
  --cyan: #7ef0ff;
  --foam: #d6f6ff;
  --heart: #ff8fab;
  --gold: #f6d58a;
  --ink: #e8f7ff;
  --muted: #9bb8c6;
  --glass: rgba(10, 20, 30, 0.6);
  --stroke: rgba(255, 122, 89, 0.26);
  --stroke-cool: rgba(126, 240, 255, 0.2);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Syne", "Trebuchet MS", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--abyss);
  line-height: 1.55;
  overflow-x: hidden;
}

.skip {
  position: absolute; left: 1rem; top: -3rem; z-index: 20;
  background: var(--coral); color: #240a03; padding: 0.4rem 0.7rem;
  border-radius: 999px; font-weight: 800; text-decoration: none;
}
.skip:focus { top: 1rem; }

.ocean {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 480px at 82% -8%, rgba(255, 122, 89, 0.12), transparent 55%),
    radial-gradient(900px 420px at 12% 108%, rgba(30, 200, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #14303f 0%, #071824 45%, #01060d 100%);
}
.caustics, .mist { position: absolute; inset: 0; pointer-events: none; }
.caustics {
  background:
    radial-gradient(240px 90px at 22% 28%, rgba(255, 171, 143, 0.07), transparent 60%),
    radial-gradient(260px 90px at 72% 62%, rgba(126, 240, 255, 0.06), transparent 60%);
  animation: drift 20s ease-in-out infinite alternate;
}
.mist { background: linear-gradient(180deg, transparent 40%, rgba(1, 6, 13, 0.55) 100%); }

/* coral polyps swaying along the sea floor */
.polyps span {
  position: absolute; bottom: -4px;
  left: var(--x, 50%);
  width: 6px; height: var(--h, 30px);
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, var(--hue, var(--coral)), transparent 90%);
  opacity: 0.5;
  transform-origin: bottom center;
  animation: sway 7s ease-in-out infinite alternate;
  animation-delay: var(--d, 0s);
}

.hero, .filters, .reef, .foot, .featured {
  width: min(1120px, calc(100% - 2rem));
  margin-left: auto; margin-right: auto;
}
.hero { padding: 4.5rem 0 1rem; }
.eyebrow {
  letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 0.74rem; color: var(--coral-soft); margin: 0 0 0.8rem;
  font-weight: 800;
}
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 0.95; margin: 0 0 1rem;
  text-wrap: balance;
  text-shadow: 0 0 40px rgba(255, 122, 89, 0.16);
}
.lede { max-width: 44rem; color: var(--foam); font-size: 1.08rem; margin: 0 0 1.6rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
/* The sounding line. Anyone can publish a topic count; this says how much of
   the topic was actually read, which is the only number worth trusting. */
.sounding {
  margin: 1.4rem 0 0; max-width: 44rem;
  color: var(--muted); font-size: 0.86rem; line-height: 1.7;
}
.sounding b { color: var(--foam); font-weight: 800; }
.sounding a { color: var(--coral-soft); }
.btn {
  appearance: none; border: 1px solid var(--stroke);
  background: var(--glass); color: var(--foam);
  font: inherit; font-weight: 800; text-decoration: none;
  padding: 0.7rem 1.1rem; border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:hover, .btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.2);
  outline: none;
}
.btn.primary { background: var(--coral); color: #240a03; border-color: transparent; }
.btn.primary:hover, .btn.primary:focus-visible { background: var(--coral-soft); }

.featured { padding: 1.2rem 0 0.4rem; }
.featured h2 {
  font-family: var(--font-display); font-size: 1.25rem; margin: 0 0 0.7rem;
}
.featured .fine { font-family: var(--font-body); font-size: 0.8rem; color: var(--muted); font-weight: 700; margin-left: 0.5rem; }
.shelf {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(320px, 82vw);
  gap: 0.8rem; overflow-x: auto; padding: 0.2rem 0.2rem 0.9rem;
  scroll-snap-type: x proximity;
}
.pickcard {
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 0.35rem;
  background: linear-gradient(160deg, rgba(255, 122, 89, 0.14), rgba(10, 20, 30, 0.7) 55%);
  border: 1px solid var(--stroke);
  border-radius: 18px; padding: 0.9rem 1rem;
  color: inherit; text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pickcard:hover, .pickcard:focus-visible {
  transform: translateY(-3px); border-color: var(--coral-soft); outline: none;
}
.pickcard strong { font-family: var(--font-display); font-size: 1.05rem; }
.pickdesc {
  color: var(--muted); font-size: 0.85rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pickmeta { color: var(--coral-soft); font-size: 0.78rem; font-weight: 800; margin-top: auto; }

.filters {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.4rem 0 1.2rem; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(1,6,13,0.78), rgba(1,6,13,0.3) 80%, transparent);
  backdrop-filter: blur(8px);
}
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; }
.chip {
  appearance: none; border: 1px solid var(--stroke-cool);
  background: rgba(7, 20, 28, 0.55); color: var(--foam);
  font: inherit; font-weight: 700; font-size: 0.85rem;
  padding: 0.32rem 0.8rem; border-radius: 999px; cursor: pointer;
}
.chip.is-on, .chip[aria-pressed="true"] {
  background: var(--coral); color: #240a03; border-color: transparent;
}
.chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.search {
  flex: 1 1 14rem; min-width: 10rem;
  appearance: none; border: 1px solid var(--stroke-cool);
  background: rgba(7, 20, 28, 0.55); color: var(--ink);
  font: inherit; font-weight: 600; padding: 0.4rem 0.9rem;
  border-radius: 999px;
}
.search::placeholder { color: var(--muted); }
.search:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.sorts { display: inline-flex; gap: 0.4rem; }
.select {
  appearance: none; border: 1px solid var(--stroke-cool);
  background: rgba(7, 20, 28, 0.75); color: var(--foam);
  font: inherit; font-weight: 700; font-size: 0.85rem;
  padding: 0.32rem 0.9rem; border-radius: 999px; cursor: pointer;
}
.stats { margin-left: auto; color: var(--muted); font-size: 0.8rem; font-weight: 700; white-space: nowrap; }

.reef {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  padding-bottom: 3rem;
}
.card {
  display: flex; flex-direction: column; gap: 0.45rem;
  background: var(--glass);
  border: 1px solid var(--stroke-cool);
  border-radius: 18px; padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(255, 122, 89, 0.5);
}
.card.is-pick { border-color: var(--stroke); }
.card .head { display: flex; align-items: baseline; gap: 0.6rem; }
.card h3 { margin: 0; font-family: var(--font-display); font-size: 1.05rem; min-width: 0; overflow-wrap: anywhere; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover, .card h3 a:focus-visible { color: var(--coral-soft); outline: none; }
.stars { margin-left: auto; color: var(--gold); font-weight: 800; font-size: 0.85rem; white-space: nowrap; }
.badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.badge {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--stroke-cool);
}
.badge.official { background: #4d6bfe; color: white; border-color: transparent; }
.badge.pick { background: var(--coral); color: #240a03; border-color: transparent; }
.badge.cat { color: var(--cyan); }
.badge.tag { color: var(--coral-soft); border-color: var(--stroke); }
.desc { margin: 0; color: var(--muted); font-size: 0.92rem; }
.install { display: flex; align-items: center; gap: 0.4rem; margin: 0.15rem 0 0; }
.install code {
  flex: 1; min-width: 0;
  font-size: 0.72rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--foam);
  background: rgba(0, 0, 0, 0.25);
  padding: 0.28rem 0.5rem;
  border-radius: 8px;
}
.copy {
  appearance: none;
  border: 1px solid var(--stroke-cool);
  background: rgba(7, 20, 28, 0.55);
  color: var(--coral-soft);
  font: inherit; font-size: 0.72rem; font-weight: 800;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.copy.is-copied { background: var(--coral); color: #240a03; }
.meta { margin: auto 0 0; font-size: 0.78rem; color: var(--foam); opacity: 0.75; }
.proof { color: inherit; text-decoration-color: var(--stroke-cool); text-underline-offset: 2px; }
.proof:hover, .proof:focus-visible { color: var(--cyan); }
.activity.fresh { color: var(--teal); font-weight: 700; }
.empty {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1rem;
  color: var(--foam); font-family: var(--font-display); font-size: 1.3rem;
}
/* The waterline: cards below it are drawn as you reach them, so the count is
   a depth reading, not a "load more" button to hunt for. */
.tide {
  grid-column: 1 / -1; text-align: center; margin: 0.5rem 0 0;
  color: var(--muted); font-size: 0.85rem; font-weight: 700;
}
.foot {
  padding: 1rem 0 3rem; color: var(--muted); font-size: 0.92rem;
  border-top: 1px solid rgba(255, 122, 89, 0.14);
}
.foot a { color: var(--coral-soft); }
#heart-anchor { cursor: pointer; }
.heart {
  position: fixed; pointer-events: none; z-index: 30;
  font-size: 1.4rem; animation: floatheart 1.1s ease-out forwards;
}

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-3%, 2%, 0) scale(1.06); }
}
@keyframes sway {
  from { transform: rotate(-6deg); }
  to { transform: rotate(7deg); }
}
@keyframes floatheart {
  to { transform: translateY(-80px) scale(1.3); opacity: 0; }
}

@media (max-width: 640px) {
  .hero { padding-top: 3rem; }
  .lede { font-size: 1rem; }
  .stats { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .caustics, .polyps span, .heart { animation: none !important; }
  .card, .btn, .pickcard { transition: none !important; }
}

/* ---------- shared site bar ----------
   The same bar dsh.works and the sister registry wear. It is deliberately
   not in this page's palette: it belongs to the site, not to the reef, and
   a visitor crossing between surfaces should recognise it unchanged. Black,
   mono, cyan caret — the house style, stated once per surface. */
.sitebar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.5rem max(1rem, calc((100% - 1120px) / 2));
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #262626;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem; line-height: 1.6;
}
.sitebar a { text-decoration: none; }
.sitebar a:hover { text-decoration: underline; text-underline-offset: 3px; }
.sitebar-brand { color: #ffffff; font-weight: 700; white-space: nowrap; }
.sitebar-brand .caret { color: #00c2e9; }
.sitebar-brand i { color: #9a9a9a; font-style: normal; font-weight: 400; }
.sitebar-links {
  display: flex; gap: 1.1rem; margin-left: auto;
  overflow-x: auto; scrollbar-width: none;
}
/* The fade is the affordance for a strip that actually scrolls. Applied
   unconditionally it just clips the last link on a wide screen, so it is
   scoped to the widths where the strip really does run out of room. */
@media (max-width: 40rem) {
  .sitebar-links {
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 1.25rem), transparent 100%);
  }
}
.sitebar-links::-webkit-scrollbar { display: none; }
.sitebar-links a { color: #9a9a9a; white-space: nowrap; }
.sitebar-links a:hover { color: #00c2e9; }
.sitebar-links a[aria-current="page"] { color: #e8e8e8; }
.sitebar :focus-visible { outline: 2px solid #00c2e9; outline-offset: 2px; border-radius: 3px; }
