/* Mack West Designs — company site (STAGING)
   Vanilla CSS. Bold coastal palette, clean layout.
   Motion is opt-in: only runs when <html> has .js-motion (set by site.js
   when JS is on AND the visitor has not asked for reduced motion).
   No JS and reduced-motion both fall through to the plain, fully-visible page. */

:root {
  /* Coastal-but-bold palette */
  --ink: #0e1b2a;          /* deep navy, near-black */
  --ink-soft: #1d3147;
  --paper: #f7f4ee;        /* warm off-white */
  --paper-2: #efe9dd;
  --sea: #0a7d8c;          /* teal */
  --sea-deep: #065b66;
  --surf: #16b3c4;         /* bright teal accent */
  --sun: #ff6a3d;          /* bold coral/sunset — the primary accent (decorative fills only) */
  --sun-deep: #e8502a;
  /* WCAG-AA coral: same sunset family, darkened so white text clears 4.5:1 on it
     and it clears 4.5:1 as text on paper/white. Used anywhere coral meets text. */
  --coral-aa: #bf3718;     /* lum 0.139 — white-on-it 5.56:1; on paper 5.07:1; on white 5.56:1 */
  --coral-aa-deep: #a8341c;/* lum 0.109 — deeper stop for the CTA gradient and primary-button hover */
  --sand: #f4b740;         /* warm highlight */
  --line: rgba(14, 27, 42, 0.12);
  --shadow: 0 18px 50px -24px rgba(14, 27, 42, 0.45);
  --radius: 16px;
  --wrap: 1120px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 800;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
p { margin: 0 0 1em; }
a { color: var(--sea-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--sun-deep); }
img { max-width: 100%; display: block; }
ul { margin: 0 0 1em; padding-left: 1.2em; }
li { margin: 0.35em 0; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.lead { font-size: clamp(1.1rem, 2vw, 1.4rem); color: var(--ink-soft); max-width: 42ch; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--coral-aa);
  margin: 0 0 0.9em;
}
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85em 1.5em;
  border-radius: 999px;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--coral-aa); color: #fff; box-shadow: 0 10px 24px -10px var(--sun-deep); }
.btn-primary:hover { background: var(--coral-aa-deep); color: #fff; transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--paper-2); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .btn:hover { transform: none; } }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.center .btn-row { justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  /* Solid (not translucent): page content must not show through the sticky bar,
     and headings scrolling past go cleanly behind it instead of ghosting under a
     see-through header. White text on the old 0.86 cream also measured 1.10:1. */
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 20px -16px rgba(14, 27, 42, 0.5);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; }
.brand { display: flex; align-items: baseline; gap: 0; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 800; font-size: 1.22rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand .dot { color: var(--sun); }
.brand .wm-letter { display: inline-block; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.98rem; }
.nav a:hover { color: var(--sun-deep); }
/* Only the FILLED (coral) nav button carries white text. The ghost button keeps
   its dark --ink text from .btn-ghost so it stays legible on the light header
   (the old blanket `.nav .btn { color:#fff }` made it white-on-cream, 1.10:1). */
.nav .btn-primary { color: #fff; }
.nav .btn-primary:hover { color: #fff; }

.nav-toggle { display: none; background: none; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-weight: 700; color: var(--ink); }

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 24px 18px;
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 12px; text-align: center; }
}

/* ---------- Sections ---------- */
section { padding: clamp(56px, 9vw, 110px) 0; }
/* Keep any anchor-jumped section/heading clear of the sticky header (~68px tall),
   so a deep-linked heading never lands hidden underneath it. Zero-specificity
   (:where) so it overrides nothing. */
:where(section, h1, h2, h3, #main) { scroll-margin-top: 90px; }
.section-ink { background: var(--ink); color: var(--paper); }
.section-ink h2, .section-ink h3 { color: #fff; }
.section-ink .lead, .section-ink .muted { color: rgba(247, 244, 238, 0.8); }
.section-ink a { color: var(--sand); }
.section-sea { background: linear-gradient(135deg, var(--sea-deep), var(--sea)); color: #fff; }
.section-sea h2, .section-sea h3 { color: #fff; }
.section-sea .lead { color: rgba(255,255,255,0.9); }
.section-alt { background: var(--paper-2); }

.section-head { max-width: 46ch; margin-bottom: 44px; }
.center.section-head { margin-inline: auto; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(48px, 7vw, 90px); }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 85% 10%, rgba(255, 106, 61, 0.18), transparent 60%),
    radial-gradient(55% 60% at 5% 90%, rgba(10, 125, 140, 0.16), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 15ch; }
.hero .lead { margin-top: 8px; }
.hero .btn-row { margin-top: 28px; }
.hero-note { margin-top: 18px; font-size: 0.95rem; color: var(--ink-soft); }

/* Animated wordmark (hero) */
.wordmark { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; }
.wordmark .w {
  display: inline-block;
  color: var(--ink);
}
.wordmark .w.accent { color: var(--sun); }

/* ---------- The chain (found -> chosen -> paid) ---------- */
.chain { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
.chain-step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px; box-shadow: var(--shadow); position: relative;
}
.chain-step .num {
  font-family: var(--display); font-weight: 800; font-size: 1rem;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: var(--sun); margin-bottom: 16px;
}
.chain-step:nth-child(2) .num { background: var(--sea); }
.chain-step:nth-child(3) .num { background: var(--ink); }
.chain-arrow { display: none; }
@media (max-width: 760px) { .chain { grid-template-columns: 1fr; } }

/* ---------- Cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 26px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.35em; }
.card .tag { font-size: 0.85rem; font-weight: 800; color: var(--sea-deep); text-transform: uppercase; letter-spacing: 0.08em; }
.section-ink .card { background: var(--ink-soft); border-color: rgba(255,255,255,0.12); color: var(--paper); }
.section-ink .card h3 { color: #fff; }

.card-link { text-decoration: none; color: inherit; display: block; transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-link:hover { transform: translateY(-4px); box-shadow: 0 26px 60px -24px rgba(14,27,42,0.5); }
.card-link .more { color: var(--coral-aa); font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .card-link:hover { transform: none; } }

/* for/not-for columns */
.fit { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .fit { grid-template-columns: 1fr; } }
.fit .card { height: 100%; }
.fit .yes .tag { color: var(--sea-deep); }
.fit .no .tag { color: var(--sun-deep); }
.fit li { list-style: none; position: relative; padding-left: 1.6em; }
.fit li::before { position: absolute; left: 0; font-weight: 800; }
.fit .yes li::before { content: "✓"; color: var(--sea); }
.fit .no li::before { content: "✕"; color: var(--sun-deep); }

/* ---------- Process (steps) ---------- */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 18px; align-items: start; }
.step .n {
  counter-increment: step;
  font-family: var(--display); font-weight: 800;
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 1.15rem;
}
.step:nth-child(odd) .n { background: var(--sun); }
.step h3 { margin-bottom: 0.2em; }

/* ---------- Proof / stats ---------- */
.proof-grid { display: grid; gap: 22px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .proof-grid { grid-template-columns: 1fr; } }
.quote { background: #fff; border-left: 5px solid var(--sun); border-radius: 12px; padding: 26px; box-shadow: var(--shadow); }
.quote p { font-size: 1.08rem; }
.quote .who { font-weight: 700; color: var(--ink); margin: 0; }
.quote .who span { display: block; font-weight: 500; color: var(--ink-soft); font-size: 0.92rem; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq details {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 2px 22px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.12rem;
  padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.5rem; color: var(--sun); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq details > p { margin: 0 0 18px; color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band { background: linear-gradient(120deg, var(--coral-aa), var(--coral-aa-deep)); color: #fff; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band .lead { color: rgba(255,255,255,0.92); margin-inline: auto; }
.cta-band .btn-primary { background: #fff; color: var(--coral-aa); }
.cta-band .btn-primary:hover { background: var(--ink); color: #fff; }
.cta-band .btn-ghost { border-color: #fff; color: #fff; }
.cta-band .btn-ghost:hover { background: #fff; color: var(--coral-aa); }

/* ---------- Pricing ---------- */
.price-grid { display: grid; gap: 22px; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .price-grid { grid-template-columns: 1fr; } }
.price { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow); }
.price.featured { border: 2px solid var(--sun); }
.price .amt { font-family: var(--display); font-weight: 800; font-size: 2.4rem; }
.price .amt small { font-size: 1rem; font-weight: 600; color: var(--ink-soft); }
.price ul { list-style: none; padding: 0; }
.price li { padding-left: 1.6em; position: relative; }
.price li::before { content: "✓"; position: absolute; left: 0; color: var(--sea); font-weight: 800; }

/* ---------- Portfolio mock (CSS only — no logos, no real marks) ---------- */
.mock { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.mock .bar { background: #e9e3d8; padding: 10px 14px; display: flex; gap: 6px; align-items: center; }
.mock .bar i { width: 11px; height: 11px; border-radius: 50%; background: #c9c0b1; display: inline-block; }
.mock .bar .url { margin-left: 10px; font-size: 0.78rem; color: #8a8072; background: #fff; border-radius: 6px; padding: 3px 10px; }
.mock .screen { padding: 22px; min-height: 180px; color: #fff; display: flex; flex-direction: column; justify-content: flex-end; }
.mock .screen .kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; font-weight: 800; opacity: 0.9; }
.mock .screen .big { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.1; margin: 6px 0 12px; }
.mock .screen .pill { display: inline-block; background: rgba(255,255,255,0.9); color: #222; font-weight: 800; font-size: 0.8rem; padding: 7px 14px; border-radius: 999px; align-self: flex-start; }
.mock.t-plumb .screen { background: linear-gradient(135deg, #0a7d8c, #065b66); }
.mock.t-barber .screen { background: linear-gradient(135deg, #1d3147, #0e1b2a); }
.mock.t-land .screen { background: linear-gradient(135deg, #3f7d3a, #255a2a); }
.mock.t-dental .screen { background: linear-gradient(135deg, #16b3c4, #0a7d8c); }
.mock.t-detail .screen { background: linear-gradient(135deg, #ff6a3d, #e8502a); }
.mock.t-cafe .screen { background: linear-gradient(135deg, #b5651d, #7a3f12); }
.portfolio-item .meta { padding-top: 16px; }
.portfolio-item .meta .tag { font-size: 0.8rem; }
.portfolio-item .stamp { font-size: 0.82rem; color: var(--ink-soft); margin: 10px 0 0; font-style: italic; }

/* ---------- Disclosure ---------- */
.disclosure {
  background: var(--paper-2); border: 1px dashed var(--ink-soft); border-radius: 12px;
  padding: 16px 20px; font-size: 0.95rem; color: var(--ink-soft); margin: 0 0 28px;
}

/* ---------- Contact form (concept, not wired) ---------- */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: var(--paper); color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 3px solid var(--coral-aa); outline-offset: 2px; border-color: var(--sun-deep); }
.form-note { font-size: 0.9rem; color: var(--ink-soft); }
.staging-flag {
  background: #fff4ec; border: 1px solid var(--sun); color: var(--coral-aa);
  border-radius: 10px; padding: 12px 16px; font-weight: 700; margin-bottom: 20px; font-size: 0.95rem;
}
/* Free-scan form states (live). Error: warm attention, AA-contrast coral text. Success: calm teal. */
.scan-err {
  background: #fff4ec; border: 1px solid var(--coral-aa); color: var(--coral-aa);
  border-radius: 10px; padding: 14px 16px; font-weight: 700; margin-bottom: 20px;
}
.scan-ok { border-left: 4px solid var(--sea); padding-left: 16px; }
.scan-ok h3 { margin: 0; color: var(--sea-deep); }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgba(247,244,238,0.82); padding: 60px 0 36px; }
.site-footer a { color: var(--sand); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 8px 0; }
.footer-brand { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: #fff; }
.footer-brand .dot { color: var(--sun); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.14); padding-top: 22px; font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }

/* ---------- Scroll-reveal (only active under .js-motion) ---------- */
.js-motion .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; will-change: opacity, transform; }
.js-motion .reveal.in { opacity: 1; transform: none; }
.js-motion .reveal.d1 { transition-delay: 0.08s; }
.js-motion .reveal.d2 { transition-delay: 0.16s; }
.js-motion .reveal.d3 { transition-delay: 0.24s; }

/* Wordmark letter animation (hero) — only under .js-motion */
.js-motion .wordmark .w { opacity: 0; transform: translateY(0.5em) rotate(4deg); transition: opacity 0.5s ease, transform 0.5s ease; }
.js-motion .wordmark.played .w { opacity: 1; transform: none; }

/* Underline sweep on section headings — decorative only.
   box-decoration-break: clone gives each wrapped line fragment its OWN tight
   background box, so a highlighted phrase that wraps (hero "call first": "call"
   on one line, "first" on the next) underlines each word exactly and sweeps them
   in reading order — instead of the slice default, which paints one bar across the
   union box and fills the lower line before the upper one. */
.swipe { position: relative; display: inline; -webkit-box-decoration-break: clone; box-decoration-break: clone; background-image: linear-gradient(var(--sun), var(--sun)); background-repeat: no-repeat; background-position: 0 90%; background-size: 0% 0.18em; }
.js-motion .swipe { transition: background-size 0.6s ease 0.2s; }
.js-motion .reveal.in .swipe { background-size: 100% 0.18em; }
/* Without JS/motion, show the underline statically so it never looks broken */
html:not(.js-motion) .swipe { background-size: 100% 0.18em; }

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

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

/* ---------- Focus indicators (author-declared, WCAG 2.4.7 / 1.4.11, 3:1) ----------
   Every interactive element gets a visible keyboard-focus ring — not the browser
   default, which is invisible on the dark footer/bands. On light surfaces the deep
   coral --coral-aa clears 3:1 (5.0–5.6:1); on the dark navy/coral bands a white ring
   clears it with wide margin. outline-offset keeps the ring on the surrounding
   surface so it is measured against the background the ring is actually drawn on. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[role="link"]:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--coral-aa);
  outline-offset: 2px;
}
/* Dark bands (navy "our work" section, coral CTA band, footer): light ring. */
.section-ink a:focus-visible,
.section-ink button:focus-visible,
.section-ink summary:focus-visible,
.section-ink [tabindex]:focus-visible,
.cta-band a:focus-visible,
.cta-band button:focus-visible,
.site-footer a:focus-visible {
  outline-color: #ffffff;
}
