/* Panek Labs: lab-bench look. Cool paper, ink, one cobalt accent, highlighter yellow for the credit line. */
:root {
  --paper: #EAEEF3;
  --surface: #F7F9FC;
  --ink: #0F1B2D;
  --muted: #4F5F74;
  --line: #C7D1DC;
  --cobalt: #2740F0;
  --cobalt-hover: #1B2FC4;
  --on-cobalt: #FFFFFF;
  --mark: #FFE45C;
  --coffee: #F6C85F;
  --coffee-hover: #F0B93B;
  --coffee-ink: #3A2A06;
  --coffee-soft: #FFF4D6;
  --coffee-line: #E9CB7B;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1080px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0C1422;
    --surface: #131E32;
    --ink: #E7EDF6;
    --muted: #9FB0C6;
    --line: #243551;
    --cobalt: #8493FF;
    --cobalt-hover: #A3AEFF;
    --on-cobalt: #0C1422;
    --mark: #6B5A00;
    --coffee: #F2C14E;
    --coffee-hover: #F7D170;
    --coffee-ink: #2B1F05;
    --coffee-soft: #2A2412;
    --coffee-line: #5C4B1C;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-hover); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 2rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 800; font-size: 1.35rem; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 30px; flex: none; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.4rem; margin-left: auto; }
.site-nav a:not(.btn) { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.site-nav a:not(.btn):hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--cobalt); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font: inherit; font-weight: 700; padding: .6rem 1.1rem; border-radius: 6px; border: 2px solid var(--ink); background: transparent; color: var(--ink); text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn:hover { color: var(--ink); background: var(--surface); }
.btn-primary { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.btn-primary:hover { background: var(--cobalt-hover); border-color: var(--cobalt-hover); color: var(--on-cobalt); }
.btn-small { padding: .4rem .8rem; font-size: .95rem; }

/* Support button: warm honey, deliberately softer than a bright yellow */
.btn-coffee { background: var(--coffee); border-color: var(--coffee); color: var(--coffee-ink); }
.btn-coffee:hover, .site-footer a.btn-coffee:hover { background: var(--coffee-hover); border-color: var(--coffee-hover); color: var(--coffee-ink); }
.site-footer a.btn-coffee { color: var(--coffee-ink); }
.btn-coffee::before {
  content: ""; flex: none; width: 1.15em; height: 1.15em; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h13v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8zm13 1.5h1.5a2.5 2.5 0 0 1 0 5H17v-1.8h1.5a.7.7 0 0 0 0-1.4H17V9.5zM7 3h1.6v3H7zm3.4 0H12v3h-1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h13v6a5 5 0 0 1-5 5H9a5 5 0 0 1-5-5V8zm13 1.5h1.5a2.5 2.5 0 0 1 0 5H17v-1.8h1.5a.7.7 0 0 0 0-1.4H17V9.5zM7 3h1.6v3H7zm3.4 0H12v3h-1.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Support card shown on every page */
.support-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; background: var(--coffee-soft); border: 1px solid var(--coffee-line); border-left: 4px solid var(--coffee); border-radius: 6px; padding: 1rem 1.25rem; margin: 2rem 0; }
.support-card strong { display: block; font-family: var(--font-head); font-size: 1.1rem; line-height: 1.25; }
.support-card span { color: var(--muted); }

/* Small thank-you note after a download */
.toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: min(460px, calc(100% - 2rem)); background: var(--surface); border: 2px solid var(--ink); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); padding: .9rem 2.4rem .9rem 1rem; z-index: 30; }
.toast p { margin: 0 0 .65rem; font-size: .98rem; }
.toast-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.toast-close { position: absolute; top: .35rem; right: .45rem; width: 2rem; height: 2rem; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.toast-close:hover { color: var(--ink); }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero p.lead { font-size: 1.2rem; max-width: 34ch; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; gap: 2rem; } .hero { padding-top: 2.25rem; } }

/* Credit box: the thing people need to copy */
.credit-box { background: var(--surface); border: 2px solid var(--ink); border-radius: 6px; padding: 1.25rem 1.25rem 1.1rem; box-shadow: 6px 6px 0 var(--cobalt); }
.credit-box h2, .credit-box h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.credit-box .hint { font-size: .95rem; color: var(--muted); margin-bottom: .9rem; }
.credit-text { white-space: pre-line; overflow-wrap: anywhere; user-select: all; background: var(--paper); border: 1px dashed var(--muted); border-radius: 4px; padding: .8rem .9rem; margin: 0 0 .9rem; font-size: .95rem; line-height: 1.5; }
mark { background: var(--mark); color: inherit; padding: 0 .2em; border-radius: 2px; }

/* Filters bar: search, sort, genre */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toolbar { border-top: 1px solid var(--line); padding-top: 1.75rem; }
.filters { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: .75rem; margin-bottom: 1.5rem; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: .85rem; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search, .selects select { width: 100%; font: inherit; padding: .7rem 1rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); color: var(--ink); }
.search { padding-left: 2.6rem; }
.search::placeholder { color: var(--muted); }
.selects { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.select-wrap { display: block; min-width: 0; }
.selects select { cursor: pointer; text-overflow: ellipsis; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr; } }
.toolbar-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; }

/* Cover art (thumbnail) with the play button on top */
.cover { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--line); flex: none; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.cover .play svg { width: 18px; height: 18px; }
.cover-big .play { width: 68px; height: 68px; }
.cover-big .play svg { width: 28px; height: 28px; }

/* Track list rows */
.tracklist { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.track { position: relative; display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: .5rem 1.1rem; align-items: center; padding: 1rem 0; border-top: 1px solid var(--line); }
.track:last-child { border-bottom: 1px solid var(--line); }
.track .title { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: block; overflow-wrap: anywhere; }
.track .title:hover { color: var(--cobalt); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: .1rem 1rem; font-size: .95rem; color: var(--muted); }
.meta .genres { color: var(--ink); font-weight: 700; }
.desc { margin: .35rem 0 0; font-size: .95rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pills { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.pill { font: inherit; font-size: .82rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; padding: .05rem .5rem; text-decoration: none; cursor: pointer; }
a.pill:hover, button.pill:hover { border-color: var(--cobalt); color: var(--cobalt); }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }
.prog { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; opacity: 0; }
.prog i { display: block; height: 100%; width: 0; background: var(--cobalt); }
.is-playing .prog { opacity: 1; }
@media (max-width: 760px) {
  .track { grid-template-columns: 88px minmax(0, 1fr); gap: .5rem .9rem; align-items: start; }
  .track .actions { grid-column: 1 / -1; justify-content: flex-start; }
  .track .title { font-size: 1.1rem; }
  .cover .play { width: 40px; height: 40px; }
}
.empty { padding: 2.5rem 0; text-align: center; color: var(--muted); }
.more { text-align: center; margin: 2rem 0 0; }

/* Browse by genre */
.browse { padding: 2.5rem 1.25rem 3rem; }
.genre-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.genre-card { display: flex; flex-direction: column; gap: .1rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--cobalt); border-radius: 6px; color: var(--ink); text-decoration: none; }
.genre-card:hover { border-color: var(--ink); border-left-color: var(--cobalt); color: var(--ink); }
.genre-card strong { font-family: var(--font-head); font-size: 1.1rem; }
.genre-card span { color: var(--muted); font-size: .92rem; }

/* Player */
.play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--cobalt); color: var(--on-cobalt); display: grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.play:hover { background: var(--cobalt-hover); }
.play svg { width: 20px; height: 20px; }
.play .i-pause { display: none; }
.is-playing .play .i-play { display: none; }
.is-playing .play .i-pause { display: block; }
.wave { display: flex; align-items: center; gap: 2px; height: 48px; cursor: pointer; min-width: 0; }
.wave i { flex: 1; min-width: 2px; background: var(--line); border-radius: 1px; transition: background .08s linear; }
.wave i.on { background: var(--cobalt); }
.wave:hover i:not(.on) { background: var(--muted); }

/* Track page */
.crumbs { padding: 1.5rem 0 0; font-size: .95rem; }
.track-head { padding: 1rem 0 1.5rem; }
.track-head h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin-bottom: .6rem; }
.track-head .meta { align-items: center; }
.genre-links { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.stage { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 2rem; align-items: start; margin-bottom: 2rem; }
.stage .cover-big { width: 100%; }
.stage-side { min-width: 0; }
.wave-row { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .75rem 1rem; margin-bottom: 1.25rem; }
.wave-row .wave { flex: 1; height: 56px; }
.wave-row .time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .95rem; white-space: nowrap; }
.download-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem; }
.btn-big { padding: .85rem 1.5rem; font-size: 1.1rem; }
.track-body { max-width: 68ch; padding-bottom: 3rem; }
.track-body h2 { margin-top: 1.6rem; }
@media (max-width: 760px) { .stage { grid-template-columns: 1fr; gap: 1.25rem; } .stage .cover-big { max-width: 420px; } }

/* Genre page */
.genre-intro { max-width: 62ch; color: var(--muted); font-size: 1.1rem; }
.other-genres { padding: 2.5rem 0 3rem; }

/* Prose pages */
.page { padding: 2.5rem 0 4rem; }
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2.2rem; }
.prose h3 { font-size: 1.15rem; margin: 1.4rem 0 .3rem; }
.prose h3 + p { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }
.note { border-left: 4px solid var(--cobalt); background: var(--surface); padding: .8rem 1rem; margin: 1.25rem 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 2rem 0 3rem; font-size: .95rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.site-footer a { color: var(--ink); }
.support-line { margin: 0; }

/* Permission letter */
.letter-layout { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 900px) { .letter-layout { grid-template-columns: 1fr; } }
.field { display: block; margin-bottom: 1rem; }
.field span { display: block; font-weight: 700; margin-bottom: .25rem; }
.field input { width: 100%; font: inherit; padding: .6rem .8rem; border: 2px solid var(--ink); border-radius: 6px; background: var(--surface); color: var(--ink); }
.letter { background: #fff; color: #14181f; border: 1px solid var(--line); padding: 3rem 3.25rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem; line-height: 1.55; max-width: 760px; }
.letter h2 { font-family: Georgia, serif; font-size: 1.5rem; letter-spacing: .02em; margin-bottom: 1.25rem; }
.letter dl { display: grid; grid-template-columns: 8.5rem 1fr; gap: .25rem 1rem; margin: 0 0 1.5rem; }
.letter dt { font-weight: 700; }
.letter dd { margin: 0; }
.letter .credit-text { background: #f4f4f4; border-color: #888; font-family: Georgia, serif; user-select: text; color: #14181f; }
.letter mark { background: #ffe45c; }
.letter .sig { margin-top: 2.5rem; }
.letter .sig-name { font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 1.8rem; border-bottom: 1px solid #14181f; display: inline-block; min-width: 14rem; padding-bottom: .1rem; }
.fill { background: #ffe45c; padding: 0 .25em; }
@media (max-width: 600px) { .letter { padding: 1.5rem; } .letter dl { grid-template-columns: 1fr; } }

@media print {
  .site-header, .site-footer, .noprint, .skip { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .letter-layout { display: block; }
  .letter { border: 0; padding: 0; max-width: none; }
  .fill { background: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Stop long unbreakable links (like the Creative Commons URL) from making the page scroll sideways on phones */
.prose, .letter, .note, .credit-box { overflow-wrap: anywhere; }
.letter-layout > * { min-width: 0; }
