/* =========================================================
   The Mental Gain – homepage pilot
   Plain CSS, no build step.
   ========================================================= */

/* ---------- Design tokens (taken from the live site) ---------- */
:root {
  --contrast:   #353a3d;   /* body text */
  --contrast-2: #666666;
  --contrast-3: #3a606e;   /* headings, dark teal */
  --base:       #f5f3f2;   /* header background */
  --base-3:     #ffffff;
  --accent:     #db7965;   /* coral */
  --accent-2:   #667780;   /* nav links */
  --blue:       #097baa;   /* form button */
  --footer-bg:  #65bedb;

  --font-body:    "Lato", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Lora", Georgia, "Times New Roman", serif;

  --container: 1200px;
}

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

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--contrast);
  background: var(--base-3);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 400;
  margin: 0;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--contrast-3); color: #fff; padding: 10px 16px; border-radius: 2px;
}
.skip-link:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { background: var(--base); position: relative; z-index: 20; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 10px;
}

.site-logo img { width: 280px; }

.primary-nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; }

.primary-nav a {
  display: block;
  padding: 0 20px;
  line-height: 38px;
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-2);
  transition: color .2s ease;
}
.primary-nav a:hover,
.primary-nav a[aria-current="page"] { color: var(--contrast-3); }

/* mobile toggle (hidden on desktop) */
.menu-toggle {
  display: none;
  background: none; border: 0; padding: 12px; cursor: pointer; color: var(--contrast-3);
}
.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
  display: block; width: 26px; height: 3px; background: currentColor; border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.menu-toggle-bars { position: relative; }
.menu-toggle-bars::before,
.menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle-bars::before { top: -8px; }
.menu-toggle-bars::after  { top:  8px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::before { transform: translateY(8px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-bars::after  { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1023px) {
  .site-logo img { width: 220px; }
  .menu-toggle { display: block; }

  .primary-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--contrast-3);
    display: none;
  }
  .primary-nav.is-open { display: block; }
  .primary-nav ul { flex-direction: column; padding: 10px 0; }
  .primary-nav a { color: #fff; padding: 6px 30px; line-height: 40px; }
  .primary-nav a:hover,
  .primary-nav a[aria-current="page"] { color: var(--base); background: rgba(255,255,255,.08); }
}

/* ---------- Hero ---------- */
.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 80px;
  align-items: start;
  padding-top: 30px;
  padding-bottom: 70px;
}

.hero-text h1 {
  font-size: 34.2px;   /* was 38px (-10%) */
  line-height: 1.4;
  margin: 0 0 20px;
  padding: 50px 0 0 30px;
  border-left: 1px solid var(--contrast);
}

.hero-text p {
  font-size: 18px;     /* was 20px (-10%) */
  line-height: 1.7;
  color: var(--contrast-3);
  margin: 0 0 30px;
  padding-left: 30px;
}

/* newsletter form */
.newsletter { padding-left: 30px; max-width: 640px; }

.newsletter input[type="email"] {
  display: block;
  width: 100%;
  font: inherit; font-size: 16px;
  padding: 9px;
  color: #000;
  background: #ededed;
  border: 1px solid #777771;
  border-radius: 2px;
}
.newsletter input[type="email"]:focus { border-color: var(--blue); background: #fff; }

.newsletter button {
  margin-top: 12px;
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 10px 20px;
  color: #fff;
  background: var(--blue);
  border: 0; border-radius: 2px;
  cursor: pointer;
  transition: background .2s ease;
}
.newsletter button:hover { background: #07638a; }
.newsletter button[disabled] { opacity: .6; cursor: progress; }

.form-status { margin: 12px 0 0 !important; padding: 0 !important; font-size: 16px !important; min-height: 1.5em; color: var(--contrast) !important; }
.form-status.is-success { color: #1e7b3a !important; }
.form-status.is-error   { color: #b3261e !important; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* photo with "leaf" corners */
.hero-photo img {
  width: 100%;
  border-radius: 80px 4px;
}

@media (max-width: 1023px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 10px; }
  .hero-text h1 { padding-top: 30px; }
  .hero-photo { max-width: 360px; margin-inline: auto; }
}
@media (max-width: 600px) {
  .hero-text h1 { font-size: 28.8px; padding-left: 20px; }   /* was 32px (-10%) */
  .hero-text p, .newsletter { padding-left: 20px; }
  .hero-text p { font-size: 16.2px; }                        /* was 18px (-10%) */
}

/* ---------- Section headings ---------- */
.services h2,
.clients h2 {
  font-size: 28px;
  line-height: 1.4;
  color: var(--contrast-3);
  margin-bottom: 60px;
}

/* ---------- Services ---------- */
.services { padding-block: 40px 70px; }

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 60px 60px;
}
@media (min-width: 700px)  { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .service-grid { grid-template-columns: repeat(4, 1fr); gap: 40px; } }

.service h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  line-height: 1.4;
  color: var(--contrast-3);
  margin-bottom: 20px;
}

.service .icon { flex: 0 0 auto; width: 32px; height: 32px; fill: currentColor; }
.service .icon-stroke { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.service p { margin: 0 0 27px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-2);
  text-decoration: none;
  transition: color .2s ease;
}
.link-arrow svg { width: 1em; height: 1em; transition: transform .2s ease; }
.link-arrow:hover { color: var(--accent); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Proven Success (full-width photo banner) ---------- */
.proven {
  /* photo is 929x586, so at full width it is 63.08vw tall */
  --img-h: 63.08vw;                    /* full height of the photo at screen width */
  --win-h: max(31.54vw, 470px);        /* visible window: 1/2 the photo (min 470px so the text box fits) */
  position: relative;
  width: 100%;
}

.proven-window {
  position: relative;
  width: 100%;
  height: var(--win-h);
  overflow: hidden;
  background: var(--contrast);
}

/* Photo is full-width at its natural height; JS sets --p (0 = top, 1 = bottom)
   as you scroll, which slides the photo up to reveal its lower portion. */
.proven-img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: var(--img-h);
  max-width: none;
  object-fit: cover;
  transform: translate3d(0, calc(var(--p, 0) * (var(--win-h) - var(--img-h))), 0);
  will-change: transform;
}

.proven-title {
  position: absolute;
  top: clamp(16px, 3vw, 40px);
  left: clamp(20px, 4vw, 60px);
  z-index: 2;
  margin: 0;
  font-size: clamp(32px, 3.6vw, 52px);   /* medium-large */
  font-weight: 700;
  line-height: 1.15;
  color: #e00000;                         /* red */
  text-shadow:                            /* yellow-gold outer glow */
    0 0 6px  #ffd700,
    0 0 14px #ffd700,
    0 0 26px #ffc300,
    0 0 42px #ffb400;
}

.proven-box {
  position: absolute;
  right: clamp(20px, 4vw, 60px);
  bottom: calc(clamp(20px, 3vw, 40px) + 50px);   /* raised 50px so it clears "National Champions" */
  z-index: 2;
  width: min(440px, 44%);
  padding: 22px 26px;
  background: #e1e8f0;                                            /* fallback */
  background: linear-gradient(135deg, #e1e8f0 0%, #6f9fd0 100%);  /* light gray-blue -> medium blue, diagonal */
  color: #1f2a33;
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
}
.proven-box p { margin: 0 0 12px; font-size: 15px; line-height: 1.55; }
.proven-box p:last-child { margin-bottom: 0; }

.proven-site { color: blue; text-decoration: underline; }

/* phones/tablets: show the whole photo (no scroll pan), text box underneath */
@media (max-width: 900px) {
  .proven-window { height: auto; }
  .proven-img { position: relative; height: auto; transform: none; will-change: auto; }
  .proven-title { top: 14px; left: 18px; }
  .proven-box {
    position: relative; right: auto; bottom: auto;
    width: auto; margin: -40px 16px 0;
  }
}

/* ---------- Clients ---------- */
.clients { padding-block: 70px 90px; }

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 24px 40px;
  margin-bottom: 24px;
}
.logo-row li { flex: 0 1 auto; }
.logo-row img { width: calc(var(--w, 200px) * .75); max-width: 100%; }  /* 25% smaller */

@media (max-width: 600px) {
  .logo-row img { width: calc(var(--w, 200px) * .75 * .7); }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: #fff;
  padding-block: 80px 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 40px; } }

.footer-cta h2 { font-size: 28px; line-height: 1.4; margin-bottom: 20px; }
.footer-cta p  { font-size: 17px; margin: 0 0 30px; }

.btn-light {
  display: inline-block;
  padding: 10px 20px;
  background: #fff;
  color: var(--accent);
  border-radius: 2px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.btn-light:hover { background: var(--contrast-3); color: #fff; }

.footer-col h4 { font-size: 20px; line-height: 1.4; margin-bottom: 30px; }
.footer-col li { margin-bottom: 5px; }
.footer-col a { font-size: 17px; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; }

.social { display: inline-flex; }
.social svg { width: 30px; height: 30px; }

.copyright { margin: 60px 0 0; font-size: 16px; }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 30px; bottom: 30px; z-index: 30;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--contrast-3); color: #fff;
  border-radius: 3px;
  font-size: 20px;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.back-to-top svg { width: 1em; height: 1em; }
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
