/*
 * RAMVAS GURUKUL — shared website stylesheet
 * Navy, crimson and a straightforward academic layout.
 * Works with the existing HTML, script.js and resources.js.
 */

:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --soft: #edf2f7;
  --ink: #15283f;
  --muted: #56667a;
  --primary: #b42338;
  --primary-hover: #921a2c;
  --on-primary: #ffffff;
  --navy: #14283f;
  --accent: #b07b26;
  --line: #d9e1ea;
  --mint: #edf2f7;
  --success: #176444;
  --danger: #b42338;
  --radius: 6px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1724;
  --surface: #142234;
  --soft: #1b2c40;
  --ink: #edf3fa;
  --muted: #b2bfd0;
  --primary: #fa8996;
  --primary-hover: #ffabb5;
  --on-primary: #201017;
  --navy: #101f30;
  --accent: #edbd69;
  --line: #304258;
  --mint: #1b2c40;
  --success: #8bdcb4;
  --danger: #ffa5ae;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

body,
button,
input,
select,
textarea {
  font-feature-settings: "kern";
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover {
  color: var(--primary);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
summary {
  cursor: pointer;
}

button {
  color: inherit;
}

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

svg {
  max-width: 100%;
  vertical-align: middle;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: inherit;
  text-wrap: balance;
}

h1 {
  font-size: clamp(38px, 4.6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

h2 {
  font-size: clamp(29px, 3vw, 42px);
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

h3 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

p {
  color: var(--muted);
}

p + p {
  margin-top: 16px;
}

ul,
ol {
  padding-left: 22px;
}

li + li {
  margin-top: 8px;
}

button,
a,
input,
select,
textarea,
summary {
  -webkit-tap-highlight-color: transparent;
}

:where(a, button, summary, input, select, textarea):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

::selection {
  background: #f0ccd2;
  color: #14283f;
}

.container {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 12px 18px;
  background: var(--primary);
  color: var(--on-primary);
  transform: translateY(-160%);
}

.skip-link:focus {
  color: var(--on-primary);
  transform: translateY(0);
}

/* Header and primary navigation */

.announcement {
  padding: 10px 20px;
  background: #14283f;
  color: #edf3fa;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
}

.announcement a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: underline;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 11px;
}

.brand:hover {
  color: inherit;
}

.brand img {
  width: 43px;
  height: 43px;
  border-radius: 3px;
}

.brand strong {
  display: block;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.25;
}

.brand small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.045em;
  line-height: 1.4;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 23px;
  font-size: 13px;
  font-weight: 600;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.primary-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 9px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.theme-toggle {
  padding: 9px 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
}

.theme-toggle:hover,
.menu-toggle:hover {
  border-color: var(--muted);
  background: var(--soft);
}

.menu-toggle {
  display: none;
  padding: 7px 12px;
  font-size: 20px;
}

/* Shared links and buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  gap: 12px;
  padding: 13px 22px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  transition: background-color 160ms ease, border-color 160ms ease;
}

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

.btn-secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover {
  border-color: var(--muted);
  background: var(--soft);
  color: var(--ink);
}

.btn-small {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.button-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.text-link {
  display: inline-block;
  padding-block: 5px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--line);
}

.text-link:hover {
  text-decoration-color: currentColor;
}

.eyebrow {
  display: block;
  margin-bottom: 17px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.055em;
  line-height: 1.5;
  text-transform: uppercase;
}

.microcopy {
  margin-top: 14px !important;
  font-size: 12px !important;
  line-height: 1.6;
}

/* Home page */

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  align-items: center;
  gap: 64px;
  padding: 58px 0;
}

.hero h1 {
  max-width: 650px;
}

.hero h1 em {
  color: var(--primary);
  font-style: normal;
  font-weight: inherit;
}

.hero-copy > p {
  max-width: 580px;
  margin-top: 23px;
  font-size: 17px;
  line-height: 1.75;
}

.hero-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 30px;
  padding-top: 21px;
  border-top: 1px solid var(--line);
}

.hero-proof span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.hero-proof b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.teacher-stage {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.teacher-stage img {
  width: 100%;
  aspect-ratio: 1 / 1.02;
  object-fit: cover;
  object-position: center top;
  background: #ffffff;
}

.teacher-stage .live-pill {
  display: block;
  padding: 11px 20px;
  border-top: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.teacher-caption {
  padding: 19px 20px;
  background: #14283f;
  color: #ffffff;
}

.teacher-caption strong {
  display: block;
  font-size: 19px;
  font-weight: 750;
  line-height: 1.4;
}

.teacher-caption small {
  display: block;
  margin-top: 3px;
  color: #c2cfde;
  font-size: 12px;
}

.floating-note,
.teacher-caption .seal,
.subject-strip .dot {
  display: none;
}

.subject-strip {
  padding: 20px 0;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.subject-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.subject-strip p {
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subject-strip span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

/* Page sections and course information */

.section {
  padding: 72px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 48px;
  margin-bottom: 32px;
}

.section-head h2 {
  max-width: 620px;
}

.section-head > p {
  max-width: 380px;
  font-size: 15px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.subject-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.subject-card:nth-child(2) {
  border-top-color: #426a92;
}

.subject-card:nth-child(3) {
  border-top-color: var(--accent);
}

.subject-icon {
  display: block;
  margin-bottom: 18px;
  color: var(--primary);
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.2;
}

.subject-card p {
  margin: 13px 0 20px;
  font-size: 14px;
}

.subject-card ul {
  margin: 0 0 22px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
}

.subject-card .text-link {
  margin-top: auto;
}

.soft-section {
  border-block: 1px solid var(--line);
  background: var(--soft);
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 64px;
}

.split h2 {
  margin-bottom: 22px;
}

.learning-board {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 19px 25px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.5;
}

.lesson-row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-inline: 25px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.lesson-row:last-child {
  border-bottom: 0;
}

.lesson-num {
  min-width: 28px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.lesson-row h3 {
  font-size: 16px;
}

.lesson-row p {
  margin-top: 6px;
  font-size: 13px;
}

.check-list {
  margin: 24px 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  margin-top: 0;
  padding: 12px 0 12px 26px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.check-list li::before {
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 800;
  content: "✓";
}

.price-panel {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 60px;
  padding: 42px;
  border-top: 4px solid #c7394c;
  border-radius: var(--radius);
  background: #14283f;
  color: #ffffff;
  scroll-margin-top: 110px;
}

.price-panel h2 {
  color: #ffffff;
  font-size: clamp(28px, 3vw, 38px);
}

.price-panel .eyebrow {
  color: #d5dfea;
}

.price-panel p {
  color: #c2cfde;
}

.price {
  margin-top: 22px;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.price small {
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
}

.price-panel ul {
  margin: 0 0 24px;
  padding-left: 20px;
  color: #edf3fa;
  font-size: 14px;
}

.price-panel .btn {
  border-color: #ffffff;
  background: #ffffff;
  color: #14283f;
}

.price-panel .btn:hover {
  border-color: #e4ebf4;
  background: #e4ebf4;
  color: #14283f;
}

.teacher-section img {
  width: 100%;
  max-height: 440px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  object-fit: cover;
  object-position: center 24%;
}

.teacher-section .credential {
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 650;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 35px;
  margin-top: 34px;
}

.step {
  padding-top: 21px;
  border-top: 2px solid var(--line);
}

.step > span {
  color: var(--primary);
  font-size: 23px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  margin: 12px 0 9px;
  font-size: 19px;
}

.step p {
  font-size: 14px;
}

.faq {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 70px;
}

.faq h2 {
  margin-bottom: 19px;
}

.faq details {
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.faq details:first-child {
  border-top: 1px solid var(--line);
}

.faq summary {
  padding-right: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
}

.faq summary::marker {
  color: var(--primary);
}

.faq details p {
  padding: 15px 15px 0 0;
  font-size: 14px;
}

.cta-panel {
  padding: 40px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
}

.cta-panel h2 {
  max-width: 790px;
  margin-bottom: 18px;
}

.cta-panel p {
  max-width: 760px;
}

/* Inner pages and article content */

.page-hero {
  max-width: 960px;
  padding: 48px 0 42px;
}

.page-hero h1 {
  max-width: 900px;
  font-size: clamp(36px, 4vw, 54px);
}

.page-hero p {
  max-width: 740px;
  margin-top: 22px;
  font-size: 17px;
}

.breadcrumbs {
  margin-bottom: 25px;
  color: var(--muted);
  font-size: 12px;
}

.breadcrumbs a {
  text-decoration: underline;
}

.page-content {
  padding-bottom: 64px;
}

.info-card {
  min-width: 0;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.info-card h3 {
  margin-bottom: 12px;
}

.info-card p {
  margin-top: 12px;
  font-size: 14px;
}

.info-card .btn {
  margin-top: 22px;
}

.info-card a {
  overflow-wrap: anywhere;
}

.prose {
  max-width: 800px;
  overflow-wrap: break-word;
}

.prose h2 {
  margin: 34px 0 17px;
  font-size: 29px;
}

.prose h3 {
  margin: 26px 0 12px;
}

.prose p,
.prose li {
  font-size: 16px;
  line-height: 1.8;
}

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

.notice {
  margin: 24px 0;
  padding: 20px 23px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.notice strong {
  color: var(--ink);
}

.subject-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.subject-links a {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
}

.link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 25px;
}

.link-list a {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.article-card {
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-number {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.article-card h3 {
  margin: 14px 0;
  font-size: 22px;
}

.article-card p {
  margin-bottom: 18px;
  font-size: 14px;
}

.article-body {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.article-body > :first-child,
.article-body > div > :first-child {
  margin-top: 0;
}

.article-body h1 {
  font-size: 36px;
}

.article-body .article-highlight,
.article-body .article-tip {
  margin: 22px 0;
  padding: 20px;
  border-left: 3px solid var(--primary);
  background: var(--soft);
}

.article-body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 14px;
}

.article-body td,
.article-body th {
  padding: 11px;
  border: 1px solid var(--line);
  text-align: left;
}

.article-body th {
  background: var(--soft);
}

.article-author {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.article-author p {
  font-size: 13px;
}

/* Parent enquiry forms */

.form-layout {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  align-items: start;
  gap: 52px;
}

.form-aside h2 {
  margin-bottom: 20px;
  font-size: 33px;
}

.form-aside .price {
  color: var(--primary);
  font-size: 45px;
}

.form-aside .price small {
  color: var(--muted);
}

.lead-form {
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  background: var(--surface);
}

.lead-form h2 {
  margin-bottom: 12px;
  font-size: 29px;
}

.lead-form > p {
  margin-bottom: 24px;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px 17px;
}

.field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--muted);
}

.field textarea {
  min-height: 108px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}

.full-width {
  grid-column: 1 / -1;
}

.lead-form fieldset {
  min-width: 0;
  margin: 23px 0;
  padding: 0;
  border: 0;
}

.lead-form legend {
  margin-bottom: 12px;
  padding: 0;
  font-size: 12px;
  font-weight: 650;
}

.checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.checkboxes label {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  font-size: 12px;
  cursor: pointer;
}

.lead-form input[type="checkbox"],
.quiz-option input[type="radio"] {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 21px 0;
  font-size: 12px;
  line-height: 1.75;
}

.consent input {
  margin-top: 4px !important;
}

.consent a {
  color: var(--primary);
  text-decoration: underline;
}

.lead-form button[type="submit"] {
  width: 100%;
}

.form-status {
  margin-top: 18px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.form-status:empty {
  display: none;
}

.form-status[data-state="success"] {
  padding: 14px;
  border-left: 3px solid var(--success);
  background: var(--soft);
}

.form-status[data-state="error"] {
  padding: 14px;
  border-left: 3px solid var(--danger);
  background: var(--soft);
}

.fallback-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 17px;
  font-size: 12px;
}

.fallback-links a {
  padding-block: 6px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
}

.honey {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* PDFs, chapter lists and practice quizzes */

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.resource-card {
  min-width: 0;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.resource-card h3 {
  margin: 13px 0;
  font-size: 19px;
}

.resource-card p {
  margin-bottom: 17px;
  font-size: 13px;
}

.resource-controls {
  display: flex;
  max-width: 650px;
  gap: 20px;
  margin-bottom: 24px;
}

.resource-controls label {
  flex: 1;
}

.resource-chapter-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.resource-chapter-list li + li {
  margin-top: 10px;
}

.resource-chapter {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.resource-chapter:hover {
  border-color: var(--muted);
  background: var(--soft);
}

.resource-chapter[aria-pressed="true"] {
  border-color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
  background: var(--soft);
}

.resource-chapter span {
  display: block;
  font-size: 15px;
  font-weight: 650;
}

.resource-chapter small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

:is(.resource-detail, #resource-detail) {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

:is(.resource-detail, #resource-detail) h2 {
  margin: 22px 0;
  font-size: 30px;
}

:is(.resource-detail, #resource-detail) h3 {
  margin: 24px 0 12px;
}

:is(.resource-detail, #resource-detail) p,
.resource-empty {
  margin: 15px 0;
  font-size: 14px;
}

.quiz-question {
  min-width: 0;
  margin: 23px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.quiz-question legend {
  max-width: 100%;
  padding: 0 7px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.6;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  margin-top: 9px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--bg);
  font-size: 14px;
  cursor: pointer;
}

.quiz-option input {
  margin-top: 3px !important;
}

.quiz-option:has(input:checked) {
  border-color: var(--primary);
}

.quiz-feedback {
  padding-top: 12px;
  font-size: 14px;
  font-weight: 600;
}

.quiz-feedback.is-correct {
  color: var(--success);
}

.quiz-feedback.is-incorrect {
  color: var(--danger);
}

.quiz-result {
  margin: 20px 0;
  padding: 17px 20px;
  border-left: 3px solid var(--primary);
  background: var(--soft);
  font-size: 14px;
  font-weight: 600;
}

.quiz-result:empty {
  display: none;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* Footer and persistent mobile enquiry link */

.site-footer {
  padding: 50px 0 25px;
  border-top: 4px solid #b42338;
  background: #14283f;
  color: #ffffff;
}

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

.site-footer .brand small,
.site-footer p,
.footer-bottom {
  color: #c2cfde;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer .text-link {
  color: #ffffff;
  text-decoration-color: #61748a;
}

.footer-grid h3 {
  margin-bottom: 17px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
}

.footer-grid p {
  margin: 17px 0;
  font-size: 13px;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.footer-grid li + li {
  margin-top: 11px;
}

.footer-grid a {
  overflow-wrap: anywhere;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid #40546b;
  font-size: 11px;
  line-height: 1.7;
}

.mobile-bar,
.print-only {
  display: none;
}

/* Tablet widths */

@media (max-width: 1120px) {
  .header-inner {
    gap: 15px;
  }

  .brand strong {
    font-size: 19px;
  }

  .primary-nav {
    gap: 15px;
    font-size: 12px;
  }

  .header-actions {
    gap: 8px;
  }

  .header-actions .btn {
    padding-inline: 12px;
  }

  .theme-toggle {
    padding-inline: 9px;
  }

  .hero {
    gap: 40px;
  }

  .hero-proof {
    gap: 12px;
  }

  .split {
    gap: 40px;
  }

  .footer-grid {
    gap: 25px;
  }
}

@media (max-width: 900px) {
  .container {
    width: calc(100% - 40px);
  }

  .header-inner {
    min-height: 78px;
  }

  .header-actions {
    margin-left: auto;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    font-size: 14px;
  }

  .primary-nav.is-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
  }

  .primary-nav a {
    padding: 6px 10px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 30px;
    padding-block: 42px;
  }

  .hero h1 {
    font-size: 43px;
  }

  .hero-copy > p {
    font-size: 15px;
  }

  .hero-proof {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .hero-proof b {
    display: inline;
    margin-right: 7px;
  }

  .subject-strip .container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 25px;
  }

  .subject-strip p {
    width: 100%;
    text-align: center;
  }

  .section {
    padding-block: 54px;
  }

  .section-head {
    gap: 30px;
  }

  .section-head > p {
    max-width: 310px;
  }

  .grid-3 {
    gap: 15px;
  }

  .subject-card,
  .info-card {
    padding: 22px;
  }

  .subject-card h3 {
    font-size: 19px;
  }

  .split {
    gap: 30px;
  }

  .price-panel {
    gap: 30px;
    padding: 32px;
  }

  .faq {
    gap: 35px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
  }

  .form-layout {
    grid-template-columns: 0.75fr 1.25fr;
    gap: 25px;
  }

  .lead-form {
    padding: 25px;
  }

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

  .article-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Navigation stays available if the shared script cannot run. */

  html:not([data-rvg-ready]) .header-inner {
    flex-wrap: wrap;
    padding-block: 15px;
  }

  html:not([data-rvg-ready]) .primary-nav {
    display: flex;
    position: static;
    order: 3;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
    padding: 5px 0 0;
    border: 0;
  }

  html:not([data-rvg-ready]) .menu-toggle,
  html:not([data-rvg-ready]) .theme-toggle {
    display: none;
  }
}

/* Mobile layouts */

@media (max-width: 680px) {
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  .container {
    width: calc(100% - 36px);
  }

  .announcement {
    padding: 9px 14px;
    font-size: 11px;
  }

  .header-inner {
    min-height: 74px;
    gap: 10px;
  }

  .brand {
    gap: 9px;
  }

  .brand img {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    margin-top: 3px;
    font-size: 8px;
    letter-spacing: 0.025em;
  }

  .header-actions > .btn {
    display: none;
  }

  .header-actions {
    gap: 7px;
  }

  .theme-toggle {
    min-width: 44px;
    padding: 7px;
    font-size: 10px;
  }

  .menu-toggle {
    min-width: 44px;
    padding-inline: 9px;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 34px 0 38px;
  }

  .hero h1 {
    max-width: 580px;
    font-size: clamp(35px, 9.3vw, 48px);
    line-height: 1.1;
  }

  .hero-copy > p {
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.75;
  }

  .hero .eyebrow {
    margin-bottom: 16px;
    font-size: 11px;
  }

  .button-row {
    gap: 10px;
    margin-top: 23px;
  }

  .btn {
    padding: 12px 18px;
    font-size: 13px;
  }

  .hero-proof {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    padding-top: 18px;
  }

  .hero-proof b {
    display: block;
    margin: 0 0 5px;
    font-size: 12px;
  }

  .hero-proof span {
    font-size: 10px;
  }

  .teacher-stage {
    width: 100%;
    max-width: 440px;
    margin-inline: auto;
  }

  .teacher-stage img {
    aspect-ratio: 1.12 / 1;
  }

  .teacher-stage .live-pill {
    padding: 10px 16px;
  }

  .teacher-caption {
    padding: 16px;
  }

  .teacher-caption strong {
    font-size: 18px;
  }

  .subject-strip {
    padding-block: 18px;
  }

  .subject-strip .container {
    gap: 9px 18px;
  }

  .subject-strip span {
    font-size: 13px;
  }

  .section {
    padding-block: 43px;
  }

  .section-head {
    display: block;
    margin-bottom: 25px;
  }

  .section-head > p {
    max-width: none;
    margin-top: 17px;
    font-size: 14px;
  }

  .eyebrow {
    font-size: 11px;
  }

  .grid-3,
  .split,
  .steps,
  .faq,
  .form-layout {
    grid-template-columns: 1fr;
    gap: 23px;
  }

  .subject-card,
  .info-card {
    padding: 25px;
  }

  .subject-icon {
    margin-bottom: 15px;
  }

  .subject-card h3 {
    font-size: 21px;
  }

  .subject-card p {
    font-size: 14px;
  }

  .split {
    gap: 28px;
  }

  .board-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
    padding: 19px 21px;
  }

  .lesson-row {
    margin-inline: 21px;
    padding-block: 20px;
  }

  .price-panel {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 27px;
  }

  .price-panel h2 {
    font-size: 29px;
  }

  .price-panel .eyebrow {
    font-size: 10px;
  }

  .price {
    font-size: 46px;
  }

  .price-panel .btn {
    width: 100%;
  }

  .teacher-section img {
    max-height: 370px;
  }

  .steps {
    gap: 26px;
    margin-top: 28px;
  }

  .step {
    padding-top: 17px;
  }

  .step h3 {
    margin-top: 9px;
  }

  .faq {
    gap: 24px;
  }

  .faq summary {
    font-size: 14px;
  }

  .cta-panel {
    padding: 27px 23px;
  }

  .cta-panel h2 {
    font-size: 29px;
  }

  .cta-panel p {
    font-size: 14px;
  }

  .page-hero {
    padding: 32px 0 30px;
  }

  .page-hero h1 {
    font-size: clamp(32px, 8.6vw, 42px);
  }

  .page-hero p {
    margin-top: 19px;
    font-size: 15px;
  }

  .breadcrumbs {
    margin-bottom: 21px;
    font-size: 11px;
  }

  .page-content {
    padding-bottom: 43px;
  }

  .prose h2 {
    font-size: 26px;
  }

  .prose p,
  .prose li {
    font-size: 15px;
  }

  .notice {
    padding: 17px 18px;
    font-size: 12px;
  }

  .lead-form {
    padding: 24px 20px;
  }

  .lead-form h2 {
    font-size: 27px;
  }

  .form-aside h2 {
    font-size: 29px;
  }

  .form-grid {
    gap: 17px;
  }

  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }

  .resource-grid,
  .article-grid,
  .link-list {
    grid-template-columns: 1fr;
  }

  .resource-controls {
    gap: 13px;
  }

  :is(.resource-detail, #resource-detail) {
    padding: 20px;
  }

  .resource-chapter {
    padding: 15px 17px;
  }

  .quiz-question {
    padding: 15px;
  }

  .quiz-question legend {
    font-size: 14px;
  }

  .quiz-option {
    padding: 11px 9px;
    font-size: 13px;
  }

  .article-card {
    padding: 24px;
  }

  .article-body {
    padding: 25px 20px;
  }

  .site-footer {
    padding-top: 37px;
  }

  .footer-grid {
    gap: 29px 21px;
  }

  .footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    margin-top: 29px;
  }

  .mobile-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px max(12px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .mobile-bar > span {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.5;
  }

  .mobile-bar b {
    display: block;
    color: var(--ink);
    font-size: 15px;
  }

  .mobile-bar .btn {
    min-height: 44px;
    padding: 11px 17px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .container {
    width: calc(100% - 28px);
  }

  .brand strong {
    font-size: 16px;
  }

  .brand img {
    width: 32px;
    height: 32px;
  }

  .brand small {
    font-size: 7px;
  }

  .header-actions {
    gap: 5px;
  }

  .theme-toggle {
    padding-inline: 5px;
  }

  .hero-proof {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .hero-proof b {
    display: inline;
    margin-right: 7px;
  }

  .hero-proof span {
    font-size: 11px;
  }

  .hero .button-row > .btn {
    width: 100%;
  }

  .mobile-bar {
    padding-inline: 14px;
  }

  .mobile-bar .btn {
    padding-inline: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .btn,
  .badge,
  .theme-toggle,
  .menu-toggle,
  .quiz-option {
    border: 1px solid ButtonText;
  }

  .resource-chapter[aria-pressed="true"] {
    outline: 2px solid Highlight;
  }
}

@media print {
  :root,
  :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --soft: #f3f3f3;
    --ink: #000000;
    --muted: #333333;
    --line: #bbbbbb;
    --primary: #000000;
  }

  body {
    padding-bottom: 0;
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
  }

  .container {
    width: 100%;
  }

  .announcement,
  .site-header,
  .site-footer,
  .mobile-bar,
  .theme-toggle,
  .button-row,
  .skip-link,
  .teacher-stage,
  .fallback-links,
  .lead-form button {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .hero,
  .split,
  .faq,
  .form-layout {
    display: block;
  }

  .hero,
  .section,
  .page-hero {
    padding-block: 20px;
  }

  .price-panel {
    display: block;
    border: 1px solid #999999;
    background: #ffffff;
    color: #000000;
  }

  .price-panel h2,
  .price-panel p,
  .price-panel .eyebrow,
  .price-panel ul {
    color: #000000;
  }

  .price-panel .btn {
    display: none;
  }

  .subject-card,
  .info-card,
  .resource-card {
    break-inside: avoid;
  }

  .article-body {
    padding: 0;
    border: 0;
  }

  a {
    color: #000000;
  }
}