:root {
  color-scheme: dark;
  --bg: #100f18;
  --surface: #201d2b;
  --line: #373244;
  --ink: #f5f0ff;
  --muted: #b1aabd;
  --accent: #a7f9ec;
  --restricted: #f4abda;
  --tailnet: #bca8ff;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  scrollbar-color: #5b516b var(--bg);
  scroll-behavior: smooth;
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 70% 0%, #28203f, transparent 37rem) fixed, var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

.icon {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  flex: none;
  vertical-align: middle;
}
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: var(--bg); background: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.frame {
  width: min(1120px, calc(100% - 3rem));
  margin-inline: auto;
}

.site-header, .site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font: 500 .78rem var(--mono);
  color: var(--muted);
}

.site-header {
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  font-weight: 500;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid #564879;
  border-radius: .4rem;
  background: #27203b;
  color: var(--accent);
}

.brand-mark .icon { width: 1.45rem; height: 1.45rem; }

.github, .back-to-top, .hero-daw {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}

.github .icon { width: 1rem; height: 1rem; }
.hero-daw .icon:first-child { color: var(--accent); }
.site-header a:hover, .site-footer a:hover { color: var(--accent); }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr minmax(0, .85fr);
  align-items: center;
  isolation: isolate;
  gap: clamp(2rem, 5vw, 5.2rem);
  min-height: 465px;
  border-bottom: 1px solid var(--line);
}

.hero-copy { padding: 3rem 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: 0 0 1.1rem;
  color: var(--accent);
  font: 500 .7rem var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow span {
  width: 1rem;
  height: 1px;
  background: currentColor;
}

h1, h2, h3 { margin: 0; }

h1 {
  font-size: clamp(4.2rem, 10.1vw, 8.6rem);
  font-weight: 700;
  letter-spacing: -.065em;
  line-height: .96;
}

h1 span { color: var(--accent); }

.intro {
  max-width: 29ch;
  margin: 1.5rem 0 1.9rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.15rem;
}

.hero-daw {
  color: var(--muted);
  font: 500 .75rem var(--mono);
  padding-block: .65rem;
}

.hero-daw:hover { color: var(--accent); }

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
  border-radius: .4rem;
  background: var(--accent);
  color: #142620;
  font-size: .9rem;
  font-weight: 700;
  transition: background-color .18s ease;
}

.hero-link:hover { background: #d1fff5; }

.synth {
  min-width: 0;
  width: min(100%, 440px);
  justify-self: end;
  margin-block: 1.75rem;
  padding: .8rem;
  border: 1px solid #484059;
  border-radius: .75rem;
  background: linear-gradient(160deg, #2a2438, #1d1928 65%);
  box-shadow: inset 0 1px #ffffff12, 0 18px 36px #0806126e;
}

.synth-header {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 30px;
  margin-bottom: .65rem;
  font: 500 .66rem var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.synth-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-right: auto;
  color: var(--ink);
}

.synth-label span {
  width: .38rem;
  height: .38rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px #a7f9ec80;
}

.synth-toggle, .synth-tempo {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid #514762;
  border-radius: .25rem;
  background: #171320;
}

.synth-tempo { padding-inline: .5rem; color: #decfff; }

.synth-toggle {
  width: 36px;
  padding: 0;
  color: var(--accent);
}

.synth-toggle:hover { background: #372b4c; }

.synth-toggle .icon { width: .9rem; height: .9rem; }
.synth.is-playing .play-icon, .synth:not(.is-playing) .pause-icon { display: none; }

.synth-screen {
  display: grid;
  place-items: center;
  padding: .85rem;
  border: 1px solid #504364;
  border-radius: .4rem;
  background:
    linear-gradient(#b3a5ee17 1px, transparent 1px) center / 20px 20px,
    linear-gradient(90deg, #b3a5ee17 1px, transparent 1px) center / 20px 20px,
    radial-gradient(ellipse, #35284d, #100e19 78%);
  box-shadow: inset 0 0 20px #080715;
}

.radar-face {
  position: relative;
  width: min(84%, 290px);
  aspect-ratio: 1;
  border: 1px solid #a68bdf99;
  border-radius: 50%;
  background: repeating-radial-gradient(circle closest-side, #bfa7fa57 0 1px, transparent 1px 25%);
  box-shadow: 0 0 30px #a07cfc35, inset 0 0 26px #a07cfc21;
}

.radar-axis {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), #c0a9ef47 50%, transparent calc(50% + .5px)),
    linear-gradient(transparent calc(50% - .5px), #c0a9ef47 50%, transparent calc(50% + .5px));
}

.rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 13deg, transparent 0deg 54deg, #7dffe225 87deg, transparent 90deg);
  transform: rotate(12deg);
  animation: rotor-spin 8s linear infinite;
}

.blade {
  position: absolute;
  left: 50%;
  top: calc(50% - 3px);
  width: 47%;
  height: 6px;
  border-radius: 1px 4px 4px 1px;
  background: linear-gradient(90deg, #82f6e2, #c0fff5);
  box-shadow: 0 0 11px #60ffe0a6;
  transform-origin: 0 50%;
  transform: rotate(90deg);
}

.blade:nth-child(2) { transform: rotate(180deg); }
.blade:nth-child(3) { transform: rotate(270deg); }
.blade:nth-child(4) { transform: rotate(360deg); }

.radar-hub {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 14px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid #c0fff5;
  border-radius: 50%;
  background: #2a2540;
  box-shadow: 0 0 12px #83ffe2;
}

.orbit {
  position: absolute;
  inset: var(--inset);
  color: var(--note-color);
  transform: rotate(var(--angle));
  animation: note-orbit var(--period) linear infinite;
}

.orbit-outer { --inset: 12.5%; --angle: 25deg; --period: 6s; --note-color: #ff9acf; }
.orbit-middle { --inset: 25%; --angle: 146deg; --period: 4s; --note-color: #d3b1ff; animation-direction: reverse; }
.orbit-inner { --inset: 37.5%; --angle: 265deg; --period: 3s; --note-color: #ffe2a0; }

.orbit-note {
  position: absolute;
  top: 50%;
  left: 100%;
  width: clamp(6px, 1vw, 9px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 24%, transparent), 0 0 12px currentColor;
}

.step-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 3px;
  margin-top: .65rem;
  padding-top: 6px;
}

.step-track::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: calc((100% - 45px) / 16);
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  animation: step-playhead 2s steps(16, end) infinite;
}

.step-track i {
  height: 12px;
  border: 1px solid #504862;
  border-radius: 2px;
  background: #2e283b;
}

.step-track i:nth-child(4n + 1) { margin-left: 2px; }
.step-track .step-active { border-color: #8976c0; background: #62518e; }
.step-track .step-active:nth-child(4n + 1) { border-color: #84d8ca; background: #47796f; }

.synth:not(.is-playing) :is(.rotor, .orbit),
.synth:not(.is-playing) .step-track::before { animation-play-state: paused; }

@keyframes rotor-spin {
  from { transform: rotate(12deg); }
  to { transform: rotate(372deg); }
}

@keyframes note-orbit {
  from { transform: rotate(var(--angle)); }
  to { transform: rotate(calc(var(--angle) + 360deg)); }
}

@keyframes step-playhead {
  to { transform: translateX(calc(1600% + 48px)); }
}

.directory { padding: 2.85rem 0 4rem; scroll-margin-top: 1rem; }

.directory-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1rem;
  margin-bottom: 1.3rem;
}

h2 {
  font-size: clamp(2.15rem, 4vw, 3.2rem);
  letter-spacing: -.07em;
  line-height: 1;
}

.result-count {
  margin: 0;
  color: var(--muted);
  font: .75rem var(--mono);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  margin-bottom: 1.75rem;
}

.filters { display: flex; flex-wrap: wrap; gap: .4rem; }

.filters button {
  min-height: 40px;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
}

.filters button:hover { color: var(--ink); }
.filters button[aria-pressed='true'] {
  border-color: #7871aa;
  background: #31274a;
  color: var(--accent);
}

.search {
  display: flex;
  flex: 0 1 270px;
  align-items: center;
  gap: .7rem;
  min-height: 40px;
  padding: 0 .65rem 0 .8rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  color: var(--muted);
  cursor: text;
}

.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.search input {
  flex: 1;
  min-width: 0;
  padding: .45rem 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: .85rem;
}

.search input::placeholder { color: var(--muted); }

.search kbd {
  padding: .1rem .35rem;
  border: 1px solid #484059;
  border-radius: .22rem;
  font: .68rem var(--mono);
}

.search-icon { width: 1rem; height: 1rem; }

.service-group + .service-group { margin-top: 2.2rem; }

h3 {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-bottom: .75rem;
  color: var(--muted);
  font: 500 .7rem var(--mono);
  letter-spacing: .11em;
  text-transform: uppercase;
}

h3 .icon { width: .9rem; height: .9rem; }

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.service {
  --badge-size: 2.5rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  gap: .45rem .55rem;
  height: 100%;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--surface);
  transition: border-color .18s ease, background-color .18s ease;
}

.service-icon {
  display: grid;
  place-items: center;
  align-self: center;
  width: var(--badge-size);
  height: var(--badge-size);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: var(--corner, .45rem);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  color: var(--accent);
}

.service-emoji {
  font: 1.42rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-variant-emoji: emoji;
}

.service-brand {
  border-color: color-mix(in srgb, var(--brand-ink) 35%, var(--brand-bg));
  background: var(--brand-bg);
  color: var(--brand-ink);
}

.service-icon .icon { width: 1.42rem; height: 1.42rem; }
.brand-nextcloud { --brand-ink: #0082c9; --brand-bg: #edf9ff; }
.brand-soundcloud { --brand-ink: #f50; --brand-bg: #fff3e8; }
.brand-youtube { --brand-ink: #f00; --brand-bg: #fff1f1; }
.brand-supabase { --brand-ink: #3fcf8e; --brand-bg: #102b23; }
.brand-n8n { --brand-ink: #ff91ac; --brand-bg: #351e2a; }
.brand-docker { --brand-ink: #6172ff; --brand-bg: #f1f3ff; }
.brand-notion { --brand-ink: #000; --brand-bg: #fff; }

.service-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .55rem;
  font-size: 1.08rem;
  line-height: 1.25;
}

.service-top strong { font-weight: 600; overflow-wrap: anywhere; }
.service-arrow { color: var(--muted); width: .95rem; height: .95rem; }
.service-description, .service-meta { grid-column: 1 / -1; }
.service-description { color: var(--muted); font-size: .87rem; line-height: 1.45; }

.service-meta {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .35rem;
  color: var(--muted);
  overflow-wrap: anywhere;
  font: .66rem var(--mono);
}

.service-access { width: .78rem; height: .78rem; color: var(--accent); }
[data-access='private'] .service-access { color: var(--restricted); }
[data-access='tailnet'] .service-access { color: var(--tailnet); }
[data-access='local'] .service-access { color: var(--muted); }

a.service:hover, a.service:focus-visible {
  border-color: #7871aa;
  background: #29233a;
}

a.service:hover .service-arrow, a.service:focus-visible .service-arrow { color: var(--accent); }

.no-results {
  padding: 1.2rem;
  border: 1px dashed var(--line);
  border-radius: .45rem;
  color: var(--muted);
}

.site-footer {
  padding: 1.4rem 0 2rem;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .hero { min-height: 360px; gap: 1.5rem; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .frame { width: calc(100% - 2rem); }
  .site-header { min-height: 58px; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 0; }
  .hero-copy { padding: 2.85rem 0 1.55rem; }
  .synth { width: 100%; margin: 0 0 1.65rem; justify-self: center; }
  .radar-face { width: min(75%, 230px); }
  .directory { padding-top: 2rem; }
  .controls { flex-direction: column-reverse; align-items: stretch; }
  .filters button { padding-inline: .62rem; }
  .search { flex-basis: auto; }
  .search input { font-size: 1rem; }
  .search kbd { display: none; }
  .service { padding: .8rem; }
}

@media (max-width: 390px) {
  .service-grid { grid-template-columns: minmax(0, 1fr); }
}

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

.header-actions, .theme-picker {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.header-actions { gap: clamp(.85rem, 3vw, 2rem); }
.theme-picker .icon { color: var(--accent); }

.theme-picker select {
  max-width: 100%;
  min-height: 36px;
  padding: .25rem .4rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

@media (max-width: 430px) {
  .site-header { flex-wrap: wrap; padding-block: .7rem; }
  .header-actions { flex-wrap: wrap; }
  .theme-picker { gap: .4rem; }
}
