/* ============================================================
   MyJF Club — design tokens
   Palette: ink background, violet→cyan signal gradient (nods to
   Jellyfin's own purple/blue identity without reusing its marks),
   amber for "live/today" state.
   ============================================================ */

:root {
  --bg: #0b0b12;
  --bg-elevated: #131320;
  --bg-card: #15151f;
  --border: #26263a;
  --border-soft: #1d1d2c;

  --text: #edf0f7;
  --text-dim: #9797ac;
  --text-faint: #5f5f74;

  --violet: #8b5cf6;
  --violet-soft: #6d4bd1;
  --blue: #38bdf8;
  --amber: #ffb454;

  --gradient: linear-gradient(90deg, var(--violet) 0%, var(--blue) 100%);

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before {
  /* faint fixed vignette so panels feel like they sit in a dim room, not on flat black */
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(ellipse 800px 500px at 100% 0%, rgba(56, 189, 248, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

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

img, svg { display: block; }

::selection { background: var(--violet-soft); color: #fff; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ---------- signature element: "the wire" ----------
   A thin animated gradient scanline used as a recurring device —
   a nod to a stream's buffering/progress bar. Marks section starts
   and the live/today state. */

.wire {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--violet), var(--blue), transparent);
  background-size: 200% 100%;
  animation: wire-sweep 6s linear infinite;
  opacity: 0.85;
}

@keyframes wire-sweep {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .wire, .dot-live, .hero-orb { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- header ---------- */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(11, 11, 18, 0.75);
  border-bottom: 1px solid var(--border-soft);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo .mark {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--gradient);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.logo .grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

nav.links {
  display: flex;
  gap: 28px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

nav.links a { transition: color 0.15s ease; }
nav.links a:hover { color: var(--text); }

/* ---------- hero ---------- */

.hero {
  padding: 88px 0 64px;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255, 180, 84, 0.6);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 180, 84, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(255, 180, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 180, 84, 0); }
}

h1.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  max-width: 14ch;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 46ch;
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--gradient);
  color: #0b0b12;
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--blue); }

/* ---------- section scaffolding ---------- */

section { padding: 56px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

h2.section-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  margin: 4px 0 0;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.98rem;
  max-width: 56ch;
  margin: 10px 0 0;
}

.section .wire { margin: 20px 0 36px; }

/* ---------- apps grid ---------- */

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

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.app-card:hover {
  border-color: transparent;
  transform: translateY(-2px);
}

.app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: var(--radius);
  background: var(--gradient);
  opacity: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.app-card:hover::before { opacity: 1; }

.app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(139,92,246,0.18), rgba(56,189,248,0.14));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--blue);
}

.app-icon svg { width: 18px; height: 18px; }

.app-name {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.app-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 16px;
}

.app-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-card:hover .app-link { text-decoration: underline; }

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

/* ---------- pricing / membership ---------- */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 720px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.pricing-card:hover { transform: translateY(-2px); }

.pricing-card.is-featured {
  border-color: transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--gradient) border-box;
  border: 1px solid transparent;
}

.pricing-badge {
  position: absolute;
  top: -11px;
  right: 22px;
  background: var(--gradient);
  color: #0b0b12;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.pricing-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dim);
  margin: 0 0 14px;
}

.pricing-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 14px;
}

.pricing-amount .price {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.pricing-amount .period {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-faint);
}

.pricing-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0 0 22px;
  flex: 1;
}

.pricing-cta {
  width: 100%;
  justify-content: center;
}

.pricing-empty {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  max-width: 720px;
}

/* ---------- calendar ---------- */

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.cal-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cal-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

.cal-chip .swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.cal-chip.is-error {
  color: #ff8484;
  border-color: rgba(255, 132, 132, 0.35);
}

.btn-refresh {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  background: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-refresh:hover { border-color: var(--blue); color: var(--text); }
.btn-refresh.is-loading svg { animation: spin 0.9s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.agenda { display: flex; flex-direction: column; gap: 28px; }

.agenda-day {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
}

.agenda-date {
  text-align: center;
  padding-top: 4px;
}

.agenda-date .dow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}

.agenda-date .dom {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1.1;
}

.agenda-day.is-today .dom { color: var(--amber); }
.agenda-day.is-today .dow { color: var(--amber); }

.agenda-events {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-left: 1px solid var(--border-soft);
  padding-left: 20px;
}

.event-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.event-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--blue);
  white-space: nowrap;
  padding-top: 2px;
  min-width: 68px;
}

.event-body { flex: 1; min-width: 0; }

.event-title {
  font-weight: 600;
  font-size: 0.96rem;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.event-title .swatch {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-meta {
  color: var(--text-faint);
  font-size: 0.82rem;
}

.event-source {
  color: var(--text-faint);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

.cal-empty, .cal-loading {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-faint);
}

.cal-empty .big, .cal-loading .big {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.cal-empty code, .cal-loading code {
  font-family: var(--font-mono);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border-soft);
  padding: 32px 0 48px;
  margin-top: 40px;
  color: var(--text-faint);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

footer .grad-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
  .nav { height: 60px; }
  nav.links { gap: 16px; font-size: 0.85rem; }
  .hero { padding: 56px 0 40px; }
  .agenda-day { grid-template-columns: 48px 1fr; gap: 12px; }
  .agenda-date .dom { font-size: 1.3rem; }
  .agenda-events { padding-left: 12px; }
  section { padding: 40px 0; }
}
