/* ══════════════════════════════════════════
   LEARN PAGE — loaded after styles.css.
   Reuses the app's tokens (felt background, #2EA985 accent,
   #1a1a1a panels, Inter) and only adds page layout.
══════════════════════════════════════════ */

/* styles.css locks the viewport for the no-scroll app shell;
   this is a normal scrolling document, so restore flow. */
@media (max-width: 768px) {
  html, body.learn-page {
    position: static;
    overflow: auto;
    height: auto;
    width: auto;
  }
}

body.learn-page {
  overflow-x: hidden; /* belt-and-braces: never any horizontal scroll */
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.learn-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* ── Back-to-trainer pill (reuses .app-toggle-btn look) ── */
.learn-back {
  text-decoration: none;
}

/* On mobile, park it top-right like the app's own menu button */
@media (max-width: 768px) {
  .learn-back {
    left: auto;
    right: 12px;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
  }
}

.back-arrow {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.learn-back:hover .back-arrow {
  transform: translateX(-2px);
}

/* ── Hero ── */
.learn-hero {
  text-align: center;
  padding: 92px 4px 8px;
}

.learn-eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2EA985;
  background: rgba(46, 169, 133, 0.12);
  border: 1px solid rgba(46, 169, 133, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  margin: 0 0 18px;
}

.learn-hero h1 {
  font-size: clamp(1.7rem, 6vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  color: #fff;
}

.learn-lead {
  font-size: clamp(0.95rem, 2.6vw, 1.08rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  max-width: 620px;
  margin: 0 auto 26px;
}

.learn-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* ── Buttons (anchors — the global `button` rule doesn't reach these) ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  background: linear-gradient(160deg, #2ea985, #1e8a6b);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-primary:hover {
  background: linear-gradient(160deg, #33bc95, #229d78);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn-primary:focus-visible,
.btn-ghost:focus-visible {
  outline: 2px solid #2EA985;
  outline-offset: 3px;
}

.btn-small {
  padding: 10px 20px;
  font-size: 0.9rem;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  color: #2EA985;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid rgba(46, 169, 133, 0.4);
  background: rgba(46, 169, 133, 0.08);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-ghost:hover {
  background: rgba(46, 169, 133, 0.18);
  border-color: rgba(46, 169, 133, 0.7);
  color: #fff;
}

/* ── Table of contents ── */
.learn-toc {
  margin: 26px 0 8px;
  text-align: center;
}

.toc-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin: 0 0 12px;
}

.learn-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.learn-toc a {
  display: inline-block;
  padding: 7px 13px;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ddd;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.learn-toc a:hover {
  background: rgba(46, 169, 133, 0.16);
  border-color: rgba(46, 169, 133, 0.5);
  color: #fff;
}

/* ── Content cards (same panel look as .welcome-box) ── */
.learn-card {
  background: #1a1a1a;
  border: 1px solid rgba(46, 169, 133, 0.14);
  border-radius: 16px;
  padding: clamp(22px, 5vw, 34px);
  margin-top: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  scroll-margin-top: 74px; /* anchor jumps clear the fixed back button */
}

.learn-card h2 {
  color: #2EA985;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.01em;
  margin: 0 0 16px;
}

.learn-card h3 {
  color: #fff;
  font-size: 1.02rem;
  font-weight: 700;
  margin: 24px 0 8px;
}

.learn-card p {
  font-size: 0.94rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 14px;
}

.learn-card p:last-child {
  margin-bottom: 0;
}

.learn-card a:not([class]) {
  color: #2EA985;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(46, 169, 133, 0.4);
  text-underline-offset: 3px;
}

.learn-card a:not([class]):hover {
  text-decoration-color: #2EA985;
}

.learn-card ul,
.learn-card ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.learn-card li {
  font-size: 0.94rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 9px;
}

.learn-card li:last-child {
  margin-bottom: 0;
}

.learn-card li::marker {
  color: #2EA985;
}

.learn-card strong {
  color: #fff;
}

.learn-steps li {
  margin-bottom: 14px;
}

.cta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 20px !important;
}

/* ── Strategy chart (cells/legend styled by styles.css) ── */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 6px -6px 0;
  padding: 0 6px;
}

.table-scroll .strategy-table table {
  min-width: 480px; /* keeps cells readable; wrapper scrolls instead of the page */
}

@media (max-width: 768px) {
  .table-scroll .strategy-table {
    font-size: 12px;
  }
}

/* ── FAQ ── */
#faq details {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  overflow: hidden;
  transition: border-color 0.2s;
}

#faq details:last-child {
  margin-bottom: 0;
}

#faq details[open] {
  border-color: rgba(46, 169, 133, 0.4);
}

#faq summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 0.94rem;
  font-weight: 600;
  color: #fff;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.2s;
}

#faq summary::-webkit-details-marker {
  display: none;
}

#faq summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.15rem;
  font-weight: 400;
  color: #2EA985;
  transition: transform 0.2s;
}

#faq details[open] summary::after {
  transform: rotate(45deg);
}

#faq summary:hover {
  background: rgba(46, 169, 133, 0.08);
}

#faq details p {
  padding: 0 16px 15px;
  margin: 0;
}

/* ── Footer ── */
.learn-footer {
  text-align: center;
  padding: 36px 0 8px;
}

.learn-footer p {
  margin-top: 18px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Desktop polish ── */
@media (min-width: 769px) {
  .learn-hero {
    padding-top: 110px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .btn-primary,
  .btn-ghost,
  .learn-back .back-arrow {
    transition: none;
  }
}
