/* ============================================================
     CONFIG NOTE FOR THE SITE OWNER
     - This file is styling only. For the video hosting integration,
       edit video-provider.js. For lesson content and the free-video
       paywall limit, edit the LESSONS array and FREE_LIMIT inside
       index.html's inline script block.
     - The subscribe flow is a working front-end mock. Look for
       "STRIPE INTEGRATION POINT" in index.html to wire up real payment.
     ============================================================ */

  :root {
    /* Palette: shades of red and yellow, per the Richard James logo.
       Variable names kept as-is (--teal etc.) to avoid touching every
       usage across this file — only the VALUES changed. */
    --ink: #3D0A0A;
    --ink-soft: #6B1414;
    --paper: #FDF3DC;
    --paper-raised: #FFFBEF;
    --text: #2B1210;
    --text-soft: #7A5347;
    --gold: #F2B705;
    --gold-deep: #C98A00;
    --teal: #C81E1E;
    --teal-deep: #8F1414;
    --line: #EAD39A;
    --line-dark: #6B1B1B;
    --radius-s: 4px;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0;
    background: var(--paper);
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3, .display {
    font-family: 'Spectral', serif;
    font-weight: 600;
    color: var(--ink);
    margin: 0;
    line-height: 1.15;
  }
  a { color: var(--teal); }
  img { max-width: 100%; display: block; }
  .mono { font-family: 'IBM Plex Mono', monospace; }
  a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
  }

  .wrap { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

  /* ---------- Header ---------- */
  header.site {
    position: sticky; top: 0; z-index: 40;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav { display: flex; align-items: center; justify-content: space-between; padding: 18px 32px; }
  .brand { display: flex; align-items: center; text-decoration: none; }
  .brand-logo { height: 80px; width: auto; display: block; }
  nav.links { display: flex; gap: 26px; align-items: center; }
  nav.links a { color: var(--ink-soft); text-decoration: none; font-size: 14.5px; font-weight: 500; }
  nav.links a:hover { color: var(--teal); }
  .status-pill {
    font-family: 'IBM Plex Mono', monospace; font-size: 12px;
    padding: 5px 10px; border-radius: var(--radius-s);
    border: 1px solid var(--line); color: var(--text-soft); background: var(--paper-raised);
  }
  .status-pill.unlocked { color: var(--teal); border-color: var(--teal); }

  /* ---------- Hero ---------- */
  .hero {
    background: var(--ink);
    background-image:
      repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 34px),
      repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 34px);
    color: #EFEDE4;
    padding: 68px 0 60px;
    text-align: center;
  }
  .eyebrow-row {
    display: inline-flex; gap: 10px; align-items: center; margin-bottom: 20px;
    color: var(--gold); font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  }
  .eyebrow-row .rule { width: 28px; height: 1px; background: var(--gold); }
  .hero h1 {
    color: #FBFAF5; font-size: 44px; font-weight: 600;
    max-width: 18ch; margin: 0 auto;
  }
  .hero h1 em { font-style: italic; color: var(--gold); }
  .hero p.lede { margin: 20px auto 0; font-size: 17px; color: #C9CBD6; max-width: 52ch; }
  .hero-actions { margin-top: 28px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

  .btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 20px; border-radius: var(--radius-s);
    font-size: 15px; font-weight: 600; text-decoration: none;
    border: 1px solid transparent; cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
  }
  .btn-gold { background: var(--gold); color: #1A1204; }
  .btn-gold:hover { background: #D69A38; }
  .btn-outline { border-color: rgba(255,255,255,0.35); color: #F3F0E7; background: transparent; }
  .btn-outline:hover { border-color: #F3F0E7; }
  .btn-outline.on-light { border-color: var(--line); color: var(--ink); }
  .btn-outline.on-light:hover { border-color: var(--ink); }
  .btn-teal { background: var(--teal); color: #F3F0E7; }
  .btn-teal:hover { background: var(--teal-deep); }

  /* ---------- Section shell ---------- */
  section.block { padding: 68px 0; }
  .block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
  .block-head h2 { font-size: 28px; max-width: 24ch; }
  .block-head p { color: var(--text-soft); font-size: 15px; max-width: 42ch; margin-top: 8px; }

  /* ---------- Video grid + cards ---------- */
  .video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

  .video-card {
    background: var(--paper-raised);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.92);
    cursor: pointer;
    border: 0;
    padding: 0;
    font: inherit;
  }
  .thumb iframe, .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
  .thumb .glyph { font-family: 'Spectral', serif; font-size: 44px; font-weight: 600; opacity: 0.85; }
  .thumb .play-ring {
    position: absolute; width: 46px; height: 46px; border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.85);
    display: flex; align-items: center; justify-content: center; font-size: 15px;
    background: rgba(61,10,10,0.25);
  }
  .thumb .lock-overlay {
    position: absolute; inset: 0;
    background: rgba(61,10,10,0.72);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: #F3F0E7;
  }
  .thumb .placeholder-note {
    position: absolute; bottom: 8px; left: 8px; right: 8px;
    font-family: 'IBM Plex Mono', monospace; font-size: 10.5px;
    color: rgba(255,255,255,0.7); text-align: center;
  }
  .card-body { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .card-badges { display: flex; gap: 8px; align-items: center; }
  .level-badge {
    font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.02em;
    padding: 3px 7px; border-radius: 3px;
  }
  .level-badge.primary { background: rgba(200,30,30,0.12); color: var(--teal-deep); }
  .level-badge.secondary { background: rgba(242,183,5,0.20); color: var(--gold-deep); }
  .card-duration { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-soft); margin-left: auto; }
  .card-title { font-weight: 600; color: var(--ink); font-size: 15.5px; }
  .card-desc { color: var(--text-soft); font-size: 13.5px; flex: 1; }
  .card-cta {
    margin-top: 4px; font-size: 13.5px; font-weight: 600;
    padding: 8px 14px; border-radius: var(--radius-s);
    border: 1px solid var(--teal); background: transparent; color: var(--teal);
    cursor: pointer; align-self: flex-start;
  }
  .card-cta:hover { background: var(--teal); color: #fff; }
  .card-cta.locked { border-color: var(--line); color: var(--text-soft); }
  .card-cta.locked:hover { background: var(--paper); color: var(--text-soft); }
  .card-cta.watched { border-color: var(--line); color: var(--text-soft); }

  /* topic colors for thumbnail backgrounds, cycled by topic name */
  /* topic colors for thumbnail backgrounds, cycled by topic name — all
     within the red/yellow palette so every thumbnail stays on-brand */
  .t-color-0 { background: #B4231F; }
  .t-color-1 { background: #C98A00; }
  .t-color-2 { background: #7A1414; }
  .t-color-3 { background: #D98E04; }
  .t-color-4 { background: #941B1B; }
  .t-color-5 { background: #A66200; }

  /* ---------- Library level sections ---------- */
  .level-jump { display: flex; gap: 10px; margin-bottom: 8px; }
  .level-jump a {
    font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
    text-decoration: none; color: var(--text-soft);
    border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px;
  }
  .level-jump a:hover { color: var(--teal); border-color: var(--teal); }

  .level-section { margin-bottom: 56px; scroll-margin-top: 90px; }
  .level-section:last-child { margin-bottom: 0; }
  .level-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
  .level-section-head h3 { font-size: 22px; }
  .level-section-head .age { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--text-soft); }

  .topic-group { margin-bottom: 32px; }
  .topic-group:last-child { margin-bottom: 0; }
  .topic-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
  .topic-title h4 { font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 15px; color: var(--ink-soft); margin: 0; }
  .topic-title .rule2 { flex: 1; height: 1px; background: var(--line); }

  /* ---------- Approach ---------- */
  .approach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
  .approach-item { background: var(--paper-raised); padding: 26px 24px; }
  .approach-item .mark { font-family: 'IBM Plex Mono', monospace; color: var(--gold-deep); font-size: 13px; margin-bottom: 10px; display: block; }
  .approach-item h3 { font-size: 17px; margin-bottom: 8px; }
  .approach-item p { color: var(--text-soft); font-size: 14.5px; margin: 0; }

  /* ---------- Testimonials ---------- */
  .testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .testimonial-card {
    margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px;
    padding: 24px; display: flex; flex-direction: column; gap: 18px;
  }
  .testimonial-card blockquote {
    margin: 0; font-family: 'Spectral', serif; font-size: 16.5px; font-style: italic;
    color: var(--ink); line-height: 1.5;
  }
  .testimonial-card blockquote::before { content: "“"; }
  .testimonial-card blockquote::after { content: "”"; }
  .testimonial-card figcaption { display: flex; flex-direction: column; gap: 2px; }
  .testimonial-card .t-name { font-weight: 600; font-size: 14px; color: var(--ink); }
  .testimonial-card .t-role { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--text-soft); }

  /* ---------- Pricing ---------- */
  .pricing-wrap { background: var(--ink); color: #EFEDE4; }
  .pricing-wrap .block-head { border-bottom-color: var(--line-dark); }
  .pricing-wrap .block-head h2 { color: #FBFAF5; }
  .pricing-wrap .block-head p { color: #B7BAC8; }
  .price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .price-card { border: 1px solid var(--line-dark); border-radius: 4px; padding: 28px; background: rgba(255,255,255,0.02); }
  .price-card.featured { border-color: var(--gold); background: rgba(242,183,5,0.10); }
  .price-card .tier { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--gold); }
  .price-card .amount { font-family: 'Spectral', serif; font-size: 34px; color: #FBFAF5; margin: 10px 0 4px; }
  .price-card .amount span { font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; color: #9CA0B0; }
  .price-card ul { list-style: none; padding: 0; margin: 18px 0 24px; color: #C9CBD6; font-size: 14.5px; }
  .price-card li { padding: 6px 0; border-top: 1px solid var(--line-dark); }
  .price-card li:first-child { border-top: none; }

  /* ---------- Footer ---------- */
  footer.site { padding: 40px 0; border-top: 1px solid var(--line); }
  .footer-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
  .footer-row p { color: var(--text-soft); font-size: 13.5px; margin: 0; }

  /* ---------- Paywall modal ---------- */
  .modal-backdrop { position: fixed; inset: 0; background: rgba(61,10,10,0.55); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 100; }
  .modal-backdrop.open { display: flex; }
  .modal { background: var(--paper-raised); border-radius: 6px; max-width: 460px; width: 100%; padding: 32px; border: 1px solid var(--line); position: relative; }
  .modal .close-x { position: absolute; top: 14px; right: 14px; background: none; border: none; cursor: pointer; font-size: 18px; color: var(--text-soft); line-height: 1; padding: 4px; }
  .modal .lock-badge { width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #1A1204; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; font-size: 18px; }
  .modal h3 { font-size: 22px; margin-bottom: 8px; }
  .modal p.desc { color: var(--text-soft); font-size: 14.5px; margin-bottom: 22px; }
  .modal .btn { width: 100%; justify-content: center; margin-bottom: 10px; }
  .modal .fine-print { font-size: 12.5px; color: var(--text-soft); text-align: center; margin-top: 14px; }
  .subscribe-form { display: none; margin-top: 18px; }
  .subscribe-form.open { display: block; }
  .subscribe-form label { display: block; font-size: 12.5px; color: var(--text-soft); margin-bottom: 5px; font-family: 'IBM Plex Mono', monospace; }
  .subscribe-form input { width: 100%; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--radius-s); font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; background: var(--paper); }

  /* ---------- Auth modal (login / sign up / forgot password) ---------- */
  .auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
  .auth-tab {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 14.5px; font-weight: 600;
    padding: 10px 4px; margin-bottom: -1px; background: none; border: none; border-bottom: 2px solid transparent;
    color: var(--text-soft); cursor: pointer;
  }
  .auth-tab.active { color: var(--ink); border-bottom-color: var(--teal); }
  .link-btn {
    display: block; width: 100%; text-align: center; background: none; border: none;
    font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; color: var(--teal);
    cursor: pointer; padding: 8px 0 0; text-decoration: underline;
  }

  /* ---------- Account area (nav) ---------- */
  .account-area { display: flex; align-items: center; gap: 10px; }
  .account-btn {
    font-family: 'IBM Plex Sans', sans-serif; font-size: 13.5px; font-weight: 600;
    padding: 7px 14px; border-radius: var(--radius-s); border: 1px solid var(--teal);
    background: transparent; color: var(--teal); cursor: pointer;
  }
  .account-btn:hover { background: var(--teal); color: #fff; }
  .account-btn.subtle { border-color: var(--line); color: var(--text-soft); }
  .account-btn.subtle:hover { background: var(--paper); color: var(--ink); border-color: var(--ink); }
  .account-name { font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--text-soft); }

  @media (max-width: 900px) {
    .video-grid { grid-template-columns: 1fr 1fr; }
    .approach-grid { grid-template-columns: 1fr; }
    .price-grid { grid-template-columns: 1fr; }
    .testimonial-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 620px) {
    .video-grid { grid-template-columns: 1fr; }
    nav.links { display: none; }
    .hero h1 { font-size: 32px; }
    .wrap { padding: 0 20px; }
    .site-nav { padding: 14px 20px; }
    .brand-logo { height: 56px; }
  }

/* ---------- About page ---------- */
.about-hero {
  background: var(--ink);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 34px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.035) 0, rgba(255,255,255,0.035) 1px, transparent 1px, transparent 34px);
  color: #EFEDE4;
  padding: 60px 0 54px;
}
.about-hero h1 { color: #FBFAF5; font-size: 38px; max-width: 20ch; }
.about-hero p.lede { margin-top: 16px; font-size: 16.5px; color: #C9CBD6; max-width: 54ch; }

.bio-grid { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }
.bio-portrait {
  width: 200px; aspect-ratio: 1/1; border-radius: 6px;
  background: var(--teal); color: #F3F0E7;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Spectral', serif; font-size: 56px; font-weight: 600;
  border: 1px solid var(--line-dark);
}
.bio-copy p { color: var(--text); font-size: 15.5px; margin: 0 0 16px; max-width: 62ch; }
.bio-copy p:last-child { margin-bottom: 0; }
.credentials { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 8px; }
.credentials li {
  font-size: 14px; color: var(--text-soft); padding-left: 18px; position: relative;
}
.credentials li::before {
  content: "—"; position: absolute; left: 0; color: var(--gold-deep);
}

.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 18px; }
.contact-list li { display: flex; flex-direction: column; gap: 2px; }
.contact-list .label { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--gold-deep); }
.contact-list .value { font-size: 16px; color: var(--ink); font-weight: 500; }
.contact-list .value a { color: var(--ink); text-decoration: none; }
.contact-list .value a:hover { color: var(--teal); }

.contact-form-card {
  background: var(--paper-raised); border: 1px solid var(--line); border-radius: 6px; padding: 28px;
}
.contact-form-card label {
  display: block; font-size: 12.5px; color: var(--text-soft); margin-bottom: 5px;
  font-family: 'IBM Plex Mono', monospace;
}
.contact-form-card input, .contact-form-card textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; background: var(--paper);
  resize: vertical;
}
.contact-form-card textarea { min-height: 100px; }
.form-note { font-size: 12.5px; color: var(--text-soft); margin-top: 4px; }

@media (max-width: 760px) {
  .bio-grid { grid-template-columns: 1fr; }
  .bio-portrait { width: 120px; height: 120px; font-size: 36px; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* ---- Legal pages (privacy.html, terms.html) and reset-password.html ---- */
.legal { padding: 56px 0 72px; }
.legal .wrap { max-width: 820px; }
.legal h1 { font-size: 38px; margin: 0 0 8px; }
.legal .updated { color: var(--text-soft); font-size: 14px; margin: 0 0 32px; }
.legal h2 { font-size: 22px; margin: 36px 0 10px; }
.legal p, .legal li { font-size: 16px; line-height: 1.7; }
.legal ul { padding-left: 22px; }
.legal .notice { background: #FFF6DD; border: 1px solid #E6CD85; border-radius: 10px; padding: 14px 18px; font-size: 14.5px; margin-bottom: 28px; }
.reset-card { max-width: 440px; margin: 56px auto; padding: 32px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.reset-card label { display: block; font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.reset-card input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.reset-card .btn { width: 100%; justify-content: center; margin-top: 18px; }
.reset-card .msg { margin-top: 14px; font-size: 14.5px; }
