/* videos.justinahampton.com
   Three themes, all driven by the same tokens:
     daylight — the default. Light, clean, a bit of colour and motion.
     midnight — same personality with the lights off.
     terminal — the original phosphor-green hacker look, kept intact.
   Everything below the token blocks is theme-agnostic. */

:root {
  --bg: #f6f7fc;
  --bg-wash:
    radial-gradient(900px 500px at 12% -10%, #ffe3ec 0%, transparent 60%),
    radial-gradient(800px 460px at 92% 0%, #e2e8ff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f0f2fa;
  --text: #17182b;
  --muted: #6b6f8a;
  --line: #e5e8f4;
  --line-strong: #cfd4e8;

  --c1: #7c5cff;
  --c2: #ff5d73;
  --c3: #ffab1f;
  --c4: #00bfa5;
  --c5: #2f9bff;
  --accent: var(--c1);
  --on-accent: #fff;
  --brand-gradient: linear-gradient(135deg, #7c5cff, #ff5d73 55%, #ffab1f);

  --ok: #0e9f6e;
  --warn: #b7791f;
  --danger: #e0344b;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 24, 43, .05), 0 10px 28px -14px rgba(23, 24, 43, .28);
  --shadow-lift: 0 2px 6px rgba(23, 24, 43, .07), 0 22px 44px -18px rgba(23, 24, 43, .35);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --font-brand: var(--font);
  --brand-weight: 800;
  --letter: -0.01em;
}

[data-theme="midnight"] {
  --bg: #0e0f1d;
  --bg-wash:
    radial-gradient(900px 520px at 10% -12%, rgba(124, 92, 255, .28) 0%, transparent 60%),
    radial-gradient(760px 460px at 94% -4%, rgba(255, 93, 115, .20) 0%, transparent 58%);
  --surface: #191b2f;
  --surface-2: #21243c;
  --text: #ecebff;
  --muted: #9a9cc4;
  --line: #2a2d48;
  --line-strong: #3a3e63;

  --c1: #9d84ff;
  --c2: #ff7d8f;
  --c3: #ffc04d;
  --c4: #2fd9be;
  --c5: #62b4ff;
  --on-accent: #12132a;
  --brand-gradient: linear-gradient(135deg, #9d84ff, #ff7d8f 55%, #ffc04d);

  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #ff6b81;

  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 34px -18px rgba(0, 0, 0, .9);
  --shadow-lift: 0 2px 8px rgba(0, 0, 0, .55), 0 26px 52px -20px rgba(0, 0, 0, .95);
}

[data-theme="terminal"] {
  --bg: #050605;
  --bg-wash: none;
  --surface: #0b0f0c;
  --surface-2: #0f2419;
  --text: #d6e8dd;
  --muted: #2c8a5e;
  --line: #12331f;
  --line-strong: #185a3b;

  --c1: #35ff9e;
  --c2: #35ff9e;
  --c3: #ffcf5c;
  --c4: #57e5ff;
  --c5: #35ff9e;
  --accent: #35ff9e;
  --on-accent: #050605;
  --brand-gradient: none;

  --ok: #35ff9e;
  --warn: #ffcf5c;
  --danger: #ff5f6e;

  --radius: 8px;
  --radius-sm: 5px;
  --shadow: none;
  --shadow-lift: none;

  --font: var(--font-mono);
  --font-brand: var(--font-mono);
  --brand-weight: 700;
  --letter: .04em;
}

* { box-sizing: border-box; }

/* .btn sets display, which would otherwise beat the UA rule for [hidden]. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(14px, .55vw + 12px, 16px);
  line-height: 1.55;
  letter-spacing: var(--letter);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image: var(--bg-wash);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

.wrap { width: min(1140px, 100%); margin: 0 auto; padding: 22px 18px 72px; }

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

.top {
  width: min(1140px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 18px 14px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-brand); font-weight: var(--brand-weight); font-size: 1.05rem; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--brand-gradient);
  position: relative; flex: 0 0 auto;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: var(--on-accent);
  clip-path: polygon(38% 28%, 38% 72%, 72% 50%);
}
[data-theme="terminal"] .brand-mark { background: var(--accent); border-radius: 3px; }
.brand-text { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme="terminal"] .brand-text { background: none; color: var(--accent); }
[data-theme="terminal"] .brand-text::after { content: "█"; margin-left: 2px; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.top nav { display: flex; align-items: center; gap: 6px; }
.top nav > a {
  color: var(--muted);
  font-size: .88rem;
  padding: 7px 11px;
  border-radius: 999px;
  transition: color .15s, background .15s;
}
.top nav > a:hover { color: var(--text); background: var(--surface-2); }

/* --------------------------------------------------------- theme menu --- */

.theme-menu { position: relative; }
.theme-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: .88rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface); }
.theme-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand-gradient); }
[data-theme="terminal"] .theme-dot { background: var(--accent); }

.theme-list {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 172px; margin: 0; padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
}
[data-theme="terminal"] .theme-list { box-shadow: 0 0 0 1px var(--line); }
.theme-list button {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font: inherit; font-size: .9rem; text-align: left;
  color: var(--text); background: none; border: 0; border-radius: 6px;
  padding: 8px 9px; cursor: pointer;
}
.theme-list button:hover { background: var(--surface-2); }
.theme-list .tick { margin-left: auto; opacity: 0; color: var(--accent); }
.theme-list button[aria-checked="true"] .tick { opacity: 1; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(128, 128, 128, .35); }
.swatch-daylight { background: linear-gradient(135deg, #fff 40%, #7c5cff 40%, #ff5d73); }
.swatch-midnight { background: linear-gradient(135deg, #191b2f 40%, #9d84ff 40%, #ff7d8f); }
.swatch-terminal { background: linear-gradient(135deg, #050605 40%, #35ff9e 40%); }

/* ------------------------------------------------------------ catalog --- */

.series { margin-bottom: 46px; --series-accent: var(--c1); }
.series:nth-of-type(5n+2) { --series-accent: var(--c2); }
.series:nth-of-type(5n+3) { --series-accent: var(--c4); }
.series:nth-of-type(5n+4) { --series-accent: var(--c3); }
.series:nth-of-type(5n+5) { --series-accent: var(--c5); }

.series h2 {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 4px; font-size: 1.15rem; font-weight: 700;
}
.series h2::before {
  content: ""; width: 8px; height: 22px; border-radius: 3px;
  background: var(--series-accent); flex: 0 0 auto;
}
.series p.blurb { margin: 0 0 18px; color: var(--muted); font-size: .92rem; }

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

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: rise .38s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card:nth-child(2) { animation-delay: .04s; }
.card:nth-child(3) { animation-delay: .08s; }
.card:nth-child(4) { animation-delay: .12s; }
.card:nth-child(n+5) { animation-delay: .16s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--series-accent); }
.card.locked { opacity: .82; }

.thumb {
  position: relative; aspect-ratio: 16 / 9;
  background: var(--surface-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--line);
}
.thumb .glyph { font-size: 1.7rem; opacity: .6; }
.thumb .runtime {
  position: absolute; right: 9px; bottom: 9px;
  background: rgba(10, 10, 20, .78); color: #fff;
  border-radius: 6px; padding: 2px 7px;
  font-size: .75rem; font-variant-numeric: tabular-nums;
}
.meta { padding: 12px 14px 14px; }
.meta .title { font-weight: 650; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.meta .sub { color: var(--muted); font-size: .85rem; margin-top: 3px; }

.badge {
  display: inline-block;
  font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line);
}
.badge.pub { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.lock { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.hid { color: var(--muted); }

/* ------------------------------------------------------------- player --- */

.player {
  background: #000;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.player video { width: 100%; height: auto; display: block; max-height: 78vh; background: #000; }
h1.ep { margin: 0 0 5px; font-size: 1.4rem; font-weight: 750; }
.ep-sub { color: var(--muted); font-size: .9rem; margin: 0 0 18px; }
.ep-desc { max-width: 68ch; }

/* -------------------------------------------------------------- login --- */

.gate {
  max-width: 400px; margin: 10vh auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.gate h1 { margin: 0 0 6px; font-size: 1.15rem; }
.gate p { margin: 0 0 20px; color: var(--muted); font-size: .9rem; }

label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
input[type=password], input[type=text], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text); font: inherit;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* Password fields carry a show/hide toggle (see assets/password.js). */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle:focus-visible {
  outline: none; color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pw-toggle[aria-pressed="true"] { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent);
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
[data-theme="daylight"] .btn, [data-theme="midnight"] .btn { background-image: var(--brand-gradient); }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.full { width: 100%; }
.btn.ghost { background: transparent; background-image: none; color: var(--text); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: transparent; background-image: none; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

.err { color: var(--danger); font-size: .88rem; margin: 14px 0 0; }
.empty { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
