/* Koinvera public website. Self-hosted, no external fonts or resources.
   Brand: charcoal + teal + cream (see BRAND.md). PWF1 moved this out of an
   inline <style> block so the Content-Security-Policy can be 'self' only. */

:root {
  --charcoal: #2C2C2A;
  --dark-gray: #444441;
  --teal: #1D9E75;
  --teal-dark: #178a65;
  --cream: #F1EFE8;
  --line: #ddd9cc;
  --muted: #6f6b60;      /* darker than the old #837f73 -> better contrast on cream */
  --err: #a5432f;
  --success-text: #0b6b45; /* ~5.7:1 on --cream; --teal-dark (#178a65) was ~3.9:1, below AA */
  --maxw: 1160px;
}

* { box-sizing: border-box; }

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

/* Guard against horizontal overflow: long unbroken strings (URLs, emails)
   wrap instead of forcing the page wider than the viewport. */
body { overflow-wrap: break-word; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--charcoal);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--teal-dark); }
a:hover { color: var(--teal); }

/* --- focus visibility (keyboard) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--charcoal);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* --- layout helpers --- */
.section-inner { max-width: var(--maxw); margin: 0 auto; }
.section-inner.narrow { max-width: 760px; }
section, article { padding: 0 48px; }

/* --- header --- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--cream);
}
.topbar-inner {
  position: relative;   /* anchor for the mobile menu panel */
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 48px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--charcoal);
}
.brand-mark { display: block; }
.wordmark { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }

.primary-nav { margin-left: auto; }

/* Desktop: the link list is always visible; the toggle button is hidden.
   This does NOT depend on any disclosure/details element being open. */
.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links li { min-width: 0; }
.primary-nav a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--dark-gray);
  text-decoration: none;
  padding: 6px 2px;
  white-space: nowrap;
}
.primary-nav a:hover { color: var(--charcoal); }
.primary-nav a[aria-current="page"] {
  color: var(--charcoal);
  border-bottom: 2px solid var(--teal);
}

/* Menu toggle button: hidden on desktop, shown on narrow viewports. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--cream);
  border: 1.5px solid var(--teal);
  border-radius: 8px;
  padding: 8px 14px;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle-bars::before { position: absolute; top: -5px; }
.nav-toggle-bars::after { position: absolute; top: 5px; }

/* --- hero --- */
.hero { padding: 76px 48px 60px; }
.hero-grid { display: flex; gap: 60px; align-items: flex-start; flex-wrap: wrap; }
.hero-text { max-width: 640px; flex: 1 1 460px; min-width: 0; }
.hero-aside {
  flex: 1 1 300px;
  min-width: 0;
  max-width: 400px;
  border-left: 1px solid var(--line);
  padding-left: 40px;
}
.hero-aside .aside-label,
.section-title {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}
.hero-aside p { font-size: 14.5px; color: var(--dark-gray); margin: 0 0 14px; }
.hero-aside p:last-child { margin-bottom: 0; }

h1 {
  font-size: 40px; font-weight: 600; line-height: 1.18;
  margin: 0 0 18px; letter-spacing: -0.015em;
}
.lede { font-size: 17.5px; color: var(--dark-gray); margin: 0 0 30px; max-width: 58ch; }

/* --- signup form --- */
.signup { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.signup input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 13px 14px;
  font-size: 15px;
  border: 1.5px solid #d8d5c9;
  border-radius: 8px;
  background: #fff;
  color: var(--charcoal);
  font-family: inherit;
}
.signup button {
  padding: 13px 22px; font-size: 15px; font-weight: 600;
  border: none; border-radius: 8px;
  background: var(--teal); color: #fff; cursor: pointer; font-family: inherit;
}
.signup button:hover { background: var(--teal-dark); }
.signup button:disabled { opacity: 0.6; cursor: default; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 1px; }
.form-note { font-size: 13px; color: var(--muted); margin: 0; }
.form-note a { color: var(--muted); }
.form-message { font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.form-message.success { color: var(--success-text); font-weight: 500; }
.form-message.error { color: var(--err); }

/* --- content bands --- */
.band {
  background: #fff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 56px 48px;
}
.band.alt { background: var(--cream); border-bottom: none; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; }
.feature h3 {
  font-size: 16px; font-weight: 600; margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.feature p { font-size: 14.5px; color: var(--dark-gray); margin: 0; }
.check { width: 16px; height: 16px; flex-shrink: 0; display: inline-flex; }
.check svg { width: 16px; height: 16px; }
.band-cta { margin: 32px 0 0; font-weight: 600; }
.band .narrow p { color: var(--dark-gray); }

/* --- prose pages --- */
.prose { padding-top: 56px; padding-bottom: 72px; }
.prose h1 { margin-bottom: 12px; }
.prose .lede { margin-bottom: 32px; }
.prose h2 {
  font-size: 20px; font-weight: 600; margin: 34px 0 10px; letter-spacing: -0.01em;
}
.prose p, .prose li { color: var(--dark-gray); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }
.prose .meta { font-size: 13px; color: var(--muted); }
.prose code {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 1px 5px; font-size: 0.9em;
}
.page-cta { margin-top: 28px; font-weight: 600; }

.callout {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 20px 0;
}
.callout p { margin: 0; color: var(--charcoal); }

.legal .draft-banner {
  background: #fbf3d9;
  border: 1px solid #e6d59a;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: #7a5b12;
  margin-bottom: 24px;
}
.draft-tag { color: var(--muted); font-weight: 500; font-size: 0.6em; vertical-align: middle; }

/* --- error pages --- */
.error-page { padding: 96px 48px 120px; text-align: center; }
.error-code { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 8px; }
.error-page h1 { font-size: 30px; }

/* --- footer --- */
.site-footer { padding: 36px 48px 48px; border-top: 1px solid var(--line); }
.site-footer .section-inner { font-size: 12.5px; color: var(--muted); }
.site-footer .disclaimer { margin: 0 0 12px; max-width: 70ch; }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; margin: 0 0 10px; }
.footer-nav a { color: var(--muted); }
.contactline, .copyline { margin: 4px 0 0; }

/* --- responsive --- */
@media (max-width: 900px) {
  section, article, .topbar-inner, .band, .hero, .site-footer { padding-left: 24px; padding-right: 24px; }

  /* Toggle button is always visible while the menu is closed. */
  .nav-toggle { display: inline-flex; }

  /* Menu panel: hidden until opened, then anchored to the header and
     constrained to the viewport width so no label is ever clipped. */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 24px;
    right: 24px;
    margin-top: 8px;
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 10px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 6px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-links.open { display: flex; }
  .primary-nav a { display: block; padding: 10px 12px; width: 100%; white-space: normal; }
  .primary-nav a[aria-current="page"] { border-bottom: none; background: #fff; border-radius: 6px; }
  .hero { padding-top: 48px; }
  .hero-grid { flex-direction: column; gap: 36px; }
  .hero-aside { border-left: none; border-top: 1px solid var(--line); padding-left: 0; padding-top: 28px; max-width: none; }
  h1 { font-size: 32px; }
  .grid-3 { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 420px) {
  h1 { font-size: 27px; }
  .lede { font-size: 16px; }
  .signup button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
