/* WindieWatch web UI. Dark only, small and quiet; the ASCII record is the one flourish.
   See PRODUCT.md. Contrast: every text color below is >= 4.5:1 on --bg. */

:root {
  color-scheme: dark;

  --bg:        oklch(0.285 0.004 70);   /* dim warm gray */
  --bg-input:  oklch(0.255 0.004 70);
  --rule:      oklch(0.37 0.004 70);
  --text:      oklch(0.90 0.006 80);    /* names, primary */
  --text-2:    oklch(0.76 0.006 80);    /* secondary */
  --text-3:    oklch(0.665 0.006 80);   /* tertiary, still AA on --bg */
  --signal:    oklch(0.83 0.095 80);    /* pale amber: going + your artists only */
  --error:     oklch(0.78 0.09 30);
  --record:    oklch(0.58 0.005 70);

  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --fs-xs: 0.75rem;     /* 12px  mono data, labels */
  --fs-s:  0.84375rem;  /* 13.5px body */
  --fs-m:  1rem;        /* 16px  page titles, the largest thing on the site */

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);   /* expo-ish */
  --col: 38rem;
}

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

html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: clip; }   /* the record hangs off the corner; it must never widen the page */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-s)/1.6 var(--sans);
  font-feature-settings: "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 1px solid var(--signal); outline-offset: 3px; border-radius: 2px; }

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

/* --------------------------------------------------------------- shell */

.shell {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.25rem 12rem;
  margin-left: max(1.25rem, 12vw);
  max-width: calc(var(--col) + 2.5rem);
}

.top {
  display: flex;
  align-items: baseline;
  gap: 1.75rem;
  margin-bottom: 4.5rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}
.top a { text-decoration: none; color: var(--text-3); }
.top a:hover, .top a[aria-current="page"] { color: var(--text); }
.top .wordmark { color: var(--text); margin-right: auto; letter-spacing: 0.02em; }

.page-title {
  font-size: var(--fs-m);
  font-weight: 400;
  margin: 0 0 0.5rem;
  max-width: 30ch;
  line-height: 1.4;
}
.lede { color: var(--text-2); margin: 0 0 2.5rem; max-width: 52ch; }

.section-label {
  font: 400 var(--fs-xs)/1.5 var(--mono);
  color: var(--text-3);
  margin: 3.5rem 0 1.25rem;
}
.section-label:first-of-type { margin-top: 0; }

/* --------------------------------------------------------------- record */

.record {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}
.record canvas {
  display: block;
  width: 100%;
  height: 100%;
  animation: spin 8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.shell { transition: opacity 0.6s var(--ease-out); }
html.intro .shell { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .record canvas { animation: none; }
  .shell { transition: none; }
}

/* --------------------------------------------------------------- picks list */

.picks { list-style: none; margin: 0; padding: 0; }

.pick {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0 1rem;
  padding: 1.1rem 0 1.3rem;
}
.pick + .pick { border-top: 1px solid color-mix(in oklch, var(--rule) 55%, transparent); }

.pick__when {
  font: 400 var(--fs-xs)/1.7 var(--mono);
  color: var(--text-2);
  padding-top: 0.1rem;
}
.pick__when span { display: block; }
.pick__when .time { color: var(--text-3); }

.pick__name { margin: 0; color: var(--text); font-weight: 500; }
.pick__name a { text-decoration: none; }
.pick__name a:hover { text-decoration: underline; text-decoration-color: var(--rule); }
.pick__name .new {
  font: 400 var(--fs-xs)/1 var(--mono);
  color: var(--text-3);
  margin-left: 0.6rem;
}
.pick__meta { margin: 0; color: var(--text-2); }
.pick__meta .venue { color: var(--text-2); }
.pick__meta .support { color: var(--text-3); }

.why {
  margin: 0.65rem 0 0;
  font: 400 var(--fs-xs)/1.25 var(--mono);   /* tight enough that box-drawing lines join */
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
}
.why .from { color: var(--text-2); }
.why .via  { color: var(--text-3); }
.why .to   { color: var(--text); }
.why .line { color: var(--text-3); }
.why .note { color: var(--text-3); }
.why .mark { color: var(--signal); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  margin-top: 0.75rem;
  font: 400 var(--fs-xs)/1.5 var(--mono);
}
.act {
  appearance: none;
  background: none;
  border: 0;
  padding: 0.3rem 0;
  margin: 0;
  font: inherit;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: none;
}
.act:hover { color: var(--text); }
.act[aria-pressed="true"] { color: var(--text); }
.act[data-type="going"][aria-pressed="true"] { color: var(--signal); }
.act[data-type="going"][aria-pressed="true"]::before { content: "* "; }
.act[data-type="thumbs_up"][aria-pressed="true"]::before { content: "+ "; }
a.act { color: var(--text-3); }

.actions[hidden] { display: none; }
.pick.is-hiding .pick__when,
.pick.is-hiding .pick__name,
.pick.is-hiding .pick__meta,
.pick.is-hiding .why { opacity: 0.35; }
.pick__undo { font: 400 var(--fs-xs)/1.5 var(--mono); color: var(--text-3); margin-top: 0.75rem; }

.month + .month { margin-top: 0.5rem; }

/* --------------------------------------------------------------- forms */

.field { display: block; margin-bottom: 1rem; }
.field__label { display: block; font: 400 var(--fs-xs)/1.5 var(--mono); color: var(--text-3); margin-bottom: 0.4rem; }

.input {
  width: 100%;
  max-width: 26rem;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.6rem 0.7rem;
  font: 400 var(--fs-s)/1.4 var(--sans);
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: none; border-color: var(--text-3); }
.input:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }

.btn {
  appearance: none;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  border-radius: 3px;
  padding: 0.6rem 0.95rem;
  font: 500 var(--fs-s)/1.2 var(--sans);
  cursor: pointer;
}
.btn:hover { background: oklch(0.96 0.005 80); }
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn--quiet { background: none; color: var(--text-2); border-color: var(--rule); }
.btn--quiet:hover { background: none; color: var(--text); border-color: var(--text-3); }

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.hint { color: var(--text-3); font-size: var(--fs-xs); font-family: var(--mono); margin: 0.6rem 0 0; }
.error { color: var(--error); font-size: var(--fs-xs); font-family: var(--mono); margin: 0.6rem 0 0; min-height: 1.2em; }
.status { color: var(--text-2); font-size: var(--fs-xs); font-family: var(--mono); margin: 0.6rem 0 0; min-height: 1.2em; }

/* artist picker: chips + autocomplete */
.picker { max-width: 26rem; position: relative; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0; list-style: none; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: 400 var(--fs-xs)/1 var(--mono);
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.35rem 0.3rem 0.6rem;
}
.chip button {
  appearance: none; background: none; border: 0; color: var(--text-3); cursor: pointer;
  font: inherit; padding: 0 0.2rem; line-height: 1;
}
.chip button:hover { color: var(--text); }

.suggest {
  list-style: none; margin: 0.25rem 0 0; padding: 0.25rem 0;
  position: absolute; left: 0; right: 0; z-index: 5;
  background: var(--bg-input);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.suggest[hidden] { display: none; }
.suggest li {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.45rem 0.7rem; cursor: pointer;
}
.suggest li .n { color: var(--text-3); font: 400 var(--fs-xs)/1.6 var(--mono); }
.suggest li[aria-selected="true"], .suggest li:hover { background: color-mix(in oklch, var(--rule) 60%, transparent); }

.try { font: 400 var(--fs-xs)/1.6 var(--mono); color: var(--text-3); margin: 0.75rem 0 0; }
.try button {
  appearance: none; background: none; border: 0; padding: 0; margin: 0 0.15rem;
  font: inherit; color: var(--text-2); cursor: pointer; text-decoration: underline;
  text-decoration-color: var(--rule); text-underline-offset: 0.2em;
}
.try button:hover { color: var(--text); }

/* --------------------------------------------------------------- landing */

.demo-results { margin-top: 3rem; }
.demo-results[hidden] { display: none; }
.demo-count { font: 400 var(--fs-xs)/1.6 var(--mono); color: var(--text-2); margin: 0 0 1rem; }

.join { margin-top: 3.5rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.join[hidden] { display: none; }
.join p { margin: 0 0 1rem; color: var(--text-2); max-width: 46ch; }

.about { margin-top: 5rem; color: var(--text-3); max-width: 50ch; font-size: var(--fs-xs); font-family: var(--mono); line-height: 1.7; }
.about p { margin: 0 0 0.6rem; }

/* --------------------------------------------------------------- taste */

.taste-list { list-style: none; margin: 0; padding: 0; max-width: 30rem; }
.taste-list li {
  display: flex; align-items: baseline; gap: 1rem;
  padding: 0.45rem 0;
}
.taste-list .name { flex: 1; }
.taste-list .src { font: 400 var(--fs-xs)/1.5 var(--mono); color: var(--text-3); }
.taste-list .rm {
  appearance: none; background: none; border: 0; cursor: pointer; padding: 0.2rem 0.3rem;
  font: 400 var(--fs-xs)/1 var(--mono); color: var(--text-3);
}
.taste-list .rm:hover { color: var(--error); }

/* --------------------------------------------------------------- settings */

.choices { border: 0; margin: 0 0 2rem; padding: 0; }
.choices legend { font: 400 var(--fs-xs)/1.5 var(--mono); color: var(--text-3); margin-bottom: 0.75rem; padding: 0; }
.choice { display: flex; gap: 0.7rem; align-items: baseline; padding: 0.35rem 0; cursor: pointer; }
.choice input { accent-color: var(--signal); margin: 0; transform: translateY(0.1rem); }
.choice .sub { color: var(--text-3); }

.empty { color: var(--text-2); max-width: 46ch; }
.empty p { margin: 0 0 1.25rem; }

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

@media (max-width: 40rem) {
  .shell { margin-left: 0; padding: 1.5rem 1.1rem 10rem; }
  .top { margin-bottom: 3rem; gap: 1.1rem; }
  .pick { grid-template-columns: 1fr; }
  .pick__when { display: flex; gap: 0.6rem; padding: 0 0 0.2rem; }
  .pick__when span { display: inline; }
}

.input:disabled { cursor: default; opacity: 1; }
.input:disabled::placeholder { color: var(--text-2); }
