/* ==========================================================================
   OgbonMath — Welcome Screen V2 (Resume + Ask)
   --------------------------------------------------------------------------
   The new home: one hero action (Continue), one subtle AI prompt, a small
   secondary strip (streak, daily challenge), and an optional quick-access
   grid. Everything else demoted to the command palette.
   ========================================================================== */

.wv2 {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 40px 64px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  font-family: var(--font-sans);
}

@media (max-width: 768px) {
  .wv2 {
    padding: 32px 20px 48px;
    gap: 36px;
  }
}

/* Hero — editorial flagship. Two-column spread on desktop (paired with
   Continue or Featured hero card); single-column stack below 1024px. */
.wv2-hero-v3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 1024px) {
  .wv2-hero-v3--paired {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
  }
}

.wv2-hero-v3-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 560px;
}

.wv2-hero-v3-companion {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1024px) {
  .wv2-hero-v3-companion > .wv2-continue,
  .wv2-hero-v3-companion > .wv2-featured-hero {
    width: 100%;
  }
}

/* No-companion fallback (rare cold-start with zero featured picks). */
.wv2-hero-v3--solo .wv2-hero-v3-text {
  max-width: 760px;
}

.wv2-hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 18px;
}

.wv2-hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--tx);
  margin: 0 0 22px;
  max-width: 22ch;
}

.wv2-hero-body {
  font-size: 17px;
  line-height: 1.65;
  color: var(--tx2);
  margin: 0 0 32px;
  max-width: 60ch;
}

.wv2-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--ac);
  color: var(--ac-tx);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.wv2-hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--ac-ring);
}

.wv2-hero-cta:focus-visible {
  outline: 3px solid var(--ac-ring);
  outline-offset: 2px;
}

.wv2-hero-cta-arrow {
  display: inline-block;
  transition: transform var(--dur-fast) var(--ease-out);
}

.wv2-hero-cta:hover .wv2-hero-cta-arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .wv2-hero-cta {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   Continue card — only when user has an active lesson
   ==========================================================================
*/
.wv2-continue {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 28px 36px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-left: 4px solid var(--ac);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.wv2-continue:hover {
  transform: translateY(-2px);
  border-color: var(--ac);
  box-shadow: var(--shadow-lg);
}

.wv2-continue:focus-visible {
  outline: 3px solid var(--ac-ring);
  outline-offset: 2px;
}

.wv2-continue-main {
  flex: 1;
  min-width: 0;
}

.wv2-continue-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 10px;
}

.wv2-continue-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-semibold);
  color: var(--tx);
  letter-spacing: -0.012em;
  line-height: 1.25;
  margin-bottom: 6px;
}

.wv2-continue-meta {
  font-size: 13px;
  color: var(--tx2);
  margin-bottom: 14px;
}

.wv2-continue-bar {
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.wv2-continue-bar-fill {
  height: 100%;
  background: var(--ac);
  transition: width var(--dur) var(--ease-out);
}

.wv2-continue-bar-label {
  font-size: 12px;
  color: var(--tx3);
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.2px;
}

.wv2-continue-cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: transparent;
  color: var(--ac);
  border: 1.5px solid var(--ac);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 0.3px;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.wv2-continue:hover .wv2-continue-cta {
  background: var(--ac);
  color: var(--ac-tx);
}

@media (max-width: 768px) {
  .wv2-continue {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 24px;
  }
  .wv2-continue-title {
    font-size: 19px;
  }
  .wv2-continue-cta {
    align-self: flex-start;
  }
}

/* ==========================================================================
   Sections — shared header + spacing pattern for non-hero sections
   ==========================================================================
*/
.wv2-section {
  display: flex;
  flex-direction: column;
}

.wv2-section-header {
  margin-bottom: 24px;
}

.wv2-section-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-bold, 700);
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--tx3);
}

.wv2-section-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.012em;
  color: var(--tx);
  margin: 6px 0 0;
  line-height: 1.25;
}

@media (max-width: 768px) {
  .wv2-section-header { margin-bottom: 18px; }
  .wv2-section-title { font-size: 20px; }
}

/* The legacy 8-tile book grid (.wv2-book-grid + .wv2-book-tile*) was
   removed when Featured Today + Library footer replaced it. Audit
   confirmed no DOM/JS references remain (2026-05-01). */

/* ==========================================================================
   AI tutor section — wraps existing InlineTutor mount with a header
   ==========================================================================
*/
.wv2-ai-section .wv2-ask-mount {
  display: block;
}

/* ==========================================================================
   Quick actions — Daily Challenge, Quick Practice, Playground
   ==========================================================================
*/
.wv2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* ==========================================================================
   Stats — achievement-card row
   ==========================================================================
*/
.wv2-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .wv2-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.wv2-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 24px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.wv2-stat-card:hover {
  border-color: var(--ac);
  transform: translateY(-1px);
}

.wv2-stat-card-glyph {
  font-size: 14px;
  color: var(--ac);
  margin-bottom: 10px;
  line-height: 1;
}

.wv2-stat-card-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--fw-semibold);
  letter-spacing: -0.012em;
  color: var(--tx);
  line-height: 1;
  margin-bottom: 6px;
}

.wv2-stat-card-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tx3);
}

@media (max-width: 768px) {
  .wv2-stat-card { padding: 18px 20px; }
  .wv2-stat-card-value { font-size: 24px; }
}

/* ---------- Ask band (AI tutor prompt) ---------- */
.wv2-ask {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 16px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-fast), box-shadow var(--dur) var(--ease-out);
}

.wv2-ask:focus-within {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-ring);
}

.wv2-ask-icon {
  color: var(--tx2);
  font-size: 18px;
  flex-shrink: 0;
}

.wv2-ask-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  color: var(--tx) !important;
  font-family: var(--font-sans) !important;
  font-size: var(--fs-base) !important;
  min-width: 0;
}

.wv2-ask-input::placeholder {
  color: var(--tx3);
}

.wv2-ask-submit {
  background: var(--ac);
  color: var(--ac-tx);
  border: none;
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast);
}

.wv2-ask-submit:hover { background: var(--ac2); }
.wv2-ask-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.wv2-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color var(--dur-fast), transform var(--dur-fast);
  text-align: left;
  font-family: var(--font-sans);
  color: var(--tx);
}

.wv2-card:hover {
  border-color: var(--ac);
}

.wv2-card:active { transform: scale(0.99); }

.wv2-card-icon {
  font-size: 22px;
  color: var(--ac);
  margin-bottom: var(--sp-1);
  line-height: 1;
}

.wv2-card-title {
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
}

.wv2-card-sub {
  color: var(--tx2);
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
}

/* Mobile tweaks for the .wv2-grid Quick Actions row are inherited from
   the auto-fit grid-template-columns above; no override needed. */

/* ==========================================================================
   Featured today — 1 editorial hero + 2 supporting cards.
   Replaces the old 8-tile library grid on the home screen. The hero
   spans 2 of 3 columns on desktop and stacks below 768px.
   ========================================================================== */

.wv2-featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: 18px;
}

/* No-hero variant: when the Featured hero card has been promoted to the
   hero spread above, only the two supporting cards remain in this
   section. Render them side-by-side on desktop (no row-spanning hero
   to fill the left column) and stack on mobile via the shared media
   query below. */
.wv2-featured-grid--no-hero {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
}

@media (max-width: 768px) {
  .wv2-featured-grid,
  .wv2-featured-grid--no-hero {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.wv2-featured-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--tx3);
  margin-bottom: 8px;
}

/* Hero card (first pick). Spans both rows in the 2x2 grid. Oversized
   typographic glyph as a watermark establishes the editorial feel. */
.wv2-featured-hero {
  position: relative;
  grid-row: 1 / span 2;
  display: flex;
  align-items: flex-end;
  min-height: 280px;
  padding: 32px;
  background: linear-gradient(135deg, var(--bg2) 0%, var(--bg3) 100%);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.wv2-featured-hero:hover {
  transform: translateY(-2px);
  border-color: var(--ac);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.wv2-featured-hero:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 3px;
}

.wv2-featured-hero-watermark {
  position: absolute;
  top: -32px;
  right: -16px;
  font-family: var(--font-display);
  font-size: 240px;
  line-height: 1;
  color: var(--ac);
  opacity: 0.08;
  pointer-events: none;
  user-select: none;
}

.wv2-featured-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 540px;
}

.wv2-featured-hero-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.018em;
  line-height: 1.15;
  color: var(--tx);
  margin: 0 0 12px;
}

.wv2-featured-hero-tagline {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--tx2);
  margin: 0 0 20px;
  max-width: 480px;
}

.wv2-featured-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ac);
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .wv2-featured-hero {
    min-height: 220px;
    padding: 24px;
  }
  .wv2-featured-hero-watermark {
    font-size: 180px;
    top: -20px;
    right: -10px;
  }
  .wv2-featured-hero-title {
    font-size: 26px;
  }
}

/* Supporting cards (picks 2 + 3). Same data shape, smaller surface.
   No CTA chrome — the whole card is clickable. */
.wv2-featured-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease;
}

.wv2-featured-card:hover {
  transform: translateY(-2px);
  border-color: var(--ac);
}

.wv2-featured-card:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 3px;
}

.wv2-featured-card-glyph {
  position: absolute;
  top: 16px;
  right: 18px;
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--ac);
  opacity: 0.7;
}

.wv2-featured-card-inner {
  padding-right: 36px; /* leave room for glyph */
}

.wv2-featured-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.008em;
  line-height: 1.25;
  color: var(--tx);
  margin: 0 0 8px;
}

.wv2-featured-card-tagline {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--tx2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   For You — horizontal rail of recently-viewed books
   ========================================================================== */

.wv2-foryou-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 768px) {
  .wv2-foryou-rail {
    grid-template-columns: 1fr;
  }
}

.wv2-foryou-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease;
}

.wv2-foryou-card:hover {
  transform: translateY(-1px);
  border-color: var(--ac);
}

.wv2-foryou-card:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 3px;
}

.wv2-foryou-glyph {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1.2;
  color: var(--ac);
  flex-shrink: 0;
}

.wv2-foryou-inner {
  flex: 1;
  min-width: 0;
}

.wv2-foryou-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--tx);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wv2-foryou-cta {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--ac);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Library footer — single-card CTA replacing the old 8-tile grid
   ========================================================================== */

.wv2-library-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px;
  background: var(--bg2);
  border: 1px solid var(--bdr);
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease;
}

.wv2-library-footer:hover {
  transform: translateY(-2px);
  border-color: var(--ac);
}

.wv2-library-footer:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 3px;
}

.wv2-library-footer-inner {
  flex: 1;
  min-width: 0;
}

.wv2-library-footer-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--tx3);
  margin-bottom: 6px;
}

.wv2-library-footer-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.25;
  color: var(--tx);
  margin: 0 0 8px;
}

.wv2-library-footer-sub {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--tx2);
  margin: 0;
  max-width: 640px;
}

.wv2-library-footer-arrow {
  font-family: var(--font-sans);
  font-size: 28px;
  line-height: 1;
  color: var(--ac);
  flex-shrink: 0;
  transition: transform 160ms ease;
}

.wv2-library-footer:hover .wv2-library-footer-arrow {
  transform: translateX(4px);
}

@media (max-width: 768px) {
  .wv2-library-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 22px;
  }
  .wv2-library-footer-title {
    font-size: 18px;
  }
}
