/* dX — ambient music producer, Canada
   Yellow + black. Core tech only: HTML, CSS, JS. */

:root {
  --black: #0a0a0a;
  --ink: #141414;
  --card: #1a1a1a;
  --line: #2c2c2c;
  --yellow: #ffd400;
  --yellow-soft: #ffe566;
  --yellow-dim: rgba(255, 212, 0, 0.12);
  --text: #f5f1e0;
  --muted: #b3ad98;

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 4px;
  --max: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

img, iframe { max-width: 100%; display: block; }

a { color: var(--yellow); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--yellow-soft); }

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

::selection { background: var(--yellow); color: var(--black); }

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--yellow);
  color: var(--black);
  padding: 10px 16px;
  font-weight: 700;
  z-index: 1000;
}
.skip-link:focus { top: 16px; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--yellow);
  color: var(--black);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 700;
}
.logo:hover { color: var(--text); }

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.nav a {
  display: block;
  padding: 10px 14px;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav a:hover { color: var(--yellow); background: var(--yellow-dim); }
.nav a[aria-current="page"] { color: var(--black); background: var(--yellow); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--yellow);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--black);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .nav a { padding: 14px; font-size: 15px; }
}

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

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.55;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  padding-top: clamp(72px, 14vw, 160px);
  padding-bottom: clamp(72px, 12vw, 140px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--yellow);
  margin: 0 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: var(--yellow);
}

.hero h1 {
  font-size: clamp(64px, 16vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  margin: 0 0 24px;
  font-weight: 700;
}
.hero h1 .x { color: var(--yellow); }

.hero .lede {
  font-size: clamp(18px, 2.4vw, 24px);
  max-width: 34ch;
  color: var(--text);
  margin: 0 0 36px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 2px solid var(--yellow);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--yellow); color: var(--black); }
.btn-primary:hover { background: var(--yellow-soft); border-color: var(--yellow-soft); color: var(--black); }
.btn-ghost { background: transparent; color: var(--yellow); }
.btn-ghost:hover { background: var(--yellow); color: var(--black); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Page header (inner pages) ---------- */

.page-head {
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, transparent 0 39px, var(--line) 39px 40px),
    var(--black);
}
.page-head .wrap { padding-top: 72px; padding-bottom: 56px; }
.page-head h1 {
  font-size: clamp(44px, 9vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 16px;
}
.page-head h1 span { color: var(--yellow); }
.page-head p { color: var(--muted); max-width: 60ch; margin: 0; }

/* ---------- Sections ---------- */

.section { padding: clamp(64px, 9vw, 112px) 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
}
.section-head .num {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--yellow);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}
.link-arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.2s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}
@media (min-width: 860px) {
  .about-grid { grid-template-columns: 1.3fr 1fr; gap: 72px; }
}
.about-grid p { font-size: 19px; max-width: 60ch; margin: 0 0 18px; }
.about-grid p:first-child::first-letter {
  color: var(--yellow);
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  align-self: start;
}
.stat { background: var(--black); padding: 24px; }
.stat b {
  display: block;
  font-size: 44px;
  line-height: 1;
  color: var(--yellow);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- Patch cards ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

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

.chip {
  min-height: 40px;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.chip:hover { border-color: var(--yellow); color: var(--yellow); }
.chip[aria-pressed="true"] { background: var(--yellow); color: var(--black); border-color: var(--yellow); }

.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 340px;
}
.search label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 40px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--yellow); outline: none; }
.search svg {
  position: absolute;
  left: 12px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.count {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
}

.patch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.patch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.4s var(--ease) forwards;
}
.patch-card:hover {
  border-color: var(--yellow);
  background: #1f1d12;
  color: var(--text);
}
.patch-card:hover .patch-go { background: var(--yellow); color: var(--black); }

.patch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border: 1px solid var(--yellow);
  color: var(--yellow);
  border-radius: 2px;
}
.patch-idx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.patch-card h3 {
  font-size: 20px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.patch-card p { color: var(--muted); font-size: 15px; margin: 0; flex: 1; }
.patch-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.patch-go {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--yellow);
  border-radius: 50%;
  color: var(--yellow);
  transition: all 0.2s var(--ease);
}
.patch-go svg { width: 14px; height: 14px; }

.empty {
  padding: 48px 24px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--muted);
}
.empty button { margin-top: 16px; }

/* ---------- Videos ---------- */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
@media (max-width: 400px) {
  .video-grid, .patch-grid { grid-template-columns: 1fr; }
}

.video {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s var(--ease);
  opacity: 0;
  transform: translateY(8px);
  animation: rise 0.4s var(--ease) forwards;
}
.video:hover { border-color: var(--yellow); }

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: var(--ink);
  cursor: pointer;
}
.video-play img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.7) contrast(1.05);
  transition: filter 0.3s var(--ease), transform 0.4s var(--ease);
}
.video-play:hover img, .video-play:focus-visible img { filter: none; transform: scale(1.03); }
.video-play .play-icon {
  position: absolute;
  left: 50%; top: 50%;
  width: 68px; height: 68px;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background: var(--yellow);
  color: var(--black);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(255, 212, 0, 0.2);
  transition: transform 0.2s var(--ease);
}
.video-play:hover .play-icon { transform: translate(-50%, -50%) scale(1.08); }
.video-play .play-icon svg { width: 26px; height: 26px; margin-left: 4px; }

.video figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.video figcaption a { font-size: 12px; }

/* Playlist banner */
.banner {
  display: grid;
  gap: 24px;
  align-items: center;
  padding: clamp(28px, 5vw, 48px);
  background: var(--yellow);
  color: var(--black);
  border-radius: var(--radius);
  margin-top: 48px;
}
@media (min-width: 760px) { .banner { grid-template-columns: 1fr auto; } }
.banner h2 { margin: 0 0 6px; font-size: clamp(26px, 4vw, 40px); line-height: 1.05; letter-spacing: -0.03em; }
.banner p { margin: 0; font-size: 17px; }
.banner .btn { background: var(--black); color: var(--yellow); border-color: var(--black); }
.banner .btn:hover { background: var(--ink); color: var(--yellow-soft); }

/* ---------- Marquee ---------- */

.marquee {
  overflow: hidden;
  background: var(--yellow);
  color: var(--black);
  border-block: 1px solid var(--yellow);
}
.marquee-track {
  display: flex;
  width: max-content;
  animation: scroll 40s linear infinite;
}
.marquee span {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 14px 24px;
  white-space: nowrap;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }

/* ---------- Motion ---------- */

@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes scroll { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .marquee-track { animation: none; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
