/* ============================================================
   Mend — shared stylesheet
   Aesthetic: "Paper & Rust" — warm, hand-crafted, calm.
   Built to pass its own audit: WCAG 2.1 AA.
   ============================================================ */

/* ---- Design tokens ------------------------------------------------ */
:root {
  /* Surfaces */
  --bg:        #f5f1e8;   /* parchment */
  --surface:   #fbf8f0;   /* page */
  --raised:    #ffffff;   /* raised surface */
  --border:    #e3dccb;
  --border-strong: #d6cdb6;

  /* Ink */
  --text:      #1d1a14;   /* near-black, warm cast */
  --muted:     #6c6555;   /* 5.1:1 on parchment */

  /* Brand */
  --accent:        #c4502c;  /* rust — fills / white-on-rust only */
  --accent-text:   #a23a1c;  /* darker rust — links & inline text (5.9:1) */
  --accent-hover:  #9c3d20;
  --accent-soft:   #f6e4dc;  /* rust tint for chips */

  /* Pass / success */
  --pass-text: #3c5a23;
  --pass-bg:   #d8e6cd;

  /* Severity flourishes */
  --sev-critical: #a02616;
  --sev-serious:  #9c4308;
  --sev-moderate: #735100;
  --sev-minor:    #5a5340;

  /* Type */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Radius */
  --r-sm: 8px;
  --r:    14px;
  --r-lg: 22px;
  --r-pill: 999px;

  /* Shadows — warm-tinted */
  --shadow-sm: 0 1px 2px rgba(60, 44, 24, .06), 0 2px 6px rgba(60, 44, 24, .05);
  --shadow:    0 2px 4px rgba(60, 44, 24, .06), 0 10px 28px rgba(60, 44, 24, .10);
  --shadow-lg: 0 6px 14px rgba(60, 44, 24, .08), 0 24px 60px rgba(60, 44, 24, .14);

  /* Layout */
  --maxw: 1120px;
  --maxw-prose: 720px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.0625rem;            /* 17px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* faint paper warmth at the top — purely cosmetic, behind everything */
  background-image:
    radial-gradient(1200px 520px at 78% -8%, rgba(196, 80, 44, .055), transparent 70%),
    radial-gradient(900px 480px at 8% -4%, rgba(115, 81, 0, .035), transparent 65%);
  background-repeat: no-repeat;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.25rem, 5.2vw, 3.5rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; font-family: var(--font-sans); font-weight: 650; letter-spacing: -0.005em; }

p { margin: 0 0 1rem; text-wrap: pretty; }

a { color: var(--accent-text); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: .25rem 0; }

code, kbd, pre { font-family: var(--font-mono); }

/* ---- Accessibility utilities ------------------------------------- */

/* Visible focus on every interactive element */
:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--text);
  color: var(--surface);
  padding: .65rem 1rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; color: var(--surface); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---- Layout ------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 22px;
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2.25rem, 5vw, 3.5rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-sans);
  font-size: .8rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 .9rem;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }

/* ---- Header / nav ------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { color: var(--text); }
.brand__mark {
  width: 34px; height: 34px;
  flex: none;
  display: grid;
  place-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .85rem;
  border-radius: var(--r-pill);
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
  font-size: .97rem;
}
.site-nav a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent-text); }
.site-nav a[aria-current="page"] {
  color: var(--accent-text);
  background: var(--accent-soft);
}

/* ---- Buttons ------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: 0 1.3rem;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn svg { flex: none; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--primary:active { transform: translateY(0); }

.btn--ghost {
  background: var(--raised);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover { color: var(--text); border-color: var(--accent); background: var(--surface); transform: translateY(-1px); }

.btn--lg { min-height: 54px; padding: 0 1.6rem; font-size: 1.05rem; }

/* ---- Cards -------------------------------------------------------- */
.card {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.6rem 1.6rem 1.7rem;
  box-shadow: var(--shadow-sm);
}

/* ---- Chips / badges ---------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  font-size: .82rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}
.dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; }
.dot--critical { background: var(--sev-critical); }
.dot--serious  { background: var(--sev-serious); }
.dot--moderate { background: var(--sev-moderate); }
.dot--minor    { background: var(--sev-minor); }

.pass-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .8rem;
  border-radius: var(--r-pill);
  background: var(--pass-bg);
  color: var(--pass-text);
  font-weight: 650;
  font-size: .9rem;
}

/* ---- Footer ------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.site-footer__band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-block: 2.25rem;
}
.site-footer__lead { display: flex; align-items: center; gap: .9rem; }
.site-footer__lead p { margin: 0; color: var(--muted); font-size: .95rem; max-width: 42ch; }
.site-footer__lead strong { color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: .35rem; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 .85rem;
  border-radius: var(--r-pill);
  color: var(--text);
  text-decoration: none;
  font-weight: 550;
}
.footer-links a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent-text); }
.site-footer__fine {
  border-top: 1px solid var(--border);
  padding-block: 1.1rem;
  color: var(--muted);
  font-size: .85rem;
}

/* ---- Pip illustration sizing ------------------------------------- */
.pip { display: block; height: auto; }

/* ============================================================
   Home page
   ============================================================ */
.hero { padding-top: clamp(2.5rem, 5vw, 4rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.hero__copy h1 { margin-bottom: .65rem; }
.hero__sub { font-size: 1.18rem; color: var(--muted); max-width: 40ch; margin-bottom: 1.6rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.hero__note { margin: 1.1rem 0 0; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: .5rem; }

/* hero art: Pip + floating audit panel */
.hero__art { position: relative; display: grid; place-items: center; }
.hero__art-inner { position: relative; width: min(100%, 440px); min-height: 360px; }
.hero__pip {
  width: min(88%, 286px);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 18px 28px rgba(60,44,24,.16));
}

.panel-mock {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  width: 290px;
}
.panel-mock--float {
  position: absolute;
  right: -10px;
  bottom: -8px;
  width: 224px;
}
.panel-mock__bar {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  font-weight: 650; font-size: .9rem;
}
.panel-mock__bar .pass-pill { margin-left: auto; padding: .2rem .55rem; font-size: .75rem; }
.panel-issue { padding: .8rem .9rem; border-bottom: 1px solid var(--border); }
.panel-issue:last-child { border-bottom: 0; }
.panel-issue__top { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.panel-issue__sev { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.panel-issue__sev--critical { color: var(--sev-critical); }
.panel-issue__sev--serious  { color: var(--sev-serious); }
.panel-issue__rule { margin-left: auto; font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.panel-issue__title { font-weight: 600; font-size: .92rem; margin: 0 0 .35rem; }
.panel-issue__fix {
  font-size: .82rem; color: var(--pass-text);
  background: var(--pass-bg); border-radius: var(--r-sm);
  padding: .4rem .55rem; margin: 0;
  display: flex; gap: .4rem;
}
.panel-issue__fix b { color: var(--pass-text); }

/* Differentiators */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
.feature {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.5rem 1.6rem;
  box-shadow: var(--shadow-sm);
}
.feature__num {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .9rem;
}
.feature h3 { margin-bottom: .35rem; }
.feature p { margin: 0; color: var(--muted); font-size: .98rem; }
.feature__extra { margin-top: 1rem; }

.codeflip {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .82rem;
  line-height: 1.5;
}
.codeflip__row { display: flex; gap: .5rem; padding: .5rem .7rem; align-items: baseline; }
.codeflip__row--before { background: #fbeeea; color: #7a2417; }
.codeflip__row--after  { background: var(--pass-bg); color: var(--pass-text); }
.codeflip__tag { font-weight: 700; flex: none; }

/* How it works */
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  counter-reset: step;
}
.step {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.step__n {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: .9rem;
  letter-spacing: .05em;
}
.step h3 { margin: .5rem 0 .35rem; }
.step p { margin: 0; color: var(--muted); font-size: .97rem; }
.step__demo {
  margin-top: 1rem;
  display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap;
}

.mini-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: .82rem; font-weight: 600; color: var(--text);
}
.mini-btn--accent { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ============================================================
   Prose pages (Privacy / Support)
   ============================================================ */
.page-head { padding-top: clamp(2.5rem, 5vw, 3.5rem); padding-bottom: 1rem; }
.page-head h1 { margin-bottom: .4rem; }
.page-head .lede { margin: 0; }
.page-meta { color: var(--muted); font-size: .92rem; margin-top: .4rem; }

.prose { max-width: var(--maxw-prose); }
.prose h2 { font-size: 1.45rem; margin-top: 2.2rem; }
.prose h2:first-of-type { margin-top: 0; }
.prose p { color: var(--text); }
.prose p, .prose li { font-size: 1.05rem; }
.prose strong { font-weight: 650; }

.callout {
  background: var(--raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--r);
  padding: 1.1rem 1.25rem;
  margin: 1.4rem 0;
}
.callout p:last-child { margin-bottom: 0; }

/* FAQ — native <details>, fully keyboard operable */
.faq { max-width: var(--maxw-prose); display: grid; gap: .8rem; }
.faq details {
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 1.05rem 1.2rem;
  font-weight: 650;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q-icon {
  margin-left: auto;
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  transition: transform .2s ease;
  font-size: 1.1rem; line-height: 1;
}
.faq details[open] summary .q-icon { transform: rotate(45deg); }
.faq .faq__body { padding: 0 1.2rem 1.15rem; color: var(--muted); }
.faq .faq__body p { margin: 0; }

.support-contact {
  margin-top: 2.4rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.7rem;
  box-shadow: var(--shadow-sm);
}
.support-contact .pip { width: 96px; flex: none; }
.support-contact h2 { margin: 0 0 .3rem; font-size: 1.3rem; }
.support-contact p { margin: 0; color: var(--muted); }

/* ---- Responsive --------------------------------------------------- */
@media (max-width: 719px) {
  .hero__art-inner { min-height: 0; width: 100%; max-width: 360px; }
  .hero__pip { width: 200px; margin: 0 auto; }
  .panel-mock--float { position: static; width: 100%; max-width: 320px; margin: -1rem auto 0; }
}
@media (min-width: 720px) {
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .hero__grid { grid-template-columns: 1.05fr .95fr; }
  .hero__sub { font-size: 1.22rem; }
}
