/* The Headless design template: tokens and base elements.
 * The Proxy Matches app's look (joedaviesio/proxymatches, the home screen),
 * inverted and hardened: its off-white becomes the text, black becomes the
 * page, and the soft corners, shadows and springs are taken away.
 * DESIGN.md at the top of the repo explains each choice. A page links this
 * file first, then its own stylesheet, and uses only the tokens below.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
  src: url(/balcony/fonts/inter-latin.woff2) format('woff2');
}

:root {
  color-scheme: dark;

  /* Palette */
  --black: #0a0a0a;
  --concrete: #161616;
  --steel: #2a2a2a;
  --white: #faf9f6;
  --cream: #fee9ce;
  --pink: #fa4f92;
  --blue: #109bc8;
  --pale-blue: #abccff;
  --orange: #fd6e19;
  --green: #359927;
  --grey: #a8a8a8;
  --tan: #c9a690;
  --rose: #d36582;
  --danger: #dc2626;
  --line: rgba(250, 249, 246, 0.18);
  --tint: rgba(250, 249, 246, 0.06);

  /* Roles */
  --bg: var(--black);
  --surface: var(--concrete);
  --text: var(--white);
  --text-dim: rgba(250, 249, 246, 0.55);
  --border: var(--white);
  --accent: var(--pink);
  --success: var(--green);
  --warning: var(--orange);

  /* Type */
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --weight-body: 400;
  --weight-strong: 600;
  --weight-header: 700;
  --track-label: 0.14em;
  --size-tiny: 0.625rem;
  --size-small: 0.75rem;
  --size-body: 0.875rem;
  --size-medium: 1rem;
  --size-large: 1.25rem;
  --size-xlarge: 1.5rem;
  --size-xxlarge: 2rem;
  --size-huge: 3rem;
  --size-poster: clamp(3rem, 13vw, 7.5rem);
  --leading-tight: 0.95;
  --leading-normal: 1.5;

  /* Space */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-xxl: 32px;
  --space-huge: 48px;

  /* Shape: square. No rounding, no shadows; edges are drawn with lines. */
  --radius: 0;
  --border-thin: 1px;
  --border-thick: 3px;

  /* Motion: short and hard. Things cut in; nothing bounces or glides. */
  --dur-fast: 80ms;
  --dur-base: 140ms;
  --dur-strobe: 500ms;
  --ease: linear;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: var(--weight-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: var(--weight-header);
  line-height: var(--leading-tight);
  text-transform: uppercase;
  margin: 0;
}
/* The page title is a poster: as big as the page allows, packed tight. */
h1 { font-size: var(--size-poster); letter-spacing: -0.06em; }
/* Section titles are labels: small, spaced out. */
h2 { font-size: var(--size-small); letter-spacing: var(--track-label); }

p { margin: 0; }
strong, b { font-weight: var(--weight-strong); }

/* Small spaced capitals, for anything that names rather than says. */
.label {
  font-size: var(--size-small);
  font-weight: var(--weight-strong);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* A section: a rule on top, a title row, then content. */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-top: var(--border-thick) solid var(--border);
}

/* The count beside a section title. */
.badge {
  background: var(--pink);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: var(--size-small);
  font-weight: var(--weight-header);
  font-variant-numeric: tabular-nums;
  padding: 2px var(--space-sm);
}

/* A framed panel: a black hole with a hard edge. */
.frame {
  background: #000;
  border: var(--border-thin) solid var(--line);
}

.hint {
  font-size: var(--size-small);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-align: center;
  color: var(--text-dim);
}

button {
  font: inherit;
  font-size: var(--size-small);
  font-weight: var(--weight-header);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  border: var(--border-thin) solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
/* The one big action on a page: a solid white slab. */
button.primary {
  background: var(--white);
  color: var(--black);
  font-size: var(--size-medium);
  padding: var(--space-lg) var(--space-xxl);
}
button:hover { background: var(--white); color: var(--black); }
button.primary:hover { background: var(--pink); border-color: var(--pink); }
button:active { background: var(--pink); border-color: var(--pink); color: var(--black); }
button:disabled { opacity: 0.4; cursor: default; }

input[type='checkbox'], input[type='range'] { accent-color: var(--white); }

:focus-visible { outline: var(--border-thick) solid var(--pink); outline-offset: 2px; }

.hidden { display: none; }

/* Motion pieces a page can use by name. */
@keyframes enter {
  from { background-color: var(--white); color: var(--black); }
  to { background-color: transparent; }
}
@keyframes strobe {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.25; }
}

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