/* Underground TV shared styles ("Midnight Velvet"). Owner: foundation.
   One header and one footer on every page: put these in the page and load the two assets.

     <link rel="preconnect" href="https://fonts.googleapis.com">
     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
     <link href="https://fonts.googleapis.com/css2?family=Bodoni+Moda:ital,opsz,wght@0,6..96,400;0,6..96,600;0,6..96,700;1,6..96,500&family=Inter:wght@300;400;500;600&display=swap" rel="stylesheet">
     <link rel="stylesheet" href="/assets/site.css">
     <script src="/assets/site.js" defer></script>
     ...
     <header data-site><a class="site-logo" href="/">Underground <i>TV</i></a></header>
     <main class="page"> ... </main>
     <footer data-site></footer>

   The logo inside <header data-site> is only a fallback; site.js fills in the real header.
   Page-specific styles go in the page after this file. Mobile first: everything must fit a
   375px-wide phone with no sideways scrolling (wide tables go inside .table-wrap). */

:root {
  --bg: #0E0A14; --bg2: #160E1E; --panel: #1A1222; --panel2: #221829; --line: #2C2036;
  --gold: #C8A04D; --gold-hi: #E4C878; --wine: #8E2749; --wine-hi: #B83A64;
  --ink: #F3EDE4; --mut: #C2B0BC; --dim: #8C7C8A;
  --ok: #6FCF97; --warn: #E4C878; --err: #FF7A93;
  --serif: "Bodoni Moda", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --radius: 12px; --wrap: 1040px; --gutter: 16px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px;
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img, video, svg, canvas { max-width: 100%; }
a { color: var(--gold-hi); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
h1, h2, h3, p, li, td, th, label { overflow-wrap: break-word; }
.page h1, .page h2, .page h3, .card h2, .card h3 { font-family: var(--serif); line-height: 1.2; }
@media (min-width: 720px) { :root { --gutter: 20px; } }

/* ---- Layout ---------------------------------------------------------------- */
.wrap { position: relative; z-index: 1; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.page { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 24px var(--gutter) 64px; }
.page-wide { max-width: var(--wrap); }
.page h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--gold-hi); margin: 8px 0 8px; }
.page h2 { font-size: 1.25rem; margin: 28px 0 8px; }
.eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: var(--mut); }
.lede { color: var(--mut); font-size: 1.05rem; max-width: 52ch; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.muted { color: var(--mut); }
.dim { color: var(--dim); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden, [hidden] { display: none !important; }
.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; }

/* ---- Header ------------------------------------------------------------------
   Phone: logo + Sign in on the first row, Watch / Join / Become a creator on the second.
   Wider screens: one row. */
header[data-site] {
  position: relative; z-index: 2; max-width: var(--wrap); margin: 0 auto; padding: 14px var(--gutter) 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 96px; align-content: flex-start;
}
@media (min-width: 720px) { header[data-site] { min-height: 62px; padding-top: 20px; flex-wrap: nowrap; } }
.site-logo {
  order: 1; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; letter-spacing: .02em; line-height: 1.3;
  color: var(--gold); text-decoration: none; white-space: nowrap; margin-right: auto;
}
.site-logo i { font-style: italic; color: var(--wine-hi); }
.site-acct { order: 2; display: flex; gap: 6px; align-items: center; }
.site-nav {
  order: 3; flex: 1 0 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 8px;
}
@media (min-width: 720px) {
  .site-nav { order: 2; flex: 0 1 auto; border: 0; padding: 0; justify-content: flex-end; gap: 22px; }
  .site-acct { order: 3; }
}
.site-nav a, .site-acct a {
  color: var(--mut); font-size: .86rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px;
}
.site-nav a:hover, .site-acct a:hover { color: var(--gold-hi); }
.site-nav a[aria-current="page"], .site-acct a[aria-current="page"] { color: var(--gold-hi); }
.site-nav a.site-pill { color: var(--gold); border: 1px solid rgba(200, 160, 77, .45); border-radius: 99px; padding: 0 13px; min-height: 36px; }
.site-acct a.site-signin { color: var(--ink); border: 1px solid rgba(243, 237, 228, .28); border-radius: 99px; padding: 0 13px; min-height: 36px; }
.site-acct a { min-height: 36px; }
.site-acct a.site-staff { color: var(--gold); padding: 0 6px; }

/* ---- Footer ------------------------------------------------------------------ */
footer[data-site] {
  position: relative; z-index: 1; border-top: 1px solid var(--line); margin-top: 24px;
  padding: 24px var(--gutter) 44px; text-align: center; color: var(--dim); font-size: .84rem;
}
.site-foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; max-width: 640px; margin: 0 auto 10px; }
.site-foot-nav a { color: var(--mut); text-decoration: none; display: inline-flex; align-items: center; min-height: 36px; }
.site-foot-nav a:hover { color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; }
.site-copy { color: var(--dim); }

/* ---- Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border: 0; border-radius: var(--radius); font: inherit; font-weight: 600; font-size: 1rem; line-height: 1.2;
  color: #1a1206; text-decoration: none; cursor: pointer; text-align: center;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 8px 26px rgba(200, 160, 77, .25);
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(243, 237, 228, .3); box-shadow: none; }
.btn-wine { background: linear-gradient(180deg, var(--wine-hi), var(--wine)); color: var(--ink); box-shadow: 0 8px 26px rgba(142, 39, 73, .3); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn-block { display: flex; width: 100%; }
.link-btn { display: inline-block; min-height: 24px; background: none; border: 0; padding: 2px 0; font: inherit; color: var(--gold-hi); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---- Forms ------------------------------------------------------------------- */
.field { display: block; margin: 0 0 16px; }
.field > span, .field > label { display: block; font-size: .9rem; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.field .help { display: block; font-size: .82rem; color: var(--dim); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="url"], input[type="number"], input[type="search"], input[type="tel"],
input[type="date"], input[type="password"], input:not([type]), select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--ink); font: inherit; font-size: 16px; /* 16px stops iPhone zoom */
}
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
/* Text boxes show focus with a gold ring. Checkboxes, radio buttons and sliders keep the
   :focus-visible outline above, which is easier to see on small controls. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 160, 77, .2); }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible, input[type="range"]:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--err); }
input.code { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--gold); }
.form-error { color: var(--err); font-size: .9rem; margin: 6px 0 0; }

/* ---- Cards, tiles, notices, badges -------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.card-gold { border-top: 2px solid var(--gold); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { display: block; background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: inherit; text-decoration: none; min-width: 0; }
.tile b { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--gold-hi); line-height: 1.15; overflow-wrap: anywhere; }
.tile span { display: block; color: var(--mut); font-size: .85rem; margin-top: 4px; }
a.tile:hover { border-color: rgba(200, 160, 77, .5); }
.notice { border: 1px solid var(--line); border-left: 3px solid var(--gold); background: var(--panel); border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.notice-ok { border-left-color: var(--ok); }
.notice-warn { border-left-color: var(--warn); }
.notice-err { border-left-color: var(--err); }
.badge { display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--mut); white-space: nowrap; }
.badge-ok { background: rgba(111, 207, 151, .15); color: var(--ok); }
.badge-warn { background: rgba(228, 200, 120, .15); color: var(--warn); }
.badge-err { background: rgba(255, 122, 147, .15); color: var(--err); }
.badge-gold { background: rgba(200, 160, 77, .18); color: var(--gold-hi); }

/* ---- Tables (always inside .table-wrap so a phone scrolls the table, not the page) */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 600; white-space: nowrap; background: var(--bg2); }
.table tr:last-child td { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Section menus for /admin/ and /studio/ (wraps onto more rows on a phone, nothing hidden) ---- */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 6px; overflow: visible; padding: 4px 0 10px; margin: 0 0 16px; border-bottom: 1px solid var(--line); }
.subnav a { flex: 0 0 auto; color: var(--mut); text-decoration: none; font-size: .9rem; padding: 8px 12px; border-radius: 99px; white-space: nowrap; }
.subnav a[aria-current="page"] { color: #1a1206; background: var(--gold); font-weight: 600; }
