/* MP3Juice — one stylesheet for every page of the site.
   Visual language borrowed from the layout we modelled the site on: a soft gradient page,
   one wide rounded card per idea, a sticky translucent header and a composer that is the
   first thing on the page. Hand-written (no build step): edit here, redeploy the pages. */

:root {
  --bg: #f3f4f6;
  --fg: #111827;
  --muted: #6b7280;
  --card: #fff;
  --border: rgba(17, 24, 39, 0.1);
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-fg: #fff;
  --ring: rgba(2, 132, 199, 0.15);
  --dl: #166534;
  --dl-hover: #14532d;
  --error: #b91c1c;
  --blob-a: #dbeafe;
  --blob-b: #ffe4e6;
  --blob-c: #e0e7ff;
  --blob-opacity: 1;
  --header-bg: rgba(255, 255, 255, 0.75);
  --radius: 12px;
  --radius-lg: 16px;
}

html[data-theme="dark"] {
  --bg: #030712;
  --fg: #f9fafb;
  --muted: #9ca3af;
  --card: #0b1220;
  --border: rgba(255, 255, 255, 0.1);
  --accent: #0ea5e9;
  --accent-hover: #38bdf8;
  --ring: rgba(14, 165, 233, 0.2);
  --dl: #15803d;
  --dl-hover: #16a34a;
  --error: #f87171;
  --blob-a: #0c4a6e;
  --blob-b: #4c0519;
  --blob-c: #1e1b4b;
  --blob-opacity: 0.35;
  --header-bg: rgba(3, 7, 18, 0.75);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(55rem 32rem at 50% -12%, var(--blob-a), transparent 70%),
    radial-gradient(38rem 38rem at 108% 55%, var(--blob-b), transparent 70%),
    radial-gradient(38rem 38rem at -18% 72%, var(--blob-c), transparent 70%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}
html[data-theme="dark"] body { background-image:
    radial-gradient(55rem 32rem at 50% -12%, color-mix(in srgb, var(--blob-a) 60%, transparent), transparent 70%),
    radial-gradient(38rem 38rem at 108% 55%, color-mix(in srgb, var(--blob-b) 60%, transparent), transparent 70%),
    radial-gradient(38rem 38rem at -18% 72%, color-mix(in srgb, var(--blob-c) 60%, transparent), transparent 70%); }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; height: auto; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: flex; align-items: center; gap: 16px;
  max-width: 1080px; margin: 0 auto; padding: 10px 20px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px; margin-right: auto;
  font-size: 1.25rem; font-weight: 600; color: var(--fg); text-decoration: none;
}
.brand:hover { color: var(--fg); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.site-nav { display: flex; gap: 20px; font-size: 0.9375rem; }
.site-nav a { color: var(--fg); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.header-tools { display: flex; align-items: center; gap: 10px; }

.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  font: inherit; font-size: 0.875rem; cursor: pointer;
}
.tool:hover { border-color: var(--accent); color: var(--accent); }
.tool.icon { width: 38px; padding: 0; }
.tool svg { width: 18px; height: 18px; }

.lang { position: relative; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  display: none; min-width: 190px; padding: 6px; margin: 0; list-style: none;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
.lang.open .lang-menu { display: block; }
.lang-menu a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: var(--fg); text-decoration: none; font-size: 0.9375rem;
}
.lang-menu a:hover { background: var(--bg); }
.lang-menu a[aria-current="true"] { color: var(--accent); font-weight: 600; }

/* ---------- hero + composer ---------- */

.hero { max-width: 860px; margin: 0 auto; padding: 56px 20px 8px; }
.hero-head { text-align: center; margin-bottom: 28px; }
.hero-logo { width: 88px; height: 88px; border-radius: 22px; }
.hero h1 {
  margin: 18px 0 0; font-size: 2.25rem; line-height: 1.2;
  font-weight: 700; letter-spacing: -0.02em;
}
.hero-sub { margin: 14px auto 0; max-width: 46rem; color: var(--muted); font-size: 1.0625rem; }

.composer {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.field { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.field-icon { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
#ym-url {
  width: 100%; height: 56px; padding: 0 44px 0 44px;
  border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 1.0625rem;
  border-radius: var(--radius);
}
#ym-url::placeholder { color: var(--muted); }
#ym-url:focus { outline: none; }
.clear {
  position: absolute; right: 6px; display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.clear:hover { background: var(--bg); color: var(--fg); }
.clear[hidden] { display: none; }
.clear svg { width: 18px; height: 18px; }

.actions { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 26px; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; font-size: 1rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn svg { width: 20px; height: 20px; }
.btn-mp3 { background: var(--dl); color: #fff; }
.btn-mp3:hover:not(:disabled) { background: var(--dl-hover); }
.btn-mp4 { background: transparent; color: var(--dl); border-color: var(--dl); }
.btn-mp4:hover:not(:disabled) { background: var(--dl); color: #fff; }
.btn:disabled { cursor: default; opacity: 0.45; }

.agreement { margin: 10px 0 0; text-align: center; font-size: 0.8125rem; color: var(--muted); }
.agreement a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.agreement a:hover { color: var(--fg); }

.note {
  margin: 14px 0 0; min-height: 22px; text-align: center;
  font-size: 0.9375rem; color: var(--muted);
}
.note[data-error="true"] { color: var(--error); }

.progress {
  margin: 10px auto 0; height: 5px; width: 100%; max-width: 460px;
  border-radius: 999px; background: var(--border); overflow: hidden;
  opacity: 0; transition: opacity 0.2s;
}
.progress[data-state="running"], .progress[data-state="done"] { opacity: 1; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--dl); transition: width 0.35s ease; }
.progress[data-unknown="true"] .progress-fill { width: 35%; animation: misja-slide 1.1s ease-in-out infinite; }
@keyframes misja-slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .progress[data-unknown="true"] .progress-fill { animation: none; width: 100%; opacity: 0.4; }
  .progress-fill { transition: none; }
}

/* ---------- content cards ---------- */

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.card {
  margin-top: 32px; padding: 32px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--card);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.card h2 { margin: 32px 0 0; font-size: 1.25rem; line-height: 1.35; font-weight: 600; }
.card h3 { margin: 22px 0 0; font-size: 1rem; font-weight: 600; }
.card p { margin: 12px 0 0; color: var(--muted); }
.card h2 + p, .card h3 + p { margin-top: 8px; }
.card strong { color: var(--fg); font-weight: 600; }
.card ul, .card ol { margin: 12px 0 0; padding-left: 22px; color: var(--muted); }
.card li + li { margin-top: 6px; }
.card code {
  padding: 2px 6px; border-radius: 5px; background: var(--bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em;
}

.tablewrap { margin-top: 14px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); color: var(--muted); }
th { color: var(--fg); font-weight: 600; background: var(--bg); }
td:first-child { color: var(--fg); font-weight: 500; white-space: nowrap; }

.steps { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  position: relative; padding-left: 42px; margin-top: 14px; color: var(--muted);
}
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px;
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--dl); color: #fff; font-size: 0.875rem; font-weight: 600;
}
.steps strong { color: var(--fg); }

.faq { margin-top: 14px; border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  padding: 14px 0; cursor: pointer; font-weight: 600; color: var(--fg);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.25rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- article pages (policies, contact) ---------- */

.page-head { max-width: 800px; margin: 0 auto; padding: 48px 20px 0; }
.page-head h1 { margin: 0; font-size: 2rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em; }
.page-head .lede { margin: 12px 0 0; color: var(--muted); }
.updated { margin: 16px 0 0; font-size: 0.875rem; color: var(--muted); }
.article { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.article h2 { margin: 32px 0 0; font-size: 1.125rem; font-weight: 600; }
.article p, .article li { color: var(--muted); }
.article p { margin: 10px 0 0; }
.article ul, .article ol { margin: 10px 0 0; padding-left: 22px; }
.article li + li { margin-top: 6px; }
.article strong { color: var(--fg); }

/* ---------- footer ---------- */

.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: var(--card); }
.site-footer .bar {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 1080px; margin: 0 auto; padding: 32px 20px;
  font-size: 0.875rem; color: var(--muted); text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--fg); }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .site-nav { display: none; }
  .hero { padding-top: 36px; }
  .hero h1 { font-size: 1.75rem; }
  .hero-logo { width: 72px; height: 72px; }
  .card { padding: 22px; margin-top: 24px; }
  .composer { padding: 6px; }
  .actions { width: 100%; }
  .actions .btn { flex: 1 1 0; padding: 0 12px; }
  #ym-url { height: 48px; font-size: 1rem; }
  .btn { height: 48px; }
}

/* ---------- article components (2026-09-21 rewrite) ----------
   Same language as everything above: one soft card per idea, a sky-blue accent for anything
   the reader can act on, green kept for "this works / this is live", muted grey for prose.
   Nothing here introduces a new colour, font or radius — only the existing custom properties. */

.brand small { font-weight: 400; font-size: 0.8125rem; color: var(--muted); }

/* breadcrumb above the page head */
.trail { max-width: 800px; margin: 0 auto; padding: 28px 20px 0; font-size: 0.875rem; }
.trail ol {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 0; padding: 0; list-style: none; color: var(--muted);
}
.trail li + li::before { content: "/"; margin-right: 6px; color: var(--muted); opacity: 0.55; }
.trail a { color: var(--muted); text-decoration: none; }
.trail a:hover { color: var(--accent); }

/* "Checked on 21 September 2026" — a dated pill, not a claim */
.checked-on {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--muted); font-size: 0.8125rem; font-weight: 500; line-height: 1.5;
}
.checked-on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.lede { margin: 12px 0 0; color: var(--muted); font-size: 1.0625rem; }

/* the answer, before the article starts */
.summary-box {
  max-width: 800px; margin: 22px auto 0; padding: 20px 24px;
  background: var(--card); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius-lg);
}
.summary-box h2 {
  margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
}
.summary-box p { margin: 0 0 10px; color: var(--fg); }
.summary-box p:last-child { margin-bottom: 0; }

/* how we checked — sunken, dashed, deliberately quieter than the prose around it */
.method-box {
  margin: 20px 0 0; padding: 14px 18px;
  background: var(--bg); border: 1px dashed color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: var(--radius); color: var(--muted); font-size: 0.9375rem;
}
.method-box p { margin: 0; }
.method-box p + p { margin-top: 8px; }
.method-box strong { color: var(--fg); }

/* state tables: what an address did on the day we looked */
table caption {
  caption-side: top; text-align: left; padding: 0 0 10px;
  color: var(--muted); font-size: 0.875rem;
}
table.state td:first-child {
  white-space: normal; word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em;
}
table.state td { vertical-align: top; }
.state-live, .state-redirect, .state-dead {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  border: 1px solid transparent; font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
}
.state-live {
  color: var(--dl); background: color-mix(in srgb, var(--dl) 12%, transparent);
  border-color: color-mix(in srgb, var(--dl) 28%, transparent);
}
.state-redirect {
  color: var(--accent-hover); background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 28%, transparent);
}
.state-dead {
  color: var(--muted); background: color-mix(in srgb, var(--fg) 7%, transparent);
  border-color: var(--border);
}
.after-table { margin-top: 14px; font-size: 0.9375rem; color: var(--muted); }

/* primary sources, listed the way a footnote would be */
ul.sources { margin: 18px 0 0; padding-left: 20px; font-size: 0.875rem; color: var(--muted); }
ul.sources li + li { margin-top: 6px; }

/* the one bridge back to the converter */
.go-convert {
  margin: 34px 0 0; padding: 24px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  text-align: center;
}
.go-convert p { margin: 0 0 14px; color: var(--muted); }
.go-convert .btn { text-decoration: none; }
.go-convert .btn-mp3, .go-convert .btn-mp3:hover { color: #fff; }

/* router cards: "which MP3Juice are you looking for?" and the sibling links under an article */
ul.router, ul.name-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px; margin: 16px 0 0; padding: 0; list-style: none;
}
ul.router li, ul.name-cards li { margin: 0; }
ul.router a, ul.name-cards a {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 16px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--fg); text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
ul.router a:hover, ul.name-cards a:hover {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); color: var(--fg);
}
ul.router strong, ul.name-cards strong { font-weight: 600; color: var(--fg); }
ul.router span, ul.name-cards span { color: var(--muted); font-size: 0.875rem; line-height: 1.55; }

.grid-2 {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px; margin-top: 16px;
}
.grid-2 .card { margin-top: 0; padding: 22px; }

/* what is not here — every line is an observable absence, never a promise */
ul.absences { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; color: var(--muted); }
ul.absences li { position: relative; padding-left: 30px; }
ul.absences li + li { margin-top: 0; }
ul.absences li::before {
  content: "\2715"; position: absolute; left: 0; top: 3px;
  display: grid; place-items: center; width: 20px; height: 20px;
  border: 1px solid color-mix(in srgb, var(--fg) 18%, transparent); border-radius: 6px;
  color: var(--accent); font-size: 0.6875rem; font-weight: 700;
}
ul.absences strong { color: var(--fg); }

/* ---------- dark theme ---------- */

html[data-theme="dark"] .checked-on { background: color-mix(in srgb, var(--card) 70%, #000 30%); }
html[data-theme="dark"] .summary-box { background: color-mix(in srgb, var(--card) 92%, var(--accent) 8%); }
html[data-theme="dark"] .method-box {
  background: color-mix(in srgb, var(--card) 65%, #000 35%);
  border-color: color-mix(in srgb, var(--fg) 16%, transparent);
}
html[data-theme="dark"] .go-convert,
html[data-theme="dark"] ul.router a,
html[data-theme="dark"] ul.name-cards a { background: color-mix(in srgb, var(--card) 80%, #fff 3%); }
html[data-theme="dark"] .state-live { color: #4ade80; }
html[data-theme="dark"] .state-redirect { color: #7dd3fc; }
html[data-theme="dark"] .state-dead { color: var(--muted); background: color-mix(in srgb, #fff 8%, transparent); }
html[data-theme="dark"] ul.absences li::before { border-color: color-mix(in srgb, #fff 20%, transparent); }

/* ---------- small screens ---------- */

@media (max-width: 720px) {
  .trail { padding-top: 20px; }
  .summary-box { margin-left: 20px; margin-right: 20px; padding: 18px 20px; }
  .go-convert { padding: 20px; }
  ul.router, ul.name-cards { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand { font-size: 1.0625rem; gap: 8px; }
  .brand small { font-size: 0.75rem; }
  .site-header .bar { gap: 8px; padding: 10px 14px; }
}

.brand span, .brand small, .lang-toggle span { white-space: nowrap; }
.lang-toggle { flex: 0 0 auto; }
@media (max-width: 600px) {
  .brand small { display: none; }
  .lang-toggle span { display: none; }
  .lang-toggle { width: 38px; padding: 0; justify-content: center; }
}
@media (max-width: 480px) {
  table { font-size: 0.875rem; }
  th, td { padding: 8px 8px; }
  table.state { min-width: 540px; }
  table.state td:first-child, table.state th:first-child { white-space: nowrap; font-size: 0.8125rem; }
  .tablewrap { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
}

/* article pages: the prose lives in one card, aligned with the page head and the summary box */
.trail, .page-head, .summary-box, .article { max-width: 840px; box-sizing: border-box; margin-left: auto; margin-right: auto; }
.trail { padding: 28px 28px 0; }
.page-head { padding: 36px 28px 0; }
.summary-box { margin-top: 22px; padding: 20px 28px 20px 24px; }
.article {
  margin-top: 24px; padding: 6px 28px 30px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.article h2 { margin: 30px 0 0; padding-top: 24px; border-top: 1px solid var(--border); font-size: 1.1875rem; line-height: 1.35; }
.article > h2:first-child { margin-top: 18px; padding-top: 0; border-top: 0; }
.article h3 { margin: 22px 0 0; font-size: 1rem; font-weight: 600; }
.article h3 + p { margin-top: 6px; }
.article p, .article li { line-height: 1.65; }
.article .faq { border-top: 0; margin-top: 0; }
.article .method-box { margin-top: 18px; }
.article .go-convert { background: var(--bg); }
.article ul.router a, .article ul.name-cards a { background: var(--bg); }
.article ul.router a:hover, .article ul.name-cards a:hover { background: var(--card); }
.tablewrap { border: 1px solid var(--border); border-radius: var(--radius); }
th, td { padding: 10px 14px; }
tbody tr:last-child td { border-bottom: 0; }
table.state td:first-child { white-space: nowrap; word-break: normal; overflow-wrap: normal; }
@media (max-width: 880px) {
  .summary-box, .article { margin-left: 16px; margin-right: 16px; }
  .trail, .page-head { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 720px) {
  .article { padding: 4px 20px 24px; }
  .summary-box { padding: 16px 20px 16px 18px; }
}
