/* LCHSP — Base / design-system primitives.
   Ported from the prototype (source/styles.css + feedback FAB/modal from the
   HTML shell), adapted to be framework-independent and WCAG 2.1 AA friendly
   (visible focus states, skip link). Depends on tokens.css. */

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

body.lchsp {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
}

/* ---- Headings ---- */
.lchsp h1, .lchsp h2, .lchsp h3, .lchsp h4,
.lchsp .h1, .lchsp .h2, .lchsp .h3, .lchsp .h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.08;
  margin: 0;
  font-variation-settings: "SOFT" 30, "WONK" 0;
  font-optical-sizing: auto;
}
.lchsp h1, .lchsp .h1 { font-size: clamp(42px, 6vw, 84px); }
.lchsp h2, .lchsp .h2 { font-size: clamp(32px, 4vw, 54px); }
.lchsp h3, .lchsp .h3 { font-size: clamp(22px, 2.4vw, 32px); }
.lchsp h4, .lchsp .h4 { font-size: 20px; line-height: 1.25; }

.lchsp em, .lchsp .italic { font-style: italic; }

.lchsp p { margin: 0 0 1em; }
.lchsp a { color: var(--teal); text-decoration: none; border-bottom: 1px solid currentColor; }
.lchsp a:hover { color: var(--teal-deep); }

/* ---- Eyebrow + mono labels ---- */
.lchsp .mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.lchsp .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.lchsp .eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 1px;
  background: var(--teal);
}
/* On dark surfaces the eyebrow rule + text go paper-colored */
.lchsp .eyebrow.on-dark { color: var(--paper); }
.lchsp .eyebrow.on-dark::before { background: var(--paper); }

/* ---- Container ---- */
.lchsp .container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}
@media (max-width: 720px) {
  .lchsp .container { padding: 0 var(--container-pad-mobile); }
}

/* ---- Rules ---- */
.lchsp .rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.lchsp .rule-strong { border-top: 1px solid var(--ink); }

/* ---- Buttons ---- */
.lchsp .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
  line-height: 1;
}
.lchsp .btn-primary { background: var(--ink); color: var(--paper); }
.lchsp .btn-primary:hover { background: var(--teal); color: var(--paper); }
.lchsp .btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.lchsp .btn-secondary:hover { background: var(--ink); color: var(--paper); }
.lchsp .btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.lchsp .btn-ghost:hover { border-color: var(--ink); }
.lchsp .btn-teal { background: var(--teal); color: var(--paper); }
.lchsp .btn-teal:hover { background: var(--teal-deep); }
.lchsp .btn .arrow { transition: transform .2s ease; }
.lchsp .btn:hover .arrow { transform: translateX(3px); }

/* ---- Chips ---- */
.lchsp .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--cream-deep);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-60);
}
.lchsp .chip.teal { background: var(--teal-light); color: var(--teal-deep); }
.lchsp .chip.moss { background: var(--moss-light); color: var(--moss-deep); } /* AA: moss fell to 4.31:1 on moss-light */
.lchsp .chip.navy { background: color-mix(in srgb, var(--navy) 15%, transparent); color: var(--navy); }

.lchsp .dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---- Sections ---- */
.lchsp .section { padding: var(--section-pad) 0; }
.lchsp .section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
}
.lchsp .section-head h2 { flex: 1; max-width: 720px; }

/* ---- Card ---- */
.lchsp .card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---- Grid + flex utils ---- */
.lchsp .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.lchsp .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.lchsp .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 960px) {
  .lchsp .grid-2, .lchsp .grid-3, .lchsp .grid-4 { grid-template-columns: 1fr; }
}
.lchsp .stack { display: flex; flex-direction: column; }
.lchsp .row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---- Placeholder image blocks (until real photography) ---- */
.lchsp .ph {
  position: relative;
  background: repeating-linear-gradient(135deg, var(--cream-deep) 0 12px, var(--cream) 12px 24px);
  display: grid;
  place-items: center;
  color: var(--ink-60);
  overflow: hidden;
  border: 1px solid var(--rule);
}
.lchsp .ph-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.lchsp .ph.dark {
  background: repeating-linear-gradient(135deg, var(--navy-deep) 0 12px, var(--navy) 12px 24px);
  color: var(--paper);
}
.lchsp .ph.dark .ph-label {
  background: var(--navy-deep);
  border-color: color-mix(in srgb, var(--paper) 20%, transparent);
  color: var(--paper);
}
.lchsp .ph.teal {
  background: repeating-linear-gradient(135deg, var(--teal-deep) 0 12px, var(--teal) 12px 24px);
  color: var(--paper);
}
.lchsp .ph.teal .ph-label {
  background: var(--teal-deep);
  border-color: color-mix(in srgb, var(--paper) 25%, transparent);
  color: var(--paper);
}

/* ---- Page enter transition ---- */
.lchsp .page-enter { animation: lchspPageEnter .4s cubic-bezier(.2,.7,.2,1); }
@keyframes lchspPageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .lchsp .page-enter { animation: none; }
  .lchsp * { scroll-behavior: auto !important; }
}

/* ---- Feedback FAB (baked in: visible) ---- */
.lchsp .feedback-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: var(--r-pill);
  padding: 14px 22px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-fab);
  transition: all .2s ease;
}
.lchsp .feedback-fab:hover { background: var(--teal); transform: translateY(-1px); }
.lchsp .feedback-fab .dot { width: 8px; height: 8px; background: var(--teal); }
.lchsp .feedback-fab:hover .dot { background: var(--paper); }

/* ---- Feedback modal ---- */
.lchsp .feedback-overlay[hidden] { display: none; } /* explicit: beat the display:grid below */
.lchsp .feedback-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11,34,51,.55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  animation: lchspFadeIn .2s ease;
}
@keyframes lchspFadeIn { from { opacity: 0; } to { opacity: 1; } }
.lchsp .feedback-modal {
  background: var(--paper);
  border-radius: 16px;
  max-width: 560px;
  width: 100%;
  padding: 40px;
  box-shadow: var(--shadow-modal);
  max-height: 90vh; overflow-y: auto;
}

/* ---- Logo (real image, or teal "L" badge fallback) ---- */
.lchsp .lchsp-logo-img { display: block; height: auto; border: none; border-radius: 50%; }
.lchsp .nav-logo-mark {
  border-radius: 50%;
  background: var(--teal);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 500;
  position: relative;
  flex-shrink: 0;
}
.lchsp .nav-logo-mark::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid color-mix(in srgb, var(--paper) 40%, transparent);
  border-radius: 50%;
}

/* ---- Accessibility: skip link + visible focus ---- */
.lchsp .skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 18px;
  border-radius: 0 0 var(--r-md) 0;
  z-index: 999;
}
.lchsp .skip-link:focus {
  left: 0;
  outline: 2px solid var(--paper);
  outline-offset: -4px;
}
.lchsp a:focus-visible,
.lchsp button:focus-visible,
.lchsp input:focus-visible,
.lchsp textarea:focus-visible,
.lchsp select:focus-visible,
.lchsp [tabindex]:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 2px;
}
/* On dark/teal surfaces use a paper focus ring for contrast */
.lchsp .on-dark :focus-visible,
.lchsp .surface-dark :focus-visible { outline-color: var(--paper); }

/* Headings/text on dark surfaces go paper (global — used on every page's dark blocks) */
.lchsp .on-dark-text,
.lchsp .surface-dark h2 { color: var(--paper); }

/* Screen-reader-only utility */
.lchsp .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;
}
