/* ============================================================
   MUSTARD SEED — SHARED STYLESHEET
   Used by both index.html and psle-oral-ai-tutor.html
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,500&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  /* Premium navy + gold academic palette, tying back to the Mustard Seed
     mark (navy book, sage sprout, gold seed). More elevated than a purely
     "tuition centre" look, closer to an academic/professional-services feel. */
  --ink: #16233F;         /* primary text, deep navy */
  --ink-soft: #545E78;    /* secondary text, slate-navy */
  --navy-deep: #0D1730;   /* darkest navy, used for dark sections */
  --gold: #C08A2E;        /* primary accent */
  --gold-deep: #8F6A20;   /* hover / emphasis */
  --gold-pale: #F2E4C4;   /* pale gold for badges/backgrounds */
  --sage: #5B7A4A;        /* secondary accent, callback to the sprout mark */
  --clay: #A34B39;        /* sparing use — alerts, "not included" */
  --bg: #FAF8F3;          /* warm paper background */
  --bg-alt: #F3EFE3;      /* alternating section background */
  --card: #FFFFFF;
  --line: #E4E0D3;
  --line-strong: #D2CBB4;
  --max: 1160px;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
  font-family: 'Newsreader', serif;
  font-weight: 500;
  line-height: 1.15;
  margin: 0;
  color: var(--ink);
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; }
button { font-family: inherit; }

.ms-wrap { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
section { padding: 96px 0; }
.ms-section-tight { padding: 64px 0; }
@media (max-width: 760px) {
  section { padding: 64px 0; }
  .ms-section-tight { padding: 44px 0; }
}

::selection { background: var(--gold); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

.ms-fade-in { animation: msFade .5s ease both; }
@keyframes msFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Scroll reveal ----------
   Elements start faded/lowered, then ease into place once when they
   enter the viewport (see main.js IntersectionObserver). One-time
   reveal, not a re-trigger on every scroll — that reads as premium
   rather than gimmicky. Respects prefers-reduced-motion below. */
.ms-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.ms-reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .ms-reveal { opacity: 1; transform: none; transition: none; }
}

/* Subtle parallax layer, nudged by scroll position via main.js */
.ms-parallax { will-change: transform; transition: transform .05s linear; }
@media (prefers-reduced-motion: reduce) { .ms-parallax { transform: none !important; } }

.ms-alt { background: var(--bg-alt); }
.ms-dark { background: var(--navy-deep); color: #F3EFE3; }
.ms-dark h1, .ms-dark h2, .ms-dark h3, .ms-dark h4 { color: #fff; }
.ms-dark .ms-eyebrow { color: var(--gold); }
.ms-dark p { color: rgba(243,239,227,0.78); }

/* ---------- Eyebrow / section headings ---------- */
.ms-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--gold-deep);
  margin-bottom: 14px;
}
.ms-section-head { max-width: 680px; margin-bottom: 48px; }
.ms-section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.ms-section-head h2 { font-size: clamp(28px, 3.4vw, 40px); }
.ms-section-head p.lede { margin-top: 14px; font-size: 16.5px; color: var(--ink-soft); line-height: 1.6; }

/* ---------- Buttons ---------- */
.ms-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 4px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .1s ease, color .15s ease;
}
.ms-btn:active { transform: translateY(1px); }
.ms-btn-primary { background: var(--ink); color: #fff; }
.ms-btn-primary:hover { background: var(--navy-deep); }
.ms-btn-gold { background: var(--gold); color: var(--navy-deep); }
.ms-btn-gold:hover { background: #D6A64A; }
.ms-btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.ms-btn-ghost:hover { border-color: var(--ink); }
.ms-btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.ms-btn-ghost-light:hover { border-color: #fff; }
.ms-btn-sm { padding: 10px 18px; font-size: 13.5px; }
.ms-btn-block { width: 100%; }

/* ---------- Header / Nav ---------- */
.ms-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,248,243,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .35s ease, box-shadow .35s ease, padding .25s ease;
}
.ms-header.is-scrolled { border-color: var(--line); box-shadow: 0 2px 20px rgba(22,35,63,0.06); }
.ms-nav { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; transition: padding .25s ease; }
.ms-header.is-scrolled .ms-nav { padding: 10px 0; }
.ms-brand { display: flex; align-items: center; gap: 10px; }
.ms-brand img { height: 38px; width: auto; transition: height .25s ease; }
.ms-header.is-scrolled .ms-brand img { height: 32px; }
.ms-brand span { font-family: 'Newsreader', serif; font-size: 16px; color: var(--ink); display: none; }
@media (min-width: 560px) { .ms-brand span { display: inline; } }

.ms-nav-links {
  display: flex; align-items: center; gap: 4px;
}
.ms-nav-links a:not(.ms-nav-cta) {
  padding: 9px 14px; font-size: 14px; color: var(--ink-soft); border-radius: 4px;
  transition: color .15s ease, background .15s ease;
}
.ms-nav-links a:not(.ms-nav-cta):hover { color: var(--ink); background: rgba(22,35,63,0.05); }
.ms-nav-links a.is-active { color: var(--ink); font-weight: 600; }
.ms-nav-cta {
  margin-left: 8px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold); color: var(--navy-deep); padding: 10px 18px; border-radius: 4px;
  font-size: 13.5px; font-weight: 700; white-space: nowrap;
  transition: background .15s ease;
}
.ms-nav-cta:hover { background: #D6A64A; }

.ms-nav-toggle {
  display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px;
}
.ms-nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 1px; transition: transform .2s ease, opacity .2s ease; }
.ms-nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.ms-nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.ms-nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 900px) {
  .ms-nav-toggle { display: flex; position: relative; z-index: 160; }
  .ms-nav-links {
    /* Full-screen overlay (covers the header entirely, at a higher
       z-index) rather than being positioned at a guessed "top: 65px"
       below the header. The old approach broke whenever the header's
       real rendered height didn't match that guess exactly (varies by
       device/font rendering), clipping the first link. This way it
       always starts flush at the top of the viewport, no guessing. */
    position: fixed; inset: 0; z-index: 150;
    background: var(--bg); flex-direction: column; align-items: stretch; gap: 0;
    padding: 90px 24px 32px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ms-nav-links.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .ms-nav-links a:not(.ms-nav-cta) { padding: 16px 4px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 16px; }
  .ms-nav-cta { margin: 16px 0 0; justify-content: center; padding: 14px; }
}

/* ---------- Hero ---------- */
.ms-hero { padding: 84px 0 72px; }
.ms-hero-grid { display: grid; grid-template-columns: 1.05fr 0.85fr; gap: 56px; align-items: center; }
@media (max-width: 900px) { .ms-hero-grid { grid-template-columns: 1fr; } .ms-hero-art { order: -1; max-width: 320px; margin: 0 auto; } }
.ms-hero h1 { font-size: clamp(36px, 5vw, 58px); max-width: 14ch; }
.ms-hero h1 em { font-style: italic; color: var(--gold-deep); }
.ms-hero p.lede { margin-top: 22px; font-size: 18px; color: var(--ink-soft); max-width: 48ch; line-height: 1.6; }
.ms-hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* ---------- Cards ---------- */
.ms-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.ms-grid { display: grid; gap: 20px; }
.ms-grid-2 { grid-template-columns: 1fr 1fr; }
.ms-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ms-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .ms-grid-3, .ms-grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .ms-grid-2, .ms-grid-3, .ms-grid-4 { grid-template-columns: 1fr; } }

.ms-feature-card { padding: 28px 24px; }
.ms-feature-card .ms-icon {
  width: 44px; height: 44px; border-radius: 8px; background: var(--gold-pale);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
  color: var(--gold-deep);
}
.ms-feature-card h3 { font-size: 18px; font-weight: 600; font-family: 'IBM Plex Sans', sans-serif; }
.ms-feature-card p { margin-top: 8px; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }

/* ---------- Stat / trust strip ---------- */
.ms-trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); margin-top: 52px; padding-top: 32px; }
.ms-trust-strip .item { padding: 0 20px; border-left: 1px solid var(--line); }
.ms-trust-strip .item:first-child { border-left: none; padding-left: 0; }
.ms-trust-strip .num { font-family: 'Newsreader', serif; font-size: 27px; display: block; }
.ms-trust-strip .label { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; display: block; line-height: 1.4; }
@media (max-width: 760px) { .ms-trust-strip { grid-template-columns: 1fr 1fr; row-gap: 24px; } .ms-trust-strip .item:nth-child(3) { border-left: none; } }

/* ---------- Numbered steps ---------- */
.ms-steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-strong); }
.ms-step { padding: 28px 24px 0 0; border-left: 1px solid var(--line); }
.ms-step:first-child { border-left: none; padding-left: 0; }
.ms-step .n { font-family: 'Newsreader', serif; font-size: 15px; color: var(--gold-deep); }
.ms-step h3 { margin-top: 14px; font-size: 17.5px; font-weight: 600; font-family: 'IBM Plex Sans', sans-serif; }
.ms-step p { margin-top: 10px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
@media (max-width: 860px) { .ms-steps { grid-template-columns: 1fr 1fr; row-gap: 32px; } .ms-step:nth-child(3) { border-left: none; } }
@media (max-width: 520px) { .ms-steps { grid-template-columns: 1fr; } .ms-step { border-left: none; border-top: 1px solid var(--line); padding: 24px 0 0; } .ms-step:first-child { border-top: none; padding-top: 0; } }

/* ---------- FAQ (native details/summary) ---------- */
.ms-faq-list { border-top: 1px solid var(--line-strong); max-width: 780px; }
.ms-faq-list.wide { max-width: none; }
.ms-faq-list details { border-bottom: 1px solid var(--line); padding: 22px 0; }
.ms-faq-list summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 20px;
  align-items: center; font-size: 16px; font-weight: 500; color: var(--ink);
}
.ms-faq-list summary::-webkit-details-marker { display: none; }
.ms-faq-list summary .plus { font-family: 'Newsreader', serif; font-size: 22px; color: var(--gold-deep); transition: transform .18s ease; flex: none; }
.ms-faq-list details[open] summary .plus { transform: rotate(45deg); }
.ms-faq-list details p { margin-top: 14px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.65; max-width: 68ch; }

/* ---------- Pricing ---------- */
.ms-pricing-card {
  max-width: 460px; margin: 0 auto; background: var(--navy-deep); color: #fff;
  border-radius: 10px; padding: 44px 36px; text-align: center; position: relative; overflow: hidden;
}
.ms-pricing-badge {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  background: var(--gold); color: var(--navy-deep); padding: 6px 14px; border-radius: 999px; margin-bottom: 22px;
}
.ms-price-row { display: flex; align-items: baseline; justify-content: center; gap: 12px; flex-wrap: wrap; }
.ms-price-was { font-family: 'Newsreader', serif; font-size: 20px; color: rgba(255,255,255,0.45); text-decoration: line-through; }
.ms-price-now { font-family: 'Newsreader', serif; font-size: 52px; color: #fff; }
.ms-price-unit { font-size: 14px; color: rgba(255,255,255,0.6); }
.ms-pricing-card ul { text-align: left; margin-top: 30px; }
.ms-pricing-card ul li {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.1);
  font-size: 14.5px; color: rgba(255,255,255,0.88);
}
.ms-pricing-card ul li:last-child { border-bottom: none; }
.ms-pricing-card ul li svg { flex: none; margin-top: 2px; color: var(--gold); }
.ms-pricing-card .ms-btn { width: 100%; margin-top: 28px; }
.ms-pricing-note { margin-top: 16px; font-size: 12.5px; color: rgba(255,255,255,0.55); }
.ms-pricing-card--compact { max-width: none; margin: 0; padding: 34px 32px; text-align: left; }
.ms-pricing-card--compact .ms-pricing-badge { margin-bottom: 16px; }
.ms-pricing-card--compact .ms-price-row { justify-content: flex-start; }
.ms-pricing-card--compact ul { margin-top: 22px; }
.ms-pricing-card--compact ul li { padding: 8px 0; font-size: 13.5px; }

/* ---------- Testimonials ---------- */
.ms-testimonial-row { border-top: 1px solid var(--line-strong); }
.ms-testimonial-row .t {
  padding: 34px 0; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: start;
}
@media (max-width: 700px) { .ms-testimonial-row .t { grid-template-columns: 1fr; } }
.ms-testimonial-row .quote { font-family: 'Newsreader', serif; font-size: 18.5px; line-height: 1.55; font-style: italic; }
.ms-testimonial-row .attr { font-size: 13.5px; color: var(--ink-soft); }
.ms-testimonial-row .attr strong { display: block; color: var(--ink); margin-bottom: 2px; font-style: normal; }
.ms-placeholder-tag { display: inline-block; font-size: 10.5px; letter-spacing: 0.05em; color: var(--clay); border: 1px solid var(--clay); border-radius: 2px; padding: 2px 7px; margin-bottom: 10px; }

/* ---------- Footer ---------- */
.ms-footer { background: var(--navy-deep); color: rgba(243,239,227,0.7); padding: 56px 0 32px; }
.ms-footer a { color: rgba(243,239,227,0.7); }
.ms-footer a:hover { color: #fff; }
.ms-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .ms-footer-grid { grid-template-columns: 1fr 1fr; } }
.ms-footer h4 { color: #fff; font-size: 13px; font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; letter-spacing: 0.03em; margin-bottom: 14px; }
.ms-footer ul li { margin-bottom: 10px; font-size: 14px; }
.ms-footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 44px; padding-top: 24px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 12.5px; }

/* ---------- Misc utility ---------- */
.ms-center { text-align: center; }
.ms-mt-lg { margin-top: 40px; }
.ms-badge-pill {
  display: inline-flex; align-items: center; gap: 8px; background: var(--gold-pale); color: var(--gold-deep);
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.ms-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
@media (max-width: 860px) { .ms-two-col { grid-template-columns: 1fr; gap: 32px; } }
.ms-check-list { list-style: none; }
.ms-check-list li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink-soft); }
.ms-check-list li:first-child { padding-top: 0; }
.ms-check-list li svg { flex: none; margin-top: 3px; color: var(--gold-deep); }
.ms-check-list li strong { color: var(--ink); }

.ms-cta-banner {
  background: var(--navy-deep); border-radius: 12px; padding: 56px 40px; text-align: center; color: #fff;
}
.ms-cta-banner h2 { color: #fff; font-size: clamp(26px, 3vw, 36px); }
.ms-cta-banner p { color: rgba(243,239,227,0.78); margin-top: 12px; font-size: 15.5px; }
.ms-cta-banner .ms-hero-ctas { justify-content: center; margin-top: 26px; }

/* ---------- Big two-stat highlight band ---------- */
.ms-highlight-band { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(255,255,255,0.12); border-radius: 12px; overflow: hidden; }
@media (max-width: 700px) { .ms-highlight-band { grid-template-columns: 1fr; } }
.ms-highlight-band .cell { background: var(--navy-deep); padding: 40px 32px; }
.ms-highlight-band .cell .tag { font-size: 12.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--gold); }
.ms-highlight-band .cell h3 { color: #fff; font-size: clamp(22px, 2.6vw, 28px); margin-top: 10px; }
.ms-highlight-band .cell p { margin-top: 10px; font-size: 14.5px; color: rgba(243,239,227,0.78); line-height: 1.6; }

/* ============================================================
   MOBILE OPTIMIZATIONS
   ============================================================ */

/* Safety net — nothing should ever cause horizontal scroll.
   Applied to body only, not html: overflow-x:hidden on the html element
   itself is known to interfere with position:fixed elements (like the
   mobile nav overlay above) on some mobile browsers. */
body { overflow-x: hidden; }

/* The name/phone fields in the contact form — was a hardcoded 2-column
   inline grid with no mobile override, so it squeezed both inputs into
   cramped half-width columns on narrow phones. Stack them below 480px. */
.ms-form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 480px) { .ms-form-grid-2 { grid-template-columns: 1fr; } }

@media (max-width: 480px) {
  /* iOS Safari auto-zooms into any input/select/textarea with a font-size
     under 16px, which feels broken to users filling in the enquiry form.
     Force 16px minimum on small screens regardless of inline styles. */
  input, select, textarea { font-size: 16px !important; }

  /* Tighten section and component padding further on small phones —
     the 760px breakpoint already reduces section padding, but 320-400px
     phones still benefit from trimming a bit more. */
  section { padding: 48px 0; }
  .ms-hero { padding: 56px 0 48px; }
  .ms-cta-banner { padding: 36px 20px; }
  .ms-highlight-band .cell { padding: 28px 22px; }
  .ms-pricing-card { padding: 32px 22px; }
  .ms-pricing-card--compact { padding: 28px 22px; }
  .ms-price-now { font-size: 42px; }
  .ms-feature-card { padding: 22px 18px; }

  /* Long trust-strip labels (e.g. "PSLE·O-Level·IGCSE") were sized for
     desktop; shrink slightly so they wrap cleanly in narrow columns. */
  .ms-trust-strip .num { font-size: 22px; }
  .ms-trust-strip { row-gap: 20px; }

  /* Full-width primary CTAs stack better and are easier to tap when
     there are two side-by-side buttons on a narrow screen. */
  .ms-hero-ctas { flex-direction: column; align-items: stretch; }
  .ms-hero-ctas .ms-btn { width: 100%; }
}

/* Slightly larger tap targets throughout on touch devices */
@media (hover: none) and (pointer: coarse) {
  .ms-btn { padding: 15px 26px; }
  .ms-nav-links a:not(.ms-nav-cta) { padding: 16px 4px; }
}
