/* ============================================================
   Essential Life Insights — shared stylesheet
   Plain CSS, no framework, no build step, no external requests.

   Breakpoints:
     base        phone
     >= 640px    tablet
     >= 1024px   laptop / desktop
     >= 1440px   wide desktop
   ============================================================ */

:root {
  /* Color */
  --color-bg: #F1F3EE;
  --color-bg-alt: #E6ECE2;
  --color-surface: #FBFBF8;
  --color-ink: #232B22;
  --color-ink-soft: #4A5347;
  --color-primary: #1F4B43;
  --color-primary-light: #3C6E63;
  --color-accent: #B4623F;
  --color-line: #D3D6C6;

  /* Hero gradient: light tints of the brand palette, so dark ink text
     sits on it at full contrast. */
  --grad-a: #D3E2DA;
  --grad-b: #E4EDE5;
  --grad-c: #F7E8DB;

  /* Type */
  --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, 'URW Palladio L', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Layout */
  --measure: 680px;
  --shell: 100%;
  --gutter: 1.25rem;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 2.75rem;
  --space-5: 4.5rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  margin: 0;
  background: transparent;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
}

a:not(.btn) {
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75em 1.25em;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: var(--space-2);
  top: var(--space-2);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Layout shell ----------
   .shell    full-width structural container, grows with the viewport
   .measure  constrained reading column for long-form body copy
------------------------------------ */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-width: var(--measure);
}

/* ---------- Fixed gradient backdrop ---------- */

.fixed-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(155deg,
    var(--grad-a) 0%,
    var(--grad-b) 45%,
    var(--grad-c) 100%);
}

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

.site-header {
  position: relative;
  z-index: 2;
  padding-block: var(--space-2);
  background: transparent;
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.wordmark .pillars {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-ink-soft);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
}

.site-nav a:hover {
  color: var(--color-primary);
}

/* ---------- Hero (transparent, sits on the gradient) ---------- */

.hero {
  position: relative;
  padding-block: var(--space-4) var(--space-5);
  overflow: hidden;
}

.hero .shell {
  position: relative;
}

.hero .pillars-ambient {
  position: absolute;
  right: 0;
  top: 40px;
  width: 170px;
  height: 170px;
  opacity: 0.1;
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 3rem);
  line-height: 1.08;
  margin: 0 0 var(--space-2);
  color: var(--color-ink);
}

.hero-tagline {
  font-size: clamp(1.3rem, 4.5vw, 1.85rem);
  line-height: 1.3;
  margin: 0 0 var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.05em 0.55em;
}

.hero-tagline .tag-ai {
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  color: var(--color-accent);
  font-weight: 700;
}

.hero-tagline .tag-human {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-primary);
  font-weight: 600;
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--color-ink-soft);
  max-width: 34ch;
  margin: 0 0 var(--space-3);
}

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

.btn {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background: var(--color-primary-light);
}

.btn-block {
  width: 100%;
  text-align: center;
}

/* ---------- Page body ----------
   Opaque sheet covering the fixed backdrop for everything below the
   hero. Without this the gradient shows through behind body copy.
--------------------------------- */

.page-body {
  position: relative;
  z-index: 1;
  background: var(--color-bg);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

/* ---------- Page nav (in-page jump links) ---------- */

.page-nav {
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--color-line);
  background: var(--color-bg-alt);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}

.page-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5em;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.page-nav ul::-webkit-scrollbar {
  display: none;
}

/* Fade the right edge so a clipped item reads as "scroll for more"
   rather than as a broken layout. Removed once the list can wrap. */
@media (max-width: 639px) {
  .page-nav ul {
    -webkit-mask-image: linear-gradient(to right, #000 82%, transparent 100%);
    mask-image: linear-gradient(to right, #000 82%, transparent 100%);
    padding-right: var(--space-3);
  }
}

.page-nav a {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.5em 0.9em;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-surface);
}

.page-nav a:hover {
  border-color: var(--color-primary);
}

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

section[id] {
  scroll-margin-top: var(--space-2);
}

.section {
  padding-block: var(--space-4);
}

.section + .section {
  border-top: 1px solid var(--color-line);
}

/* Heading block then content block: stacked on phone and tablet,
   side by side on desktop. */
.section-grid {
  display: grid;
  gap: var(--space-2);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 1.9rem);
  line-height: 1.2;
  color: var(--color-ink);
  margin: 0;
}

.section-body > p {
  margin: 0 0 var(--space-2);
  color: var(--color-ink-soft);
  max-width: var(--measure);
}

.section-body > p:last-child {
  margin-bottom: 0;
}

.section-lede {
  color: var(--color-ink);
}

.section-hook {
  font-weight: 700;
  color: var(--color-ink);
  font-size: 1.05rem;
  margin: 0 0 var(--space-2);
}

/* Compact hero for secondary pages: same gradient/type treatment as
   Home's hero, shorter, no tagline or CTA. */
.hero--compact {
  padding-block: var(--space-4) var(--space-3);
}

/* ---------- Fact strip ---------- */

.fact-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 0.9em;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--color-primary);
  margin: var(--space-2) 0 0;
  text-transform: uppercase;
  list-style: none;
  padding: 0;
}

.fact-strip li {
  white-space: nowrap;
}

.fact-strip li + li::before {
  content: "·";
  color: var(--color-line);
  margin-right: 0.7em;
}

/* ---------- Pillars ---------- */

.pillars-list {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.pillar {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: var(--space-2);
  align-items: start;
  align-content: start;
}

.pillar-icon {
  width: 40px;
  height: 40px;
  padding-top: 0.15em;
}

.pillar h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.2em;
  color: var(--color-ink);
}

.pillar p {
  margin: 0;
  color: var(--color-ink-soft);
}

/* ---------- Callout ---------- */

.callout {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin-top: var(--space-3);
}

.callout p {
  color: var(--color-ink);
  margin: 0;
}

/* ---------- Form ---------- */

.form-card {
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.field {
  margin-bottom: var(--space-2);
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.35em;
  color: var(--color-ink);
}

.field .hint {
  display: block;
  font-weight: 400;
  color: var(--color-ink-soft);
  font-size: 0.85rem;
  margin-top: 0.3em;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7em 0.8em;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
}

.field textarea {
  min-height: 6em;
  resize: vertical;
}

.field-optional-tag {
  font-weight: 400;
  color: var(--color-ink-soft);
  font-size: 0.85rem;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6em;
  margin-bottom: 0.65em;
  font-size: 0.95rem;
  color: var(--color-ink);
}

.checkbox-option input {
  margin-top: 0.3em;
  flex-shrink: 0;
}

.nested-field {
  margin: 0 0 0.8em 1.9em;
  padding-left: var(--space-2);
  border-left: 2px solid var(--color-line);
}

.nested-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.35em;
  color: var(--color-ink);
}

.nested-field input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.6em 0.7em;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--color-ink);
}

.state-message {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  text-align: center;
  font-size: 1.05rem;
  color: var(--color-ink);
}

/* ---------- Kiosk page (Event Intake) ---------- */

.kiosk {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-block: var(--space-4);
}

.kiosk-wordmark {
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-ink);
  margin: 0 0 var(--space-3);
}

.kiosk-wordmark .pillars {
  width: 20px;
  height: 20px;
}

.kiosk h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  margin: 0 0 var(--space-3);
  color: var(--color-ink);
}

/* honeypot: hidden from sighted and keyboard users, still readable by bots */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-footnote {
  font-size: 0.85rem;
  color: var(--color-ink-soft);
  margin-top: var(--space-2);
}

.form-footnote a {
  color: var(--color-ink-soft);
}

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

.site-footer {
  position: relative;
  z-index: 1;
  background: var(--color-bg-alt);
  padding-block: var(--space-4);
  border-top: 1px solid var(--color-line);
  color: var(--color-ink-soft);
  font-size: 0.9rem;
}

.site-footer .wordmark {
  font-size: 1rem;
  margin: 0 0 0.2em;
}

.site-footer .tagline {
  color: var(--color-ink-soft);
  margin: 0 0 var(--space-2);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em 0.8em;
  margin: 0 0 var(--space-2);
  padding: 0;
}

.footer-links a {
  color: var(--color-ink-soft);
}

.footer-disclosure {
  max-width: 60ch;
  color: var(--color-ink-soft);
  margin: 0;
}

/* ============================================================
   TABLET  >= 640px
   ============================================================ */

@media (min-width: 640px) {
  :root {
    --shell: 720px;
    --gutter: 2rem;
  }

  body {
    font-size: 18px;
  }

  .hero {
    padding-block: var(--space-5) var(--space-5);
  }

  .hero .pillars-ambient {
    width: 260px;
    height: 260px;
    top: -10px;
    right: var(--gutter);
    opacity: 0.18;
  }

  .section {
    padding-block: var(--space-5);
  }

  .page-nav ul {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .pillars-list {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3) var(--space-2);
  }

  .footer-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-3);
    align-items: start;
  }
}

/* ============================================================
   DESKTOP  >= 1024px
   ============================================================ */

@media (min-width: 1024px) {
  :root {
    --shell: 1120px;
    --gutter: 2.5rem;
  }

  .hero {
    padding-block: var(--space-5) calc(var(--space-5) * 1.3);
  }

  .hero h1 {
    font-size: clamp(2.8rem, 4.5vw, 3.6rem);
  }

  .hero .pillars-ambient {
    width: 340px;
    height: 340px;
    right: 0;
  }

  /* Editorial two-column sections: heading left, content right.
     Uses the full viewport width while keeping the reading measure sane. */
  .section-grid {
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: var(--space-4);
  }

  .section-head {
    position: sticky;
    top: var(--space-3);
    align-self: start;
  }

  /* In the narrow head column the strip reads better stacked. */
  .fact-strip {
    flex-direction: column;
    gap: 0.25em;
    margin-top: var(--space-3);
  }

  .fact-strip li + li::before {
    content: none;
  }

  /* Pillars span the full content column, four across. */
  .pillars-list {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3) var(--space-2);
  }

  .pillar {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .pillar-icon {
    margin-bottom: 0.3em;
  }

  .form-card {
    padding: var(--space-4);
  }

  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }
}

/* ============================================================
   WIDE  >= 1440px
   ============================================================ */

@media (min-width: 1440px) {
  :root {
    --shell: 1240px;
  }
}
