/* ===============================
   - Mi Tutor Latino Landing Page Styles
   - Mobile-first, responsive, and accessible
   - Theme: Yellow (#FFD54F) + Purple (#6A1B9A)
   - Generous comments for clarity and customization
   =============================== */

/* Root theme variables (customize as needed) */
:root {
  /* Brand colors */
  --color-purple: #6A1B9A; /* Primary purple */
  --color-yellow: #FFD54F; /* Primary yellow */

  /* Text colors chosen for accessible contrast on brand colors */
  --color-text: #1a1a1a; /* Default body text on light background */
  --color-text-on-purple: #ffffff; /* White text on purple (AA+) */
  --color-text-on-yellow: #6A1B9A; /* Purple text on yellow (AA+) */

  /* Backgrounds */
  --color-bg: #ffffff;
  --color-surface: #f7f4fa; /* subtle surface tint using purple hue */
  --color-surface-strong: #efe8f6; /* slightly stronger surface */

  /* Borders and outlines */
  --color-border: #d9cbe8; /* light purple-tinted border */

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Sizing */
  --content-max-width: 72rem; /* ~1152px */
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 16px rgba(0,0,0,0.12);

  /* Header: fixed height for layout offset */
  --header-height: 64px; /* mobile baseline */
}

/* Respect user motion preferences: reduce non-essential motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* CSS reset (minimal) and base element styles */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html:focus-within {
  scroll-behavior: smooth; /* smooth scrolling for anchor navigation */
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  text-rendering: optimizeLegibility;
}

/* Reusable container to constrain content width */
.container {
  width: min(var(--content-max-width), 100% - var(--space-6));
  margin-inline: auto;
}

/* Skip link — visible when focused */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-120%);
  background: var(--color-yellow);
  color: var(--color-text-on-yellow);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
}
.skip-link:focus {
  transform: translateY(0);
  outline: 2px dashed var(--color-purple);
  outline-offset: 4px;
}

/* Focus styles for interactive elements */
a, button, input, textarea, select {
  outline-offset: 3px;
}
:focus-visible {
  outline: 3px solid var(--color-yellow);
}

/* Utility: visually hidden (for accessible labels) */
.sr-only {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
/* Utility: muted text */
.u-muted { color: #4a3a5c; }

/* ===============================
   Header (Sticky Top Bar)
   =============================== */
.site-header {
  position: fixed; /* sticky header via fixed positioning */
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-purple);
  color: var(--color-text-on-purple);
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Brand link */
.brand {
  color: var(--color-text-on-purple);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.4px;
  font-size: 1.125rem;
}

/* Navigation */
.primary-nav {
  /* Mobile: nav is hidden by default and revealed via JS toggle */
  position: absolute;
  left: 0;
  right: 0;
  top: var(--header-height); /* drop below header */
  background: var(--color-purple);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms step-end;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* When header has data attribute set by JS, reveal the menu */
.site-header[data-menu-open="true"] .primary-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-list {
  list-style: none;
  padding: var(--space-3) var(--space-4);
  margin: 0;
  display: grid;
  gap: var(--space-2);
}

.nav-list a {
  color: var(--color-text-on-purple);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.nav-list a:hover {
  background: rgba(255, 213, 79, 0.15); /* subtle yellow hover on purple */
}
.nav-list a:focus-visible {
  background: rgba(255, 213, 79, 0.2);
}

/* Mobile menu toggle button */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-on-purple);
  cursor: pointer;
  font-weight: 600;
}
.menu-toggle:hover {
  border-color: rgba(255,255,255,0.35);
}
.menu-toggle__icon {
  font-size: 1.25rem; /* simple hamburger icon character */
}

/* Larger screens: show nav inline and hide the toggle */
@media (min-width: 768px) {
  :root { --header-height: 72px; } /* roomier header on larger screens */

  .primary-nav {
    position: static;
    background: transparent;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
  }

  .nav-list {
    display: flex;
    gap: var(--space-4);
    padding: 0;
  }

  .nav-list a {
    padding: var(--space-2) var(--space-2);
  }
  .nav-list a:hover {
    background: rgba(255,255,255,0.15);
  }

  .menu-toggle {
    display: none;
  }
}

/* Offset the fixed header so content isn't hidden underneath it */
main {
  padding-top: var(--header-height);
}

/* Ensure anchor targets aren't hidden by the fixed header when scrolled to */
section {
  scroll-margin-top: calc(var(--header-height) + 16px);
}

/* ===============================
   Sections and Layout
   =============================== */
.section {
  padding-block: var(--space-7);
}
.section__header {
  margin-bottom: var(--space-5);
}
.section__title {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.75rem;
}
.section__intro {
  margin: 0;
  color: #3b2a4b; /* readable on light surface */
}

/* ===============================
   Hero
   =============================== */
.hero {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-bg) 100%);
}
.hero__inner {
  display: grid;
  gap: var(--space-5);
  text-align: left;
  min-height: 60vh; /* satisfying hero height */
  align-content: center;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin: 0;
}
.hero__subtitle {
  margin: 0;
  max-width: 65ch;
  color: #46335a;
}
.hero__cta {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ===============================
   Feature Grid
   =============================== */
.feature-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.feature-card__title {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.25rem;
}
.feature-card__body {
  margin: 0;
  color: #4a3a5c;
}

@media (min-width: 640px) {
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===============================
   Pricing
   =============================== */
.pricing {
  background: var(--color-surface);
}
.pricing-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.pricing-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: var(--space-4);
}
.pricing-card--featured {
  border-color: var(--color-yellow);
  box-shadow: var(--shadow-md);
}
.pricing-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.pricing-card__title {
  margin: 0;
  font-size: 1.25rem;
}
.pricing-card__price {
  margin: 0;
  font-weight: 800;
  color: var(--color-purple);
  font-size: 1.5rem;
}
.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-2);
}
@media (min-width: 720px) {
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===============================
   About
   =============================== */
.about__text {
  margin: 0;
  max-width: 70ch;
}

/* ===============================
   Contact Form
   =============================== */
.contact {
  background: var(--color-surface);
}
.contact-form {
  display: grid;
  gap: var(--space-4);
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.form-field {
  display: grid;
  gap: var(--space-2);
}
label {
  font-weight: 600;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font: inherit;
  background-color: #fff;
  color: var(--color-text);
}
input::placeholder,
textarea::placeholder {
  color: #7b6a8c;
}
input:focus-visible,
textarea:focus-visible {
  border-color: var(--color-purple);
  outline: 3px solid var(--color-yellow);
  outline-offset: 2px;
}
.form-feedback {
  min-height: 1rem; /* reserve space so layout doesn't shift */
  margin: 0;
  color: var(--color-purple);
}

/* ===============================
   Buttons
   =============================== */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75rem 1.125rem;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease, color 120ms ease, filter 120ms ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--color-yellow);
  color: var(--color-text-on-yellow);
  border-color: var(--color-yellow);
  box-shadow: 0 6px 14px rgba(255, 213, 79, 0.35);
}
.btn--primary:hover {
  filter: brightness(0.97);
}
.btn--ghost {
  background: transparent;
  color: var(--color-purple);
  border-color: var(--color-purple);
}
.btn--ghost:hover {
  background: rgba(106, 27, 154, 0.08);
}

/* ===============================
   Footer
   =============================== */
.site-footer {
  background: var(--color-purple);
  color: var(--color-text-on-purple);
  padding: var(--space-6) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: var(--space-3);
}
.footer-nav__list a {
  color: var(--color-text-on-purple);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}
.footer-nav__list a:hover {
  background: rgba(255,255,255,0.15);
}

/* ===============================
   Accessibility: color contrast note
   - Purple (#6A1B9A) on white and white on purple meet AA+
   - Purple on yellow (#FFD54F) meets AA for normal text
   - Avoid white text directly on yellow to preserve contrast
   =============================== */