/* TakeCare Physio + Ma Pilates website.
   Palette, fonts and corner sizes follow the TakeCare clinic app
   ("Sunny Clinic": deep teal on warm cream, Nunito). Physio pages use the
   teal; Pilates pages switch --brand to the app's coral accent. */
:root {
  --color-primary: #0e7469;
  --color-primary-bright: #16a89a;
  --color-ink: #2a2a33;
  --color-muted: #6a6a76;
  --color-bg: #fdf5ea;
  --color-bg-alt: #f9f1e3;
  --color-border: #efe4d2;
  --color-border-strong: #d9ccb6;
  --color-surface: #fffdf9;
  --color-card: #ffffff;
  --color-success-bg: #e3f4f0;

  --accent-coral: #ef6f56;
  --accent-coral-soft: #ffe9e3;
  --accent-coral-fg: #b93c27;
  --accent-sun: #e0982a;
  --accent-sun-soft: #fcefd6;
  --accent-sky: #3f93b5;
  --accent-sky-soft: #e2f0f7;
  --accent-grape: #8064bd;
  --accent-grape-soft: #ede7f9;
  --accent-meadow: #56a35e;
  --accent-meadow-soft: #e6f3e4;

  /* The service colour for the current page. */
  --brand: var(--color-primary);
  --brand-bright: var(--color-primary-bright);
  --brand-soft: var(--color-success-bg);

  /* Nunito has no Thai letters; Thai falls through to Noto Sans Thai Looped
     (looped Thai letters, easier to read for older patients). */
  --font-ui: "Nunito", "Noto Sans Thai Looped", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(42, 42, 51, 0.08);
  --max: 1120px;
}

/* Ma Pilates colours, taken from its logo (Logo Ma ma Pilates Final CS6):
   terracotta #b9775f on sand #d9cfb4. Text and buttons use a darker
   terracotta so white text on it and it on cream pass WCAG AA. */
.theme-pilates {
  --brand: #94553f;
  --brand-bright: #b9775f;
  --brand-soft: #f1e8dc;
  --accent-sun-soft: #ece4d0;
  --color-bg: #faf6ee;
  --color-surface: #fffcf7;
  --color-border: #ebe1cf;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 800; }

/* Thai tone marks and vowels sit above and below the line: give them room. */
:lang(th) body { line-height: 1.75; }
:lang(th) h1, :lang(th) h2, :lang(th) h3 { line-height: 1.45; }
:lang(th) h1 { font-size: clamp(2rem, 5.4vw, 3.4rem); }
/* Thai has no spaces between words, and browsers split some words in the
   middle ("พิ|ลาทิส"). .keep holds a heading phrase together (it still
   wraps inside if wider than the screen); .nobr never splits a loanword. */
.keep { display: inline-block; }
.nobr, :lang(th) h1 .tc, :lang(th) h1 .ma { white-space: nowrap; }
h1 { font-size: clamp(2.2rem, 6vw, 3.8rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.lead { font-size: 1.15rem; color: var(--color-muted); max-width: 60ch; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  transition: background 0.25s, box-shadow 0.25s, transform 0.3s ease;
}
/* Phones and small tablets: script.js slides the header away while
   scrolling down and brings it back on any scroll up. */
.site-header.tucked { transform: translateY(-100%); box-shadow: none; }
.site-header.scrolled {
  background: rgba(255, 253, 249, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--color-border);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 80px; }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo img { height: 48px; width: auto; }
.logo-divider { width: 1px; height: 38px; background: var(--color-border-strong); }
.nav { margin-left: auto; display: flex; flex-wrap: nowrap; gap: 6px; }
.nav a {
  text-decoration: none;
  color: var(--color-ink);
  font-weight: 700;
  padding: 8px 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  white-space: nowrap;
}
@media (hover: hover) { .nav a:hover { background: var(--color-card); } }
.nav a[aria-current="page"] { background: var(--brand); color: #fff; }
.nav a.lang { border: 1.5px solid var(--color-border-strong); margin-left: 4px; font-size: 0.9rem; }

/* Full logos are wide: on smaller screens the nav drops below them. */
@media (max-width: 820px) {
  .site-header .wrap { flex-wrap: wrap; justify-content: center; height: auto; padding-block: 6px 4px; row-gap: 2px; }
  .nav { margin-left: 0; }
  .logo img { height: 38px; }
  .logo.pair img { height: 30px; }
  .logo { gap: 10px; }
  .logo-divider { height: 24px; }
}
@media (max-width: 400px) {
  .logo img { height: 34px; }
  .logo.pair img { height: 26px; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 11px; font-size: 0.95rem; }
  .nav a.lang { margin-left: 2px; }
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  transition: transform 0.15s, box-shadow 0.15s;
}
@media (hover: hover) { .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); } }
.btn.ghost { background: transparent; color: var(--brand); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ── Picture placeholders ────────────────────────────────────────────────
   Every PHOTO SLOT is a .ph div. Replace it with
   <img src="images/<name>.jpg" alt="..."> (keep any parallax data-speed). */
.ph {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: var(--radius-lg);
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, var(--brand-bright), var(--brand));
  color: #fff;
  font-weight: 800;
  text-align: center;
  overflow: hidden;
}
.ph::before {
  content: attr(data-label);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.95rem;
}
.ph.sun { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, #f3b85a, var(--accent-sun)); }
.ph.sky { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, #7cbad3, var(--accent-sky)); }
.ph.grape { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, #a993d8, var(--accent-grape)); }
.ph.teal { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, var(--color-primary-bright), var(--color-primary)); }
.ph.coral { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, #f59a87, var(--accent-coral)); }
/* Ma Pilates logo colours. */
.ph.terra { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(135deg, #cf9a85, #b9775f); }
.ph.sand { background: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 14px, transparent 14px 28px), linear-gradient(135deg, #e6dec7, #c9bc98); }

/* ── Parallax ────────────────────────────────────────────────────────────
   script.js moves every [data-speed] element by scroll × speed. Layers are
   oversized so their edges never show while they move. */
[data-speed] { will-change: transform; }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: -15% 0; z-index: -2; }
.hero-bg.ph { border-radius: 0; min-height: 0; opacity: 0.16; }
.hero-bg.ph::before { display: none; }
.blob {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.55;
}
.blob.b1 { width: 380px; height: 380px; background: var(--brand-soft); top: 8%; right: -80px; }
.blob.b2 { width: 220px; height: 220px; background: var(--accent-sun-soft); bottom: 6%; left: -60px; }
.blob.b3 { width: 120px; height: 120px; background: var(--accent-sky-soft); top: 22%; left: 42%; }
.blob.b4 { width: 70px; height: 70px; background: var(--brand-bright); opacity: 0.25; bottom: 22%; right: 18%; }

.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
.hero-art { position: relative; height: 460px; }
.hero-art .ph { position: absolute; box-shadow: var(--shadow); }
.hero-art .main { inset: 0 15% 12% 0; }
.hero-art .float { width: 46%; height: 42%; right: 0; bottom: 0; min-height: 0; border: 6px solid var(--color-surface); }
.hero-art .mascot { position: absolute; width: 150px; left: -40px; bottom: -20px; filter: drop-shadow(0 10px 18px rgba(42,42,51,.18)); }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { height: 320px; }
  .hero-art .mascot { width: 90px; left: 0; }
}

/* Landing split: one tall panel per service. */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 40px; }
.service-card {
  position: relative;
  min-height: 460px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display: flex;
  align-items: flex-end;
  isolation: isolate;
  box-shadow: var(--shadow);
}
.service-card .ph { position: absolute; inset: -25% 0; z-index: -2; border-radius: 0; }
.service-card .ph::before { position: absolute; top: 25%; margin-top: 24px; }
.service-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(20, 20, 26, 0.7), transparent 60%);
}
.service-card .body { padding: 28px; }
.service-card h3 { font-size: 1.8rem; margin-bottom: 6px; }
.service-card p { opacity: 0.92; margin-bottom: 14px; }
.service-card .go { font-weight: 800; display: inline-flex; gap: 6px; transition: gap 0.2s; }
@media (hover: hover) { .service-card:hover .go { gap: 12px; } }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .service-card { min-height: 380px; } }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { padding: 96px 0; position: relative; }
.alt { background: var(--color-surface); border-block: 1px solid var(--color-border); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

.cards { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 2px 0 var(--color-border);
}
.card .icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  display: grid; place-items: center;
  font-size: 1.6rem;
  background: var(--brand-soft);
  margin-bottom: 16px;
}
.card p { color: var(--color-muted); margin: 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.two-col.flip > :first-child { order: 2; }
.two-col .ph { min-height: 380px; }
@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
  .two-col.flip > :first-child { order: 0; }
}

.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding-left: 34px; position: relative; margin-bottom: 12px; }
.checks li::before {
  content: "✓";
  position: absolute; left: 0; top: 1px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}

/* Full-width picture band that scrolls slower than the page. */
.band { position: relative; height: 440px; overflow: hidden; padding: 0; display: grid; place-items: center; isolation: isolate; }
.band .ph { position: absolute; inset: -45% 0; border-radius: 0; z-index: -1; }
.band .ph::before { display: none; }
.band blockquote {
  margin: 0 20px;
  max-width: 720px;
  background: rgba(255, 253, 249, 0.94);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
}
.band cite { display: block; margin-top: 10px; font-size: 0.95rem; font-style: normal; color: var(--color-muted); font-weight: 600; }

/* Steps */
.steps { counter-reset: step; display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.step { counter-increment: step; }
.step::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800;
  margin-bottom: 14px;
}

/* Price / class list */
.price-list { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.price { text-align: center; }
.price .amount { font-size: 2.2rem; font-weight: 800; color: var(--brand); margin: 6px 0; }
.price.featured { border: 2px solid var(--brand); }
@media (min-width: 760px) { .price.featured.in { transform: translateY(-8px); } }

/* Gallery of placeholders at mixed depths */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 40px; }
.gallery .ph { min-height: 260px; }
.gallery .ph:nth-child(2) { margin-top: 60px; }
@media (max-width: 760px) { .gallery { grid-template-columns: 1fr 1fr; } .gallery .ph:nth-child(2) { margin-top: 0; } }

@media (min-width: 560px) { .cards, .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 680px) { .price-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cards, .steps { grid-template-columns: repeat(4, 1fr); } }

/* Phones: feature and step cards put the icon or number beside the text,
   so four cards take about half the height. */
@media (max-width: 559px) {
  .cards .card, .steps .step {
    display: grid; grid-template-columns: 48px 1fr; column-gap: 16px;
    align-items: start; text-align: left; padding: 20px;
  }
  .cards .card .icon, .steps .step::before { grid-row: span 2; margin-bottom: 0; }
  .cards .card .icon { width: 48px; height: 48px; font-size: 1.4rem; }
  .cards .card h3, .steps .step h3 { margin-bottom: 2px; }
}

/* Team */
.team { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 40px; }
.member .avatar { width: 140px; height: 140px; min-height: 0; border-radius: 50%; margin: 0 auto 18px; border: 5px solid var(--color-surface); box-shadow: var(--shadow); }
.member .avatar::before { font-size: 0.8rem; }
.member h3 { margin-bottom: 4px; }
.member .role { color: var(--brand); font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; }
@media (min-width: 680px) { .team { grid-template-columns: repeat(3, 1fr); } }

/* Call to action */
.cta {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.cta .lead { color: rgba(255, 255, 255, 0.9); margin-inline: auto; }
.cta .btn { background: #fff; color: var(--brand); border-color: #fff; }
.cta .btn.ghost { background: transparent; color: #fff; }
.cta .blob { opacity: 0.18; background: #fff; }

/* Contact / map */
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; margin-top: 40px; }
.contact-grid .ph { min-height: 320px; }
.contact-grid dl { margin: 0; }
.contact-grid dt { font-weight: 800; margin-top: 14px; }
.contact-grid dd { margin: 0; color: var(--color-muted); }
@media (max-width: 760px) { .contact-grid { grid-template-columns: 1fr; } }

/* ── Mascot GIFs outside the hero ────────────────────────────────────────── */
.peek-wrap { position: relative; }
.peek { position: absolute; width: 110px; top: -78px; right: 18px; pointer-events: none; }
.cta-mascot { position: absolute; width: 140px; right: 28px; bottom: 0; }
@media (max-width: 760px) {
  .cta-mascot { position: static; display: block; width: 100px; margin: -24px auto 8px; }
}

/* ── Home page: TakeCare teal mixed with Ma Pilates terracotta ───────────── */
.theme-mix {
  --color-bg: #fcf5ec;
  --mix: linear-gradient(120deg, var(--color-primary), #94553f);
  --mix-soft: linear-gradient(120deg, var(--color-success-bg), #f1e8dc);
}
.theme-mix .nav a[aria-current="page"] { background: var(--mix); }
.theme-mix .eyebrow { background: var(--mix-soft); color: var(--color-ink); }
.theme-mix .tc { color: var(--color-primary); }
.theme-mix .ma { color: #94553f; }
.theme-mix .blob.b2 { background: #f1e8dc; }
.theme-mix .blob.b3 { background: #ece4d0; }
.theme-mix .blob.b4 { background: #b9775f; }
.theme-mix .card:nth-child(even) .icon { background: #f1e8dc; }
.theme-mix .card:nth-child(3) .icon { background: var(--mix-soft); }
.theme-mix .card h3 { color: var(--color-ink); }
.ph.mix { background: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px), linear-gradient(120deg, var(--color-primary-bright), #b9775f); }
.theme-mix .site-header::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--mix); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer { padding: 40px 0; border-top: 1px solid var(--color-border); color: var(--color-muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.site-footer a { color: var(--color-muted); display: inline-block; padding: 12px 8px; margin-left: 8px; }

/* ── Reveal on scroll ────────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header { transition: background 0.25s, box-shadow 0.25s; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .service-card .go { transition: none; }
}
