/* Colours and type match guykweb.com (guyk-web-portfolio/site/css/site.css) */
:root {
  --bg: #06153a;
  --panel: #0b2052;
  --line: rgba(220, 230, 255, 0.12);
  --line-strong: rgba(220, 230, 255, 0.24);
  --text: #f2f5fb;
  --silver: #c6d0e3;
  --muted: #93a1bd;
  --accent: #3b7bff;
  --accent-soft: #8db6ff;
  --accent-ink: #ffffff;
  --danger: #ff7a7a;
  --radius: 28px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(59, 123, 255, 0.22), transparent 60%),
    radial-gradient(700px 500px at -10% 60%, rgba(59, 123, 255, 0.08), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--apple);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* everything in capitals (done here, so the words are typed normally) - except what people type, links, and the
   pronunciation spelling, which would change meaning */
body, button { text-transform: uppercase; }
.field, .dict-phon { text-transform: none; }
.field::placeholder { text-transform: uppercase; }

svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand b { color: inherit; font-weight: inherit; } /* (the whole name thin, in one colour) */
/* the name: white, drawn in stars like the logo (name-stars.js lays a canvas of stars over the letters and makes
   the letters themselves see-through), and faded in once it is ready and the intro is over */
.brand-name { position: relative; display: inline-block; color: #fff; opacity: 0; transition: opacity 1.4s ease; }
.brand-name.is-in { opacity: 1; }
.intro-pending .brand-name, .intro-running .brand-name { opacity: 0; }
.brand-name.is-stars .brand-word { color: transparent; }
.name__live { position: absolute; left: -10px; top: -10px; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .brand-name { transition: none; } }
.brand-mark { display: block; width: 40px; height: 40px; }
/* the logo turns clockwise, once every 8 s (not during the intro, which measures it to land on it) */
html:not(.intro-pending):not(.intro-running) .brand-mark:not(.is-hidden) { animation: logo-spin 8s linear infinite; }
/* the header logo in stars (intro.js, intro3d.js): a see-through canvas 1.44x the picture, centred on it, its edge
   softly masked off. The same stars as the intro's, so the intro lands on it with nothing changing. The picture
   underneath keeps the space (and is the logo without WebGL). */
.brand-logo { position: relative; display: block; flex: none; }
.mark__live {
  position: absolute; left: -22%; top: -22%; width: 144%; height: 144%;
  pointer-events: none; opacity: 0;
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 62%, transparent 100%);
}
.mark__live.is-on { opacity: 1; }
.brand-mark.is-hidden { opacity: 0 !important; transition: none; }
.brand:hover .brand-mark { animation-duration: 2s; }
@keyframes logo-spin { to { transform: rotate(360deg); } }

/* ---------- layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 44px 16px 40px; }


/* ---------- the menu: a Menu button, and a panel of every tool that slides in from the right ---------- */
/* (the header stays at the top while the page scrolls, over a blurred view of what's behind it) */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(6, 21, 58, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.topbar-end { display: flex; align-items: center; gap: 10px; }
.menu-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(141, 182, 255, 0.28);
  background: rgba(141, 182, 255, 0.12);
  color: #dbe7ff;
  font: 600 14px var(--apple); letter-spacing: 0.04em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.menu-toggle svg { width: 19px; height: 19px; }
.menu-toggle:hover, .menu-open .menu-toggle { background: rgba(141, 182, 255, 0.24); border-color: rgba(141, 182, 255, 0.5); color: #fff; }
.menu-toggle:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* the dimmed page behind the open panel (a click on it closes the panel) */
.menu-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(2, 8, 24, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.menu-open .menu-backdrop { opacity: 1; visibility: visible; transition: opacity 0.3s ease, visibility 0s; }
.menu-open { overflow: hidden; } /* (the page underneath doesn't scroll while the panel is open) */

.menubar {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(380px, 88vw);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 0 14px calc(24px + env(safe-area-inset-bottom));
  /* (its colours fade slowly between deep blues and violet) */
  background: linear-gradient(160deg, #0c2160, #1a1f6e, #0a3a78, #251c6b, #0c2160);
  background-size: 300% 300%;
  animation: menu-colours 16s ease-in-out infinite;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.5);
  transform: translate3d(100%, 0, 0);
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.38s;
}
.menu-open .menubar { transform: none; visibility: visible; transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s; }
.menu-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 -14px 6px; padding: 18px 18px 14px 28px;
  background: rgba(8, 22, 64, 0.55);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font: 700 15px var(--apple); letter-spacing: 0.12em; color: #fff;
}
.menu-close {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(141, 182, 255, 0.28);
  background: rgba(141, 182, 255, 0.12);
  color: #dbe7ff; cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.menu-close:hover { background: rgba(141, 182, 255, 0.26); color: #fff; }
.menu-close:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.menu-close svg { width: 18px; height: 18px; }
/* the tools: one simple button each, the page you're on filled in light blue */
.menu-list { display: grid; gap: 8px; padding-top: 10px; }
.menu-item {
  display: flex; align-items: center; justify-content: center;
  min-height: 50px; padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(141, 182, 255, 0.28);
  background: linear-gradient(180deg, var(--graphite-top), var(--graphite-bottom));
  color: var(--pill-text);
  font: 600 15px var(--apple); letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1);
}
.menu-item:hover { border-color: rgba(141, 182, 255, 0.55); background: rgba(141, 182, 255, 0.24); color: #fff; }
.menu-item:active { transform: scale(0.965); transition-duration: 0.07s; }
.menu-item:focus-visible { outline: 2px solid var(--pill-focus); outline-offset: 2px; }
.menu-item[aria-current="page"] {
  border-color: transparent;
  background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom));
  color: var(--pill-ink);
}
/* (the buttons arrive one after another as the panel opens) */
.menu-open .menu-item { animation: menu-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
.menu-open .menu-item:nth-child(2) { animation-delay: 0.02s; }
.menu-open .menu-item:nth-child(3) { animation-delay: 0.04s; }
.menu-open .menu-item:nth-child(4) { animation-delay: 0.06s; }
.menu-open .menu-item:nth-child(5) { animation-delay: 0.08s; }
.menu-open .menu-item:nth-child(6) { animation-delay: 0.10s; }
.menu-open .menu-item:nth-child(7) { animation-delay: 0.12s; }
.menu-open .menu-item:nth-child(8) { animation-delay: 0.14s; }
.menu-open .menu-item:nth-child(9) { animation-delay: 0.16s; }
.menu-open .menu-item:nth-child(10) { animation-delay: 0.18s; }
.menu-open .menu-item:nth-child(11) { animation-delay: 0.20s; }
@keyframes menu-in { from { opacity: 0; transform: translate3d(24px, 0, 0); } }
@keyframes menu-colours { 0%, 100% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } }

/* the Type Beat button: its colours fade from blue to violet to cyan and round again */
.menu-item[data-tab="typebeat"] {
  border-color: transparent;
  background: linear-gradient(110deg, #3b7bff, #8a5cff, #36c6ff, #6d7bff, #3b7bff);
  background-size: 300% 100%;
  color: #fff;
  text-shadow: 0 1px 2px rgba(6, 21, 58, 0.35);
  animation: type-beat-colours 6s linear infinite;
}
.menu-open .menu-item[data-tab="typebeat"] { animation: menu-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both, type-beat-colours 6s linear infinite; }
.menu-item[data-tab="typebeat"]:hover { filter: brightness(1.12); background-color: transparent; }
.menu-item[data-tab="typebeat"][aria-current="page"] { box-shadow: 0 0 0 2px #dbe8ff, 0 8px 24px rgba(108, 92, 255, 0.45); color: #fff; }
@keyframes type-beat-colours { to { background-position: 300% 0; } }

/* the account: Log in, or the email and Log out */
.menu-account { padding: 6px 0 4px; margin-bottom: 4px; padding-bottom: 14px; }
.menu-login {
  width: 100%; min-height: 50px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; border: 0;
  background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom));
  color: var(--pill-ink);
  font: 700 15px var(--apple); letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1);
}
.menu-login svg { width: 19px; height: 19px; }
.menu-login:hover { filter: brightness(1.06); }
.menu-login:active { transform: scale(0.965); transition-duration: 0.07s; }
.menu-login:focus-visible, .menu-logout:focus-visible { outline: 2px solid var(--pill-focus); outline-offset: 2px; }
.menu-user { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 4px 4px 14px; }
/* (the email in its own capitals, like anything typed) */
.menu-user-email { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; color: #dbe7ff; font-size: 14px; }
.menu-logout {
  flex: none; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid rgba(141, 182, 255, 0.28);
  background: linear-gradient(180deg, var(--graphite-top), var(--graphite-bottom));
  color: var(--pill-text); font: 600 13px var(--apple); letter-spacing: 0.04em; cursor: pointer;
}
.menu-logout:hover { border-color: rgba(141, 182, 255, 0.55); color: #fff; }

/* the log in / sign up form (in the same window as the ad) */
/* the owner's log in, at the foot of the menu */
.menu-admin { padding-top: 22px; }
.menu-admin .menu-logout { width: 100%; height: 50px; font-size: 15px; }
.ad-box.auth-box { width: min(420px, 100%); text-align: left; }
.auth-box .ad-title, .auth-box .ad-lede { text-align: center; }
.auth-mode { justify-self: center; }
.auth-field { display: grid; gap: 6px; }
.auth-field > span { color: var(--muted); font-size: 12px; letter-spacing: 0.12em; }
.auth-box .primary { width: 100%; justify-content: center; }

/* panels: a quick fade out, then a quick fade in, as the tabs change (app.js adds .is-shown, then .is-in) */
.panel { display: none; }
.panel.is-shown {
  display: block;
  opacity: 0;
  transition: opacity 0.16s ease;
}
.panel.is-in { opacity: 1; }
.panel.is-out { transition-duration: 0.12s; }

.panel-head { text-align: center; margin-bottom: 22px; }
/* the gold infinity sign above every page's title (drawn from one shared copy, kept out of sight) */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.infinity { display: block; width: clamp(84px, 16vw, 112px); height: auto; margin: 0 auto 12px; filter: drop-shadow(0 4px 14px rgba(243, 198, 84, 0.35)); }
.panel-head h2 { font-size: clamp(28px, 5.5vw, 38px); letter-spacing: -0.025em; margin: 0 0 10px; }
.panel-head p { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 auto; max-width: 520px; }

/* ---------- card + form parts ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 4vw, 28px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.label {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.card > .label { margin-bottom: -8px; }

.input-row { display: flex; gap: 8px; }
.field {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font: 16px var(--apple);
  height: 52px;
  padding: 0 22px;
  outline: none;
  transition: border-color 0.2s;
}
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--muted); opacity: 0.8; }

.options { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.seg { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.seg label { flex: 1; }
.seg input, .grid-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.seg span:hover { color: var(--text); }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent-soft); }

/* bigger picks: formats and mastering sounds */
.grid-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-choice--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-choice span {
  display: grid;
  align-content: start;
  gap: 4px;
  height: 100%;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.grid-choice b { font-size: 15px; }
.grid-choice small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.grid-choice span:hover { border-color: var(--line-strong); }
.grid-choice input:checked + span { border-color: var(--accent); background: rgba(59, 123, 255, 0.2); }
.grid-choice input:focus-visible + span { outline: 2px solid var(--accent-soft); }

/* ---------- buttons: bright blue pills (the shape and size of guykweb.com's .btn); each tool's main button in
   guykweb.com's dark blue ("Create website now") ---------- */
button, .primary { font-family: inherit; cursor: pointer; }
.primary, .ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 54px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), opacity 0.3s ease, transform 0.3s var(--ease);
}
.primary:active, .ghost:active { transform: scale(0.98); }
.primary { width: 100%; background: var(--accent); color: #fff; }
.primary--fit { width: auto; }
.primary:hover { background: #5b8cff; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.primary .arrow { width: 18px; height: 18px; transition: transform 0.35s var(--ease); }
.primary:hover .arrow { transform: translateX(3px); }
.ghost { background: var(--accent); color: #fff; font-size: 15px; }
.ghost:hover { background: #5b8cff; }
.ghost--sm { height: 40px; padding: 0 16px; font-size: 14px; }


/* ---------- downloader platforms ---------- */
.chips-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  flex: 1;
  justify-content: center;
  padding: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(59, 123, 255, 0.45);
  background: rgba(59, 123, 255, 0.16);
  color: #dbe7ff;
  font: 600 15px var(--apple);
  transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}
.chip:hover { border-color: var(--accent); background: rgba(59, 123, 255, 0.28); color: #fff; }
.chip.is-on { border-color: var(--accent); color: #fff; background: var(--accent); }
.chips-arrow {
  display: none;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent-soft);
  place-items: center;
}
.chips-arrow svg { width: 18px; height: 18px; }

/* ---------- drop zones ---------- */
.drop {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 28px 18px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 22px;
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: rgba(59, 123, 255, 0.08); }
.drop-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 999px; background: rgba(59, 123, 255, 0.16); color: var(--accent-soft); }
.drop-icon svg { width: 24px; height: 24px; }
.drop-text { color: var(--muted); font-size: 15px; }
.drop-text b { color: var(--text); }
.drop-file { font-family: var(--mono); font-size: 13px; color: var(--accent-soft); word-break: break-all; }
.drop-file:empty { display: none; }
.drop.has-file { border-style: solid; border-color: var(--accent); }

/* ---------- progress ---------- */
/* the loading ring. "Dots Ring", ported from Amicro by Syed Subhan Uddin under the MIT License. */
.dots-ring { position: relative; width: 48px; height: 48px; margin: 4px auto 18px; }
.dots-ring i {
  position: absolute; top: 0; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 999px;
  background: #fff; transform-origin: 4px 24px; transform: rotate(var(--turn));
  animation: dots-ring 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite both; animation-delay: var(--wait);
}
.dots-ring i:nth-child(1) { --turn: 0deg; --wait: 0s; }
.dots-ring i:nth-child(2) { --turn: 45deg; --wait: 0.15s; }
.dots-ring i:nth-child(3) { --turn: 90deg; --wait: 0.3s; }
.dots-ring i:nth-child(4) { --turn: 135deg; --wait: 0.45s; }
.dots-ring i:nth-child(5) { --turn: 180deg; --wait: 0.6s; }
.dots-ring i:nth-child(6) { --turn: 225deg; --wait: 0.75s; }
.dots-ring i:nth-child(7) { --turn: 270deg; --wait: 0.9s; }
.dots-ring i:nth-child(8) { --turn: 315deg; --wait: 1.05s; }
@keyframes dots-ring {
  0%, 100% { transform: rotate(var(--turn)) scale(1); opacity: 1; }
  50% { transform: rotate(var(--turn)) scale(0.5); opacity: 0.3; }
}
@media (prefers-reduced-motion: reduce) { .dots-ring i { animation: none; } }
.progress-head { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 10px; }
.ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--silver); }
.ppct { font-family: var(--mono); color: var(--accent-soft); }
.bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.pfill { height: 100%; width: 0; background: linear-gradient(90deg, #5b8cff, #8db6ff, #c3d8ff); transition: width 0.4s ease; }

/* ---------- results (downloads) ---------- */
.results { display: grid; gap: 12px; }
.results-head { display: grid; gap: 8px; }
.badge {
  justify-self: start;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.results-title { font-size: 18px; word-break: break-word; }
.track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg);
}
.track-name { font-weight: 600; font-size: 15px; }
.track audio { grid-column: 1 / -1; width: 100%; height: 40px; }
.track .primary { width: auto; height: 40px; padding: 0 18px; font-size: 14px; }
.track .primary svg { width: 16px; height: 16px; }
.track--original .track-name { color: var(--muted); }

.error { color: var(--danger); margin: 0; font-size: 14px; }
/* "or" between a drop box and a link field */
.or-line { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or-line + .field { flex: none; width: 100%; box-sizing: border-box; }
.hint { color: var(--muted); font-size: 13px; text-align: center; margin: -6px 0 0; }

/* Song Lyrics: the lyric sheet (in the song's own capitals, not the site's) */
.lyric-sheet { display: grid; gap: 10px; }
.lyric-sheet pre {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(141, 182, 255, 0.22);
  background: rgba(6, 21, 58, 0.55);
  color: #eef3ff;
  font: 500 16px/1.65 var(--apple);
  text-transform: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-user-select: text;
  user-select: text;
}
.note { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }

/* ---------- rhymes and dictionary ---------- */
.seg--full { width: 100%; }
.word-results:empty, #dict-results:empty { display: none; }
.syl-group { display: grid; gap: 10px; margin-bottom: 18px; }
.syl-group:last-child { margin-bottom: 0; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word {
  height: 38px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 500 15px var(--apple);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s var(--ease);
}
.word:hover { border-color: var(--accent); background: rgba(59, 123, 255, 0.12); }
.word:active { transform: scale(0.95); }
.word.is-top { border-color: rgba(141, 182, 255, 0.45); }
.empty { color: var(--muted); font-size: 15px; margin: 0; }

.dict-word { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.dict-word h3 { font-size: 32px; letter-spacing: -0.02em; margin: 0; }
.dict-phon { font-family: var(--mono); color: var(--accent-soft); font-size: 15px; }
.say { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); display: grid; place-items: center; }
.say svg { width: 18px; height: 18px; }
.say:hover { border-color: var(--accent); }
.pos { margin-top: 18px; }
.pos-name { font-style: italic; color: var(--accent-soft); font-size: 15px; margin: 0 0 8px; }
.pos ol { margin: 0; padding-left: 22px; display: grid; gap: 10px; }
.pos li { line-height: 1.5; color: var(--silver); }
.pos li em { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.dict-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* ---------- key and BPM readouts ---------- */
.readout { display: grid; gap: 16px; text-align: center; }
.big {
  font-size: clamp(48px, 12vw, 76px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  background: linear-gradient(90deg, #f2f5fb 0%, #c3d8ff 55%, #8db6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.big small { font-size: 0.4em; letter-spacing: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 14px 10px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); display: grid; gap: 4px; }
.stat b { font-size: 20px; }
.stat span { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.notes { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.notes span { min-width: 42px; height: 42px; padding: 0 8px; display: grid; place-items: center; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-weight: 600; }
.notes span:first-child { background: var(--accent); border-color: var(--accent); }
.small-print { color: var(--muted); font-size: 13px; margin: 0; }

/* tap tempo */
.tap { border-top: 1px solid var(--line); padding-top: 18px; }
.tap-pad {
  width: 100%;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 26px 16px;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.2s ease, transform 0.12s var(--ease), background-color 0.2s ease;
}
.tap-pad:active, .tap-pad.is-hit { transform: scale(0.98); border-color: var(--accent); background: rgba(59, 123, 255, 0.12); }
.tap-bpm { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.tap-sub { color: var(--muted); font-size: 14px; }

/* ---------- footer and toast ---------- */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 16px 40px; }
.foot a { color: var(--silver); }
/* "Created by Guy K Web", at the bottom right (centred on phones) */
.foot { display: flex; justify-content: center; padding: 24px clamp(16px, 4vw, 40px) 32px; }
.credit { display: inline-flex; align-items: center; gap: 12px; color: #c4cce6; text-decoration: none; text-align: left; text-transform: none; font-size: 16px; transition: color 0.2s ease; }
.credit:hover { color: #fff; }
.credit img { width: 34px; height: 34px; }
.credit span { display: grid; line-height: 1.3; }
.credit small { font-size: 0.8em; opacity: 0.75; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) { .foot { justify-content: center; } }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate3d(-50%, 20px, 0);
  opacity: 0;
  pointer-events: none;
  background: var(--text);
  color: var(--bg);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease, transform 0.35s var(--ease);
  z-index: 100;
}
.toast.is-on { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* ---------- credits (header) ---------- */
.credits {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text);
  font: 600 14px var(--apple);
  letter-spacing: 0.02em;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.credits svg { width: 16px; height: 16px; color: #ffe14d; fill: #ffe14d; stroke-width: 1.5; }
.credits b { font-size: 15px; min-width: 1ch; text-align: center; }
.credits-word { color: var(--silver); font-weight: 500; }
.credits:hover { border-color: var(--silver); }
.credits.is-empty { border-color: #ffab3d; }
.credits.is-empty svg { color: #ffab3d; fill: transparent; }
.credits.is-bump b { animation: bump 0.5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.45); color: #ffe14d; } }

/* ---------- the 15-second ad ---------- */
.ad {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 10, 30, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: ad-in 0.35s var(--ease);
}
@keyframes ad-in { from { opacity: 0; } }
.ad-box {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 26px);
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: ad-rise 0.45s var(--ease);
}
@keyframes ad-rise { from { transform: translate3d(0, 18px, 0) scale(0.98); } }
.ad-title { margin: 0; font-size: clamp(19px, 4.5vw, 24px); font-weight: 700; letter-spacing: -0.01em; }
.ad-lede { margin: -8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ad-media { position: relative; border-radius: 20px; overflow: hidden; background: #050b1e; aspect-ratio: 960 / 576; }
.ad-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ad-tag {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6); color: #fff; font: 600 11px var(--mono); letter-spacing: 0.08em;
}
.ad-copy {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; border-radius: 16px;
  background: rgba(6, 21, 58, 0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  text-align: left;
}
.ad-copy img { width: 34px; height: 34px; flex: none; }
.ad-copy div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ad-copy b { font-size: 14px; }
.ad-copy span { color: var(--silver); font-size: 11.5px; line-height: 1.35; }
.ad-cta {
  flex: none; height: 36px; padding: 0 16px; display: inline-flex; align-items: center; border-radius: 999px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 13px; text-decoration: none;
}
.ad-foot { display: flex; align-items: center; gap: 12px; }
.ad-count { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; }
.ad-count svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ad-ring-bg { stroke: var(--line-strong); stroke-width: 3; }
.ad-ring { stroke: #ffe14d; stroke-width: 3; stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s linear; }
.ad-count span { font: 700 17px var(--apple); }
.ad-foot .primary { flex: 1; }
.ad-cancel { justify-self: center; background: none; border: 0; color: var(--muted); font: 500 13px var(--apple); letter-spacing: 0.04em; padding: 4px 8px; }
.ad-cancel:hover { color: var(--text); }

[hidden] { display: none !important; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .brand { font-size: 16px; gap: 10px; }
  .credits { height: 36px; padding: 0 12px 0 10px; font-size: 13px; }
  .credits-word { display: none; }
  .ad-copy span { display: none; }   /* (on phones the ad's caption is just its headline, so the video shows) */
  .brand-mark { width: 34px; height: 34px; }
  .wrap { padding-top: 26px; }
  .menu-toggle { width: 44px; padding: 0; justify-content: center; }
  .menu-toggle span { display: none; }  /* (on phones, just the ☰ icon) */
  .chips { justify-content: flex-start; }
  .chips-arrow { display: grid; }
  .options { flex-direction: column; align-items: stretch; }
  .grid-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-choice--2 { grid-template-columns: minmax(0, 1fr); }
  .seg span { padding: 9px 10px; }
}

/* ---------- Lyrics: the preview with its caption, and the lines to check ---------- */
.lyrics-edit { display: grid; gap: 16px; }
.lyric-preview {
  position: relative;
  container-type: inline-size;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
}
.lyric-preview video { display: block; width: 100%; max-height: 62vh; object-fit: contain; background: #000; }
/* the caption: as the finished video will show it (sized to the preview's width) */
.lyric-cap {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 18%;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  text-transform: none;
}
.lyric-cap.is-on { opacity: 1; }
.lyric-cap[data-pos="middle"] { bottom: auto; top: 50%; transform: translateY(-50%); }
.lyric-cap[data-pos="top"] { bottom: auto; top: 8%; }
.lyric-cap span {
  font: 700 clamp(13px, 4.4cqw, 34px)/1.25 "Helvetica Neue", var(--apple);
  color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 0 3px #000, 0 2px 4px rgba(0, 0, 0, 0.6);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.lyric-cap[data-style="bold"] span { color: #ffe14d; text-transform: uppercase; font-size: clamp(15px, 5.3cqw, 40px); text-shadow: 0 0 4px #000, 0 0 4px #000, 0 0 4px #000, 0 3px 5px rgba(0, 0, 0, 0.7); }
.lyric-cap[data-style="box"] span { background: rgba(0, 0, 0, 0.55); padding: 0.12em 0.4em; border-radius: 0.2em; text-shadow: none; font-size: clamp(12px, 4cqw, 30px); }
.lyrics-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.lyric-lines {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  overscroll-behavior: contain;
}
.lyric-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.lyric-time, .lyric-del {
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--graphite-top), var(--graphite-bottom));
  color: var(--pill-text);
  border: 1px solid rgba(141, 182, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font: 600 13px var(--mono);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.lyric-time { min-width: 64px; padding: 0 12px; }
.lyric-del { width: 44px; font: 400 22px/1 var(--apple); }
.lyric-time:hover, .lyric-del:hover { border-color: rgba(141, 182, 255, 0.6); color: #fff; }
.lyric-time:focus-visible, .lyric-del:focus-visible { outline: 2px solid var(--pill-focus); outline-offset: 2px; }
.lyric-text {
  height: 44px;
  min-width: 0;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 15px var(--apple);
  text-transform: none;
  outline: none;
  transition: border-color 0.2s ease;
}
.lyric-text:focus { border-color: var(--accent); }
/* the line being sung right now */
.lyric-line.is-now .lyric-time { background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom)); color: var(--pill-ink); border-color: rgba(6, 21, 58, 0.55); }
.lyric-line.is-now .lyric-text { border-color: rgba(141, 182, 255, 0.7); }
.results video { grid-column: 1 / -1; width: 100%; max-height: 62vh; border-radius: 14px; background: #000; }
/* phones: each line's words get the whole width, under its time and remove buttons */
@media (max-width: 600px) {
  .lyric-line { grid-template-columns: auto 1fr auto; grid-template-areas: "time . del" "text text text"; row-gap: 6px; padding-bottom: 6px; }
  .lyric-time { grid-area: time; }
  .lyric-del { grid-area: del; }
  .lyric-text { grid-area: text; }
}
@media (prefers-reduced-motion: reduce) { .lyric-cap { transition: none; } }

/* ---------- every button: the pill finish ("Assistant Pill" shape, in light blue) ----------
   solid light blue (the "silver" of .apl-send): each tool's main buttons (Convert, Find, Search, Split, Master,
   Download, Continue) and whatever is chosen (the tool tab, platform, options); see-through light blue (the
   "graphite" of .apl-pill): everything else - tool tabs, platforms, Paste, Start again, words, option tracks and
   cards, the tap pad, the credits counter. (The names below keep the original "silver"/"graphite" roles.) */
:root {
  --silver-top: #dbe8ff;
  --silver-bottom: #a9c6ff;
  --graphite-top: rgba(141, 182, 255, 0.22);
  --graphite-bottom: rgba(141, 182, 255, 0.1);
  --pill-ink: #06153a;
  --pill-text: #dbe7ff;
  --pill-focus: #8fb8ff;
}
/* graphite */
.ghost, .tab, .chip, .chips-arrow, .seg, .grid-choice span, .word, .say, .tap-pad, .credits {
  background: linear-gradient(180deg, var(--graphite-top), var(--graphite-bottom));
  color: var(--pill-text);
  border: 1px solid rgba(141, 182, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.25);
}
.seg span { color: #a9bde3; border: 1px solid transparent; }
.grid-choice small { color: #a9bde3; }
.word.is-top { border-color: rgba(141, 182, 255, 0.7); }
.credits-word { color: #b9cdf2; }
.ghost:hover:not(:disabled), .tab:hover, .chip:hover, .chips-arrow:hover, .grid-choice span:hover, .word:hover, .say:hover, .tap-pad:hover, .credits:hover {
  background: linear-gradient(180deg, rgba(141, 182, 255, 0.34), rgba(141, 182, 255, 0.18));
  color: #fff;
  border-color: rgba(141, 182, 255, 0.6);
}
.seg span:hover { color: #fff; }
.tap-pad:active, .tap-pad.is-hit { background: linear-gradient(180deg, rgba(141, 182, 255, 0.42), rgba(141, 182, 255, 0.24)); border-color: rgba(141, 182, 255, 0.8); }
/* silver */
.primary, .ad-cta,
.tab[aria-selected="true"], .chip.is-on,
.seg input:checked + span, .grid-choice input:checked + span {
  background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom));
  color: var(--pill-ink);
  border: 1px solid rgba(6, 21, 58, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 18px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.grid-choice input:checked + span small { color: #2a3f6e; }
.primary:hover:not(:disabled), .ad-cta:hover, .tab[aria-selected="true"]:hover, .chip.is-on:hover {
  background: linear-gradient(180deg, #ebf2ff, #bdd4ff);
  color: var(--pill-ink);
}
.primary svg, .ad-cta svg { color: var(--pill-ink); }
.chips-arrow, .say { border-radius: 50%; }
/* easy to tap: at least 44px tall */
.chip, .chips-arrow { height: 44px; }
.chips-arrow { width: 44px; }
.say { width: 44px; height: 44px; }
.seg span { min-height: 44px; display: grid; place-items: center; padding-block: 0; }
.track .primary { height: 44px; }
/* pressed: a quick press in, then a smooth spring back on release */
:is(.primary, .ghost, .tab, .chip, .chips-arrow, .word, .say, .ad-cta, .credits, .lyric-time, .lyric-del):active:not(:disabled) {
  transform: scale(0.965);
  transition-duration: 0.07s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.seg label:active span, .grid-choice label:active span { transform: scale(0.97); transition-duration: 0.07s; }
/* keyboard focus: a clear blue ring */
:is(.primary, .ghost, .tab, .chip, .chips-arrow, .word, .say, .tap-pad, .credits, .ad-cta, .ad-cancel):focus-visible,
.seg input:focus-visible + span, .grid-choice input:focus-visible + span { outline: 2px solid var(--pill-focus); outline-offset: 3px; }
/* disabled (e.g. while a tool is working, or the ad's Continue before the 15 s): muted graphite */
.primary:disabled, .ghost:disabled {
  background: linear-gradient(180deg, rgba(141, 182, 255, 0.12), rgba(141, 182, 255, 0.06));
  color: #6f83ad;
  border-color: rgba(141, 182, 255, 0.15);
  box-shadow: none;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
}
.primary:disabled svg { color: #6f83ad; }
.seg input:disabled + span { opacity: 0.5; cursor: not-allowed; }
:is(.primary, .ghost, .tab, .chip, .chips-arrow, .seg span, .grid-choice span, .word, .say, .tap-pad, .credits, .ad-cta) {
  transition: background 0.25s ease, color 0.22s ease, border-color 0.25s ease, box-shadow 0.25s ease,
    transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1), opacity 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  :is(.primary, .ghost, .tab, .chip, .chips-arrow, .seg span, .grid-choice span, .word, .say, .tap-pad, .credits, .ad-cta) { transition: none; }
  :is(.primary, .ghost, .tab, .chip, .chips-arrow, .word, .say, .ad-cta, .credits):active:not(:disabled) { transform: none; }
  .primary:hover .arrow { transform: none; }
}

/* ---------- sliding highlights (app.js, glider()): one pill glides to the chosen tab, platform or option ---------- */
.has-glider { position: relative; isolation: isolate; }
.glider {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom));
  border: 1px solid rgba(6, 21, 58, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 6px 18px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.glider.is-ready { transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), width 0.42s cubic-bezier(0.22, 1, 0.36, 1), height 0.42s ease; }
/* (the chosen item itself is see-through, so the pill shows behind its writing) */
.has-glider .tab[aria-selected="true"], .has-glider .tab[aria-selected="true"]:hover,
.has-glider .chip.is-on, .has-glider .chip.is-on:hover,
.seg.has-glider input:checked + span {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--pill-ink);
}

/* ---------- working: the tool's main button keeps its colour and shows a spinner ---------- */
.primary.is-loading, .primary.is-loading:disabled {
  background: linear-gradient(180deg, var(--silver-top), var(--silver-bottom));
  color: var(--pill-ink);
  border-color: rgba(6, 21, 58, 0.55);
  opacity: 0.92;
  cursor: progress;
}
.primary.is-loading .arrow { display: none; }
.primary.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- moving between tools: no jump in the page's height, and a softer fade ---------- */
.wrap { min-height: 72vh; }
.panel.is-shown { transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1); }
.panel.is-out { transition-duration: 0.11s; transition-timing-function: ease-in; }

@media (prefers-reduced-motion: reduce) {
  .glider.is-ready { transition: none; }
  :is(.primary, .ghost, .tab, .chip, .chips-arrow, .word, .say, .ad-cta, .credits, .lyric-time, .lyric-del):active:not(:disabled),
  .seg label:active span, .grid-choice label:active span { transform: none; }
  .primary.is-loading::after { animation-duration: 1.6s; }
}

/* ---------- intro (intro.js): the star logo forms over a blue cover, then lands on the header logo ---------- */
.intro-pending body::before {
  content: ""; position: fixed; inset: 0; z-index: 200; background: var(--bg);
}
.intro-pending, .intro-running { overflow: hidden; }
.intro { position: fixed; inset: 0; z-index: 201; background: var(--bg); cursor: pointer; }
.intro__stars { position: absolute; z-index: 1; }
/* the header logo shows once the stars have landed on it */
.intro-pending .brand-mark, .intro-running .brand-mark { opacity: 0; }
.brand-mark { transition: opacity 0.6s var(--ease); }
/* the page rises in as the intro fades */
.intro-pending :is(.wrap, .topbar-end), .intro-running :is(.wrap, .topbar-end) { opacity: 0; transform: translate3d(0, 18px, 0); }
.wrap { transition: opacity 0.8s ease, transform 0.8s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  .brand-mark, .wrap, .panel.is-shown, .toast, .menubar, .menu-backdrop { transition: none; }
  .menu-open .menu-item, .menu-item[data-tab="typebeat"], .menu-open .menu-item[data-tab="typebeat"], .menubar { animation: none; }
  html:not(.intro-pending):not(.intro-running) .brand-mark { animation: none; }
}

/* the ☰ menu button and the credits sit plainly in the header, with no circle around them */
.menu-toggle, .menu-toggle:hover, .menu-open .menu-toggle,
.credits, .credits:hover, .credits.is-empty { border-color: transparent; background: none; box-shadow: none; }
.menu-toggle:hover, .menu-open .menu-toggle { color: #fff; }

/* the ad's Visit button: flat and quiet - white, square-ish corners, no shine or shadow */
.ad-cta, .ad-cta:hover {
  height: 34px; padding: 0 14px; gap: 6px;
  border-radius: 8px; border: 0;
  background: #fff; color: #0b1b45; box-shadow: none;
  font: 600 12px var(--apple); letter-spacing: 0.06em;
}
.ad-cta:hover { background: #e6ecf7; }
.ad-cta svg { width: 14px; height: 14px; color: currentColor; }

/* one plain dark blue behind everything: the pages, the header (so no edge shows under it) and the menu */
html, body { background: var(--bg); }
.topbar { background: var(--bg); border-bottom: 0; box-shadow: none; }
.menubar { background: var(--bg); animation: none; border: 0; }
.menu-head { background: var(--bg); border-bottom: 0; box-shadow: none; }

/* the platform row is wider than the page on every screen now (7 buttons): it starts at its first button instead
   of being cut off at both ends, and the arrows to scroll it show everywhere, not just on phones */
.chips { justify-content: flex-start; }
.chip:first-child { margin-left: auto; }
.chip:last-child { margin-right: auto; }
.chips-arrow { display: grid; }

/* (credits switched off: the counter is not shown) */
.credits[hidden] { display: none !important; }

/* ---------- "Coming soon": a locked tool (the section has data-soon; its menu button shows a small lock) ---------- */
.panel[data-soon] > .card { display: none; }
.soon {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(32px, 7vw, 56px) clamp(18px, 4vw, 28px);
  display: grid; justify-items: center; gap: 12px; text-align: center;
}
.soon-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 999px; background: rgba(59, 123, 255, 0.16); color: var(--accent-soft); }
.lock { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.soon-icon .lock { width: 30px; height: 30px; }
.soon b { font-size: 22px; letter-spacing: 0.02em; color: var(--text); }
.soon p { margin: 0; color: var(--muted); font-size: 15px; max-width: 34ch; }
.menu-item .lock { width: 15px; height: 15px; margin-left: 8px; flex: none; opacity: 0.75; }

/* ---------- the platform row (YouTube, TikTok ...): it moves by itself, slowly, in a loop ---------- */
/* (no arrows. The track holds the buttons twice - app.js adds the second copy - and slides left by exactly one copy,
   then starts again, so the loop has no seam. It rests while the mouse or a finger is on it.) */
.chips {
  overflow: hidden; display: block; padding: 2px 0; scroll-behavior: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
.chips-track { display: flex; width: max-content; animation: chips-run 48s linear infinite; will-change: transform; }
.chips-track .chip, .chips-track .chip:first-child, .chips-track .chip:last-child { margin: 0 8px 0 0; }
.chips-track:hover, .chips-track:focus-within, .chips-track.is-held { animation-play-state: paused; }
@keyframes chips-run { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
@media (prefers-reduced-motion: reduce) {
  /* (no movement: one copy of the row, scrolled by hand) */
  .chips { overflow-x: auto; }
  .chips-track { animation: none; }
  .chip--twin { display: none; }
}

/* the menu's three lines: a little thicker, in the blue of the stars */
.menu-toggle svg { stroke: #8db6ff; stroke-width: 2.8; }
.menu-toggle:hover svg, .menu-open .menu-toggle svg { stroke: #b0ceff; }

/* the card hugs what is in it: a thin even margin all round, and corners that follow the pill buttons inside
   (their 26px curve + the 12px margin = 38px, so the two curves run side by side) */
.card { padding: 12px; border-radius: 38px; gap: 14px; }
.card > .label, .card > .options .label { padding-left: 10px; }
.soon { border-radius: 38px; }

/* the row is moved by app.js (so it can be dragged with a finger or the mouse and thrown): no CSS animation then.
   Sideways drags belong to the row, up-and-down swipes still scroll the page. */
.chips-track.is-driven { animation: none; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; backface-visibility: hidden; }
.chips-track.is-driven .chip { -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
.chips-track.is-dragging, .chips-track.is-dragging .chip { cursor: grabbing; }
.chips-track.is-dragging .chip { pointer-events: none; }

/* ---------- the menu's three lines turn into an X, and back (the Menu button, and the menu's own close button) ---------- */
/* Three separate lines (.burger). When the menu opens the top and bottom lines travel to the middle and cross, with a
   little overshoot, while the middle one shrinks away; the whole mark gives a half turn as they do. The close button
   inside the menu does the same a moment later, so it is seen changing as the panel arrives. */
.burger { stroke: #8db6ff; stroke-width: 2.8; overflow: visible; transition: transform 0.6s cubic-bezier(0.34, 1.4, 0.64, 1); }
.burger line {
  transform-box: view-box; transform-origin: 12px 12px;
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.burger line:nth-child(2) { transition: transform 0.3s ease, opacity 0.2s ease; }
.menu-open .burger { transform: rotate(180deg); }
.menu-open .burger line:nth-child(1) { transform: rotate(45deg) translateY(5px) scaleX(1.12); }
.menu-open .burger line:nth-child(2) { transform: scaleX(0); opacity: 0; }
.menu-open .burger line:nth-child(3) { transform: rotate(-45deg) translateY(-5px) scaleX(1.12); }
.menu-close .burger, .menu-close .burger line { transition-delay: 0.16s; }
.menu-toggle:hover .burger, .menu-close:hover .burger { stroke: #b0ceff; }
/* the close button sits plainly, like the Menu button: no circle round it */
.menu-close, .menu-close:hover { border-color: transparent; background: none; }
.menu-close svg { width: 24px; height: 24px; }
.menu-toggle svg { width: 22px; height: 22px; }

/* ---------- changing tools: the open one fades out all the way, and only then does the new one fade in ---------- */
.panel.is-shown { transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1); }
.panel.is-out { transition-duration: 0.28s; transition-timing-function: ease-in; }

@media (prefers-reduced-motion: reduce) {
  .burger, .burger line, .panel.is-shown { transition: none; }
}

/* ---------- the platform buttons, each in its own app's colour ---------- */
/* (every button is always in its colour; the chosen one is marked by a white ring and sits a touch larger, the
   others are slightly dimmed. "Video to MP3" is not an app and keeps the site's own blue.) */
.chips { padding: 6px 0; }
.chips-track .chip[data-platform] {
  background: var(--app, rgba(59, 123, 255, 0.16)); color: var(--app-ink, #fff); border: 1px solid transparent;
  box-shadow: none; opacity: 0.82;
  transition: opacity 0.25s ease, transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.25s ease;
}
.chips-track .chip[data-platform]:hover { background: var(--app, rgba(59, 123, 255, 0.16)); color: var(--app-ink, #fff); border-color: transparent; opacity: 1; }
.chips-track .chip[data-platform].is-on, .chips-track .chip[data-platform].is-on:hover {
  background: var(--app, rgba(59, 123, 255, 0.16)); color: var(--app-ink, #fff); border-color: transparent; opacity: 1;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff;
}
.chip[data-platform="youtube"] { --app: #ff0000; }
/* (TikTok: black, with its cyan and red edges) */
.chip[data-platform="tiktok"] { --app: #000; }
.chips-track .chip[data-platform="tiktok"]:not(.is-on) { box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55; }
.chip[data-platform="instagram"] { --app: linear-gradient(45deg, #feda75 0%, #fa7e1e 22%, #d62976 50%, #962fbf 76%, #4f5bd5 100%); }
.chip[data-platform="facebook"] { --app: #1877f2; }
.chip[data-platform="soundcloud"] { --app: #ff5500; }
.chip[data-platform="applemusic"] { --app: linear-gradient(180deg, #fb5c74 0%, #fa233b 100%); }
.chip[data-platform="spotify"] { --app: #1db954; --app-ink: #06140b; }
.chip[data-platform="video"] { --app: rgba(59, 123, 255, 0.28); }
.chips-track .chip[data-platform="video"] { border-color: rgba(59, 123, 255, 0.55); }

/* the three lines (and the X they turn into) in stars: burger-stars.js lays a canvas of stars over the mark, moves
   the stars itself, and the plain lines underneath go see-through (they still keep the space) */
.burger-stars { position: relative; display: inline-grid; place-items: center; flex: none; }
.burger-stars canvas { position: absolute; left: -7px; top: -7px; pointer-events: none; }
.burger.is-stars, .menu-open .burger.is-stars { transform: none; transition: none; }
.burger.is-stars line, .menu-open .burger.is-stars line { stroke: transparent; transform: none; transition: none; opacity: 1; }
/* (on phones the word "Menu" is hidden - a rule on every span in the button - but never the star mark) */
.menu-toggle span.burger-stars, .menu-close span.burger-stars { display: inline-grid; }

/* ---------- the platform buttons as real, pressable buttons ---------- */
/* Each keeps its app's colour, but now has a body: light falls from above (a soft shine across the top half and a
   bright upper rim), the lower half sits in shade with a darker bottom edge, and the button stands off the page on
   its own shadow. Pressing it pushes it down onto the page. (.chips gets room below so the shadow isn't cut off.) */
.chips { padding: 6px 0 16px; margin-bottom: -10px; }
.chips-track .chip[data-platform],
.chips-track .chip[data-platform]:hover,
.chips-track .chip[data-platform].is-on,
.chips-track .chip[data-platform].is-on:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.1) 46%, rgba(0, 0, 0, 0) 54%, rgba(0, 0, 0, 0.2) 100%),
    var(--app, #24418f);
  border: 1px solid rgba(0, 0, 0, 0.28);
  text-shadow: var(--app-letter, 0 1px 1px rgba(0, 0, 0, 0.35));
}
.chips-track .chip[data-platform] {
  opacity: 0.9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),      /* the bright upper rim */
    inset 0 -2px 0 rgba(0, 0, 0, 0.22),           /* the shaded lower lip */
    0 2px 0 rgba(0, 0, 0, 0.38),                  /* the button's side */
    0 9px 14px -4px rgba(0, 0, 0, 0.55);          /* its shadow on the page */
  transition: opacity 0.25s ease, transform 0.18s cubic-bezier(0.34, 1.5, 0.64, 1), box-shadow 0.18s ease, filter 0.2s ease;
}
.chips-track .chip[data-platform]:hover { opacity: 1; filter: brightness(1.07); }
/* the chosen one: the same button, lit, with its white ring */
.chips-track .chip[data-platform].is-on, .chips-track .chip[data-platform].is-on:hover {
  opacity: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 0 rgba(0, 0, 0, 0.22),
    0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 10px 16px -4px rgba(0, 0, 0, 0.6);
}
/* pressed: down onto the page - no side showing, a short tight shadow, the shine dimmed */
.chips-track .chip[data-platform]:active {
  transform: translate3d(0, 2px, 0) scale(0.985);
  filter: brightness(0.94);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 -1px 0 rgba(0, 0, 0, 0.18), 0 0 0 rgba(0, 0, 0, 0), 0 3px 6px -3px rgba(0, 0, 0, 0.5);
}
.chips-track .chip[data-platform].is-on:active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 3px 6px -3px rgba(0, 0, 0, 0.5);
}
/* (TikTok keeps its cyan and red edges, inside the button's body) */
.chips-track .chip[data-platform="tiktok"]:not(.is-on) {
  box-shadow: inset 2px 0 0 #25f4ee, inset -2px 0 0 #fe2c55, inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 rgba(0, 0, 0, 0.38), 0 9px 14px -4px rgba(0, 0, 0, 0.55);
}
/* (Spotify's writing is dark, so its letters get a light edge instead of a dark one) */
.chip[data-platform="spotify"] { --app-letter: 0 1px 0 rgba(255, 255, 255, 0.3); }
.chip[data-platform="video"] { --app: #24418f; }
@media (prefers-reduced-motion: reduce) { .chips-track .chip[data-platform]:active { transform: none; } }
