@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #0E1E36;
  --bg-raised: #16294A;
  --bg-raised-2: #1D3358;
  --text: #F5EEDD;
  --text-muted: #9FB3CE;
  --accent-cyan: #2C93F2;
  --accent-coral: #F2C94C;
  --accent-plum: #C97A9B;
  --border: rgba(245, 238, 221, 0.1);
  --radius: 14px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

/* Subtle cybernetic willow/maple corner texture, public pages only —
   admin keeps a clean flat background so the tables/forms stay readable. */
body:not(.admin-shell) {
  background-image: url('/img/bg-motif.svg'), url('/img/bg-motif.svg');
  background-repeat: no-repeat, no-repeat;
  background-position: top left, bottom right;
  background-size: 340px 340px, 340px 340px;
  background-attachment: fixed, fixed;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(27, 19, 48, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1120px;
  margin: 0 auto;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wordmark .dot { color: var(--accent-coral); }
.nav-mascot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-raised-2);
  object-fit: cover;
}
.freq-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}
.freq-nav a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.freq-nav a:hover { color: var(--accent-cyan); }
.freq-nav a.is-current { color: var(--accent-coral); }

/* ---------- Page header (Clips, Crew — lighter than the animated home hero) ---------- */
.page-header {
  padding: 56px 0 40px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.page-header .live-pill { margin-bottom: 18px; }
.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.page-header p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  font-size: 1rem;
}

/* ---------- Hero ---------- */
.hero {
  padding: 88px 0 64px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-tree-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 720px;
  height: 720px;
  z-index: 0;
  opacity: 0.65;
  pointer-events: none;
  /* Fade out the middle where the headline/tagline/CTA sit, so the tree
     frames the hero at the edges instead of fighting the lettering. */
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent 55%, black 100%);
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent 55%, black 100%);
}
.hero-content { position: relative; z-index: 1; }

.hero-mascot {
  position: relative;
  z-index: 1;
  width: 128px;
  height: 128px;
  object-fit: contain;
  margin: 0 auto 20px;
  filter: drop-shadow(0 0 34px rgba(44, 147, 242, 0.45));
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  margin-bottom: 24px;
}
.live-pill.is-live {
  border-color: var(--accent-coral);
  color: var(--accent-coral);
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted);
}
.live-pill.is-live .live-dot {
  background: var(--accent-coral);
  box-shadow: 0 0 0 0 rgba(255, 111, 168, 0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 111, 168, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(255, 111, 168, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 111, 168, 0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}
.hero h1 .accent { color: var(--accent-cyan); }

.hero p.tagline {
  max-width: 560px;
  margin: 0 auto 36px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.role-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 40px;
}
.role-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-raised);
}

.cta-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 28px;
  border-radius: 999px;
  display: inline-block;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent-cyan); color: #10142B; }
.btn-ghost { border: 1px solid var(--border); color: var(--text); }

/* ---------- Sections ---------- */
section.block { padding: 72px 0; border-top: 1px solid var(--border); }
section.block-secondary { padding: 48px 0; }
section.block-secondary .block-head h2 { font-size: 1.4rem; }

.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip:hover { border-color: var(--accent-cyan); color: var(--text); }
.filter-chip.is-active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  color: #0E1E36;
  font-weight: 600;
}

.crew-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--crew-accent, var(--accent-cyan));
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease;
  min-width: 0;
}
.crew-card:hover { transform: translateY(-3px); }
.crew-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-raised-2);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem;
  color: var(--crew-accent, var(--accent-cyan));
  overflow: hidden;
}
.crew-avatar img { width: 100%; height: 100%; object-fit: cover; }
.crew-info { min-width: 0; }
.crew-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 2px;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.25;
}
.crew-handle {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.crew-card-full {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-left: 3px solid var(--crew-accent, var(--accent-cyan));
  border-radius: var(--radius);
}
.crew-card-full .crew-avatar { width: 60px; height: 60px; font-size: 1.4rem; }
.crew-card-full .crew-info { min-width: 0; }
.crew-card-full h3 { font-family: var(--font-display); font-size: 1.1rem; margin: 0 0 2px; overflow-wrap: break-word; }
.crew-clip-count {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  margin-top: 4px;
}
.crew-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.crew-card-actions .btn { padding: 9px 16px; font-size: 0.82rem; flex: 1; text-align: center; }

.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
  flex-wrap: wrap;
}
.block-head h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 4px 0 0;
  letter-spacing: -0.02em;
}
.block-head p { color: var(--text-muted); margin: 0; max-width: 380px; font-size: 0.92rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--accent-cyan); transform: translateY(-3px); }
.card-thumb {
  aspect-ratio: 16/9;
  background: var(--bg-raised-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px; }
.card-body h3 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 4px; }
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.art-card .card-thumb { aspect-ratio: 4/5; }

.track-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.track-cover {
  width: 56px; height: 56px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-raised-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-coral);
}
.track-info h3 { font-family: var(--font-display); font-size: 0.95rem; margin: 0 0 2px; }
.track-info span { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

.schedule-list { display: flex; flex-direction: column; gap: 10px; }
.schedule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.schedule-row .label { font-family: var(--font-display); font-weight: 600; }
.schedule-row .time { font-family: var(--font-mono); color: var(--text-muted); font-size: 0.85rem; }

/* ---------- Swear Jar (floating badge, top-right, below the sticky nav) ---------- */
.swear-jar {
  position: fixed;
  top: 76px;
  right: 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.swear-jar-icon { font-size: 1.15rem; line-height: 1; }
.swear-jar-text { display: flex; flex-direction: column; line-height: 1.15; }
.swear-jar-count {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-coral);
}
.swear-jar.just-bumped .swear-jar-count { animation: swear-bump 0.4s ease; }
@keyframes swear-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.swear-jar-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .swear-jar {
    top: auto;
    bottom: 16px;
    right: 12px;
    padding: 7px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .swear-jar.just-bumped .swear-jar-count { animation: none; }
}

.nap-meter {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 24px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.nap-meter-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.nap-icon {
  font-size: 2.2rem;
  line-height: 1;
  filter: grayscale(0.15);
  transition: transform 0.3s ease;
}
.nap-meter.is-awake .nap-icon { animation: nap-bounce 0.6s ease infinite alternate; }
@keyframes nap-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}
.nap-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
}
.nap-meter.is-awake .nap-label { color: var(--accent-coral); }
.nap-sublabel {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.nap-sublabel span { color: var(--accent-cyan); }
.nap-meter.is-awake .nap-sublabel span { color: var(--accent-coral); }

.nap-bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-raised-2);
  overflow: hidden;
}
.nap-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-cyan);
  border-radius: 999px;
  transition: width 1s linear;
}
.nap-meter.is-awake .nap-bar-fill { background: var(--accent-coral); }

@media (prefers-reduced-motion: reduce) {
  .nap-meter.is-awake .nap-icon { animation: none; }
}

.fav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.fav-item {
  padding: 16px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fav-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-coral);
}
.fav-value {
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text);
}

.empty-note {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 24px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .freq-nav { gap: 14px 18px; }
  .hero { padding: 64px 0 48px; }
  section.block { padding: 52px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .live-pill.is-live .live-dot { animation: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- Admin ---------- */
.admin-shell { min-height: 100vh; }

.admin-topbar {
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(14, 30, 54, 0.9);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-sidebar {
  position: sticky;
  top: 61px;
  align-self: start;
  height: calc(100vh - 61px);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-right: 1px solid var(--border);
}
.admin-sidebar a {
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.admin-sidebar a:hover { background: var(--bg-raised); color: var(--text); }
.sidebar-view-site {
  margin-top: auto;
  color: var(--accent-cyan) !important;
  border-top: 1px solid var(--border);
  padding-top: 16px !important;
}

.admin-main { padding: 32px 28px 80px; min-width: 0; }

.admin-banner-error {
  background: rgba(242, 201, 76, 0.12);
  border: 1px solid var(--accent-coral);
  color: var(--accent-coral);
  padding: 12px 16px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.admin-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  scroll-margin-top: 80px;
}
.admin-panel h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-bottom: 18px; }
.admin-table th, .admin-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-table th { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }

.you-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--accent-cyan);
  border: 1px solid var(--accent-cyan);
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 6px;
}

.admin-form {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  padding: 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.admin-form input, .admin-form select, .admin-form textarea {
  background: var(--bg-raised); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: 8px; font-family: var(--font-body); font-size: 0.88rem;
  width: 100%;
}
.admin-form label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); display: block; margin-bottom: 4px; }
.admin-form .full { grid-column: 1 / -1; }
.admin-form button { grid-column: 1 / -1; }

.login-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-card {
  width: 340px; padding: 32px; background: var(--bg-raised);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.login-card h1 { font-family: var(--font-display); font-size: 1.4rem; margin-top: 0; }
.login-card input {
  width: 100%; margin-bottom: 12px; padding: 10px 12px;
  background: var(--bg); border: 1px solid var(--border); color: var(--text); border-radius: 8px;
}
.login-error { color: var(--accent-coral); font-size: 0.82rem; margin-bottom: 12px; font-family: var(--font-mono); }
.icon-btn { border: 1px solid var(--border); background: transparent; color: var(--text-muted); padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; font-family: var(--font-mono); }
.icon-btn:hover { color: var(--accent-coral); border-color: var(--accent-coral); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.icon-btn:disabled:hover { color: var(--text-muted); border-color: var(--border); }

.reorder-cell { display: flex; gap: 4px; }
.reorder-cell .icon-btn { padding: 4px 8px; line-height: 1; }

@media (max-width: 760px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
  }
  .sidebar-view-site { margin-top: 0; border-top: none; padding-top: 9px !important; }
  .admin-form { grid-template-columns: 1fr; }
}
