/* ===========================================================
   Mayer Commercial — styles.css  (v2, 2026-05-22)
   Editorial dispatch on warm paper — Fraunces + Newsreader,
   warm palette, deep-forest accent. v2 adds a visual layer:
   a code-built data-viz hero, an anonymized dashboard proof,
   and soft dimensional cards — while staying minimal & clean.
   Mirrors the Cocosolis Competitor Move Monitor's hand.
   =========================================================== */

/* ---- Design tokens ---- */
:root {
  --bg:        #FAF8F4;
  --bg-warm:   #F2ECE0;
  --ink:       #1A1A1A;
  --ink-soft:  #4A4A4A;
  --ink-faint: #6B6356;
  --rule:      #E5DFD3;
  --rule-soft: #EDE8DC;
  --accent:        #1F4A3B;
  --accent-deep:   #143226;

  /* status palette (warm/earthy — for the dashboard proof) */
  --crit:  #9B3B2E;
  --warn:  #9A6B12;
  --ok:    #1F4A3B;

  --font-serif:   "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Newsreader", Georgia, "Times New Roman", serif;

  --container:       768px;
  --container-wide:  1080px;
  --measure:         632px;
  --pad-y:           104px;
  --pad-y-mobile:    60px;
  --gutter:          28px;

  /* soft dimensional cards */
  --card-radius: 16px;
  --card-bg:     linear-gradient(158deg, #FFFDFA 0%, #F4EEE2 100%);
  --card-border: 1px solid rgba(120,104,74,0.16);
  --card-shadow: 0 1px 2px rgba(60,46,22,0.04), 0 18px 40px -22px rgba(60,46,22,0.20);
  --card-shadow-hover: 0 2px 4px rgba(60,46,22,0.05), 0 26px 54px -22px rgba(60,46,22,0.26);
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color .18s ease, color .18s ease, background-color .18s ease;
}
a:hover { text-decoration-color: var(--ink); }

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

/* ---- Layout primitives ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--wide { max-width: var(--container-wide); }

.section { padding-top: var(--pad-y); padding-bottom: var(--pad-y); }

/* ---- Type scale ---- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--ink);
}
p { margin: 0; }

.eyebrow {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.sec-head { display: flex; align-items: baseline; gap: 18px; margin-bottom: 36px; }
.sec-head h2 { font-size: clamp(26px, 3.4vw, 33px); }
.sec-head__rule { flex: 1; height: 1px; background: var(--rule); }

/* ---- Soft dimensional card ---- */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

/* ---- Masthead ---- */
.masthead { border-bottom: 1.5px solid var(--ink); }
.masthead__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 22px;
  padding-bottom: 16px;
}
.wordmark {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}
.wordmark b { color: var(--ink); font-weight: 600; }
a.wordmark:hover { color: var(--ink); }

/* ---- Hero ---- */
.section--hero {
  padding-top: clamp(56px, 8vw, 104px);
  padding-bottom: clamp(64px, 9vw, 112px);
  background: radial-gradient(120% 80% at 88% 0%, #F4EFE4 0%, rgba(244,239,228,0) 60%);
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(40px, 5vw, 76px);
  align-items: center;
}
.hero__headline {
  font-size: clamp(38px, 5.4vw, 60px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.022em;
  max-width: 15ch;
}
.hero__subtitle {
  margin-top: 26px;
  font-size: clamp(19px, 2.1vw, 21px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 42ch;
}
.hero__actions {
  margin-top: 38px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.hero__secondary { font-size: 15.5px; color: var(--ink-faint); }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.005em;
  text-decoration: none;
  padding: 15px 30px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}
.btn--primary { background: var(--ink); color: var(--bg); }
.btn--primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--bg); }

/* ---- Hero viz card: one smooth curve + one calm number (v3) ---- */
.viz-card {
  margin: 0;
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 28px 32px 32px;
}
.viz-card__label {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 12px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px;
}
.viz-curve { display: block; width: 100%; height: auto; }
.viz-stat { margin-top: 20px; }
.viz-stat__num {
  display: block;
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(54px, 6.4vw, 72px); line-height: 0.96;
  letter-spacing: -0.025em; color: var(--ink);
}
.viz-stat__pct { font-size: 0.46em; font-weight: 500; color: var(--accent); letter-spacing: 0; }
.viz-stat__cap {
  display: block; margin-top: 10px;
  font-size: 16.5px; line-height: 1.4; color: var(--ink-soft);
}

/* ---- Hero automation flow (v3 round 3 — chosen treatment: linear pipeline) ---- */
.flow { display: block; width: 100%; height: auto; }
.flow text { font-family: var(--font-body); fill: var(--ink); }
.flow .cap { font-family: var(--font-serif); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; fill: var(--ink-faint); }
.flow .chip { fill: #FFFDFA; stroke: rgba(31,74,59,0.30); stroke-width: 1.2; }
.flow .link { fill: none; stroke: var(--accent); stroke-width: 1.8; opacity: 0.55; }
.flow .badge { fill: rgba(31,74,59,0.06); stroke: var(--accent); stroke-opacity: 0.45; stroke-width: 1.4; }
.flow .ico { fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.flow .ico-f { fill: var(--accent); stroke: none; }
.flow-dot { fill: var(--accent); animation: flowMove 2.8s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes flowMove {
  0%   { transform: translateX(0);            opacity: 0; }
  14%  { opacity: 1; }
  86%  { opacity: 1; }
  100% { transform: translateX(var(--travel,178px)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .flow-dot { animation: none; opacity: 0; } }

/* ---- Proof (two-column: copy + dashboard) ---- */
.proof-grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.proof-copy .eyebrow { color: var(--accent-deep); }
.proof-copy__title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  line-height: 1.12;
  max-width: 18ch;
}
.proof-copy__body { margin-top: 18px; color: var(--ink-soft); max-width: 50ch; }
.proof-copy__link { margin-top: 26px; }

.link-arrow {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 16.5px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  color: var(--ink);
}
.link-arrow span { display: inline-block; transition: transform .2s ease; color: var(--accent-deep); }
.link-arrow:hover { border-bottom-color: var(--ink); }
.link-arrow:hover span { transform: translateX(4px); }

/* ---- Proof viz: calm numbers + tiny sparklines (v3) ---- */
.statcard { padding: 28px 30px 30px; }
.statcard__label {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 12px; letter-spacing: 0.20em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 26px;
}
.statrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.stat { display: flex; flex-direction: column; }
.stat__num {
  font-family: var(--font-serif); font-weight: 600;
  font-size: clamp(34px, 4vw, 46px); line-height: 0.98;
  letter-spacing: -0.022em; color: var(--ink);
}
.stat__num small { font-family: var(--font-body); font-weight: 400; font-size: 0.4em; color: var(--ink-faint); margin-left: 3px; letter-spacing: 0; }
.stat__cap { margin-top: 9px; font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.spark2 { width: 100%; height: 26px; margin-top: 16px; display: block; }

/* ---- Services (examples of broader capability; soft cards) ---- */
.services__lead {
  font-size: clamp(19px, 2vw, 21px);
  line-height: 1.55;
  color: var(--ink);
  max-width: 60ch;
  margin-bottom: 36px;
}
.services-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 2.4vw, 28px);
}
.service { padding: 28px 28px 26px; transition: transform .2s ease, box-shadow .2s ease; }
.service:hover { transform: translateY(-3px); box-shadow: var(--card-shadow-hover); }
.service__num {
  font-family: var(--font-serif); font-weight: 600;
  font-size: 13px; letter-spacing: 0.10em; color: var(--accent);
  display: block; margin-bottom: 14px;
}
.service h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; margin-bottom: 10px; }
.service p { color: var(--ink-soft); font-size: 17px; line-height: 1.55; }
.services__close {
  margin-top: 32px;
  font-style: italic;
  font-size: clamp(18px, 1.9vw, 20px);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 54ch;
}

/* ---- About (text-only; headshot slot preserved via .about__container) ---- */
.about__container { display: flex; gap: 34px; align-items: flex-start; justify-content: center; }
.about__body { padding-top: 0; }
.about__body .eyebrow { color: var(--accent); }
.about__body p:not(.eyebrow) {
  font-size: clamp(20px, 2.2vw, 23px);
  line-height: 1.55;
  color: var(--ink);
  max-width: var(--measure);
  font-weight: 400;
}

/* ---- Repeat CTA ---- */
.section--cta-repeat {
  background: linear-gradient(180deg, #F2ECE0 0%, #EFE8DA 100%);
  border-top: 1.5px solid var(--ink);
  text-align: center;
}
.cta__heading {
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 500;
  line-height: 1.12;
  max-width: 20ch;
  margin: 0 auto 34px;
}

/* ---- Footer ---- */
.footer { border-top: 1px solid var(--rule); padding: 30px 0 40px; }
.footer__row {
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 14px 24px;
}
.footer .wordmark { font-size: 12px; }
.footer__meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: var(--ink-faint); }
.footer__meta a { color: var(--ink-faint); text-decoration-color: var(--rule); }
.footer__meta a:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* ===========================================================
   Case-study page
   =========================================================== */
.cs-hero { padding-top: clamp(48px, 7vw, 84px); padding-bottom: 0; }
.cs-back {
  font-family: var(--font-serif); font-size: 14px; text-decoration: none;
  color: var(--ink-faint); border-bottom: 1px solid var(--rule); padding-bottom: 2px;
}
.cs-back:hover { color: var(--ink); border-bottom-color: var(--accent); }
.cs-eyebrow { margin-top: 30px; }
.cs-title {
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 500; line-height: 1.06; letter-spacing: -0.02em;
  max-width: 20ch; margin-top: 8px;
}
.cs-standfirst {
  margin-top: 22px; font-size: clamp(19px, 2.1vw, 22px); line-height: 1.5;
  color: var(--ink-soft); max-width: 54ch;
}
.cs-figure { margin: clamp(40px, 5vw, 64px) auto 0; max-width: var(--container-wide); padding: 0 var(--gutter); }
.cs-figure .viz-card { max-width: 540px; margin: 0 auto; }
.cs-figcap { text-align: center; margin-top: 14px; font-size: 13.5px; font-style: italic; color: var(--ink-faint); }
.cs-body { padding-top: clamp(48px, 6vw, 80px); padding-bottom: var(--pad-y); }
.cs-body h2 {
  font-size: clamp(22px, 2.8vw, 28px); font-weight: 500;
  margin: 44px 0 16px; letter-spacing: -0.012em;
}
.cs-body h2:first-child { margin-top: 0; }
.cs-body p { color: var(--ink-soft); margin-bottom: 18px; max-width: var(--measure); }
.cs-body p strong, .cs-body li strong { color: var(--ink); font-weight: 600; }
.cs-body ul, .cs-body ol { margin: 0 0 18px; padding-left: 0; list-style: none; max-width: var(--measure); }
.cs-body ol { counter-reset: step; }
.cs-body ol li {
  position: relative; padding-left: 44px; margin-bottom: 16px; color: var(--ink-soft);
}
.cs-body ol li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-family: var(--font-serif); font-weight: 600; font-size: 13px; color: var(--accent);
}
.cs-body ul li { position: relative; padding-left: 22px; margin-bottom: 12px; color: var(--ink-soft); }
.cs-body ul li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: 0.55;
}
.cs-pull {
  margin: 32px 0; padding: 6px 0 6px 26px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
  font-size: clamp(20px, 2.6vw, 26px); line-height: 1.3; color: var(--ink);
  max-width: 30ch;
}
.cs-cta { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--rule); }
.cs-cta p { margin-bottom: 22px; color: var(--ink); font-size: 20px; max-width: 46ch; }

/* ===========================================================
   Motion — minimal + intentional
   =========================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .55s ease-out, transform .55s ease-out;
  will-change: opacity, transform;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .link-arrow span, .service, .btn, a { transition: none; }
}

/* ===========================================================
   Responsive
   =========================================================== */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; gap: 44px; }
  .hero__headline { max-width: 18ch; }
  .hero__subtitle { max-width: 52ch; }
  .proof-grid { grid-template-columns: 1fr; gap: 40px; }
  .proof-copy__title, .proof-copy__body { max-width: none; }
}

@media (max-width: 720px) {
  :root { --gutter: 22px; }
  .section { padding-top: var(--pad-y-mobile); padding-bottom: var(--pad-y-mobile); }
  .sec-head { gap: 14px; margin-bottom: 26px; }
  .services-grid { grid-template-columns: 1fr; gap: 16px; }
  .hero__subtitle { max-width: none; }
  .cs-figure { padding: 0 22px; }
}

@media (max-width: 520px) {
  body { font-size: 18px; }
  .hero__actions { gap: 16px; }
  .btn { width: 100%; text-align: center; }
  .hero__actions .btn { width: auto; }
  .viz-card { padding: 24px 22px 26px; }
  .statcard { padding: 24px 20px; }
  .statrow { gap: 14px; }
  .stat__num { font-size: 30px; }
  .stat__cap { font-size: 12px; }
  .spark2 { height: 22px; margin-top: 12px; }
}
