/* Home page sections below the video hero (signed-out visitors). */

.home-plain { padding: 56px 0 8px; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 64px; align-items: start; }

.home-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--rule); }
.home-sec-head h2 { font-size: 24px; }
.home-sec-head a { font-size: 14px; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.home-sec-head a:hover { color: var(--text); }
.home-sec-gap { margin-top: 40px; }
.home-sec-lead { margin: 14px 0 6px; color: var(--text-dim); font-size: 15px; }

.home-units { margin: 0; padding-left: 24px; }
.home-units li { padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--text-faint); }
.home-units a { font-weight: 600; color: var(--text); }
.home-units a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-units span { display: block; margin-top: 2px; font-size: 14px; color: var(--text-dim); }

.home-quotes { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 15px; }
.home-quotes td { padding: 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.home-quotes a { font-weight: 600; color: var(--text); }
.home-quotes a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-quotes small { display: block; font-size: 12.5px; color: var(--text-faint); }
.home-quotes .num { text-align: right; font-variant-numeric: tabular-nums; padding-left: 12px; white-space: nowrap; }
.home-quotes .up { color: var(--bull); }
.home-quotes .down { color: var(--bear); }
.home-note { margin-top: 10px; font-size: 13px; color: var(--text-faint); }
.home-note a { text-decoration: underline; }

.home-links { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; padding: 0; font-size: 14px; }
.home-links a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.home-links a:hover { color: var(--text); }

.home-practice { list-style: none; margin: 0; padding: 0; }
.home-practice li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.home-practice a { font-weight: 600; color: var(--text); }
.home-practice a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-practice span { display: block; margin-top: 2px; font-size: 14px; color: var(--text-dim); }

.home-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; margin-top: 18px; }
.home-post-date { font-size: 13px; color: var(--text-faint); }
.home-posts h3 { font-size: 19px; line-height: 1.35; margin: 4px 0 8px; }
.home-posts h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-posts p:last-child { font-size: 14.5px; color: var(--text-dim); }

@media (max-width: 900px) {
  .home-cols { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .home-posts { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* Small looping demo clips (they load only when scrolled into view). */
.home-demos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 32px; margin-top: 18px; max-width: 980px; }
.home-demo { margin: 0; }
.home-demo-media { display: block; aspect-ratio: 1920 / 920; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); }
.home-demo .demo-video { width: 100%; height: 100%; display: block; object-fit: cover; }
.home-demo figcaption { margin-top: 10px; font-size: 14px; }
.home-demo figcaption a { font-weight: 600; color: var(--text); }
.home-demo figcaption a:hover { text-decoration: underline; text-underline-offset: 3px; }
.home-demo figcaption span { display: block; margin-top: 2px; color: var(--text-dim); }
@media (max-width: 900px) { .home-demos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .home-demos { grid-template-columns: minmax(0, 1fr); } }

/* Post images in the home page's news section */
.home-post-img { display: block; aspect-ratio: 16 / 10; margin-bottom: 12px; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-2); }
.home-post-img img { width: 100%; height: 100%; display: block; object-fit: cover; transition: opacity .15s; }
.home-post-img:hover img { opacity: .9; }

/* Hero: one quiet line under the buttons */
.hero-proof { margin-top: 18px; font-size: 14.5px; color: rgba(255,255,255,0.78); }
.hero-proof a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
:root[data-theme="light"] .hero-proof { color: var(--text-dim); }
:root[data-theme="light"] .hero-proof a { color: var(--text); }

/* What a free account gets you */
.home-join { padding-top: 64px; }
.home-join-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 56px; align-items: start; }
.home-join-title { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; }
.home-join-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.home-join-cta span { font-size: 14px; color: var(--text-faint); }
.home-perks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.home-perks li { padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 15.5px; line-height: 1.6; color: var(--text-dim); }
.home-perks strong { color: var(--text); font-weight: 600; }

/* First lesson excerpt */
.home-preview .home-preview-text, .home-preview .home-preview-title { max-width: none; }
.home-preview-meta { margin-top: 16px; font-size: 13.5px; color: var(--text-faint); }
.home-preview-title { font-size: 24px; margin: 4px 0 10px; }
.home-preview-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-preview-text { font-size: 16.5px; line-height: 1.75; color: var(--text-dim); margin: 0 0 12px; }
.home-preview-more { display: inline-block; margin-top: 4px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* Closing line */
.home-close { padding-bottom: 72px; }
.home-close .container { padding-top: 28px; border-top: 1px solid var(--rule); }
.home-close-text { font-size: 18px; color: var(--text); max-width: 640px; }
.home-close-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 900px) {
  .home-join-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* ---------- Signed-out home: editorial type and rhythm ---------- */
/* Section titles in the site's serif, larger, so each section has a clear start. */
.home-plain .home-sec-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 6px; }
.home-plain .home-sec-head h2,
.home-join-title,
.home-close-text,
.faq-title { font-family: var(--serif); font-weight: 500; letter-spacing: -0.01em; }
.home-plain .home-sec-head h2 { font-size: clamp(30px, 3.4vw, 40px); line-height: 1.1; }
.home-join-title { font-size: clamp(32px, 3.6vw, 44px); line-height: 1.08; }
.home-sec-lead { font-size: 16px; }

/* Full-width bands on alternating sections */
.home-band { background: var(--bg-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
:root[data-theme="light"] .home-band { background: #f6f4ef; }
.home-plain { padding: 72px 0 64px; }

/* What a free account gets you: two columns, each feature name on its own line */
.home-join-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.5fr); align-items: center; }
.home-perks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 36px; border-top: 0; }
.home-perks li { padding: 18px 0 18px; border-bottom: 0; border-top: 1px solid var(--border); font-size: 15px; }
.home-perks strong { display: block; margin-bottom: 4px; font-size: 17px; }
.home-perks li::before { content: ""; display: block; width: 28px; height: 2px; background: var(--accent); margin: -19px 0 17px; }

/* Units: two columns with large serif numbers */
.home-units-2 { list-style: none; padding: 0; counter-reset: unit; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 14px; }
.home-units-2 li { counter-increment: unit; position: relative; padding: 14px 0 14px 46px; border-bottom: 1px solid var(--rule); }
.home-units-2 li::before { content: counter(unit); position: absolute; left: 0; top: 8px; font-family: var(--serif); font-size: 30px; line-height: 1; color: var(--accent); font-variant-numeric: lining-nums; }
.home-units-2 a { font-size: 15.5px; }

/* Markets snapshot: bigger numbers */
.home-quotes td { padding: 13px 0; }
.home-quotes a { font-size: 16px; }
.home-quotes .num { font-size: 16px; }
.home-quotes .num.up, .home-quotes .num.down { font-weight: 600; }

/* First lesson: larger opening text with a serif drop cap */
.home-preview-title { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 3vw, 36px); }
.home-preview-text { font-size: 17.5px; }
.home-preview-title + .home-preview-text::first-letter { float: left; font-family: var(--serif); font-size: 4.1em; line-height: 0.82; margin: 6px 10px 0 0; color: var(--text); }

/* Posts: taller images, serif titles */
.home-post-img { aspect-ratio: 3 / 2; }
.home-post-img img { transition: transform .4s ease; }
.home-post-img:hover img { transform: scale(1.03); opacity: 1; }
.home-posts h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.25; }

/* FAQ title matches the other sections */
.home-plain + .section .sec-head h2, .section .sec-head h2 { font-family: var(--serif); font-weight: 500; }

/* Closing: one large serif line */
.home-close .container { padding-top: 48px; }
.home-close-text { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.3; max-width: 760px; }
.home-close-actions { margin-top: 22px; }

@media (max-width: 900px) {
  .home-plain { padding: 52px 0 44px; }
  .home-perks, .home-units-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .home-post-img img { transition: none; } }

/* ---------- Phones ---------- */
.home-mbar { display: none; }
@media (max-width: 640px) {
  /* Stack the account section (a later desktop rule was keeping two columns). */
  .home-join-grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .home-join-title { font-size: 32px; }
  .home-perks { grid-template-columns: minmax(0, 1fr); }
  .home-perks li { padding: 14px 0; }

  /* Shorter page: drop the parts that repeat or don't read well on a small screen. */
  .home-hide-phone { display: none !important; }
  .home-units-2 li:nth-child(n+6) { display: none; }
  .home-preview-text + .home-preview-text { display: none; }
  .home-posts article:nth-child(n+3) { display: none; }
  .home-plain { padding: 44px 0 36px; }
  .home-plain .home-sec-head h2 { font-size: 30px; }
  .hero-title { font-size: clamp(40px, 12vw, 52px); }

  /* Sign-up bar pinned to the bottom once the hero is out of view (see home.js). */
  .home-mbar {
    display: flex; align-items: center; gap: 14px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg-2);
    border-top: 1px solid var(--border-2); transform: translateY(110%); transition: transform .22s ease;
  }
  .home-mbar.show { transform: none; }
  .home-mbar .btn { flex: 1; justify-content: center; }
  .home-mbar-signin { font-size: 14.5px; color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
  body.has-mbar .back-to-top { bottom: 84px; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) { .home-mbar { transition: none; } }

/* ---------- Signed-out home: plainer details ---------- */
/* Features separated by a plain rule, without the accent dash above each one. */
.home-perks li::before { display: none; }
.home-perks li { padding-top: 16px; }
/* Questions follow the page's left edge like every other section. */
.home-faq .faq { max-width: 820px; margin: 14px 0 0; }
