/* BracketScene design system: Deep lagoon tokens, self-hosted type, base components.
   Light only, on every page and device (CLAUDE.md): this file carries no dark-mode media query.
   Later plans do not edit this file; page-specific styles go in their own CSS file. */

/* Stick No Bills and IBM Plex Sans are variable fonts: one file per subset covers every weight
   the design system uses, so each subset downloads once. IBM Plex Mono ships static weights. */
@font-face {
  font-family: "Stick No Bills";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/stick-no-bills-latin-ext.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: "Stick No Bills";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/fonts/stick-no-bills-latin.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;
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin-ext.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: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-sans-latin.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;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin-ext.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-500-latin.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;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin-ext.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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/ibm-plex-mono-600-latin.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 {
  /* Deep lagoon, light only */
  --ink: #0A1A22;
  --accent: #0B6477;
  --tint: #E4F1F3;
  --paper: #FFFFFF;
  --muted: #3E5561;
  --subtle: #5A6E78;
  --control: #7F959E;
  --line: #D3E1E5;
  --warn: #8A5300;
  --error: #B42318;

  /* 8-point spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
}

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

/* The hidden attribute always wins. Component rules like display: flex would otherwise outrank the
   browser's own [hidden] rule and show panels, errors and banners that scripts have hidden. */
[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.player-page {
  font-size: 17px;
  line-height: 1.55;
}

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

/* h1.page-title carries the same style as h2: every screen's primary heading is an h1 for
   assistive technology, but Phase 1's type scale has one page-title size (28px), matching the H2
   row in the UI-SPEC's Typography table. */
h2,
h1.page-title {
  font-family: "Stick No Bills", "IBM Plex Sans", system-ui, sans-serif;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

h3 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.3;
}

h4 {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

small, .text-small {
  font-size: 14px;
  line-height: 1.45;
}

label, .label {
  display: inline-block;
  font-size: 13px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Skip link: hidden until focused, so a keyboard user can jump past the header */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-sm) var(--space-md);
  z-index: 100;
}

.skip-link:focus-visible {
  left: var(--space-md);
  top: var(--space-md);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Buttons */
.btnp,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 44px;
  min-width: 44px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 0 var(--space-md);
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btnp {
  background: var(--accent);
  color: #fff;
}

.btnp:hover {
  background: #094f5f; /* accent darkened ~8% */
}

.btnp:disabled {
  background: var(--control);
  color: var(--subtle);
  cursor: not-allowed;
}

.btn {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--control);
}

.btn:hover {
  background: var(--tint);
}

.btn:disabled {
  background: var(--paper);
  color: var(--subtle);
  border-color: var(--line);
  cursor: not-allowed;
}

/* Card / panel */
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: var(--space-lg);
}

/* Table */
.tbl,
table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.tbl th,
table th {
  background: var(--tint);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 14px;
}

.tbl td,
table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}

/* Chip / badge */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
}

.chip.chip-warn {
  color: var(--warn);
}

.chip.chip-subtle {
  color: var(--subtle);
}

/* Banner (inline success confirmation) */
.banner {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--tint);
  color: var(--ink);
  border-radius: 8px;
  padding: var(--space-md);
}

.notice-warn {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  background: var(--paper);
  border: 1px solid var(--warn);
  color: var(--warn);
  border-radius: 8px;
  padding: var(--space-md);
}

/* Form field */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  padding: 0 var(--space-md);
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}

.field input:focus-visible,
.field select:focus-visible {
  border-color: var(--accent);
}

.field input:disabled,
.field select:disabled {
  background: var(--tint);
}

.field .helper {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.field.has-error input,
.field.has-error select {
  border-color: var(--error);
}

.field .error-message {
  font-size: 14px;
  line-height: 1.45;
  color: var(--error);
}

.field .input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

/* The icon arrives wrapped in its slot span, so the span is what gets pinned and centered. */
.field .input-with-icon > span {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  pointer-events: none;
  color: var(--subtle);
}

.field .input-with-icon svg {
  width: 20px;
  height: 20px;
}

.field .input-with-icon input {
  padding-left: calc(var(--space-md) * 2 + 16px);
}

/* Bracket device: [ Word ], accent brackets around the surrounding text color's word */
.bracket-device .bracket {
  color: var(--accent);
}

/* App shell header: logo lockup, and, when signed in, the account link and sign-out control */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--line);
}

.app-header .lockup {
  display: inline-flex;
  align-items: center;
  gap: 6px; /* 0.25 * 24px wordmark size */
  text-decoration: none;
  color: var(--ink);
}

.app-header .lockup img {
  height: 31.2px; /* 1.3 * 24px wordmark size */
  width: auto;
}

.app-header .lockup .wordmark {
  font-family: "Stick No Bills", "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 500;
  font-size: 24px;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.app-header .account {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.app-header .account a {
  text-decoration: none;
  font-weight: 600;
}

/* Loading state: label swap handles it, no spinner needed */
[aria-busy="true"] {
  cursor: wait;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-property: opacity !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
