:root {
  --ink: #10100d;
  --ink-soft: #1b1a16;
  --paper: #f6f1e8;
  --paper-soft: #ece3d4;
  --white: #fffaf0;
  --line: #d2c6b3;
  --line-dark: #343026;
  --muted: #736b5d;
  --muted-light: #b9ae9d;
  --gold: #c98b20;
  --gold-light: #e3a43a;
  --clay: #bd4f2f;
  --teal: #196b67;
  --blue: #315f7d;
  --green: #5d6d3b;
  --max: 1160px;
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

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

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--nav-h);
  background: rgba(16, 16, 13, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--paper);
}

.site-nav .wrap {
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.brand span span {
  color: var(--gold-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links a {
  color: var(--muted-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.nav-links a:hover,
.mobile-menu a:hover {
  color: var(--white);
}

.nav-link-strong {
  color: var(--white) !important;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
}

.nav-toggle span {
  width: 21px;
  height: 2px;
  border-radius: 2px;
  background: var(--paper);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  display: none;
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a,
.mobile-menu span {
  display: block;
  padding: 15px 20px;
  color: var(--muted-light);
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hero {
  min-height: 78svh;
  display: flex;
  align-items: end;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(16, 16, 13, 0.92) 0%, rgba(16, 16, 13, 0.78) 45%, rgba(16, 16, 13, 0.36) 100%),
    url("../og-image.jpg") center / cover no-repeat;
}

.hero .wrap {
  padding: 86px 0 72px;
}

.eyebrow {
  display: inline-flex;
  color: var(--gold-light);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
}

h1,
h2,
h3,
h4,
.serif {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.12;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: 72px;
}

.hero-copy {
  max-width: 670px;
  margin: 22px 0 0;
  color: #ddd3c3;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.58;
}

.hero-actions,
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  line-height: 1.2;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

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

.btn-primary {
  background: var(--clay);
  color: #fff;
}

.btn-primary:hover {
  background: #cf5b39;
}

.btn-secondary {
  background: var(--teal);
  color: #fff;
}

.btn-secondary:hover {
  background: #21827d;
}

.btn-quiet {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.36);
}

.btn-quiet:hover {
  border-color: var(--white);
}

.btn-line {
  color: var(--ink);
  background: transparent;
  border-color: var(--line);
}

.btn-line:hover {
  border-color: var(--ink);
}

.section {
  padding: 76px 0;
}

.section-soft {
  background: var(--paper-soft);
}

.section-dark {
  background: var(--ink);
  color: var(--paper);
}

.section-dark .section-intro,
.section-dark .muted {
  color: var(--muted-light);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}

.section-title {
  margin: 0;
  font-size: 44px;
}

.section-intro {
  max-width: 710px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 42px;
  align-items: start;
}

.card,
.price-card,
.mini-card,
.notice,
.form-panel {
  border-radius: 8px;
}

.card {
  min-height: 100%;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
}

.card h3,
.mini-card h3,
.price-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.card p,
.mini-card p,
.price-card p {
  margin: 0;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.path-card {
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.path-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.path-card .go {
  display: inline-flex;
  margin-top: 20px;
  color: var(--clay);
  font-weight: 800;
}

.reflection {
  background: var(--paper);
}

.reflection-lede {
  max-width: 880px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.48;
}

.reflection-lede strong {
  color: var(--teal);
  font-weight: 700;
}

.problem-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.problem-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.problem-card h3 {
  margin: 0 0 10px;
  color: var(--clay);
  font-size: 21px;
}

.problem-card p {
  margin: 0;
  color: var(--muted);
}

.method-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--line-dark);
}

.method-block {
  padding: 26px;
  background: var(--ink-soft);
}

.method-block h3 {
  margin: 0 0 10px;
  color: var(--paper);
  font-size: 25px;
}

.method-block p {
  margin: 0;
  color: var(--muted-light);
}

.method-block .tag {
  color: var(--gold-light);
}

.proof-list {
  display: grid;
  gap: 14px;
}

.proof-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.proof-row:first-child {
  border-top: 0;
}

.proof-row strong {
  color: var(--teal);
}

.mini-card {
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.mini-card.dark {
  background: var(--ink-soft);
  border-color: var(--line-dark);
}

.steps {
  counter-reset: steps;
}

.step {
  position: relative;
  padding-top: 42px;
}

.step::before {
  counter-increment: steps;
  content: counter(steps, decimal-leading-zero);
  position: absolute;
  top: 0;
  left: 0;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 700;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.price-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
}

.price-card.featured {
  border: 2px solid var(--gold);
}

.price {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
}

.price small {
  display: block;
  color: var(--muted);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.price-card .btn {
  margin-top: auto;
}

.library-tools {
  display: grid;
  gap: 14px;
  margin: 30px 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.library-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  min-width: 76px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.library-chip {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.library-chip:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.library-chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.library-select {
  width: auto;
  min-width: 220px;
  background: var(--paper);
  font-weight: 700;
}

.chapter-count {
  margin: 18px 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.chapter-card {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  min-height: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: inherit;
  text-decoration: none;
}

.chapter-card:hover {
  border-color: var(--gold);
}

.chapter-card.hidden {
  display: none;
}

.chapter-num {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(201, 139, 32, 0.16);
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
}

.chapter-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.chapter-mirror,
.chapter-ref {
  color: var(--muted);
  font-size: 14px;
}

.chapter-ref {
  margin-top: 3px;
  font-weight: 700;
}

.chapter-cta {
  margin-top: 14px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.lesson-band {
  background: var(--teal);
  color: #fff;
}

.lesson-band .section-intro {
  color: #d7eeeb;
}

.form-panel {
  padding: 28px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line-dark);
}

.signup-form,
.auth-form {
  display: grid;
  gap: 12px;
}

.signup-form-row {
  display: flex;
  gap: 10px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.form-panel input,
.form-panel select,
.dark-input {
  background: #12110e;
  color: var(--paper);
  border-color: var(--line-dark);
}

input:focus,
select:focus {
  outline: 2px solid rgba(201, 139, 32, 0.28);
  outline-offset: 2px;
}

.form-note,
.status,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.form-panel .form-note,
.form-panel .status {
  color: var(--muted-light);
}

.unlocked-copy {
  display: none;
}

.is-unlocked .locked-copy {
  display: none;
}

.is-unlocked .unlocked-copy {
  display: block;
}

.status.is-error {
  color: #ffb29b;
}

.status.is-success {
  color: #bfe8cf;
}

.site-footer {
  padding: 48px 0 34px;
  background: var(--ink);
  color: var(--muted-light);
}

.footer-grid {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-title {
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 700;
}

.footer-title span {
  color: var(--gold-light);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--muted-light);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.footer-links a:hover {
  color: var(--white);
}

.copyright {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #71695d;
  font-size: 13px;
}

.app-shell {
  min-height: calc(100svh - var(--nav-h));
  padding: 52px 0 76px;
  background: var(--paper);
}

.app-card {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.app-card.wide {
  width: min(980px, calc(100% - 40px));
}

.app-title {
  margin: 0 0 6px;
  font-size: 34px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 22px 0;
}

.tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-weight: 800;
}

.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.message {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.message.err {
  display: block;
  background: #3b1c16;
  color: #ffd1c4;
}

.message.ok {
  display: block;
  background: #173421;
  color: #c9f0d8;
}

.item-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.library-item,
.store-group {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.library-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.small-btn {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: transparent;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.small-btn:hover {
  background: rgba(25, 107, 103, 0.08);
}

.legal-page {
  background: var(--paper);
}

.legal {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 52px 0 76px;
}

.legal h1 {
  color: var(--ink);
  font-size: 42px;
}

.legal h2 {
  margin-top: 32px;
  font-size: 24px;
}

.notice {
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  background: var(--white);
  color: var(--muted);
}

.notes-hero {
  background:
    linear-gradient(90deg, rgba(16, 16, 13, 0.94), rgba(16, 16, 13, 0.72)),
    url("../RM1Cover.jpg?v=20260702") right center / contain no-repeat,
    var(--ink);
}

.notes-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gate-panel {
  position: relative;
}

.gate-panel.is-locked .gated-content {
  max-height: 760px;
  overflow: hidden;
  filter: blur(4px);
  opacity: 0.36;
  pointer-events: none;
}

.gate-overlay {
  display: none;
}

.gate-panel.is-locked .gate-overlay {
  display: block;
  position: sticky;
  top: 92px;
  z-index: 5;
  width: min(520px, 100%);
  margin: -680px auto 80px;
}

@media (max-width: 980px) {
  h1 {
    font-size: 54px;
  }

  .grid-3,
  .problem-grid,
  .chapter-grid,
  .price-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid-4,
  .split,
  .method-panel,
  .notes-index {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }
}

@media (max-width: 780px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero {
    min-height: 72svh;
    background-position: center;
  }

  .hero .wrap {
    padding: 70px 0 54px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy {
    font-size: 18px;
  }

  .section {
    padding: 56px 0;
  }

  .section-title {
    font-size: 34px;
  }

  .grid-3,
  .problem-grid,
  .chapter-grid,
  .grid-4,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .reflection-lede {
    font-size: 22px;
  }

  .library-filter-row {
    display: grid;
  }

  .filter-label {
    min-width: 0;
  }

  .library-select {
    width: 100%;
  }

  .proof-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .signup-form-row,
  .library-item {
    display: grid;
  }
}
