/* DistroMusic Radio - public landing + sign-in prototype (design/landing/).
   Tokens are copied 1:1 from the Player (app/index.html :root) so the pre-login
   pages read as the same product. Keep them in sync if the Player changes. */
:root {
  --bg: #14110f;
  --bg-2: #1d1814;
  --surface: #221c17;
  --line: #3a3027;
  --text: #f4ece1;
  --muted: #b3a595;
  --amber: #e8a54b;
  --amber-2: #f3c27d;
  --live: #ef5a4c;
  --ok: #7bcf8f;
  --warn: #e8c15b;
  --err: #ef7a6c;
  --radius: 22px;
  /* Fine-print greys the Player uses inline (.history-note, footer) */
  --faint: #8f8377;
  --fainter: #7d7165;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--text);
  line-height: 1.5;
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(232,165,75,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(150,110,70,.16), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber-2); }
:focus-visible { outline: 3px solid var(--amber-2); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; left: 16px; top: -60px; padding: 10px 14px; border-radius: 10px; background: var(--surface); color: var(--text); z-index: 10; }
.skip-link:focus { top: 12px; }

/* ---- Layout -------------------------------------------------------------- */
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; display: grid; gap: 22px; }
.stack { display: grid; gap: 24px; min-width: 0; }
.narrow { max-width: 560px; }   /* same column width as the Player's <main> */

/* Same brand row as the Player: logo left, small tracked label right */
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .9rem; letter-spacing: .08em; }
.brand-home { display: block; flex: none; width: 210px; max-width: 58%; }
.brand-logo { display: block; width: 100%; height: auto; }
@media (max-width: 600px) { .brand-home { width: 160px; } }
.brand-right { display: flex; align-items: center; gap: 14px; }
@media (max-width: 600px) { .brand-tag { display: none; } }

/* Language pulldown in the brand row (GET form; /assets/lang.js submits on change and hides .lang-go) */
.lang-switch { display: flex; align-items: center; gap: 8px; margin: 0; }
.lang-switch label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.lang-switch select {
  min-height: 40px; padding: 0 10px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: inherit; font-size: .9rem; letter-spacing: normal; cursor: pointer;
}
.lang-switch select:hover { border-color: var(--amber); }
.lang-go { min-height: 40px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--amber-2); font: inherit; font-size: .85rem; cursor: pointer; }
.lang-go[hidden] { display: none; }
@media (max-width: 600px) {
  .brand-right { gap: 10px; }
  .lang-switch { flex-direction: column; align-items: stretch; gap: 2px; }
  .lang-switch label { font-size: .62rem; letter-spacing: .12em; }
  .lang-switch select { min-height: 36px; padding: 0 6px; }
  .brand-right .btn-ghost { padding: 0 12px; }
}
@media (max-width: 420px) { .brand-home { width: 136px; } }

/* ---- Card (identical recipe to the Player's .card) ----------------------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01)), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 6vw, 36px);
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.04);
}

/* ---- Pills / labels (Player .live, .track-label, .dashboard h2) ---------- */
.live {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .78rem; font-weight: 700; letter-spacing: .18em;
  color: #fff; background: var(--live);
  padding: 6px 12px 6px 10px; border-radius: 999px;
}
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-2); margin: 0 0 4px; }
.section-title { margin: 0 0 12px; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
figure.preview { margin: 0; }

/* ---- Buttons (Player .play and .skip recipes) ---------------------------- */
.btn-primary {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  min-height: 56px; padding: 0 28px; border-radius: 18px;
  font: inherit; font-size: 1.15rem; font-weight: 700; letter-spacing: .06em;
  color: #1a120a; background: linear-gradient(180deg, var(--amber-2), var(--amber));
  box-shadow: 0 14px 28px -14px rgba(232,165,75,.75);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .08s ease, filter .15s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(.985); }
.btn-primary:disabled { opacity: .55; cursor: progress; }
.btn-primary svg { width: 22px; height: 22px; fill: currentColor; }
.btn-lg { min-height: 72px; font-size: 1.35rem; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 14px; text-decoration: none;
  border: 1px solid var(--amber); background: rgba(232,165,75,.08); color: var(--amber-2);
  font: inherit; font-weight: 700; letter-spacing: .04em; cursor: pointer;
}
.btn-ghost:hover { background: rgba(232,165,75,.16); }

/* ---- EQ bars (Player .eq; always animating here, as decoration) ---------- */
.eq { display: flex; align-items: flex-end; gap: 6px; height: 44px; margin: 22px 0 8px; }
.eq i { flex: 1; max-width: 14px; height: 18%; border-radius: 4px; background: linear-gradient(180deg, var(--amber-2), var(--amber)); animation: bounce 1.1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.2s; } .eq i:nth-child(3) { animation-delay: -.5s; }
.eq i:nth-child(4) { animation-delay: -.8s; } .eq i:nth-child(5) { animation-delay: -.35s; }
.eq i:nth-child(6) { animation-delay: -.65s; } .eq i:nth-child(7) { animation-delay: -.1s; }
@keyframes bounce { 0%,100% { height: 18%; } 50% { height: 100%; } }

/* ---- Landing: hero ------------------------------------------------------- */
.hero { display: grid; gap: 28px; align-items: center; grid-template-columns: 1.15fr .85fr; }
.hero h1 { margin: 14px 0 10px; font-size: clamp(1.75rem, 4.4vw, 2.7rem); line-height: 1.2; font-weight: 700; letter-spacing: .02em; }
.hero .lede { margin: 0 0 22px; color: var(--muted); font-size: 1.05rem; max-width: 30em; line-height: 1.7; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }
.hero-actions .note { color: var(--muted); font-size: .92rem; }
.genres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 20px 0 0; }
.genres-label { font-size: .72rem; letter-spacing: .16em; color: var(--amber-2); }
.chip { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: rgba(0,0,0,.18); font-size: .9rem; }

/* Preview: a static, clearly labelled sketch of the Player card (compacted vs the real card) */
.card.preview { padding: 22px 24px 16px; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.preview-tag { font-size: .75rem; letter-spacing: .1em; color: var(--faint); border: 1px dashed var(--line); border-radius: 999px; padding: 3px 10px; }
.preview .eq { height: 32px; margin: 14px 0 12px; }
.preview .tracks { display: grid; gap: 10px; margin: 0 0 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.18); }
.track-label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-2); margin-bottom: 4px; }
.track-title { font-size: 1rem; font-weight: 500; line-height: 1.3; color: var(--muted); }
.preview-name { margin: 12px 0 0; font-size: 1.5rem; font-weight: 700; line-height: 1.15; }
.status { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: .95rem; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px rgba(123,207,143,.18); flex: none; }
.preview-caption { margin: 10px 4px 0; color: var(--faint); font-size: .74rem; text-align: center; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-actions .btn-primary { width: 100%; }
}

/* ---- Landing: features + steps ------------------------------------------- */
.features { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.feature { display: grid; grid-template-columns: 30px 1fr; align-items: center; align-content: start; gap: 8px 10px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.14); }
.feature h3 { margin: 0; font-size: 1.05rem; }
.feature p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .93rem; }
.feature-icon { display: block; width: 30px; height: 30px; fill: none; stroke: var(--amber-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 820px) { .features { grid-template-columns: 1fr; } }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px 1fr; align-items: center; align-content: start; gap: 8px 10px; counter-increment: step; padding: 14px 18px; font-size: .93rem; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(232,165,75,.12); border: 1px solid var(--amber); color: var(--amber-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.steps strong { color: var(--text); font-size: 1rem; }
.steps li span { grid-column: 1 / -1; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.cta { text-align: center; }
.cta h2 { margin: 0 0 6px; font-size: clamp(1.4rem, 4vw, 1.9rem); }
.cta p { margin: 0 auto 22px; color: var(--muted); max-width: 32em; }
.cta .contact-note { margin: 20px auto 0; color: var(--faint); font-size: .88rem; }
@media (max-width: 600px) { .cta .btn-primary { width: 100%; } }

footer { text-align: center; color: var(--fainter); font-size: .8rem; padding: 4px 0; }
footer p { margin: 4px 0; }

/* ---- Sign-in page -------------------------------------------------------- */
.signin-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; }
.signin h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 6vw, 2.2rem); line-height: 1.15; }
.signin .sub { margin: 0 0 22px; color: var(--muted); }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field label { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--amber-2); }
.field input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  font: inherit; font-size: 1.05rem; color: var(--text);   /* >=16px: no iOS zoom on focus */
  background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 14px;
  -webkit-appearance: none; appearance: none;
}
.field input::placeholder { color: var(--fainter); }
.field input:hover { border-color: #4a3e33; }
.field input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(232,165,75,.22); }
.field input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px #2a221c inset; caret-color: var(--text); }
.signin .btn-primary { width: 100%; margin-top: 8px; }

/* Status line reuses the Player's dot + text pattern (.status / .st-*) */
.msg { min-height: 1.5em; margin: 14px 0 0; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .95rem; }
.msg:empty { visibility: hidden; }
.msg::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--muted); flex: none; }
.msg.is-error { color: var(--err); } .msg.is-error::before { background: var(--err); }
.msg.is-busy::before { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.msg.is-ok { color: var(--text); } .msg.is-ok::before { background: var(--ok); box-shadow: 0 0 0 4px rgba(123,207,143,.18); }
@keyframes pulse { 50% { opacity: .25; } }
.fineprint { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: .85rem; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; letter-spacing: .04em; }
.back:hover { color: var(--text); }

/* ---- Signed-in page (/me in workers/auth-poc) ---------------------------- */
.me h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 5vw, 1.9rem); line-height: 1.2; }
.me .sub { margin: 0 0 18px; color: var(--muted); }
.kv { display: grid; gap: 12px; margin: 0 0 22px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(0,0,0,.18); }
.kv dt { font-size: .72rem; letter-spacing: .16em; color: var(--amber-2); margin: 0 0 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: grid; gap: 12px; }
.actions .btn-primary, .actions .btn-ghost { width: 100%; }
.btn-primary.is-placeholder:disabled { cursor: not-allowed; }
.placeholder-note { margin: 4px 0 0; color: var(--faint); font-size: .82rem; text-align: center; }

/* ---- Phones: keep the hero + whole preview card on the first screen (390x844) */
@media (max-width: 600px) {
  body { padding-top: max(14px, env(safe-area-inset-top)); }
  .wrap { gap: 16px; }
  .stack { gap: 22px; }
  .hero { gap: 18px; }
  .hero h1 { margin: 10px 0 6px; }
  .hero .lede { margin-bottom: 14px; font-size: .98rem; line-height: 1.6; }
  .hero-actions { gap: 8px; }
  .hero-actions .btn-lg { min-height: 60px; font-size: 1.2rem; }
  .genres { margin-top: 12px; }
  .card.preview { padding: 16px 18px 12px; }
  .preview-name { margin-top: 8px; font-size: 1.3rem; }
  .preview .eq { height: 24px; margin: 10px 0 10px; }
  .preview .tracks { gap: 8px; padding: 10px 14px; margin-bottom: 10px; }
  .preview-caption { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .eq i { animation: none; height: 60%; }
  .eq i:nth-child(odd) { height: 35%; }
  .msg.is-busy::before { animation: none; }
  .btn-primary { transition: none; }
}
