/* Lightweight template CSS (no frameworks, ~6–8KB) */
:root {
  --primary: #ec4f4f;
  --secondary: #332859;
  --bg: #ffffff;
  --surface: #f6f7f9;
  --text: #1f2937;
  --muted: #6b7280;
  --ring: #94a3b8;
  --radius: 12px;
  --container: 1100px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}
html {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
    Noto Sans, Arial, Apple Color Emoji, Segoe UI Emoji;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button {
  font: inherit;
}
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}
.section {
  padding: 3.5rem 0;
}
.section--muted {
  background: var(--surface);
}
.hidden {
  display: none !important;
}

/* Header / Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid #e5e7eb;
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #f59f9f);
}
.brand__text {
  color: var(--secondary);
}
.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav a {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.nav a[aria-current="page"] {
  background: rgba(236, 79, 79, 0.08);
  color: var(--secondary);
  text-underline-offset: 3px;
}
.nav__cta {
  display: inline-block;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: var(--secondary);
  color: #fff;
  box-shadow: var(--shadow);
}
.menu-btn {
  display: none;
  border: 0;
  background: transparent;
  padding: 0.25rem;
  border-radius: 10px;
}
.menu-btn svg {
  width: 28px;
  height: 28px;
}
@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex;
  }
  .nav {
    position: fixed;
    inset: auto 0 0 0;
    top: 56px;
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-10%);
    opacity: 0;
    pointer-events: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    transition: 0.2s ease;
  }
  .nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Hero */
.hero {
  padding: 6rem 0 4rem;
  background: radial-gradient(
      1200px 400px at 10% -10%,
      rgba(236, 79, 79, 0.08),
      transparent 40%
    ),
    radial-gradient(
      1200px 400px at 90% -10%,
      rgba(51, 40, 89, 0.07),
      transparent 40%
    );
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}
.hero h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(1.9rem, 1.1rem + 2vw, 3rem);
  line-height: 1.1;
}
.lead {
  color: #374151;
  font-size: 1.125rem;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
}
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--ghost {
  border-color: #e5e7eb;
  color: var(--secondary);
  background: #fff;
}
.btn + .btn {
  margin-left: 0.5rem;
}
.hero__art {
  aspect-ratio: 4/3;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(236, 79, 79, 0.18),
    rgba(51, 40, 89, 0.12)
  );
  box-shadow: var(--shadow);
}

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

/* Grids */
.grid {
  display: grid;
  gap: 1.25rem;
}
.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 0 1px 0 rgba(10, 10, 10, 0.02);
}
.card--lift:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  transition: 0.2s ease;
}

.kpi {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.kpi__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(236, 79, 79, 0.1);
}

/* People */
.person {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 1rem;
  align-items: center;
}
.person__avatar {
  width: 88px;
  height: 88px;
  border-radius: 14px;
  background: #eee;
  object-fit: cover;
}
.person__meta {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Details / Accordion (for FAQ) */
details {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  background: #fff;
}
details + details {
  margin-top: 0.75rem;
}
details[open] {
  background: #fff;
}
summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
}

summary::-webkit-details-marker {
  display: none;
}
.chev {
  transition: transform 0.2s ease;
}
details[open] .chev {
  transform: rotate(180deg);
}

/* Forms */
.input,
textarea,
select {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
}
.input:focus,
textarea:focus,
select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}
label {
  display: block;
  font-weight: 600;
  margin: 0.75rem 0 0.4rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  border-top: 1px solid #e5e7eb;
  background: #fff;
}
.footer__inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  padding: 2rem 1rem;
}
@media (max-width: 780px) {
  .footer__inner {
    grid-template-columns: 1fr;
  }
}
.footer small {
  color: var(--muted);
}

/* Utilities */
.muted {
  color: var(--muted);
}
.center {
  text-align: center;
}
.pill {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(51, 40, 89, 0.07);
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.8rem;
}
.shadow {
  box-shadow: var(--shadow);
}
.round {
  border-radius: 16px;
}
hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

/* ---- Updates v2 ---- */

/* Solid backgrounds on mobile so nav isn't translucent */
@media (max-width: 860px) {
  .header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
  }
  .nav {
    background: #fff;
  }
}

/* Testimonials */
.testimonials {
  position: relative;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 1rem;
  align-items: stretch;
}
.ts-btn {
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  background: #fff;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  cursor: pointer;
}
.ts-btn:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.ts-track {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  min-height: 200px;
}
.testimonial {
  background: #fff;
  border: 1px solid #eef0f3;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 0 rgba(10, 10, 10, 0.02);
}
.testimonial blockquote {
  margin: 0 0 0.75rem 0;
  font-size: 1.05rem;
}
.testimonial footer {
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.testimonial footer img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.ts-dots {
  display: flex;
  gap: 0.375rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.ts-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #e5e7eb;
  border: 0;
}
.ts-dot[aria-current="true"] {
  background: var(--primary);
}
@media (max-width: 720px) {
  .testimonials {
    grid-template-columns: 40px 1fr 40px;
  }
  .ts-btn {
    width: 40px;
    height: 40px;
  }
}

/* Larger tutor images + actions */
:root {
  --avatar: 140px;
}
.person {
  grid-template-columns: var(--avatar) 1fr;
}
.person__avatar {
  width: var(--avatar);
  height: var(--avatar);
}
.person .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.person .actions .btn {
  padding: 0.55rem 0.8rem;
  border-radius: 10px;
  font-weight: 600;
}
@media (max-width: 520px) {
  :root {
    --avatar: 110px;
  }
}

/* Profile page */
.profile-header {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  align-items: center;
}
.profile-photo {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  object-fit: cover;
  background: #eee;
}
@media (max-width: 640px) {
  .profile-header {
    grid-template-columns: 1fr;
  }
  .profile-photo {
    width: 128px;
    height: 128px;
  }
}
.badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(236, 79, 79, 0.1);
  color: var(--secondary);
  font-weight: 600;
  font-size: 0.8rem;
}
.schedule {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.schedule .slot {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  text-align: center;
}
@media (max-width: 640px) {
  .schedule {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Enhancements: 2025-09-26 === */

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 10000;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Reduced motion safety */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile nav overlay */
@media (max-width: 768px) {
  .menu-btn {
    position: relative;
    z-index: 10001;
  }
  .nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: none;
    overflow: auto;
    padding: 6rem 1.25rem 2rem;
  }
  .nav.is-open {
    display: block;
  }
  body.nav-open {
    overflow: hidden;
  }
  /* Optional: vertical links & larger touch targets */
  .nav a {
    display: block;
    padding: 0.875rem 0;
    font-size: 1.125rem;
  }
}

/* Testimonials: center arrows vertically */
[data-ts] {
  position: relative;
}
[data-ts-prev],
[data-ts-next] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
[data-ts-prev] {
  left: 0.5rem;
}
[data-ts-next] {
  right: 0.5rem;
}

/* Tutors list – mobile polish */
.person {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-areas:
    "avatar title"
    "avatar meta"
    "info info"
    "actions actions";
  gap: 0.75rem 1rem;
  align-items: start;
}
.person__avatar {
  grid-area: avatar;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
}
.person__name {
  grid-area: title;
  margin: 0;
}
.person__meta {
  grid-area: meta;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.person__bio,
.person__desc,
.person__text {
  grid-area: info;
}
.person .actions {
  grid-area: actions;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
@media (min-width: 640px) {
  .person {
    grid-template-columns: 88px 2fr auto;
    grid-template-areas:
      "avatar title actions"
      "avatar meta actions"
      "avatar info actions";
  }
  .person__avatar {
    width: 88px;
    height: 88px;
  }
}

/* Slider dots centered */
[data-ts-dots] {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}
[data-ts-dots] button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
}
[data-ts-dots] button[aria-current="true"] {
  background: var(--primary);
  border-color: var(--primary);
}
/* === Nav overlay (robust) === */
.nav--overlay {
  position: fixed;
  inset: 0; /* full viewport */
  background: var(--bg);
  z-index: 2147483647; /* effectively top */
  display: grid;
  align-content: start;
  overflow: auto;
  padding: 6rem 1.25rem 2rem; /* room for header area */
}

/* big, tap-friendly links within overlay */
.nav--overlay a {
  display: block;
  padding: 0.875rem 0;
  font-size: 1.125rem;
}

/* lock background scroll when menu is open */
body.nav-open {
  overflow: hidden;
}

/* keep the hamburger accessible above the overlay while open */
body.nav-open .menu-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2147483648; /* above overlay */
}

/* (optional) subtle divider effect for overlay list */
.nav--overlay a + a {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* keep previous mobile styles for non-overlay state (small screens) */
@media (max-width: 768px) {
  .menu-btn {
    position: relative;
    z-index: 10001;
  }
}
/* === Testimonials layout fix === */
[data-ts] {
  position: relative;
  display: grid; /* allows centering of a single child easily */
  place-items: center;
}

[data-ts-item] {
  max-width: 66ch; /* comfortable measure for text */
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 1rem 3.5rem; /* space so arrows don’t crowd text */
  box-sizing: border-box;
}

/* Tweak padding on small screens */
@media (max-width: 640px) {
  [data-ts-item] {
    padding: 0.75rem 2.75rem;
  }
}

/* Arrows: keep centered vertically (from previous fix) */
[data-ts-prev],
[data-ts-next] {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
[data-ts-prev] {
  left: 0.5rem;
}
[data-ts-next] {
  right: 0.5rem;
}

/* Dots centered (keep if you use them) */
[data-ts-dots] {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}
[data-ts-dots] button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: 1px solid #d1d5db;
  background: #fff;
}
[data-ts-dots] button[aria-current="true"] {
  background: var(--primary);
  border-color: var(--primary);
}

/* === Theme (Light/Dark) === */
:root[data-theme="dark"] {
  --primary: #ec4f4f;
  --secondary: #7c6de0;
  --bg: #0b1220;
  --surface: #111827;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --ring: #3b82f6;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Background & text helpers inherit from tokens; components already use tokens */

/* Details (accordion) adaptive colors */
:root[data-theme="dark"] details {
  background: var(--surface);
  border-color: #223045;
}

/* Cards adaptive if any hard-coded white slipped through */
:root[data-theme="dark"] .card {
  background: var(--surface);
  color: var(--text);
}

/* === Theme toggle button === */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: calc(1rem + 52px); /* sits left of the close X when open */
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 2147483648;
}
:root[data-theme="dark"] .theme-toggle {
  background: var(--surface);
  border-color: #223045;
}

/* Position when nav is closed (no X), keep some margin from right */
body:not(.nav-open) .theme-toggle {
  right: 1rem;
}

/* Hide any text labels visually but keep accessible, if present */
.theme-toggle .sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Testimonials centering & layout === */
[data-ts] {
  position: relative;
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 0.5rem;
}
@media (max-width: 640px) {
  [data-ts] {
    grid-template-columns: 44px 1fr 44px;
  }
}
/* Place controls and track in columns */
[data-ts] > [data-ts-prev] {
  grid-column: 1;
  justify-self: center;
}
[data-ts] > [data-ts-next] {
  grid-column: 3;
  justify-self: center;
}
/* Ensure buttons are not absolutely positioned */
[data-ts] .ts-btn {
  position: static;
  transform: none;
}

/* Center the track content & keep readable width */
[data-ts] > .ts-track,
[data-ts] > .ts-tracks {
  grid-column: 2;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  justify-items: center;
}
.testimonial {
  max-width: 68ch;
  width: 100%;
  text-align: center;
  padding: 0.5rem 0.5rem;
  box-sizing: border-box;
}
.testimonial blockquote {
  margin: 0;
}
.testimonial footer {
  margin-top: 0.75rem;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
}

/* === Tags list (used for expertise on tutor page) === */
.tags {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Pricing cards */
.price .price__value {
  font-size: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}
.price__list {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
}
.price__list li {
  margin: 0.25rem 0;
}

/* Visible close button for mobile nav overlay */
.nav__close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  z-index: 2147483648;
}
:root[data-theme="dark"] .nav__close {
  background: var(--surface);
  border-color: #223045;
}

/* Hide hamburger while overlay is open (so we only show the X) */
body.nav-open .menu-btn {
  opacity: 0;
  pointer-events: none;
}

.brand__img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
  display: inline-block;
}

/* Ensure hero artwork looks good with an uploaded image */
.hero__art {
  background-size: cover;
  background-position: center;
}
/* === Wordmark / Large Logo support for navbar === */
.brand--image-only { gap: .5rem; }
.brand--image-only .brand__text { display: none !important; }

/* Let the logo scale like a wordmark (keep aspect ratio) */
.brand--image-only .brand__img {
  width: auto !important;       /* override the 36x36 icon size */
  height: 56px;                 /* desktop height */
  border-radius: 0;             /* wordmarks are rarely rounded */
  object-fit: contain;
}

/* Add a bit of breathing room for taller logos */
.header__inner { padding-top: .4rem; padding-bottom: .4rem; }

@media (max-width: 960px) {
  .brand--image-only .brand__img { height: 44px; } /* mobile height */
}

