:root {
  --abyss: #01060d;
  --deep: #04121c;
  --mid: #0a2a3a;
  --teal: #1ec8c8;
  --cyan: #7ef0ff;
  --foam: #d6f6ff;
  --nacho: #a3d3ff;
  --heart: #ff8fab;
  --gold: #f6d58a;
  --ink: #e8f7ff;
  --muted: #9bb8c6;
  --glass: rgba(6, 22, 34, 0.58);
  --stroke: rgba(126, 240, 255, 0.22);
  --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(--cyan); color: #032026; 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(1200px 500px at 80% -10%, rgba(163, 211, 255, 0.16), transparent 55%),
    radial-gradient(900px 420px at 20% 110%, rgba(30, 200, 200, 0.12), transparent 50%),
    linear-gradient(180deg, #16344a 0%, #071824 42%, #01060d 100%);
}
body[data-scene="abyss"] .ocean {
  background:
    radial-gradient(800px 360px at 70% 0%, rgba(214, 246, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #0b1c28 0%, #03080e 60%, #000 100%);
}
body[data-scene="glow"] .ocean {
  background:
    radial-gradient(900px 420px at 75% 15%, rgba(126, 240, 255, 0.2), transparent 55%),
    radial-gradient(700px 300px at 10% 80%, rgba(246, 213, 138, 0.08), transparent 50%),
    linear-gradient(180deg, #1a4058 0%, #08202e 45%, #01060d 100%);
}
.photo {
  /* negative inset keeps the blur's bright fringe off-screen */
  position: absolute; inset: -14px;
  background-size: cover; background-position: center 20%;
  opacity: 0; transition: opacity 0.8s ease;
  filter: saturate(0.8) brightness(0.38) blur(7px);
}
body[data-scene="shot"] .photo { opacity: 1; }
.caustics, .mist { position: absolute; inset: 0; pointer-events: none; }
.caustics {
  background:
    radial-gradient(220px 80px at 20% 30%, rgba(126, 240, 255, 0.08), transparent 60%),
    radial-gradient(260px 90px at 70% 60%, rgba(163, 211, 255, 0.07), transparent 60%);
  animation: drift 18s ease-in-out infinite alternate;
}
.mist {
  background: linear-gradient(180deg, transparent 40%, rgba(1, 6, 13, 0.55) 100%);
}

.whale {
  position: absolute; width: min(42vw, 380px); height: auto;
  left: 8%; top: 18%; fill: #071018; opacity: 0.72;
  filter: drop-shadow(0 0 18px rgba(126, 240, 255, 0.18));
  animation: swim 22s ease-in-out infinite;
  cursor: pointer;
}
.whale .eye { fill: #7ef0ff; }
.bubbles span {
  position: absolute; bottom: -20px; border-radius: 50%;
  background: rgba(214, 246, 255, 0.18);
  border: 1px solid rgba(126, 240, 255, 0.18);
  animation: rise var(--t, 12s) linear infinite;
  animation-delay: var(--d, 0s);
  left: var(--x, 50%); width: var(--s, 8px); height: var(--s, 8px);
}

.hero, .filters, .gallery, .foot {
  width: min(1120px, calc(100% - 2rem));
  margin-left: auto; margin-right: auto;
}
.hero { padding: 4.5rem 0 1.5rem; }
.eyebrow {
  letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 0.74rem; color: var(--cyan); 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(126, 240, 255, 0.18);
}
.lede {
  max-width: 42rem; color: var(--foam);
  font-size: 1.08rem; margin: 0 0 1.6rem;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.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(126, 240, 255, 0.18);
  outline: none;
}
.btn.primary { background: #7ef0ff; color: #032026; border-color: transparent; }
.btn.primary:hover, .btn.primary:focus-visible { background: #a3d3ff; }

.filters {
  display: flex; flex-direction: column; gap: 0.5rem;
  padding: 0.4rem 0 1.4rem; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(1,6,13,0.72), rgba(1,6,13,0.28) 80%, transparent);
  backdrop-filter: blur(8px);
}
.frow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.divider {
  width: 1px; align-self: stretch; margin: 0.2rem 0.15rem;
  background: rgba(126, 240, 255, 0.22);
}
.search {
  flex: 1 1 12rem; min-width: 9rem;
  appearance: none; border: 1px solid var(--stroke);
  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; }
.stats {
  margin-left: auto; color: var(--muted);
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.chip {
  appearance: none; border: 1px solid var(--stroke);
  background: rgba(7, 20, 28, 0.55); color: var(--foam);
  font: inherit; font-weight: 700; padding: 0.4rem 0.85rem;
  border-radius: 999px; cursor: pointer;
}
.chip.is-on, .chip[aria-pressed="true"] {
  background: var(--cyan); color: #032026; border-color: transparent;
}
.chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

.gallery {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding-bottom: 3rem;
}
.card {
  display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transform: translateY(0);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover, .card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(126, 240, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(126, 240, 255, 0.15), var(--shadow);
}
.thumb {
  display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: #07141c; position: relative;
}
.thumb img, .thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 70% 30%, rgba(126,240,255,0.18), transparent 45%),
    linear-gradient(160deg, #0a2433, #041018 70%);
  color: var(--foam); text-align: center; padding: 1rem;
  font-family: var(--font-display); font-weight: 800;
}
.ph small { display: block; font-family: var(--font-body); font-weight: 700; opacity: 0.7; margin-top: 0.35rem; }
.body { padding: 1rem 1.05rem 1.15rem; display: flex; flex-direction: column; gap: 0.45rem; flex: 1; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.18rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--stroke);
}
.badge.official { background: #4d6bfe; color: white; border-color: transparent; }
.badge.unofficial { color: var(--muted); }
.badge.verified { background: #166534; color: #dcfce7; border-color: transparent; }
.badge.unverified { color: var(--gold); }
.badge.broken { background: #7f1d1d; color: #fee2e2; border-color: transparent; }
.badge.cat { color: var(--nacho); }
.body h2 { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.body h2 a { color: inherit; text-decoration: none; }
.body h2 a:hover, .body h2 a:focus-visible { color: var(--cyan); outline: none; }
.body p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.meta { font-size: 0.8rem !important; color: var(--foam) !important; opacity: 0.8; margin-top: auto !important; }
.empty {
  grid-column: 1 / -1; text-align: center; padding: 3rem 1rem;
  color: var(--foam); font-family: var(--font-display); font-size: 1.3rem;
}
.foot {
  padding: 1rem 0 3rem; color: var(--muted); font-size: 0.92rem;
  border-top: 1px solid rgba(126, 240, 255, 0.1);
}
.foot a { color: var(--cyan); }
.heart {
  position: fixed; pointer-events: none; z-index: 30;
  font-size: 1.4rem; animation: floatheart 1.1s ease-out forwards;
}
.backdrop-credit {
  position: fixed; right: 0.9rem; bottom: 0.9rem; z-index: 6;
  color: var(--foam); text-decoration: none;
  font-size: 0.78rem; font-weight: 700;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--glass);
  backdrop-filter: blur(10px);
  opacity: 0.85;
}
.backdrop-credit:hover, .backdrop-credit:focus-visible {
  opacity: 1; text-decoration: underline; outline: none;
}

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-3%, 2%, 0) scale(1.06); }
}
@keyframes swim {
  0%, 100% { transform: translate3d(0,0,0) rotate(-2deg); }
  50% { transform: translate3d(18vw, 8vh, 0) rotate(3deg); }
}
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  12% { opacity: 0.7; }
  100% { transform: translateY(-110vh) scale(1.2); opacity: 0; }
}
@keyframes floatheart {
  to { transform: translateY(-80px) scale(1.3); opacity: 0; }
}

@media (max-width: 640px) {
  .hero { padding-top: 3rem; }
  .lede { font-size: 1rem; }
  .filters { top: 0; }
  .whale { top: 8%; opacity: 0.45; }
}

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

.scheme { display: inline-flex; gap: 0.4rem; margin-left: auto; }
.thumb { aspect-ratio: 16 / 10; }
.thumb a, a.thumb { color: inherit; text-decoration: none; }
.ph-whale {
  width: 70%; max-width: 220px; height: auto;
  fill: #071018; opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(126, 240, 255, 0.2));
}
.ph-whale .eye { fill: #7ef0ff; }
.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);
  background: rgba(7, 20, 28, 0.55);
  color: var(--cyan);
  font: inherit; font-size: 0.72rem; font-weight: 800;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
}
.copy.is-copied { background: var(--cyan); color: #032026; }
.dive { color: var(--cyan); text-decoration: none; font-weight: 800; }
.dive:hover, .dive:focus-visible { text-decoration: underline; }
.meta a { color: var(--cyan); text-decoration: none; }
.meta a:hover, .meta a:focus-visible { text-decoration: underline; }

.badge.live {
  background: var(--cyan);
  color: #032026;
  border-color: transparent;
}

body.porthole-open { overflow: hidden; }

.porthole[hidden] { display: none !important; }
.porthole {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.porthole-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 13, 0.38);
}
.porthole-window {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1080px, 92vw);
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  outline: none;
  animation: porthole-in 0.22s ease;
}
.porthole-titlebar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem 0.7rem;
  padding: 0.55rem 0.75rem;
  user-select: none;
  touch-action: none;
  border-bottom: 1px solid var(--stroke);
}
.porthole-dots {
  display: inline-flex;
  gap: 6px;
}
.porthole-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}
.porthole-dots i:nth-child(1) { background: var(--cyan); }
.porthole-dots i:nth-child(2) { background: var(--gold); }
.porthole-dots i:nth-child(3) { background: var(--heart); }
#porthole-title {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.porthole-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.porthole-actions button,
.porthole-actions a {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(7, 20, 28, 0.55);
  color: var(--foam);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.porthole-actions button.is-on,
.porthole-actions button[aria-pressed="true"] {
  background: var(--cyan);
  color: #032026;
  border-color: transparent;
}
.porthole-actions button:focus-visible,
.porthole-actions a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.porthole-actions [data-close] {
  width: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
}
#porthole-frame {
  display: block;
  width: 100%;
  min-height: 62vh;
  height: 62vh;
  border: 0;
  background: #07141c;
}

@keyframes porthole-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (min-width: 721px) {
  .porthole-titlebar { cursor: grab; }
  .porthole-titlebar.is-dragging { cursor: grabbing; }
}

@media (max-width: 720px) {
  .porthole-window {
    left: 0.4rem;
    top: 0.4rem;
    right: 0.4rem;
    bottom: 0.4rem;
    width: auto;
    height: auto;
    transform: none;
    border-radius: 14px;
    animation-name: porthole-in-narrow;
  }
  .porthole-titlebar { cursor: default; }
  #porthole-frame {
    min-height: 0;
    height: auto;
    flex: 1;
  }
}

@keyframes porthole-in-narrow {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- 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; }
