/* ============================================================
   Brainforest PDX — Component Styles
   Reusable classes built on tokens.css. Import tokens first:
     <link rel="stylesheet" href="tokens.css">
     <link rel="stylesheet" href="styles.css">
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Reading-friendly defaults: left-aligned, never justified,
   comfortable measure. Matters for dyslexic / struggling readers. */
p { max-width: var(--measure); margin: 0 0 var(--space-4); }
p.lead { font-size: var(--text-lg); color: var(--text-secondary); }

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  margin: 0 0 var(--space-3);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}
h1 { font-size: var(--text-h1); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-h2); font-weight: var(--weight-bold); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }

.display {
  font-family: var(--font-heading);
  font-size: var(--text-display);
  font-weight: var(--weight-black);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-4);
}

/* ---------- Links ---------- */
a { color: var(--text-link); text-decoration-thickness: 2px; text-underline-offset: 3px; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--text-link-hover); }

/* ---------- Eyebrow (small label above headings) ---------- */
.eyebrow {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--coral-700);
  margin: 0 0 var(--space-2);
}

/* ---------- Layout helpers ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-5); }
.container--narrow { max-width: var(--container-narrow); }
.section { padding: var(--space-9) 0; }
.surface-sunk { background: var(--surface-sunk); }
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: 1;
  padding: 14px 26px;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

.btn--primary { background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--color-primary-hover); }

.btn--secondary { background: var(--color-secondary); color: var(--color-on-secondary); }
.btn--secondary:hover { background: var(--color-secondary-hover); }

.btn--accent { background: var(--color-accent); color: var(--color-on-accent); box-shadow: var(--shadow-sm); }
.btn--accent:hover { background: var(--color-accent-hover); }

.btn--ghost { background: transparent; color: var(--coral-700); border: 2px solid var(--coral-200); }
.btn--ghost:hover { background: var(--coral-50); border-color: var(--coral-300); }

.btn--lg { font-size: var(--text-lg); padding: 17px 34px; }
.btn--sm { font-size: var(--text-sm); padding: 10px 18px; }

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  line-height: 1;
}
.badge--gold      { background: var(--gold-200);  color: var(--gold-800); }
.badge--coral     { background: var(--coral-100); color: var(--coral-800); }
.badge--teal      { background: var(--teal-100);  color: var(--teal-800); }
.badge--green     { background: var(--green-100); color: var(--green-700); }
.badge--blue      { background: var(--blue-100);  color: var(--blue-700); }
.badge--success   { background: var(--success-bg);   color: var(--success-text); }
.badge--warning   { background: var(--warning-bg);   color: var(--warning-text); }
.badge--info      { background: var(--info-bg);      color: var(--info-text); }
.badge--attention { background: var(--attention-bg); color: var(--attention-text); }

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

/* Program / service card with an icon tile */
.card__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-4);
  font-size: 28px;
}
.card__icon--gold  { background: var(--gold-100);  color: var(--gold-800); }
.card__icon--coral { background: var(--coral-100); color: var(--coral-700); }
.card__icon--teal  { background: var(--teal-100);  color: var(--teal-700); }
.card__icon--amber { background: var(--amber-100); color: var(--amber-700); }
.card__icon--green { background: var(--green-100); color: var(--green-700); }
.card__icon--blue  { background: var(--blue-100);  color: var(--blue-700); }
.card__icon--violet{ background: var(--violet-100);color: var(--violet-700); }

/* Spectrum signature bar — "every kind of mind" */
.spectrum-bar { height: 6px; width: 100%; background: linear-gradient(90deg,#FF6F5B,#FF9A3D,#FFC53D,#58B368,#1FA6A6,#5B8DEF,#9B72CF); }
.card h3 { margin-bottom: var(--space-2); }
.card p { color: var(--text-secondary); margin-bottom: 0; }

/* Price card */
.price-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.price-card--featured { border: 2px solid var(--coral-300); box-shadow: var(--shadow-md); position: relative; }
.price-card__amount { font-family: var(--font-heading); font-size: var(--text-h1); font-weight: var(--weight-black); color: var(--teal-700); line-height: 1; }
.price-card__unit { color: var(--text-muted); font-size: var(--text-sm); }

/* Testimonial */
.testimonial {
  background: var(--surface-warm);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.testimonial__quote { font-family: var(--font-heading); font-size: var(--text-h4); font-weight: var(--weight-medium); color: var(--ink-900); line-height: var(--leading-snug); margin: 0 0 var(--space-4); }
.testimonial__author { display: flex; align-items: center; gap: var(--space-3); }
.avatar {
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  background: var(--coral-200); color: var(--coral-800);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: var(--weight-bold);
}

/* ============================================================
   FORMS
   ============================================================ */
.field { margin-bottom: var(--space-4); max-width: var(--container-narrow); }
.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}
.input, .textarea, .select {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--white);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--teal-400); box-shadow: var(--shadow-focus); }
.textarea { min-height: 120px; resize: vertical; }
.field__hint { font-size: var(--text-sm); color: var(--text-muted); margin: var(--space-2) 0 0; }
.field__error { font-size: var(--text-sm); color: var(--attention-text); margin: var(--space-2) 0 0; font-weight: var(--weight-medium); }
.field--invalid .input, .field--invalid .textarea { border-color: var(--attention); }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  max-width: var(--container); margin: 0 auto;
}
.navbar__brand { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-heading); font-weight: var(--weight-black); font-size: var(--text-h4); color: var(--ink-900); text-decoration: none; }
.navbar__logo { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--sunset); display: flex; align-items: center; justify-content: center; color: var(--white); font-size: 22px; }
.navbar__links { display: flex; gap: var(--space-5); align-items: center; list-style: none; margin: 0; padding: 0; }
.navbar__links a:not(.btn) { font-family: var(--font-heading); font-weight: var(--weight-medium); font-size: var(--text-sm); color: var(--text-secondary); text-decoration: none; }
.navbar__links a:not(.btn):hover { color: var(--teal-700); }

/* ============================================================
   BANNER / CALLOUT
   ============================================================ */
.callout {
  display: flex; gap: var(--space-3);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  border-left: 5px solid var(--info);
  background: var(--info-bg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout--success   { background: var(--success-bg);   border-color: var(--success); }
.callout--warning   { background: var(--warning-bg);   border-color: var(--warning); }
.callout--attention { background: var(--attention-bg); border-color: var(--attention); }
.callout__title { font-family: var(--font-heading); font-weight: var(--weight-semibold); margin: 0 0 var(--space-1); }
.callout p { margin: 0; color: var(--text-secondary); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink-900); color: var(--sand-100); padding: var(--space-8) 0; }
.footer a { color: var(--gold-300); }
.footer a:hover { color: var(--gold-200); }

/* ============================================================
   ACCESSIBILITY & MOTION
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
:focus-visible { outline: 3px solid var(--teal-400); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive type ---------- */
@media (max-width: 640px) {
  :root { --text-display: 2.5rem; --text-h1: 2rem; --text-h2: 1.6rem; }
  .section { padding: var(--space-8) 0; }
  .navbar__links { gap: var(--space-3); }
}
