/* ==========================================================================
   Guardian Recovery Screening — base layer
   ========================================================================== */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  color: var(--gr-midnight);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 var(--sp-4);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; line-height: 1.25; }
h4 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--gr-midnight);
  margin: 0 0 var(--sp-2);
}

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

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

strong { font-weight: 600; }

.lead {
  font-size: var(--fs-lead);
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.55;
}

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.14em;   /* brand: all-caps uses expanded tracking */
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 var(--sp-3);
}

.caption {
  font-size: var(--fs-caption);
  color: var(--text-mute);
  line-height: 1.5;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--sp-5); }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: var(--sp-5); }

.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;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--gr-gambodge);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  z-index: 200; background: var(--gr-midnight); color: #fff;
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-sm);
  font-weight: 600; text-decoration: none;
  transition: top 0.15s var(--ease);
}
.skip-link:focus { top: var(--sp-4); color: #fff; }

/* ---------- Brand graphic elements ---------- */

/* Arch / chevron motif — always Gambodge, one per section, used sparingly */
.arch {
  width: 44px; aspect-ratio: 22.7 / 7.5; flex: none;
  color: var(--gr-gambodge);
}
.arch svg { width: 100%; height: 100%; display: block; }

/* Sunrise pattern — texture only, never a focal element */
.pattern-band {
  background-image: url('../img/pattern.svg');
  background-size: 128px 128px;
  background-repeat: repeat;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(252, 253, 255, 0.92);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); min-height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); text-decoration: none; }
.brand img { height: 34px; width: auto; }
/* The official lockup is wide (516x70); ease it down before it crowds the phone CTA. */
@media (max-width: 30rem) { .brand img { height: 27px; } }
.brand__sub {
  font-size: var(--fs-caption); font-weight: 500; color: var(--text-mute);
  padding-left: var(--sp-3); border-left: 1px solid var(--line);
  white-space: nowrap;
}
@media (max-width: 33rem) { .brand__sub { display: none; } }

.header-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 600; font-size: 0.9375rem;
  color: var(--gr-midnight); text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { color: var(--accent-text); }
.header-cta svg { width: 17px; height: 17px; flex: none; }
.header-cta__label { color: var(--text-mute); font-weight: 400; }
@media (max-width: 46rem) { .header-cta__label { display: none; } }

/* ---------- Buttons ---------- */

.btn {
  --btn-bg: var(--gr-midnight);
  --btn-fg: #fff;
  --btn-bd: var(--gr-midnight);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: 50px; padding: var(--sp-3) var(--sp-6);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1.5px solid var(--btn-bd); border-radius: var(--r-pill);
  font-family: var(--font-body); font-size: 1rem; font-weight: 600;
  line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
}
.btn:hover { color: var(--btn-fg); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled='true'] {
  opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none;
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn--accent {
  --btn-bg: var(--gr-gambodge);
  --btn-fg: var(--gr-eerie);   /* Gambodge needs dark text to pass contrast */
  --btn-bd: var(--gr-gambodge);
}
.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--gr-midnight);
  --btn-bd: var(--gr-sand);
}
.btn--ghost:hover { --btn-bd: var(--gr-midnight); }
.btn--quiet {
  --btn-bg: transparent;
  --btn-fg: var(--text-soft);
  --btn-bd: transparent;
  min-height: 44px; padding: var(--sp-2) var(--sp-4); font-weight: 500;
}
.btn--quiet:hover { --btn-fg: var(--gr-midnight); box-shadow: none; transform: none; text-decoration: underline; }
.btn--sm { min-height: 42px; padding: var(--sp-2) var(--sp-5); font-size: 0.9375rem; }
.btn--block { width: 100%; }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }

/* ---------- Cards ---------- */

.card {
  background: #fff; border: 1px solid var(--line-soft);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}

/* ---------- Hero ---------- */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(140deg, var(--gr-midnight) 0%, var(--gr-prussian) 100%);
  color: #fff;
  padding-block: var(--sp-8) var(--sp-9);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background-image: url('../img/pattern-light.svg');
  background-size: 180px 180px; opacity: 0.10; pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero .eyebrow { color: var(--gr-gambodge); }
.hero .lead { color: rgba(255, 255, 255, 0.82); max-width: 56ch; }
.hero__inner { max-width: 46rem; }

/* ---------- Sections ---------- */

.section { padding-block: var(--sp-8); }
.section--alt { background: var(--surface-alt); }
.section--sub { background: var(--surface-sub); }
.section__head { max-width: 46rem; margin-bottom: var(--sp-6); }
.section__head .arch { margin-bottom: var(--sp-4); }

/* ---------- Tool grid ---------- */

.tool-grid {
  display: grid; gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.tool-card {
  position: relative; display: flex; flex-direction: column;
  padding: var(--sp-5); background: #fff;
  border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  overflow: hidden;
  transition: transform 0.16s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tool-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--accent-fill);
}
.tool-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-lg);
  border-color: var(--accent-200); color: inherit;
}
.tool-card__badge {
  align-self: flex-start;
  font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-text); background: var(--accent-50);
  padding: 5px var(--sp-3); border-radius: var(--r-pill);
  margin-bottom: var(--sp-4);
}
.tool-card h3 { margin-bottom: var(--sp-2); }
.tool-card p { font-size: 0.9375rem; color: var(--text-soft); margin-bottom: var(--sp-4); }
.tool-card__foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line-soft);
}
.tool-card__meta { font-size: var(--fs-caption); color: var(--text-mute); }
.tool-card__go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.9375rem; font-weight: 600; color: var(--accent-text);
}
.tool-card__go svg { width: 15px; height: 15px; transition: transform 0.16s var(--ease); }
.tool-card:hover .tool-card__go svg { transform: translateX(3px); }

/* ---------- Feature list ---------- */

.feature-grid {
  display: grid; gap: var(--sp-5);
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.feature { display: flex; gap: var(--sp-4); }
.feature__icon {
  flex: none; width: 40px; height: 40px; border-radius: var(--r-md);
  display: grid; place-items: center;
  background: var(--gr-glacier); color: var(--gr-midnight);
}
.feature__icon svg { width: 20px; height: 20px; }
.feature p { font-size: 0.9375rem; color: var(--text-soft); margin: 0; }

/* ---------- Crisis notice ---------- */

.crisis {
  border: 1px solid var(--gr-gambodge);
  border-left-width: 5px;
  background: #FFFBF0;
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
}
.crisis h3, .crisis h4 { color: #7A5200; }
.crisis p { font-size: 0.9375rem; margin-bottom: var(--sp-2); }
.crisis p:last-child { margin-bottom: 0; }
.crisis a { color: #7A5200; font-weight: 600; }

/* ---------- Disclaimer ---------- */

.disclaimer {
  background: var(--surface-sub); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-caption); color: var(--text-mute); line-height: 1.55;
}
.disclaimer strong { color: var(--text-soft); }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--gr-midnight); color: rgba(255, 255, 255, 0.72);
  padding-block: var(--sp-7) var(--sp-5); margin-top: var(--sp-8);
  font-size: 0.9375rem;
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gr-gambodge); text-decoration: underline; }
.footer-grid {
  display: grid; gap: var(--sp-6);
  grid-template-columns: 1.4fr 1fr 1fr;
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
@media (max-width: 46rem) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: #fff; font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--sp-3);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.footer-tagline {
  font-family: var(--font-head); font-size: 1.375rem; color: #fff; margin-bottom: var(--sp-3);
}
.footer-bottom {
  padding-top: var(--sp-4); display: flex; flex-wrap: wrap; gap: var(--sp-4);
  justify-content: space-between; font-size: var(--fs-caption);
  color: rgba(255, 255, 255, 0.55);
}
.footer-bottom a { color: rgba(255, 255, 255, 0.8); }

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

@media print {
  .site-header, .site-footer, .btn, .quiz-nav, .lead-form { display: none !important; }
  body { background: #fff; }
}
