/* =============================================
   MERIDIAN TUTORS — JAPANDI STYLESHEET
   Palette: warm washi, stone, sage, earth ink
   Font: Lato Light + Cormorant Garamond
   ============================================= */

:root {
  --cream:       #F6F2EC;
  --parchment:   #EDE8DF;
  --stone-light: #D9D0C6;
  --stone:       #B8AFA4;
  --taupe:       #9A8E84;
  --earth:       #7A6A5A;
  --sage:        #6E7D67;
  --sage-light:  #C8D4C0;
  --ink:         #2A2420;
  --ink-mid:     #3E3830;
  --ink-light:   #5A5248;
  --text-muted:  #7A7268;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Lato', sans-serif;

  --max-w: 1160px;
  --section-pad: 9rem 0;
  --card-radius: 4px;
  --transition: 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── RESET ──────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── UTILITIES ──────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.desk-br { display: block; }

.section-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 1.25rem;
}

.section-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.section-heading em {
  font-style: italic;
  color: var(--earth);
}

.section-sub {
  margin-top: 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.8;
}

.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

/* ── SCROLL REVEAL ──────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--transition), transform 0.75s var(--transition);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }
.delay-4 { transition-delay: 0.48s; }

/* ── BUTTONS ────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  border-radius: var(--card-radius);
  transition: all 0.35s ease;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--cream);
  border: 1px solid var(--ink);
}
.btn-primary:hover {
  background: var(--ink-mid);
  border-color: var(--ink-mid);
}
.btn-ghost {
  background: transparent;
  color: rgba(246, 242, 236, 0.9);
  border: 1px solid rgba(246, 242, 236, 0.4);
}
.btn-ghost:hover {
  border-color: rgba(246, 242, 236, 0.8);
  color: var(--cream);
}
.btn-full { width: 100%; text-align: center; }

/* ── NAV ────────────────────────────────── */
.nav {
  position: fixed;
  top: 40px; left: 0; right: 0;
  z-index: 100;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  padding: 0 2rem;
}
.nav.scrolled {
  background: rgba(246, 242, 236, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--stone-light);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

/* Logo: icon + wordmark */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  /* White on hero, transitions to ink on scroll */
  color: rgba(246, 242, 236, 0.92);
  transition: color 0.4s ease;
}
.nav.scrolled .nav-logo {
  color: var(--ink);
}
.logo-mark {
  flex-shrink: 0;
  /* Inherits currentColor from .nav-logo */
}

#heroImgOverlay {
  position: absolute;
  inset: 0;
  background: #0a0a0a;   /* match your hero's dark tone */
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  /* White over hero, muted ink after scroll */
  color: rgba(246, 242, 236, 0.75);
  transition: color 0.3s ease;
}
.nav.scrolled .nav-links a {
  color: var(--ink-light);
}
.nav-links a:hover { color: var(--cream); }
.nav.scrolled .nav-links a:hover { color: var(--ink); }

.nav-cta {
  padding: 0.55rem 1.3rem;
  border: 1px solid rgba(246, 242, 236, 0.35);
  border-radius: var(--card-radius);
  transition: border-color 0.3s ease, color 0.3s ease !important;
}
.nav.scrolled .nav-cta {
  border-color: var(--stone);
}
.nav-cta:hover {
  border-color: rgba(246, 242, 236, 0.85) !important;
  color: var(--cream) !important;
}
.nav.scrolled .nav-cta:hover {
  border-color: var(--earth) !important;
  color: var(--earth) !important;
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 1px;
  background: var(--cream);
  transition: all 0.3s ease;
}
.nav.scrolled .nav-toggle span {
  background: var(--ink);
}
.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0;
  background: rgba(246, 242, 236, 0.97);
  padding: 0 2rem 1.5rem;
  border-top: 1px solid var(--stone-light);
}
.nav-mobile a {
  display: block;
  padding: 0.9rem 0;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--ink-light);
  border-bottom: 1px solid var(--parchment);
}
.nav-mobile.open { display: flex; }

/* ── HERO ───────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10rem 2rem 6rem;
  overflow: hidden;
}

/* ─ Hero image layer (parallax + blur-on-scroll) ─ */
.hero-image-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}
.hero-img-inner {
  /*
    Extra height (120%) lets the parallax translateY move
    without exposing a white gap. Centered to start.
  */
  position: absolute;
  top: -10%;
  left: 0;
  right: 0;
  bottom: -10%;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  will-change: transform, filter;
  /* Fallback warm gradient when no image is set */
  background-color: #C8B8A2;
  background-image:
    radial-gradient(ellipse 90% 70% at 50% 20%, rgba(200, 185, 165, 0.6) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 75% 85%, rgba(110, 125, 103, 0.2) 0%, transparent 55%);
}

/* Gradient overlay — keeps text legible over any image */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  /* Translucent at top, nearly opaque at bottom, so text is always readable */
  background: linear-gradient(
    160deg,
    rgba(42, 36, 32, 0.38) 0%,
    rgba(42, 36, 32, 0.52) 45%,
    rgba(246, 242, 236, 0.82) 100%
  );
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 820px;
}
.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-light);
  margin-bottom: 1.8rem;
}
.hero-headline {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 1.8rem;
  text-shadow: 0 2px 24px rgba(42, 36, 32, 0.25);
}
.hero-headline em {
  font-style: italic;
  color: var(--stone-light);
}
.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(237, 232, 223, 0.85);
  line-height: 1.85;
  margin-bottom: 3rem;
  text-shadow: 0 1px 8px rgba(42, 36, 32, 0.2);
}
.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-scroll-hint {
  position: absolute;
  bottom: 3rem;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
}
.hero-scroll-hint span {
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(237, 232, 223, 0.55);
}
.scroll-line {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, rgba(237, 232, 223, 0.5), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: scaleY(1); transform-origin: top; }
}

/* ── ABOUT ──────────────────────────────── */
.about {
  padding: var(--section-pad);
  background: var(--parchment);
}
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 6rem;
  align-items: start;
}
.about-body {
  font-size: 1rem;
  color: var(--ink-light);
  line-height: 1.9;
  margin-bottom: 1.25rem;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--stone-light);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--earth);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.5;
}

/* ── SERVICES ───────────────────────────── */
.services {
  padding: var(--section-pad);
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--stone-light);
  border: 1px solid var(--stone-light);
}
.service-card {
  background: var(--cream);
  padding: 2.5rem 2rem;
  transition: background var(--transition);
}
.service-card:hover {
  background: var(--parchment);
}
.service-icon {
  color: var(--sage);
  margin-bottom: 1.25rem;
  transition: color 0.3s ease;
}
.service-card:hover .service-icon { color: var(--earth); }
.service-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink);
  margin-bottom: 0.75rem;
}
.service-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.service-tag {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--sage);
  border: 1px solid var(--sage-light);
  padding: 0.25rem 0.7rem;
  border-radius: 2px;
}

/* ── TUTORS ─────────────────────────────── */
.tutors {
  padding: var(--section-pad);
  background: var(--parchment);
}
.tutor-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 4rem;
  padding: 4rem 0;
  border-top: 1px solid var(--stone-light);
}
.tutor-card:last-of-type { border-bottom: 1px solid var(--stone-light); }

/* ─ Portrait: image or initials fallback ─ */
.portrait-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--stone-light);
  margin-bottom: 1.5rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.portrait-2 { background: var(--sage-light); }
.portrait-3 { background: #D8CBB8; }
.tutor-card:hover .portrait-wrap { background: var(--stone); }

/* The photo — hidden when src is empty */
.portrait-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: none; /* JS/CSS reveals when src is set */
}
/* Show image when src attribute is non-empty */
.portrait-img[src]:not([src=""]) {
  display: block;
}
/* Hide initials when an image is loaded */
.portrait-img[src]:not([src=""]) ~ .portrait-initials {
  display: none;
}

/* Initials fallback */
.portrait-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--earth);
  letter-spacing: 0.05em;
  pointer-events: none;
}

.tutor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tag {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--taupe);
  border: 1px solid var(--stone-light);
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
}
.tutor-name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--ink);
  margin-bottom: 0.3rem;
}
.tutor-title {
  font-size: 0.8rem;
  color: var(--sage);
  letter-spacing: 0.04em;
  margin-bottom: 1.75rem;
}
.tutor-meta { margin-bottom: 1.25rem; }
.tutor-bio {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.9;
  margin-bottom: 1rem;
}
.tutor-credentials {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 2rem;
  margin: 2rem 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--stone-light);
  border-bottom: 1px solid var(--stone-light);
}
.cred {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.cred-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--stone);
}
.cred span:last-child {
  font-size: 0.85rem;
  color: var(--ink-light);
}
.reviews { margin-top: 2rem; }
.review {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--stone-light);
}
.review:last-child { border-bottom: none; }
.stars {
  color: var(--earth);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.6rem;
}
.review p {
  font-size: 0.9rem;
  color: var(--ink-light);
  line-height: 1.85;
  font-style: italic;
  margin-bottom: 0.5rem;
}
.reviewer {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── TESTIMONIALS BANNER ────────────────── */
.testimonials-banner {
  padding: 6rem 0;
  background: var(--ink);
}
.banner-inner {
  text-align: center;
}
.banner-quote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 300;
  color: var(--parchment);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}
.banner-quote em { color: var(--stone-light); }
.banner-attr {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--taupe);
  text-transform: lowercase;
}

/* ── CONTACT ────────────────────────────── */
.contact {
  padding: var(--section-pad);
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 6rem;
  align-items: start;
}
.contact-body {
  font-size: 0.97rem;
  color: var(--text-muted);
  line-height: 1.85;
  margin-bottom: 2.5rem;
}
.contact-details { display: flex; flex-direction: column; gap: 0.9rem; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-light);
}
.contact-icon {
  color: var(--sage);
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
}
.contact-item a:hover { color: var(--earth); }

/* Form */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--taupe);
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--parchment);
  border: 1px solid var(--stone-light);
  border-radius: var(--card-radius);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--stone); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--earth); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239A8E84' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* ── FOOTER ─────────────────────────────── */
.footer {
  background: var(--ink);
  padding: 4rem 0 2.5rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--ink-mid);
  margin-bottom: 2rem;
}
.footer-logo {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: var(--parchment);
  margin-bottom: 0.75rem;
}
.footer-brand p {
  font-size: 0.82rem;
  color: var(--taupe);
  max-width: 240px;
  line-height: 1.7;
}
.footer-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.footer-links a {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--taupe);
  transition: color 0.3s ease;
}
.footer-links a:hover { color: var(--parchment); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
}
.footer-bottom p {
  font-size: 0.72rem;
  color: var(--ink-light);
}

/* ── RESPONSIVE ─────────────────────────── */
@media (max-width: 900px) {
  :root { --section-pad: 6rem 0; }

  .desk-br { display: none; }
  .nav-links { display: none; }
  .nav-toggle { display: flex; }

  .about-grid { grid-template-columns: 1fr; gap: 3rem; }
  .about-stats { grid-template-columns: repeat(3, 1fr); }

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

  .tutor-card {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .tutor-portrait { display: flex; flex-direction: column; align-items: flex-start; }
  .portrait-wrap { width: 100px; height: 100px; }
  .portrait-initials { font-size: 1.2rem; }

  .tutor-credentials { grid-template-columns: 1fr; }

  .contact-grid { grid-template-columns: 1fr; gap: 3rem; }
  .form-row { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-links { flex-wrap: wrap; gap: 1.25rem; }
  .footer-bottom { flex-direction: column; gap: 0.5rem; }
}

/* Add near the top of your responsive section */
.banner-short { display: none; }

@media (max-width: 600px) {
  .banner-full  { display: none; }
  .banner-short { display: inline; }
  .nav { top: 38px; } /* short single-line banner */
}

@media (max-width: 600px) {
  .services-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .hero-actions {
    flex-direction: column;
    align-items: center;
    margin-bottom: 5rem; /* clearance above scroll hint */
  }
  .hero-actions .btn {
    width: auto;           /* no longer full-width */
    min-width: 200px;      /* consistent but not oversized */
    padding: 0.75rem 1.6rem;
    text-align: center;
  }
}

/* Reduce parallax motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .hero-img-inner { transform: none !important; filter: none !important; }
  .reveal { transition: none; }
  .scroll-line { animation: none; opacity: 0.7; }
}
