/* Jaba Learning — shared design system */

:root {
  --bg: #0a0b0d;
  --bg-elevated: #131519;
  --bg-card: #16181d;
  --border: #24272e;
  --text: #f2f3f5;
  --text-dim: #b7bcc4;
  --text-faint: #767c87;

  --brand: #6ea8ff;
  --brand-dim: #3f6cb8;

  --iq-accent: #f0b64d;
  --iq-accent-dim: #8a6a2e;
  --gt-accent: #3ecf7e;
  --gt-accent-dim: #2a8f58;
  --pa-accent: #4d9bf0;
  --pa-accent-dim: #2e6ab0;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-card: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
}

/* The frosted background lives on a pseudo-element: backdrop-filter on the header
   itself would trap the fixed-position mobile menu inside the 72px header. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(10, 11, 13, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.main-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.15s ease;
}

.main-nav a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

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

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-accent {
  color: #08090a;
}

.app-badge {
  height: 44px;
  width: auto;
}

.store-badge {
  display: inline-block;
  line-height: 0;
}

.store-badge img {
  height: 48px;
  width: auto;
}

/* ---------- Hero (home) ---------- */

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

.hero p.lede {
  font-size: 1.15rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 36px;
}

/* ---------- App cards grid (home) ---------- */

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding: 48px 0 96px;
}

.app-grid--two {
  grid-template-columns: repeat(2, 1fr);
}

.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.app-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-accent, var(--brand));
}

.app-card .app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-card);
}

.app-card h3 {
  font-size: 1.3rem;
  margin-bottom: 2px;
}

.app-card .app-tagline {
  color: var(--card-accent, var(--brand));
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.app-card p {
  color: var(--text-dim);
  font-size: 0.94rem;
  flex-grow: 1;
}

.app-card .card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-card--iron-query { --card-accent: var(--iq-accent); }
.app-card--geometry-tutor { --card-accent: var(--gt-accent); }
.app-card--pre-algebra-tutor { --card-accent: var(--pa-accent); }

/* ---------- Generic sections ---------- */

section {
  padding: 88px 0;
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 52px;
}

.section-header .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 12px;
  display: block;
}

.section-header h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
}

.section-header p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 0;
}

.band {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Feature grid ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.feature-grid .feature h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.feature-grid .feature p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.feature-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--page-accent, var(--brand));
  margin-bottom: 16px;
}

/* ---------- App page hero ---------- */

.app-hero {
  padding: 72px 0 40px;
}

.app-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: stretch;
  min-height: 460px;
}

.app-hero-grid > div:first-child {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 12px;
}

.app-hero .app-icon-lg {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.app-hero .app-subtitle {
  color: var(--page-accent, var(--brand));
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 10px;
}

.app-hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
}

.app-hero .lede {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 480px;
}

.app-hero .cta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.app-hero .trial-note {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.hero-screens {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
  position: relative;
}

.hero-screens img {
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.hero-screens img:nth-child(1) {
  width: 62%;
  z-index: 2;
}

.hero-screens img:nth-child(2) {
  width: 46%;
  transform: translateY(24px);
  opacity: 0.85;
  margin-left: -10%;
}

.hero-screens.hero-screens--wide {
  position: relative;
  height: 100%;
  min-height: 340px;
  display: block;
}

.hero-screens.hero-screens--wide img {
  border-radius: 12px;
  box-shadow: var(--shadow-card);
}

.hero-screens.hero-screens--wide img:nth-child(1) {
  position: absolute;
  top: 12%;
  left: 0;
  width: 82%;
  opacity: 0.7;
  z-index: 1;
}

.hero-screens.hero-screens--wide img:nth-child(2) {
  position: absolute;
  bottom: 12%;
  right: 0;
  width: 82%;
  z-index: 2;
}

/* ---------- Screenshot strip ---------- */

.screen-strip {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  padding: 8px 0 20px;
  scroll-snap-type: x mandatory;
  align-items: flex-start;
}

.screen-strip img {
  border-radius: 16px;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  flex-shrink: 0;
  height: 420px;
  width: auto;
  max-width: none;
}

.screen-strip::-webkit-scrollbar {
  height: 8px;
}

.screen-strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

/* ---------- Curriculum / list blocks ---------- */

.unit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.unit-list li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.95rem;
  color: var(--text-dim);
  display: flex;
  gap: 12px;
}

.unit-list li strong {
  color: var(--text);
  flex-shrink: 0;
}

/* ---------- CTA band ---------- */

.cta-band {
  text-align: center;
  padding: 88px 0;
}

.cta-band h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin-bottom: 12px;
}

.cta-band p {
  color: var(--text-dim);
  margin-bottom: 32px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
  color: var(--text-faint);
  font-size: 0.88rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 40px;
}

.footer-grid h5 {
  color: var(--text);
  font-size: 0.85rem;
  margin: 0 0 14px;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-grid a:hover {
  color: var(--text);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Privacy / text pages ---------- */

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 0 96px;
}

.prose h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.prose .updated {
  color: var(--text-faint);
  font-size: 0.9rem;
  margin-bottom: 40px;
}

.prose h2 {
  font-size: 1.25rem;
  margin-top: 40px;
}

.prose p, .prose li {
  color: var(--text-dim);
  font-size: 1rem;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
}

/* ---------- Blog placeholder ---------- */

.blog-empty {
  text-align: center;
  padding: 120px 0;
}

.blog-empty h1 {
  font-size: 2.2rem;
}

.blog-empty p {
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Blog ---------- */

.blog-head {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 0 32px;
}

.blog-head h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.blog-head p {
  color: var(--text-dim);
}

.post-list {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post-card:hover {
  border-color: var(--brand-dim);
  transform: translateY(-2px);
}

.post-card--image {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 22px;
  align-items: center;
}

.post-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.post-card h2 {
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.post-card p {
  color: var(--text-dim);
  margin: 0;
}

.post-card .post-meta,
.post-back {
  color: var(--text-faint);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.prose .post-back {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text-faint);
  text-decoration: none;
}

.prose .post-back:hover {
  color: var(--text);
}

.post h3 {
  font-size: 1.05rem;
  margin-top: 28px;
}

.post figure {
  margin: 28px 0;
}

.post figure img {
  max-height: 560px;
  width: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin: 0 auto;
}

.post figcaption {
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 10px;
}

.post figcaption a {
  color: inherit;
}

.post-cover {
  margin-top: 0 !important;
}

.post blockquote {
  margin: 24px 0;
  padding: 2px 20px;
  border-left: 3px solid var(--brand);
}

.post code {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.9em;
}

.post pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  line-height: 1.45;
}

.post pre code {
  background: none;
  border: 0;
  padding: 0;
}

.post hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.post strong {
  color: var(--text);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .app-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .app-hero {
    text-align: center;
  }

  .app-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .app-hero .lede {
    margin-left: auto;
    margin-right: auto;
  }

  .app-hero .cta-row {
    justify-content: center;
  }

  .hero-screens {
    margin-top: 12px;
  }

  /* Wide (Mac) screenshots at 420px tall overflow a phone; cap both sides and keep the ratio */
  .screen-strip img {
    height: auto;
    max-height: 420px;
    max-width: 85vw;
  }

  .unit-list {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .main-nav {
    position: fixed;
    inset: 72px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav a {
    font-size: 1.1rem;
  }

  .nav-toggle {
    display: block;
  }
}

@media (max-width: 560px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .post-card--image {
    grid-template-columns: 1fr;
  }
}
