/* Mathematics with Ash — guide product theme
   Keeps the learning interactions intact while aligning them with the site system. */

:root {
  color-scheme: light dark;
  --navy: #142b4a;
  --coral: #ffb000;
  --coral-ink: #a95b00;
  --blue: #0b7775;
  --cream: #eaf3ff;
  --paper: #f8fbff;
  --grey: #38506f;
  --faint: #68809c;
  --hairline: #c8d9ed;
  --dashed: #9cb4ce;
  --ink: var(--navy);
  --surface: #ffffff;
  --color-link: #0b7775;
  --color-link-hover: #085c5b;
  --color-ok: #147a4a;
  --color-ok-bg: #e2f5ea;
  --color-err: #aa2f46;
  --color-err-bg: #fde8ec;
  --on-coral: #142b4a;
  --on-navy: #fff7df;
  --milestone: #cc3f75;
  --milestone-ink: #b93668;
  --milestone-bg: #fbe5ed;
  --font-display: Georgia, "Times New Roman", serif;
  --font-head: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-fr: Georgia, "Times New Roman", serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;
  --border-ink: 1px solid var(--hairline);
  --shadow-1: 0 8px 24px rgba(20, 43, 74, 0.09);
  --shadow-2: 0 18px 50px rgba(20, 43, 74, 0.11);
  --shadow-coral: 7px 7px 0 var(--coral);
  --focus-ring: 0 0 0 3px var(--paper), 0 0 0 6px var(--coral);
  --focus-outline: 3px solid var(--coral);
  --dur-fast: 160ms;
  --dur: 240ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --navy: #eff6ff;
    --coral: #ffc044;
    --coral-ink: #ffcf62;
    --blue: #84e6dd;
    --cream: #172d48;
    --paper: #091523;
    --grey: #b9c9dd;
    --faint: #91a5bc;
    --hairline: #31506f;
    --dashed: #4f6b88;
    --ink: var(--navy);
    --surface: #10233a;
    --color-surface: var(--surface);
    --color-bg: var(--paper);
    --color-text: var(--navy);
    --color-text-muted: var(--grey);
    --color-link: #84e6dd;
    --color-link-hover: #b9fff8;
    --color-ok: #68d39a;
    --color-ok-bg: #123b31;
    --color-err: #ff8ba0;
    --color-err-bg: #492330;
    --on-coral: #071a30;
    --on-navy: #071a30;
    --milestone: #ff78aa;
    --milestone-ink: #ff9fc2;
    --milestone-bg: #3b2031;
    --shadow-1: 0 8px 24px rgba(0, 0, 0, 0.24);
    --shadow-2: 0 18px 50px rgba(0, 0, 0, 0.3);
  }
}

body {
  min-width: 20rem;
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(color-mix(in srgb, var(--blue) 9%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 9%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
}

body::selection {
  background: var(--coral);
  color: var(--on-coral);
}

.page-landing .container { max-width: 72rem; }
.page-index .container { max-width: 58rem; }

h1, h2, .landing-hero__title, .index-hero__title, .chapter-head__title {
  font-family: var(--font-display);
  letter-spacing: -0.045em;
}

.site-header {
  border-bottom: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.site-header__inner {
  min-height: 72px;
}

.site-header__home {
  gap: 0.7rem;
  color: var(--navy);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}

.site-header__logo {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 9px;
  background: #142b4a;
  box-shadow: 4px 4px 0 var(--coral);
  color: #fff7df;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: normal;
  font-weight: 700;
}

.site-header__back {
  color: var(--grey);
}

.site-header__back::after {
  background: var(--hairline);
}

.progress-rail {
  height: 3px;
}

.progress-rail__fill {
  background: linear-gradient(90deg, var(--coral), #10a7a1, #cc3f75);
}

.btn {
  border: 1px solid var(--navy);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--navy);
}

.btn:hover {
  box-shadow: 5px 5px 0 var(--navy);
}

.btn--primary {
  background: var(--navy);
  color: var(--on-navy);
}

.btn--coral {
  background: var(--coral);
  color: var(--on-coral);
}

.landing-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(4.5rem, 9vw, 8rem) clamp(2.5rem, 5vw, 4rem);
}

.landing-hero::before,
.landing-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
}

.landing-hero::before {
  inset: 12% auto auto 4%;
  width: clamp(6rem, 15vw, 11rem);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, #10a7a1 35%, transparent);
  box-shadow: inset 0 0 0 22px color-mix(in srgb, #10a7a1 5%, transparent);
}

.landing-hero::after {
  inset: auto 4% 8% auto;
  width: clamp(5rem, 12vw, 9rem);
  aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in srgb, #cc3f75 22%, transparent) 0 2px, transparent 3px);
  background-size: 14px 14px;
}

.landing-hero__brand,
.index-hero__eyebrow,
.chapter-head__eyebrow {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: var(--fs-300);
  letter-spacing: 0.12em;
}

.landing-hero__title {
  max-width: 14ch;
  margin-inline: auto;
  font-size: clamp(3.25rem, 7vw, 6.5rem);
  font-weight: 700;
  line-height: 0.96;
  text-transform: none;
}

.landing-hero__title::after,
.index-hero__title::after {
  content: ".";
  color: #cc3f75;
}

.landing-hero__lede {
  max-width: 48rem;
  margin-top: 1.5rem;
  color: var(--grey);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.65;
}

.landing-hero__cta {
  margin-top: 2rem;
}

.arc {
  margin-block: 0 clamp(3rem, 7vw, 5rem);
}

.arc__node {
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: none;
  color: var(--navy);
}

.arc .arc__node:last-of-type {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--on-navy);
}

.books-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: stretch;
  gap: 1.25rem;
}

.book-card,
.chapter-card,
.workbook__card,
.intro-panel,
.account-card,
.account-progress__row,
.deck,
.conj,
.exercise,
.prod-drill {
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}

.book-card {
  min-height: 19rem;
  border-top: 4px solid #10a7a1;
  padding: clamp(1.35rem, 3vw, 2rem);
}

.book-card:nth-child(3n + 2) { border-top-color: #cc3f75; }
.book-card:nth-child(3n + 3) { border-top-color: var(--coral); }

.book-card:hover,
.chapter-card:hover,
.workbook__card:hover {
  border-color: color-mix(in srgb, #10a7a1 55%, var(--hairline));
  box-shadow: var(--shadow-2);
  transform: translateY(-4px);
}

.book-card__num {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  box-shadow: 4px 4px 0 var(--coral);
  color: var(--on-navy);
  font-family: var(--font-display);
}

.book-card__title,
.chapter-card__title,
.workbook__card-label,
.util-card__label,
.checkpoint-card__title {
  color: var(--navy);
  font-family: var(--font-head);
}

.book-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.book-card__status,
.workbook__card-go {
  color: var(--blue);
}

.landing-util {
  margin-block: clamp(2.5rem, 6vw, 5rem);
}

.util-card {
  border: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--cream) 72%, var(--surface));
}

.util-card:hover {
  background: var(--surface);
  box-shadow: var(--shadow-1);
  transform: translateY(-3px);
}

.util-card__icon {
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.index-hero {
  padding-block: clamp(3.75rem, 8vw, 6.5rem) 2rem;
}

.index-hero__title {
  max-width: 15ch;
  margin-top: 0.75rem;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 0.98;
  text-transform: none;
}

.index-hero__sub {
  max-width: 42rem;
  color: var(--grey);
  line-height: 1.55;
}

.book-progress__bar {
  height: 12px;
  border: 1px solid var(--hairline);
  background: var(--cream);
}

.book-progress__fill {
  background: linear-gradient(90deg, #10a7a1, var(--coral));
}

.intro-panel {
  border-left: 4px solid #10a7a1;
  background: color-mix(in srgb, var(--surface) 92%, var(--cream));
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.intro-panel h2,
.intro-panel h3 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}

.chapter-list {
  gap: 0.85rem;
}

.chapter-card,
.workbook__card,
.account-progress__row {
  border-radius: 14px;
}

.chapter-card__num {
  border: 1px solid var(--hairline);
  background: var(--cream);
  color: var(--navy);
}

.checkpoint-card {
  border: 1px solid color-mix(in srgb, var(--milestone) 45%, var(--hairline));
  border-left: 4px solid var(--milestone);
  background: color-mix(in srgb, var(--milestone-bg) 78%, var(--surface));
  box-shadow: var(--shadow-1);
}

.checkpoint-card:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-4px);
}

.checkpoint-card__badge {
  border-radius: 10px;
}

.chapter {
  padding-top: clamp(2rem, 5vw, 3.5rem);
}

.chapter-head {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.chapter-head__title {
  font-size: clamp(2.75rem, 6vw, 4.8rem);
  line-height: 1;
}

.chapter-head__sub {
  color: var(--grey);
  line-height: 1.5;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.035em;
}

.section__title::after {
  height: 4px;
  background: #10a7a1;
}

.example,
.ref-strip,
.card__face--fr,
.deck__table th,
.drill__timer,
.drill__recorder,
.exercise__open .exercise__prompt {
  background: var(--cream);
}

.example { border-left-color: #10a7a1; }
.dialogue { border-left-color: #cc3f75; }

.deck,
.conj,
.exercise,
.prod-drill {
  border-radius: var(--radius-lg);
}

.exercise { border-top: 4px solid var(--coral); }
.exercise__tag { color: var(--blue); }

.card__face,
.audio,
.deck__nav,
.mcq__option,
.exercise__write,
.drill__write,
.auth-google,
.auth-field input {
  border-color: var(--hairline);
  background-color: var(--surface);
  color: var(--navy);
}

.auth-modal__backdrop {
  background: rgba(7, 26, 48, 0.62);
}

.auth-modal__card {
  border: 1px solid var(--hairline);
  background: var(--surface);
  box-shadow: var(--shadow-2);
}

.auth-modal__brand { color: var(--blue); }

.account-card {
  border-left: 4px solid #10a7a1;
}

.site-footer {
  border-top: 0;
  background: #071a30;
}

.site-footer__inner {
  color: #91a5bc;
}

.site-footer__sig {
  color: #fff7df;
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-transform: none;
}

.book-card.fw-hidden,
.chapter-card.fw-hidden,
.workbook__card.fw-hidden,
.util-card.fw-hidden,
.checkpoint-card.fw-hidden {
  opacity: 0;
  transform: translateY(24px) scale(0.985);
}

.book-card.fw-in,
.chapter-card.fw-in,
.workbook__card.fw-in,
.util-card.fw-in,
.checkpoint-card.fw-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.62s ease, transform 0.62s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 46rem) {
  .site-header__inner { min-height: 64px; }
  .landing-hero::before, .landing-hero::after { opacity: 0.55; }
  .checkpoint-card { align-items: flex-start; }
  .checkpoint-card__go { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .book-card.fw-hidden,
  .chapter-card.fw-hidden,
  .workbook__card.fw-hidden,
  .util-card.fw-hidden,
  .checkpoint-card.fw-hidden {
    opacity: 1;
    transform: none;
  }
}
