/* On the Bill — application stylesheet.

   One file, no framework, no inline styles anywhere (the CSP is
   `style-src 'self'`). Mobile first: the base rules are the phone layout and
   the media queries widen it. Colours live in the tokens below so a later
   brand pass is a change to this block, not to every rule.

   The palette is gig-poster paper and marquee red, deliberately unlike the
   black and yellow of the unrelated Cape Town agency that shares the name. */

:root {
  --ink: #1c1a17;
  --ink-soft: #4a453e;
  --muted: #6f685e;
  --paper: #faf6ef;
  --surface: #ffffff;
  --surface-sunk: #f3ede3;
  --line: #e6ded1;
  --control-line: #cfc5b5;

  /* Marquee red. #c2412d on white measures 5.1:1, so it is safe for body-size
     link text and for white text on a red button. */
  --brand: #c2412d;
  --brand-dark: #932f20;
  --brand-soft: #fbe9e4;

  --ok-bg: #e8f4ec;
  --ok-fg: #1d5c3b;
  --ok-line: #a9d3b8;
  --warn-bg: #fff6e5;
  --warn-fg: #6f4a10;
  --warn-line: #e8cf98;
  --danger-bg: #fdf0ec;
  --danger-fg: #8a2b17;
  --danger-line: #e2a796;

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 6px 20px rgba(28, 26, 23, 0.05);
  --focus: 0 0 0 3px rgba(194, 65, 45, 0.35);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system,
               BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
}

/* Inter, self-hosted from /static/fonts so no page requests a third-party
   font. Upright exists at 400/500/600/700 and italic at 400/600 — nothing
   else; any other weight is synthesised by the browser. SIL Open Font
   License 1.1, see fonts/OFL.txt. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/Inter-Bold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/Inter-Italic.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: italic; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBoldItalic.woff2") format("woff2"); }

/* ---- Base ---------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1rem; }
strong, b { font-weight: 600; }

a { color: var(--brand); text-underline-offset: 0.15em; }
a:hover { color: var(--brand-dark); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 0.25rem; }

img, svg { max-width: 100%; }

code { font-family: var(--font-mono); font-size: 0.92em; }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.site-header nav { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.site-header nav a { font-weight: 500; text-decoration: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 1.75rem; height: 1.75rem; flex: none; }

main {
  flex: 1;
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}
main:focus { box-shadow: none; }

.site-footer {
  padding: 1.5rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}
.site-footer p { margin: 0 0 0.5rem; }
.site-footer__links { display: flex; justify-content: center; gap: 1rem; }
.site-footer__links a { color: var(--muted); }

.environment-pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: var(--warn-fg);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* The account menu is a <details>, so it opens without scripting;
   app.js only closes it on an outside click or Escape. */
.account-menu { position: relative; }
.account-menu summary {
  list-style: none;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink-soft);
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 13rem;
  padding: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 5;
}
.account-menu__panel p { margin: 0.25rem 0.5rem 0.5rem; color: var(--muted); font-size: 0.85rem; overflow-wrap: anywhere; }
.account-menu__panel a,
.account-menu__panel button {
  display: block;
  width: 100%;
  padding: 0.5rem;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.account-menu__panel a:hover,
.account-menu__panel button:hover { background: var(--surface-sunk); }

.breadcrumb { margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: 0.35rem; color: var(--control-line); }

/* ---- Headings and sections ----------------------------------------------- */

.eyebrow {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eyebrow--accent { color: var(--brand); }

.page-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-header p { color: var(--ink-soft); margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.section-card {
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.section-card__header { margin-bottom: 1rem; }
.section-card__header p { color: var(--ink-soft); margin: 0; }

.card-list { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.card-list > li {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-list a { font-weight: 600; }
.card-list p { margin: 0.25rem 0 0; color: var(--ink-soft); }

.metadata-grid { display: grid; gap: 0.75rem; margin: 0; }
.metadata-row dt { color: var(--muted); font-size: 0.85rem; }
.metadata-row dd { margin: 0; overflow-wrap: anywhere; }

.empty-state {
  display: flex;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--surface-sunk);
  border-radius: var(--radius);
}
.empty-state__spark { color: var(--brand); font-size: 1.25rem; line-height: 1; }
.empty-state__title { font-weight: 600; margin: 0 0 0.25rem; }
.empty-state__copy { color: var(--ink-soft); margin: 0; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-sunk);
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 600;
}
.badge--brand { background: var(--brand-soft); color: var(--brand-dark); }

/* ---- Alerts -------------------------------------------------------------- */

.alert {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.alert h2 { font-size: 1rem; margin-bottom: 0.35rem; }
.alert ul { margin: 0; padding-left: 1.25rem; }
.alert--success { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-fg); }
.alert--warning { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-fg); }
.alert--error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger-fg); }
.alert--error a { color: var(--danger-fg); }

/* ---- Buttons ------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.button--primary { background: var(--brand); color: var(--surface); }
.button--primary:hover { background: var(--brand-dark); color: var(--surface); }
.button--secondary { background: var(--surface); border-color: var(--control-line); color: var(--ink); }
.button--secondary:hover { background: var(--surface-sunk); color: var(--ink); }
.button--danger { background: var(--surface); border-color: var(--danger-line); color: var(--danger-fg); }
.button--danger:hover { background: var(--danger-bg); color: var(--danger-fg); }
.button--link { min-height: 0; padding: 0; border: 0; background: none; color: var(--brand); text-decoration: underline; font-weight: 500; }

.inline-form { display: inline; }

/* ---- Forms --------------------------------------------------------------- */

.stack-form { display: grid; gap: 1rem; }
.form-field { display: grid; gap: 0.35rem; }
.form-field label { font-weight: 600; }
.field-help { margin: 0; color: var(--muted); font-size: 0.9rem; }
.field-error { margin: 0; color: var(--danger-fg); font-size: 0.9rem; font-weight: 600; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--control-line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--brand); }
.form-field--error input,
.form-field--error select,
.form-field--error textarea { border-color: var(--danger-fg); }

.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }

.choice-list { display: grid; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.choice-list legend { font-weight: 600; margin-bottom: 0.35rem; }
.link-fields { display: grid; gap: 1rem; margin: 0; padding: 0; border: 0; }
.link-fields legend { font-weight: 600; margin-bottom: 0.35rem; }
.field-pair { display: grid; gap: 1rem; }
@media (min-width: 40rem) {
  .field-pair { grid-template-columns: 2fr 1fr; align-items: end; }
}
.choice { display: flex; align-items: flex-start; gap: 0.5rem; }
.choice input { margin-top: 0.3rem; accent-color: var(--brand); }

/* ---- Landing page -------------------------------------------------------- */

.hero { padding: 1.5rem 0 2rem; }
.hero h1 { font-size: 2.1rem; }
.hero p { font-size: 1.1rem; color: var(--ink-soft); max-width: 36rem; }
.feature-grid { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.feature-grid li {
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.feature-grid h2 { font-size: 1.05rem; }
.feature-grid p { margin: 0; color: var(--ink-soft); }

/* ---- Legal pages ---------------------------------------------------------- */

.legal-page { max-width: 44rem; }
.legal-page h2 { margin-top: 1.75rem; }

/* ---- Wider screens ------------------------------------------------------- */

@media (min-width: 40rem) {
  main { padding: 2rem 1.5rem 4rem; }
  .site-header { padding: 0.85rem 1.5rem; }
  .page-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
  .metadata-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero h1 { font-size: 2.6rem; }
}

/* ---- Sign-in and account cards ------------------------------------------- */

.auth-card {
  max-width: 28rem;
  margin: 0 auto;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 1.5rem; }
.auth-card__aside { margin: 1.25rem 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.auth-card h2 { margin-top: 1.75rem; font-size: 1.1rem; }

/* ---- Acts ------------------------------------------------------------------ */

.section-actions { margin: 1rem 0 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.act-genres { margin: 0 0 0.75rem; }
/* A bio keeps the line breaks its author typed, without allowing any markup. */
.act-bio { margin: 0; white-space: pre-line; }
.member-form { display: grid; gap: 0.75rem; margin-top: 0.75rem; }

@media (min-width: 40rem) {
  .member-form { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
}

/* ---- Copying a link -------------------------------------------------------- */

.link-field { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9rem; }
.copy-row { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0; }
.copy-status { color: var(--ok-fg); font-size: 0.85rem; font-weight: 600; }

/* ---- Photos ---------------------------------------------------------------- */

.avatar {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--brand-soft);
  flex: none;
}
.avatar--large { width: 10rem; height: 10rem; margin-bottom: 1rem; }
.photo-card h2 { margin-top: 0; }
.profile-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.profile-head .avatar--large { margin-bottom: 0; }
.tag-list, .link-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.link-list a { font-weight: 600; }
.lineup-entry > a { display: inline-flex; align-items: center; gap: 0.75rem; }
.lineup-entry p { margin-left: 3.25rem; }
