/* ==========================================================================
   site.css - the one stylesheet for the Mejora Voice marketing website
   (www.mejoravoice.com).

   How it is organised:
     1. Colour and size tokens (light mode, then dark mode)
     2. Base page styles (fonts, links, headings)
     3. Layout helpers (container, sections, grids)
     4. Header and navigation
     5. Buttons and small pieces (chips, eyebrows)
     6. Page sections (hero, steps, feature rows, AI band, FAQ, CTA)
     7. Contact form
     8. Footer
     9. Animations (live call lines) and reduced-motion support

   Design rules come from the Mejora Voice design language: calm pastel
   colours, Space Grotesk headings, Inter body text, no boxed cards with
   shadows. We group things with whitespace, thin "hairline" lines and
   soft tinted bands instead.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens. Change a colour here and it changes everywhere.
   -------------------------------------------------------------------------- */
:root {
  --ground: #F6F4FB;        /* page background (soft lavender white) */
  --surface: #FFFFFF;       /* slightly brighter areas, e.g. form fields */
  --ink: #1F1A3D;           /* main text colour */
  --text-2: #5E5A78;        /* secondary text */
  --hairline: #E6E1F2;      /* thin divider lines */
  --ink-panel: #2A2459;     /* deep ink colour for dark bands */

  /* Pastel pairs: a soft background and a strong text colour that reads on it */
  --lav-bg: #E6E0FF;   --lav-fg: #4B3BB5;
  --mint-bg: #D3F2E4;  --mint-fg: #17784D;
  --peach-bg: #FFE2D4; --peach-fg: #B4471A;
  --sky-bg: #DAEBFF;   --sky-fg: #1F5FA6;
  --butter-bg: #FFF2C2; --butter-fg: #7A5A00;
  --rose-bg: #FFDDE6;  --rose-fg: #A3264B;

  --live: #2FA36B;      /* green "call is live" colour */
  --ringing: #F2B84B;   /* amber "phone is ringing" colour */

  --radius-s: 12px;     /* buttons, inputs */
  --radius-l: 28px;     /* big tinted bands */
  --max: 1160px;        /* widest the content gets */
  --gutter: 20px;       /* space at the left and right edges on phones */

  --font-head: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light;
}

/* Dark mode: used automatically when the visitor's device is set to dark. */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #15122B;
    --surface: #1D1939;
    --ink: #F1EEFF;
    --text-2: #B7B1D6;
    --hairline: #2C2750;
    --ink-panel: #0F0C22;
    /* In dark mode the pastels become the text colour on deep tinted grounds */
    --lav-bg: #262055;   --lav-fg: #C9BEFA;
    --mint-bg: #18352A;  --mint-fg: #9FE0C0;
    --peach-bg: #3A2219; --peach-fg: #FFC6AE;
    --sky-bg: #172C47;   --sky-fg: #A9D0FF;
    --butter-bg: #35300F; --butter-fg: #FFE38A;
    --rose-bg: #3A1726;  --rose-fg: #FFB3C7;
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   2. Base styles
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* never allow sideways scrolling on phones */
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  text-wrap: balance;            /* nicer line breaks in modern browsers */
}
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p  { margin: 0 0 1em; }

a { color: var(--lav-fg); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

img, svg { max-width: 100%; display: block; }

/* A visible focus ring for keyboard users */
:focus-visible { outline: 3px solid var(--lav-fg); outline-offset: 3px; border-radius: 6px; }

/* "Skip to content" link: hidden until a keyboard user tabs to it */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--ground); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

/* Text only screen readers can hear */
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --------------------------------------------------------------------------
   3. Layout helpers
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

section { padding: 88px 0; }
@media (max-width: 720px) { section { padding: 60px 0; } }

/* Small coloured label above a section heading */
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--lav-fg);
  margin-bottom: 14px;
}

.lead { font-size: 1.15rem; color: var(--text-2); max-width: 680px; }
.center { text-align: center; }
.center .lead { margin-left: auto; margin-right: auto; }

/* Grid helpers: columns collapse to one column on phones */
.grid-2, .grid-3, .grid-4 { display: grid; gap: 40px; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; gap: 56px; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* --------------------------------------------------------------------------
   4. Header and navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 72px; }

/* The logo: speech bubble mark + "mejora voice" word */
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand svg { width: 38px; height: 38px; }
.brand span { font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; }
.brand b { color: var(--lav-fg); font-weight: 700; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.97rem;
  padding: 10px 14px; border-radius: 10px;
}
.nav a:hover { background: var(--lav-bg); }
.nav a[aria-current="page"] { color: var(--lav-fg); }
.nav .btn { margin-left: 8px; }

/* The "menu" button that appears on phones */
.menu-btn {
  display: none; margin-left: auto;
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--hairline); background: transparent; color: var(--ink);
  cursor: pointer;
}
.menu-btn svg { margin: auto; }

@media (max-width: 900px) {
  .menu-btn { display: grid; }
  .nav {
    display: none;                               /* hidden until the menu button is pressed */
    position: absolute; left: 0; right: 0; top: 72px;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 12px var(--gutter) 20px;
    background: var(--ground); border-bottom: 1px solid var(--hairline);
  }
  .nav.open { display: flex; }
  .nav a { padding: 14px 8px; border-bottom: 1px solid var(--hairline); border-radius: 0; }
  .nav .btn { margin: 14px 0 0; text-align: center; border-bottom: 0; border-radius: 999px; }
}

/* --------------------------------------------------------------------------
   5. Buttons and chips
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 0;
  font-family: var(--font-head); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink-panel); color: #fff; }
.btn-primary:hover { background: #3B3473; }
@media (prefers-color-scheme: dark) {
  .btn-primary { background: #C9BEFA; color: #15122B; }
  .btn-primary:hover { background: #E6E0FF; }
}
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--hairline); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--lav-fg); }
.nav .btn-primary { min-height: 42px; padding: 0 18px; font-size: 0.95rem; color: #fff; }
@media (prefers-color-scheme: dark) { .nav .btn-primary { color: #15122B; } }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500;
}
.chip-lav { background: var(--lav-bg); color: var(--lav-fg); }
.chip-mint { background: var(--mint-bg); color: var(--mint-fg); }
.chip-peach { background: var(--peach-bg); color: var(--peach-fg); }
.chip-sky { background: var(--sky-bg); color: var(--sky-fg); }
.chip-butter { background: var(--butter-bg); color: var(--butter-fg); }
.chip-rose { background: var(--rose-bg); color: var(--rose-fg); }

/* A small round icon holder used next to feature names */
.ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; flex: none;
}
.ico svg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   6. Page sections
   -------------------------------------------------------------------------- */

/* ---- Hero (the first screen) ---- */
.hero { padding: 72px 0 40px; position: relative; }
.hero .grid-2 { align-items: center; }
.hero h1 span { color: var(--lav-fg); }
.hero .lead { font-size: 1.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--text-2); font-size: 0.95rem; }
.hero-points li { display: flex; align-items: center; gap: 8px; }
.hero-points li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--live); }

/* The live call picture on the right of the hero, sitting on a tinted band */
.hero-art {
  border-radius: var(--radius-l);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--lav-fg) 22%, transparent) 1px, transparent 1.5px) 0 0 / 18px 18px,
    linear-gradient(160deg, var(--lav-bg), var(--sky-bg) 60%, var(--mint-bg));
  padding: 22px;
}
.hero-art svg { width: 100%; height: auto; }

/* Inline page header used on inner pages (Features, AI, Contact) */
.page-head { padding: 72px 0 24px; }
.page-head .lead { font-size: 1.2rem; }

/* ---- A row of short facts under the hero ---- */
.facts { padding: 28px 0 8px; }
.facts ul {
  list-style: none; margin: 0; padding: 22px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}

/* ---- "Who it's for" columns: separated by a coloured top line, not boxes ---- */
.who > div { border-top: 3px solid var(--lav-fg); padding-top: 22px; }
.who > div:nth-child(2) { border-color: var(--live); }
.who > div:nth-child(3) { border-color: var(--peach-fg); }
.who p { color: var(--text-2); }
.who ul { padding-left: 18px; margin: 0; color: var(--text-2); }
.who li { margin-bottom: 4px; }

/* ---- How it works: three numbered steps ---- */
.steps { counter-reset: step; }
.steps > div { position: relative; padding-top: 70px; }
.steps > div::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 1.3rem;
  background: var(--lav-bg); color: var(--lav-fg);
}
.steps p { color: var(--text-2); }

/* ---- Big feature stories: text on one side, picture on the other ---- */
.story { padding: 56px 0; border-top: 1px solid var(--hairline); }
.story:first-of-type { border-top: 0; }
.story .grid-2 { align-items: center; }
@media (min-width: 760px) { .story.flip .art { order: -1; } }
.story .art { border-radius: var(--radius-l); padding: 26px; }
.story .art svg { width: 100%; height: auto; }
.tint-lav { background: var(--lav-bg); }
.tint-mint { background: var(--mint-bg); }
.tint-peach { background: var(--peach-bg); }
.tint-sky { background: var(--sky-bg); }
.tint-butter { background: var(--butter-bg); }

/* A list of short benefit lines with tick marks */
.ticks { list-style: none; padding: 0; margin: 18px 0 0; }
.ticks li { position: relative; padding: 12px 0 12px 34px; border-top: 1px solid var(--hairline); }
.ticks li:last-child { border-bottom: 1px solid var(--hairline); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 16px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--mint-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%2317784D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.ticks b { font-weight: 600; }
.ticks span { color: var(--text-2); }

/* ---- Feature list rows (features page): icon, name, plain explanation ---- */
.frows { display: grid; gap: 0 56px; }
@media (min-width: 860px) { .frows { grid-template-columns: 1fr 1fr; } }
.frow { display: flex; gap: 18px; padding: 24px 0; border-top: 1px solid var(--hairline); }
.frow h3 { margin-bottom: 6px; font-size: 1.12rem; }
.frow p { color: var(--text-2); margin: 0; font-size: 0.98rem; }

.group-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 0 0 18px; }
.feature-group { padding: 48px 0; }
.feature-group + .feature-group { padding-top: 8px; }

/* Sticky jump-links on the features page */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.jump a { text-decoration: none; }

/* ---- Deep ink band used for the AI section ---- */
.band-ink {
  background: var(--ink-panel); color: #F1EEFF;
  border-radius: var(--radius-l);
  padding: 64px clamp(22px, 5vw, 64px);
  position: relative; overflow: hidden;
}
.band-ink .eyebrow { color: #9FE0C0; }
.band-ink .lead { color: #C9C3EA; }
.band-ink h3 { color: #fff; }
.band-ink p { color: #C9C3EA; }
.band-ink .ai-grid > div { border-top: 1px solid rgba(255,255,255,.14); padding-top: 22px; }
.band-ink .ico { background: rgba(201,190,250,.14); color: #C9BEFA; }
.band-ink a:not(.btn) { color: #C9BEFA; }
.band-ink .btn-primary { background: #C9BEFA; color: #15122B; }
.band-ink .btn-primary:hover { background: #E6E0FF; }
/* soft glow in the corner of the AI band */
.band-ink::after {
  content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle, rgba(127,224,174,.22), transparent 65%);
  pointer-events: none;
}
.ai-grid { display: grid; gap: 34px; margin-top: 40px; }
@media (min-width: 760px) { .ai-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .ai-grid { grid-template-columns: repeat(3, 1fr); } }
.ai-grid h3 { display: flex; align-items: center; gap: 12px; }

/* ---- Privacy band ---- */
.privacy { border-radius: var(--radius-l); padding: 56px clamp(22px, 5vw, 56px); background: var(--mint-bg); }
.privacy .eyebrow { color: var(--mint-fg); }
.privacy .lead { color: var(--ink); opacity: .85; }

/* ---- FAQ using native <details>, which works without JavaScript ---- */
.faq { max-width: 820px; margin: 36px auto 0; }
.faq details { border-top: 1px solid var(--hairline); }
.faq details:last-child { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer;
  padding: 22px 44px 22px 0; position: relative;
  font-family: var(--font-head); font-weight: 600; font-size: 1.12rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 16px;
  font-size: 1.6rem; font-weight: 400; color: var(--lav-fg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text-2); padding-right: 44px; }

/* ---- The closing "Talk to us" band ---- */
.cta-band {
  border-radius: var(--radius-l);
  padding: 64px clamp(22px, 5vw, 64px);
  background: linear-gradient(135deg, var(--lav-bg), var(--peach-bg));
  display: grid; gap: 28px; align-items: center;
}
@media (min-width: 860px) { .cta-band { grid-template-columns: 1.4fr 1fr; } }
.cta-band .lead { color: var(--ink); opacity: .8; }
.cta-band .actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 860px) { .cta-band .actions { justify-content: flex-end; } }

/* --------------------------------------------------------------------------
   7. Contact form
   -------------------------------------------------------------------------- */
.form { display: grid; gap: 18px; }
@media (min-width: 640px) { .form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; } }
.form .two { display: grid; gap: 18px; }
.form label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--hairline); border-radius: var(--radius-s);
}
.form textarea { min-height: 130px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--lav-fg); }
.form .hint { font-size: 0.9rem; color: var(--text-2); margin: 0; }
.form fieldset { border: 0; padding: 0; margin: 0; }
.form legend { font-weight: 600; font-size: 0.95rem; margin-bottom: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 9px 14px; border-radius: 999px; border: 1.5px solid var(--hairline);
  font-weight: 500; cursor: pointer; min-height: 44px;
}
.checks input { width: 18px; height: 18px; min-height: 0; accent-color: var(--lav-fg); }
.checks label:has(input:checked) { background: var(--lav-bg); border-color: var(--lav-fg); color: var(--lav-fg); }

.contact-side { border-left: 1px solid var(--hairline); padding-left: 40px; }
@media (max-width: 759px) { .contact-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--hairline); padding-top: 32px; } }
.contact-side dl { margin: 0; }
.contact-side dt { font-weight: 600; margin-top: 18px; }
.contact-side dd { margin: 4px 0 0; color: var(--text-2); }

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--hairline); padding: 56px 0 36px; margin-top: 40px; font-size: 0.95rem; }
.site-footer .cols { display: grid; gap: 32px; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer h4 { font-size: 0.95rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--text-2); text-decoration: none; }
.site-footer a:hover { color: var(--lav-fg); }
.site-footer p { color: var(--text-2); }
.site-footer .legal {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--hairline);
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--text-2);
}

/* --------------------------------------------------------------------------
   9. Animation for the live call pictures
   -------------------------------------------------------------------------- */
/* Dashed green lines that flow in the direction of the call */
.flow { stroke-dasharray: 7 7; animation: flow 1s linear infinite; }
.flow-rev { stroke-dasharray: 7 7; animation: flow 1s linear infinite reverse; }
@keyframes flow { to { stroke-dashoffset: -14; } }

/* Amber ring that pulses around a ringing phone */
.pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }

/* Visitors who asked their device for less motion get no animation */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .flow, .flow-rev, .pulse { animation: none; }
  .btn:hover { transform: none; }
}

/* Colours used inside the inline SVG pictures, so they also switch in dark mode */
.svg-card { fill: var(--surface); stroke: var(--hairline); }
.svg-ink { fill: var(--ink); }
.svg-text2 { fill: var(--text-2); }
.svg-line { stroke: var(--hairline); }

/* Contact page: form wider than the side column on big screens, stacked on phones */
@media (min-width: 760px) { .contact-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
