:root {
  --bg-deep: #401268;
  --bg-page: #2c0958;
  --accent: #FFC099;
  --accent-hover: #ffdcb8;
  --text-primary: #EDE3F5;
  --text-secondary: #B9A6D1;
  --text-tertiary: #8C74A8;
  --text-lavender: #D8CBE8;
  --text-card-title: #F3EEE8;
  --border-soft: rgba(255, 192, 153, 0.15);
  --border-medium: rgba(255, 192, 153, 0.2);
  --border-strong: rgba(255, 192, 153, 0.3);
  --error: #e79a8a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-page);
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text-primary);
}

::selection { background: var(--accent); color: #2A0E4A; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(255, 192, 153, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 100%, rgba(90, 20, 150, 0.25), transparent 60%),
    var(--bg-deep);
  position: relative;
  overflow-x: hidden;
}

.display {
  font-family: 'Big Shoulders', sans-serif;
  text-transform: uppercase;
}

/* Entrance gate */
@keyframes emberDrift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-14px, -22px); }
  100% { transform: translate(0, 0); }
}

.entrance-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, #4d1780, #2c0958 70%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.gate-dismissed .entrance-gate { display: none; }

.entrance-gate-embers { position: absolute; inset: 0; pointer-events: none; }

.ember-wrap { position: absolute; transition: transform 0.4s ease-out; }

.ember {
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px 1px rgba(255, 192, 153, 0.6);
  animation-name: emberDrift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.entrance-gate-wordmark {
  font-weight: 900;
  font-size: clamp(40px, 10vw, 110px);
  color: var(--accent);
  letter-spacing: 0.02em;
  text-shadow: 0 0 60px rgba(255, 192, 153, 0.35);
  position: relative;
}

.entrance-gate-enter {
  margin-top: 28px;
  border: 1px solid rgba(255, 192, 153, 0.6);
  padding: 12px 30px;
  font-size: 13px;
  letter-spacing: 0.15em;
  color: var(--accent);
  position: relative;
}

/* Header / nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 18px 40px;
  background: rgba(30, 7, 54, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.site-nav { display: flex; gap: 8px; flex-wrap: wrap; }

.site-nav a, .site-nav-logout {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  color: var(--text-lavender);
  border-bottom: 2px solid transparent;
  display: inline-block;
}

.site-nav-logout-form { display: inline-block; }

.site-nav a.active {
  color: #F5C49B;
  border-bottom: 2px solid #F5C49B;
}

/* Sections */
.section { padding: 70px 40px 100px; max-width: 1100px; margin: 0 auto; }
.section--home { padding: 100px 40px 80px; max-width: 1100px; }
.section--videos, .section--blog { max-width: 1200px; }
.section--blog { max-width: 900px; }
.section--about { max-width: 800px; }
.section--detail { padding: 50px 40px 100px; max-width: 1100px; }

.heading-xl {
  font-weight: 900;
  font-size: clamp(48px, 9vw, 120px);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--accent);
  text-shadow: 0 0 60px rgba(255, 192, 153, 0.25);
}

.heading-lg {
  font-weight: 900;
  font-size: clamp(36px, 6vw, 64px);
  color: var(--accent);
}

.heading-about {
  font-weight: 900;
  font-size: clamp(36px, 6vw, 60px);
  color: var(--accent);
  letter-spacing: -0.01em;
}

.subhead {
  max-width: 640px;
  font-size: 19px;
  line-height: 1.6;
  color: #CBB8E0;
  margin-top: 28px;
}

.section-subhead {
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 560px;
  margin-top: 12px;
}

/* Home grid */
.home-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 28px;
  margin-top: 80px;
}

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

.card {
  border: 1px solid var(--border-medium);
  background: rgba(255, 192, 153, 0.04);
  padding: 24px;
}

.card-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.card-thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.05);
  background-size: cover;
  background-position: center;
}

.card-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 24px;
  color: var(--text-card-title);
}

.card-desc { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin-top: 8px; }
.card-date { color: var(--text-tertiary); font-size: 13px; margin-top: 6px; }
.card-excerpt { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-top: 14px; }
.card-link { display: block; margin-top: 16px; font-size: 13px; font-weight: 600; }
.card-link--secondary { margin-top: 8px; color: var(--text-tertiary); font-weight: 500; }
.card-link--secondary:hover { color: var(--text-secondary); }

/* Gate banner / signup form */
.gate-unlocked {
  margin-top: 28px;
  padding: 14px 20px;
  border: 1px solid rgba(255, 192, 153, 0.4);
  background: rgba(255, 192, 153, 0.08);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  display: inline-block;
}

.gate-form {
  margin-top: 28px;
  padding: 28px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 192, 153, 0.05);
  max-width: 440px;
}

.gate-form h3 { font-weight: 700; font-size: 15px; color: var(--text-card-title); margin: 0 0 14px; }

.gate-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text-card-title);
  font-family: inherit;
  font-size: 14px;
}

.gate-form .error { color: var(--error); font-size: 13px; margin-bottom: 10px; }

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: #2A0E4A;
  border: none;
  padding: 12px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
}

.gate-microcopy { color: var(--text-tertiary); font-size: 12px; margin-top: 10px; }

/* Video grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 44px;
}

.video-card { border: 1px solid rgba(255, 192, 153, 0.18); background: rgba(255, 192, 153, 0.03); }

.video-thumb-wrap { aspect-ratio: 16 / 9; position: relative; background: rgba(255, 255, 255, 0.05); background-size: cover; background-position: center; }

.video-thumb-wrap iframe { width: 100%; height: 100%; border: 0; }

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: var(--text-card-title);
  font-size: 11px;
  padding: 3px 7px;
  pointer-events: none;
}

.video-body { padding: 18px; }
.video-title { font-family: 'Big Shoulders', sans-serif; font-weight: 800; font-size: 19px; color: var(--text-card-title); }
.video-desc { color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin-top: 8px; min-height: 40px; }

.video-locked-note { margin-top: 12px; font-size: 12px; color: var(--text-tertiary); }

.video-thumb-link { display: block; }

.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 192, 153, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.video-play-overlay--lg { width: 76px; height: 76px; background: rgba(255, 192, 153, 0.92); }

.video-play-triangle {
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #2A0E4A;
  margin-left: 4px;
}

.video-play-triangle--lg {
  border-top-width: 15px;
  border-bottom-width: 15px;
  border-left-width: 24px;
  margin-left: 6px;
}

.video-clips-preview {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 192, 153, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-clips-preview-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.video-clips-preview-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.video-clips-preview-link:hover { color: var(--accent-hover); }

/* Video detail page */
.detail-back-link { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.detail-back-link:hover { color: var(--accent); }

.detail-player {
  margin-top: 20px;
  aspect-ratio: 16 / 9;
  background: #000;
  position: relative;
  overflow: hidden;
}

.detail-player-poster {
  cursor: pointer;
  width: 100%;
  height: 100%;
  position: relative;
  background-size: cover;
  background-position: center;
}

.detail-player-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}

.detail-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 900;
  font-size: clamp(28px, 4vw, 42px);
  color: var(--text-card-title);
  margin-top: 28px;
}

.detail-desc { color: var(--text-secondary); font-size: 15px; line-height: 1.6; margin-top: 12px; max-width: 700px; }

/* Blog list */
.post-list { display: flex; flex-direction: column; gap: 0; margin-top: 44px; }

.post-row {
  padding: 28px 0;
  border-top: 1px solid var(--border-soft);
}

.post-row-main { display: block; text-decoration: none; }
.post-row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.post-row-title { font-family: 'Big Shoulders', sans-serif; font-weight: 800; font-size: 24px; color: var(--text-card-title); }
.post-row-date { color: var(--text-tertiary); font-size: 13px; white-space: nowrap; }
.post-row-excerpt { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-top: 10px; max-width: 640px; }
.post-row-link { color: var(--accent); font-size: 13px; font-weight: 600; margin-top: 10px; }
.post-row-substack-link { display: inline-block; color: var(--text-tertiary); font-size: 12px; font-weight: 500; margin-top: 12px; }
.post-row-substack-link:hover { color: var(--text-secondary); }

.empty-state { color: var(--text-tertiary); font-size: 14px; margin-top: 44px; }

/* Blog post detail */
.detail-post-date { margin-top: 10px; }

.post-body {
  max-width: 700px;
  margin-top: 28px;
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.75;
}

.post-body p { margin: 0 0 20px; }
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-card-title);
  margin: 32px 0 14px;
}
.post-body a { text-decoration: underline; }
.post-body img { max-width: 100%; height: auto; display: block; margin: 20px 0; }
.post-body blockquote {
  border-left: 2px solid var(--border-strong);
  margin: 20px 0;
  padding: 4px 0 4px 20px;
  color: var(--text-lavender);
  font-style: italic;
}
.post-body ul, .post-body ol { margin: 0 0 20px; padding-left: 22px; }
.post-body li { margin-bottom: 8px; }
.post-body code { background: rgba(255, 255, 255, 0.08); padding: 2px 6px; font-size: 0.9em; }
.post-body pre { background: rgba(255, 255, 255, 0.06); padding: 16px; overflow-x: auto; }
.post-body hr { border: none; border-top: 1px solid var(--border-soft); margin: 32px 0; }

.detail-substack-link { display: inline-block; margin-top: 36px; font-size: 13px; font-weight: 600; color: var(--text-tertiary); }
.detail-substack-link:hover { color: var(--accent); }

/* About */
.about-body { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; color: var(--text-lavender); font-size: 16px; line-height: 1.75; }

.glossary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }

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

.glossary-card { border: 1px solid var(--border-strong); padding: 22px; }
.glossary-term { font-family: 'Big Shoulders', sans-serif; font-weight: 800; font-size: 20px; color: var(--accent); }
.glossary-origin { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.glossary-def { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-top: 12px; }

.about-closing { color: var(--text-lavender); font-size: 16px; line-height: 1.75; margin-top: 32px; }

.about-final {
  font-weight: 900;
  font-size: clamp(28px, 5vw, 42px);
  color: var(--accent);
  margin-top: 56px;
  text-transform: uppercase;
  line-height: 1.15;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  background: rgba(10, 4, 20, 0.4);
}

.footer-copy { color: var(--text-tertiary); font-size: 13px; display: flex; align-items: center; gap: 10px; }
.footer-logo { height: 22px; width: auto; display: block; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }

/* Admin */
.admin-shell { max-width: 640px; margin: 0 auto; padding: 100px 40px; }
.admin-shell--wide { max-width: 900px; }
.admin-shell--paged { padding-top: 40px; }

.admin-card {
  border: 1px solid var(--border-strong);
  background: rgba(255, 192, 153, 0.05);
  padding: 28px;
}

.admin-card label { display: block; font-size: 13px; color: var(--text-secondary); margin: 14px 0 6px; }
.admin-card label:first-child { margin-top: 0; }

.admin-card input, .admin-card textarea {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text-card-title);
  font-family: inherit;
  font-size: 14px;
}

.admin-clip-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border-soft);
}

.admin-clip-row form { display: inline; }

.btn-small {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
}

.btn-small.danger { color: var(--error); border-color: var(--error); }

.admin-hint { color: var(--text-tertiary); font-size: 13px; margin: 12px 0 0; }

.cheat-sheet-summary {
  cursor: pointer;
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
}

.cheat-sheet-list {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.cheat-sheet-list li { margin-bottom: 10px; }
.cheat-sheet-list code {
  background: rgba(255, 192, 153, 0.1);
  color: var(--accent);
  padding: 1px 5px;
  font-size: 13px;
}

.admin-video-details { margin-top: 16px; }

.admin-video-details summary.video-summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  list-style: revert;
}

.video-summary-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-card-title);
}

.video-summary-meta { color: var(--text-tertiary); font-size: 13px; white-space: nowrap; }

.clips-subsection {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border-soft);
}

.clips-subsection-title {
  font-family: 'Big Shoulders', sans-serif;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.clips-add-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.clips-add-form input {
  flex: 1;
  min-width: 160px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-strong);
  color: var(--text-card-title);
  font-family: inherit;
  font-size: 13px;
}
