:root {
  --paper: #fff;
  --soft: #f7f7f8;
  --ink: #101010;
  --line: #d8d8dc;
  --red: #e4002b;
  --max: 1440px;
}

* { box-sizing: border-box; }
html { color: var(--ink); background: var(--paper); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.site-header {
  min-height: 116px; display: grid; grid-template-columns: 170px 1fr auto; align-items: stretch;
  border-bottom: 1px solid var(--ink); max-width: var(--max); margin: 0 auto;
}
.wordmark { background: var(--red); color: white; padding: 19px 22px; text-decoration: none; font-weight: 800; font-size: 28px; line-height: .85; letter-spacing: -.06em; }
.header-status { display: flex; align-items: center; gap: 12px; padding: 24px; border-right: 1px solid var(--ink); font-size: 14px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.8s infinite; }
nav { display: flex; }
nav a { display: grid; place-items: center; padding: 0 28px; border-right: 1px solid var(--ink); text-decoration: none; }
nav a:hover { background: var(--soft); }

main, footer { max-width: var(--max); margin: 0 auto; }
.grid-section { display: grid; grid-template-columns: 170px 1fr; border-bottom: 1px solid var(--ink); }
.grid-section > :first-child { border-right: 1px solid var(--ink); }
.hero { min-height: 440px; }
.hero-index, .section-number { padding: 28px 22px; color: var(--red); font-size: clamp(60px, 8vw, 124px); font-weight: 700; letter-spacing: -.08em; line-height: .8; }
.hero > div:last-child { padding: 70px clamp(28px, 6vw, 90px); }
.eyebrow { color: var(--red); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; }
h1 { margin: 26px 0; max-width: 1000px; font-size: clamp(54px, 7vw, 112px); line-height: .84; letter-spacing: -.065em; }
.intro { max-width: 660px; font-size: 19px; line-height: 1.45; }
code { color: var(--red); font-weight: 700; background: var(--soft); padding: 2px 5px; }

.search-section > div:last-child, .queue-section > div:last-child { padding: 48px clamp(24px, 5vw, 74px) 72px; }
.search label, .stack-form label, .login-panel label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.search-row { display: grid; grid-template-columns: 1fr 130px; margin-bottom: 46px; }
input { width: 100%; border: 1px solid var(--ink); border-radius: 0; padding: 18px; background: white; min-height: 58px; }
input:focus { outline: 3px solid var(--red); outline-offset: -3px; }
button { min-height: 58px; border: 1px solid var(--ink); border-left: 0; border-radius: 0; background: var(--red); color: white; font-weight: 700; padding: 0 22px; }
button:hover { background: var(--ink); }
.track { display: grid; grid-template-columns: 112px 1fr 152px; align-items: stretch; border-top: 1px solid var(--line); min-height: 112px; }
.track:last-child { border-bottom: 1px solid var(--line); }
.track-order { display: flex; align-items: center; color: var(--red); font-size: 62px; line-height: 1; font-weight: 700; letter-spacing: -.08em; }
.track-name { align-self: center; padding: 14px 20px; }
.track-name h2 { margin: 0 0 5px; font-size: 22px; }
.track-name p { margin: 0; color: #606064; }
.code-copy { border: 0; border-left: 1px solid var(--line); background: var(--soft); color: var(--ink); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.code-copy:hover { color: white; }
.code-copy span { font-size: 22px; letter-spacing: .08em; }
.code-copy small { margin-top: 6px; }
.empty { min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 7px; border-block: 1px solid var(--line); }
.empty.compact { min-height: 90px; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--ink); padding-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 34px; letter-spacing: -.035em; }
.section-heading span { font-size: 13px; color: #606064; }
.queue-item { min-height: 86px; display: grid; grid-template-columns: 110px 1fr 180px; align-items: center; border-bottom: 1px solid var(--line); }
.queue-item.is-playing { color: var(--red); }
.queue-position { font-size: 14px; font-weight: 700; text-transform: uppercase; }
.queue-item small, .admin-row small { display: block; color: #69696d; margin-top: 4px; }

.login-page { min-height: 620px; }
.login-panel { padding: 70px clamp(28px, 7vw, 110px); }
.login-panel h1, .admin-title h1 { font-size: clamp(54px, 8vw, 108px); }
.login-panel form { max-width: 540px; }
.login-panel button { width: 100%; border-left: 1px solid var(--ink); margin-top: 14px; }
.form-error { color: var(--red); font-weight: 700; }

.admin-title > div:last-child { padding: 50px 70px; position: relative; }
.admin-title h1 { margin: 10px 0 0; }
.admin-title form { position: absolute; right: 50px; top: 50px; }
.text-button { min-height: auto; color: var(--ink); background: transparent; border: 0; padding: 0; text-decoration: underline; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--ink); }
.admin-card { padding: 44px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.admin-card.wide { grid-column: 1 / -1; }
.stack-form { margin-top: 28px; }
.settings-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.settings-form label { font-size: 13px; font-weight: 700; }
.settings-form input { margin-top: 8px; }
.settings-form button { border-left: 1px solid var(--ink); align-self: end; }
.connect-link { display: inline-flex; align-items: center; min-height: 50px; margin-top: 22px; padding: 0 20px; background: var(--ink); color: white; font-weight: 700; text-decoration: none; }
.connect-link:hover { background: var(--red); }
.stack-form label { margin-bottom: 18px; }
.stack-form input { margin-top: 8px; }
.stack-form button { border-left: 1px solid var(--ink); }
.stack-form .check { display: flex; align-items: center; gap: 10px; }
.stack-form .check input { width: auto; min-height: auto; margin: 0; }
.admin-list { margin-top: 24px; }
.admin-row { min-height: 76px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); }
.wide .admin-row { grid-template-columns: 100px minmax(0, 1fr) 100px auto; }
.catalog-code { color: var(--red); font-weight: 700; letter-spacing: .08em; }
.small-button { min-height: 38px; padding: 0 15px; border-left: 1px solid var(--ink); background: white; color: var(--ink); }
.tag { font-size: 12px; }
.muted { color: #69696d; }

footer { display: flex; justify-content: space-between; padding: 30px 22px; font-size: 13px; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.75); } }

@media (max-width: 720px) {
  .site-header { grid-template-columns: 96px 1fr; min-height: 88px; }
  .wordmark { padding: 15px 14px; font-size: 22px; }
  .header-status { border-right: 0; padding: 15px; justify-content: flex-end; font-size: 12px; }
  nav { grid-column: 1 / -1; border-top: 1px solid var(--ink); }
  nav a { flex: 1; padding: 13px; }
  .grid-section { grid-template-columns: 62px 1fr; }
  .hero-index, .section-number { padding: 18px 8px; font-size: 38px; writing-mode: vertical-rl; }
  .hero { min-height: 390px; }
  .hero > div:last-child { padding: 46px 22px; }
  h1 { font-size: clamp(48px, 14vw, 72px); }
  .intro { font-size: 16px; }
  .search-section > div:last-child, .queue-section > div:last-child { padding: 34px 18px 50px; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { border-left: 1px solid var(--ink); border-top: 0; }
  .track { grid-template-columns: 60px 1fr; }
  .track-order { font-size: 38px; }
  .track-name { padding-right: 4px; }
  .code-copy { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); min-height: 65px; }
  .queue-item { grid-template-columns: 70px 1fr; padding: 12px 0; }
  .queue-item > :last-child { grid-column: 2; }
  .admin-title > div:last-child { padding: 36px 22px; }
  .admin-title form { position: static; margin-top: 20px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-card, .admin-card.wide { grid-column: auto; padding: 28px 18px; border-right: 0; }
  .settings-form { grid-template-columns: 1fr; }
  .wide .admin-row { grid-template-columns: 80px 1fr auto; }
  .wide .admin-row .tag { display: none; }
  footer { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) { .status-dot { animation: none; } }
