:root {
  --ink: #07111f;
  --ink-2: #0c1728;
  --muted: #5e6879;
  --line: rgba(13, 24, 41, 0.13);
  --paper: #f4f6f9;
  --paper-2: #eef2f6;
  --panel: #ffffff;
  --maroon: #7a1026;
  --maroon-2: #9f1e34;
  --gold: #f0b323;
  --blue: #164b88;
  --green: #16834f;
  --shadow: 0 18px 46px rgba(9, 17, 31, 0.12);
  --soft-shadow: 0 8px 24px rgba(9, 17, 31, 0.09);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  outline-color: color-mix(in srgb, var(--maroon) 64%, white);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 22px;
  min-height: 78px;
  padding: 10px clamp(18px, 2.5vw, 34px);
  background: #06101d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 28px rgba(6, 16, 29, 0.22);
}

.brand,
.main-nav,
.button-row,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  color: #ffffff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 950;
  line-height: 1;
  text-shadow:
    -1px -1px 0 var(--maroon),
    1px -1px 0 var(--maroon),
    -1px 1px 0 var(--maroon),
    1px 1px 0 var(--maroon);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.15rem;
  line-height: 1.1;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.82rem;
  font-weight: 650;
}

.main-nav {
  justify-content: center;
}

.top-actions {
  justify-content: flex-end;
}

.main-nav a,
.primary-button,
.secondary-button,
.ghost-button,
.back-button,
.moon-button,
.spotify-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.main-nav a {
  position: relative;
  color: rgba(255, 255, 255, 0.88);
  padding: 12px 16px;
}

.main-nav a:first-child::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--maroon-2);
}

.main-nav a:hover {
  color: #ffffff;
}

svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

.moon-button {
  width: 42px;
  color: #ffffff;
}

.back-button {
  min-height: 44px;
  padding: 0 16px;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.28);
}

.primary-button {
  padding: 0 15px;
  background: linear-gradient(135deg, var(--maroon), var(--maroon-2));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(122, 16, 38, 0.24);
}

.secondary-button {
  padding: 0 15px;
  background: var(--ink);
  color: #ffffff;
}

.ghost-button {
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  border-color: var(--line);
}

.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

main {
  display: grid;
  width: min(1640px, 100%);
  margin: 0 auto;
  gap: 12px;
  padding: 10px;
}

.command-grid {
  display: grid;
  grid-template-columns: minmax(560px, 0.41fr) minmax(0, 0.59fr);
  gap: 14px;
  align-items: stretch;
}

.profile-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.hero {
  position: relative;
  height: 424px;
  min-height: 424px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ink);
  border: 1px solid rgba(122, 16, 38, 0.44);
  box-shadow: var(--soft-shadow);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.75) contrast(1.05);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(122, 16, 38, 0.58), transparent 32%),
    linear-gradient(90deg, rgba(10, 12, 19, 0.9), rgba(10, 12, 19, 0.74));
}

.hero-content {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(240px, 0.5fr) minmax(250px, 0.5fr);
  gap: 28px;
  align-items: center;
  height: 100%;
  min-height: 424px;
  padding: 26px 32px 0;
  color: #ffffff;
}

.player-photo {
  align-self: end;
  width: min(300px, 100%);
  height: 392px;
  object-fit: cover;
  object-position: 50% 12%;
  border-radius: 0;
  filter: saturate(1.06) contrast(1.03);
}

.hero-copy {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.class-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
}

.class-line strong {
  color: var(--gold);
}

.class-line span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
}

.profile-facts {
  display: grid;
  gap: 12px;
  padding: 6px 0 0;
}

.profile-facts span {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 800;
}

.profile-facts svg {
  color: #ffffff;
}

.gpa-ribbon {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 850;
}

.gpa-ribbon svg,
.gpa-ribbon strong {
  color: var(--gold);
}

.gpa-ribbon strong {
  font-size: 1.22rem;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.stat-tiles span {
  display: grid;
  min-height: 110px;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 12px 8px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #07111f, #0d1a2a);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #ffffff;
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.stat-tiles svg {
  color: var(--gold);
}

.stat-tiles small {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.stat-tiles strong {
  max-width: 100%;
  font-size: clamp(0.86rem, 0.96vw, 1.06rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.panel,
.workspace {
  display: grid;
  gap: 14px;
  padding: clamp(16px, 1.8vw, 24px);
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.email-panel {
  align-content: start;
  gap: 10px;
  padding: 18px 22px;
  min-height: 0;
}

.section-heading {
  display: grid;
  gap: 6px;
}

.section-heading.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0;
  color: var(--maroon);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.35rem, 3.8vw, 3.9rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.email-grid {
  grid-template-columns: minmax(230px, 0.42fr) minmax(0, 0.58fr);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  font-size: 0.9rem;
  font-weight: 520;
  box-shadow: inset 0 1px 0 rgba(13, 24, 41, 0.02);
}

input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--maroon) 54%, white);
  box-shadow: 0 0 0 3px rgba(122, 16, 38, 0.11);
}

textarea {
  min-height: 148px;
  resize: vertical;
  line-height: 1.42;
}

.email-panel textarea {
  height: 152px;
  min-height: 152px;
}

.school-strip {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f8fafc, #f4f0e8);
  border: 1px solid rgba(13, 24, 41, 0.12);
  border-left: 6px solid var(--blue);
}

.school-strip strong {
  font-size: 1.14rem;
}

.school-strip span,
.status {
  color: var(--muted);
  font-weight: 800;
}

.email-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status {
  margin: 0;
}

.status::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--green);
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(500px, 1.45fr) minmax(280px, 0.72fr) minmax(300px, 0.86fr);
  gap: 12px;
}

.queue-panel,
.video-panel,
.music-panel {
  align-content: start;
}

.queue {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.queue button {
  display: grid;
  min-height: 176px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.queue button:hover {
  border-color: rgba(122, 16, 38, 0.28);
  box-shadow: 0 12px 26px rgba(9, 17, 31, 0.1);
  transform: translateY(-1px);
}

.queue button.selected {
  border-color: var(--maroon-2);
  box-shadow: inset 0 0 0 1px rgba(122, 16, 38, 0.28);
}

.school-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--school-color, #123d75);
  color: var(--school-accent, #ffffff);
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(13, 24, 41, 0.12), 0 8px 18px rgba(9, 17, 31, 0.12);
  font-size: 1.02rem;
  font-weight: 950;
}

.queue strong {
  font-size: 0.9rem;
  line-height: 1.22;
}

.queue span:not(.school-logo) {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}

.queue-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.queue-footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--maroon);
  color: #ffffff;
  font-size: 0.76rem;
  font-weight: 850;
}

.video-frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #101820;
}

.video-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #101820;
}

.media-caption {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.songs {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.song-row {
  display: grid;
  grid-template-columns: 34px 1fr auto 24px;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.song-row:last-child {
  border-bottom: 0;
}

.song-play {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
}

.song-row strong {
  font-size: 0.85rem;
}

.song-row small {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
}

.song-row .dots {
  color: var(--muted);
  text-align: right;
}

.spotify-button {
  width: 100%;
  min-height: 38px;
  background: #ffffff;
  border-color: var(--ink);
  color: var(--ink);
}

.utility-section {
  margin-top: 2px;
}

.profile-panel {
  position: static;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  max-width: min(420px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #ffffff;
  font-weight: 900;
  box-shadow: var(--shadow);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 2.5vw, 34px);
  background: #06101d;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 650;
}

.app-footer span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.app-footer strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

body.contacts-page .contacts-main {
  gap: 18px;
  width: min(1480px, 100%);
}

.contacts-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  gap: 22px;
  align-items: end;
  padding: clamp(24px, 4vw, 44px);
  border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(6, 16, 29, 0.94), rgba(122, 16, 38, 0.76)),
    url("assets/basketball-court.jpg") center / cover;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.contacts-hero .eyebrow {
  color: var(--gold);
}

.contacts-hero p:not(.eyebrow) {
  max-width: 840px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
}

.contacts-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.contacts-metrics span {
  display: grid;
  gap: 4px;
  min-height: 86px;
  align-content: center;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-weight: 900;
  text-transform: uppercase;
}

.contacts-metrics strong {
  color: #ffffff;
  font-size: 2rem;
}

.worksheet-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
}

.worksheet-tabs button {
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.worksheet-tabs button.active {
  color: var(--maroon);
  border-color: var(--maroon);
}

.table-tools {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.32fr) minmax(190px, 0.26fr);
  align-items: end;
  gap: 12px;
}

.table-summary {
  color: var(--muted);
  font-weight: 900;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contacts-table {
  width: 100%;
  min-width: 1900px;
  border-collapse: collapse;
}

.contacts-table th,
.contacts-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.contacts-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.contacts-table td {
  font-size: 0.9rem;
  line-height: 1.38;
}

.contacts-table td span,
.contacts-table td em,
.contacts-table td a {
  display: block;
}

.contacts-table td em {
  color: var(--muted);
  font-style: normal;
}

.contacts-table td a {
  color: var(--blue);
  font-weight: 900;
}

.empty-state {
  display: grid;
  min-height: 96px;
  place-items: center;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .main-nav,
  .top-actions {
    justify-content: flex-start;
  }

  .command-grid,
  .lower-grid,
  .contacts-hero {
    grid-template-columns: 1fr;
  }

  .queue {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
    min-height: 0;
  }

  .main-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .main-nav a {
    justify-content: flex-start;
    min-width: 0;
    padding: 10px 8px;
  }

  .top-actions {
    width: 100%;
  }

  .back-button {
    flex: 1;
  }

  main {
    padding: 10px;
  }

  .hero,
  .hero-content {
    height: auto;
    min-height: 0;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 16px;
  }

  .player-photo {
    width: 100%;
    height: min(52vh, 430px);
    object-position: 50% 10%;
    border-radius: var(--radius);
  }

  .stat-tiles strong {
    font-size: 1.08rem;
  }

  .profile-facts span {
    font-size: 0.96rem;
  }

  .stat-tiles,
  .queue,
  .field-grid,
  .email-grid,
  .contacts-metrics,
  .table-tools {
    grid-template-columns: 1fr;
  }

  .song-row {
    grid-template-columns: 34px 1fr 24px;
  }

  .song-row small {
    display: none;
  }

  .queue-footer,
  .email-footer,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
