/* Design language "Swiss" (harness/13-designsprache.md, ADR 0007):
   font, colour and spacing tokens, base styles and the building blocks all
   pages share. Black acts, the station colour reports, red warns.
   The station colour (--accent, --on-accent) comes from /station.css. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/vendor/inter-5.3.0/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308,
    U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
    U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/vendor/inter-5.3.0/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --paper-2: #f2f2f0;
  --ink: #111111;
  --ink-2: #5c5c5c;
  --hair: #dcdcdc;
  --danger: #c8001e;
  --danger-paper: #fdecee;
  --accent: #ffd400;
  --on-accent: #111111;
  /* studio (harness/13, ADR 0011) */
  --ink-soft: #3d3d3d;
  --line-soft: #a6a6a6;
  --off: #c9c9c4;
  --unlit: #e6e6e3;
  --meter-green: #14a04c;
  --meter-yellow: #e3ae00;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --rule: 3px solid var(--ink);
  --line: 1px solid var(--ink);
  --hairline: 1px solid var(--hair);
  --ease: 150ms ease-out;
}

/* dark: the same grid, inverted -- as the system says, or as the Tag/Nacht
   switch stored it (theme-boot.js sets data-theme, ADR 0011) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e0e0e;
    --paper-2: #1a1a1a;
    --ink: #f2f2f2;
    --ink-2: #a6a6a6;
    --hair: #2c2c2c;
    --danger: #ff4d5e;
    --danger-paper: #3a1015;
    --ink-soft: #c4c4c4;
    --line-soft: #5c5c5c;
    --off: #3a3a3a;
    --unlit: #242424;
    --meter-green: #1fbf5f;
    --meter-yellow: #f5c400;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e0e0e;
  --paper-2: #1a1a1a;
  --ink: #f2f2f2;
  --ink-2: #a6a6a6;
  --hair: #2c2c2c;
  --danger: #ff4d5e;
  --danger-paper: #3a1015;
  --ink-soft: #c4c4c4;
  --line-soft: #5c5c5c;
  --off: #3a3a3a;
  --unlit: #242424;
  --meter-green: #1fbf5f;
  --meter-yellow: #f5c400;
}

/* ---- base ---------------------------------------------------------------- */

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

[hidden] {
  display: none !important;
}

html {
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

code {
  font-size: 0.9em;
}

/* ---- type helpers -------------------------------------------------------- */

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.muted {
  color: var(--ink-2);
}

.small {
  font-size: 0.875rem;
}

.num,
time {
  font-variant-numeric: tabular-nums;
}

/* ---- buttons: black acts --------------------------------------------------- */

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

button:hover,
.button:hover {
  background: var(--paper-2);
}

button.primary,
.button.primary {
  background: var(--ink);
  color: var(--paper);
}

button.primary:hover,
.button.primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

button.danger:hover {
  background: var(--danger-paper);
}

button.link {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button:disabled {
  cursor: not-allowed;
  border-color: var(--hair);
  background: transparent;
  color: var(--ink-2);
}

.inline {
  display: inline;
}

/* ---- fields ----------------------------------------------------------------- */

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form label:not(.check) {
  margin-top: var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form button {
  margin-top: var(--space-5);
  align-self: flex-start;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3);
  border: var(--line);
  border-radius: 0;
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
  min-height: 44px;
}

input[type="checkbox"] {
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--ink);
}

/* ---- the station colour reports ------------------------------------------- */

.live {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.live::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  background: currentColor;
  animation: live-blink 1.6s steps(1) infinite;
}

@keyframes live-blink {
  50% {
    opacity: 0;
  }
}

.saved {
  padding: var(--space-3) var(--space-4);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 2px var(--space-2);
  border: var(--line);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag.ended {
  border-color: var(--hair);
  color: var(--ink-2);
}

/* ---- red warns -------------------------------------------------------------- */

.errors {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--danger);
  background: var(--danger-paper);
  color: var(--danger);
  list-style: none;
}

/* ---- activity bars ------------------------------------------------------------ */

.bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  border-bottom: var(--line);
}

.bars span {
  flex: 1;
  height: 100%;
  background: var(--ink);
  transform: scaleY(0.06);
  transform-origin: bottom;
  transition: transform 300ms ease-out;
}

.is-playing .bars span {
  animation: bar 1.1s ease-in-out infinite;
}

.is-playing .bars span:nth-child(3n + 1) {
  animation-duration: 0.9s;
}

.is-playing .bars span:nth-child(3n + 2) {
  animation-duration: 1.3s;
  animation-delay: -0.4s;
}

.is-playing .bars span:nth-child(4n) {
  animation-duration: 0.8s;
  animation-delay: -0.7s;
}

.is-playing .bars span:nth-child(5n) {
  animation-delay: -0.2s;
}

@keyframes bar {
  0%,
  100% {
    transform: scaleY(0.2);
  }
  50% {
    transform: scaleY(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
