:root {
  --ink: #191a18;
  --paper: #f5f1e8;
  --acid: #c7f23a;
  --blue: #b9d9e8;
  --white: #fffdf8;
  --line: rgba(25, 26, 24, .2);
  --gutter: clamp(1.1rem, 3vw, 3.4rem);
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.45; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.launch-story a:focus-visible { outline-color: var(--acid); }
.skip-link { position: fixed; top: .75rem; left: .75rem; z-index: 20; padding: .75rem 1rem; background: var(--ink); color: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header { min-height: 4.5rem; padding: 1rem var(--gutter); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); position: relative; z-index: 10; }
.wordmark { font-size: clamp(1.7rem, 3vw, 2.55rem); font-weight: 700; letter-spacing: -.09em; line-height: 1; text-decoration: none; }
.wordmark span { color: var(--acid); }
.site-header nav { display: grid; gap: .2rem; position: absolute; inset: 100% 0 auto; padding: 1rem var(--gutter) 1.5rem; background: var(--paper); border-bottom: 1px solid var(--ink); }
.site-header[data-enhanced] nav { display: none; }
.site-header[data-enhanced] nav[data-open] { display: grid; }
.site-header nav a { display: block; padding: .8rem 0; font-weight: 600; text-decoration: none; }
.nav-toggle { min-height: 44px; border: 0; background: transparent; color: var(--ink); display: none; align-items: center; gap: .5rem; font: 600 .9rem var(--sans); }
.site-header[data-enhanced] .nav-toggle { display: flex; }
.nav-apply { color: #4d6300; }

.eyebrow { margin: 0 0 .8rem; font-size: .72rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.hero { min-height: calc(100svh - 4.5rem); display: grid; }
.hero__copy { padding: clamp(3rem, 9vw, 8rem) var(--gutter); display: flex; flex-direction: column; justify-content: center; }
.hero h1 { margin: 0; font-size: clamp(3.9rem, 15vw, 10.5rem); font-weight: 600; letter-spacing: -.085em; line-height: .78; }
.hero h1 em { font-family: var(--serif); font-weight: 500; letter-spacing: -.06em; }
.hero__dek { max-width: 35rem; margin: 2rem 0 0; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero__count { margin: 1.2rem 0 0; font-weight: 600; }
.hero__count strong { padding: .05rem .5rem; background: var(--acid); border: 1px solid var(--ink); font-variant-numeric: tabular-nums; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.2rem; margin-top: 2rem; }
.button { min-height: 48px; padding: .8rem 1.1rem; display: inline-flex; align-items: center; justify-content: center; gap: 1.4rem; border: 1px solid var(--ink); font-weight: 700; text-decoration: none; }
.button--primary { background: var(--acid); box-shadow: 4px 4px 0 var(--ink); }
.button--quiet { border-color: transparent; text-decoration: underline; }
.button--dark { background: var(--ink); color: var(--paper); }
.hero__media { margin: 0; align-self: end; }
.hero__media img { aspect-ratio: 16 / 9; object-fit: cover; }
.hero__media figcaption, .feature-card__caption { padding: .6rem .8rem; display: flex; justify-content: space-between; gap: 1rem; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.manifesto { padding: clamp(4.5rem, 10vw, 9rem) var(--gutter); display: grid; gap: 2rem; background: var(--acid); border-block: 1px solid var(--ink); }
.section-number { margin: 0; font: italic 1.25rem var(--serif); }
.manifesto h2, .section-head h2, .how h2, .eligibility h2, .launch-story h2 { margin: 0; font-size: clamp(2.6rem, 7vw, 6.6rem); line-height: .95; letter-spacing: -.065em; }
.manifesto > p:last-child { max-width: 26rem; margin: 0; font-size: 1.15rem; align-self: end; }

.featured { padding: clamp(4.5rem, 9vw, 8rem) var(--gutter); }
.section-head { margin-bottom: 2.5rem; display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.section-head a { display: none; font-weight: 700; }
.editorial-grid { display: grid; gap: 1.5rem; }
.feature-card { margin: 0; border: 1px solid var(--ink); background: var(--white); }
.feature-card img { aspect-ratio: 4 / 3; object-fit: cover; }
.feature-card--wide img { object-position: 50% 44%; }
.profile-note { padding: 1.2rem; display: grid; gap: 2rem; background: var(--blue); border-bottom: 1px solid var(--ink); }
.profile-note span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .15em; }
.profile-note strong { font: italic clamp(1.6rem, 4vw, 2.6rem)/1.03 var(--serif); }

.how { padding: clamp(4.5rem, 9vw, 8rem) var(--gutter); background: var(--blue); border-block: 1px solid var(--ink); }
.how header { display: flex; gap: 2rem; align-items: start; }
.how ol { margin: 3rem 0 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.how li { padding: 1.5rem 0; display: grid; grid-template-columns: 2rem 1fr; gap: .6rem 1rem; border-bottom: 1px solid var(--ink); }
.how li > span { grid-row: span 2; font: italic 1.1rem var(--serif); }
.how h3, .how p { margin: 0; }
.how h3 { font-size: 1.25rem; }

.eligibility { padding: clamp(4.5rem, 10vw, 9rem) var(--gutter); display: grid; gap: 3rem; }
.eligibility > div:last-child { max-width: 39rem; font-size: 1.15rem; }
.fine-print { margin: 2rem 0; padding-left: 1rem; border-left: 4px solid var(--acid); }
.fine-print em { display: block; margin-top: .4rem; font-size: .8rem; }

.launch-story { padding: clamp(4.5rem, 9vw, 8rem) var(--gutter); display: grid; gap: 2rem; background: var(--ink); color: var(--paper); }
.launch-story h2 { max-width: 16ch; }
.launch-story > div:last-child { max-width: 29rem; align-self: end; font-size: 1.1rem; }
.launch-story a { font-weight: 700; }

.site-footer { padding: 3rem var(--gutter); display: grid; gap: 1.5rem; }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; font-size: .83rem; }
.wordmark--footer { font-size: 3rem; }
.copyright { margin: 1rem 0 0; color: #5f615c; font-size: .75rem; }

/* Forms (waitlist, introduce, apply) */
.form-page { max-width: 44rem; margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter); }
.form-intro { display: grid; gap: 1rem; margin-bottom: 2.4rem; }
.form-intro h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.03; }
.form-intro p { margin: 0; max-width: 40rem; }
.back-link { font-weight: 600; text-decoration: none; }
.form-page form { display: grid; gap: 1.35rem; }
.form-page label { display: grid; gap: .45rem; font-weight: 600; }
.form-page input, .form-page textarea, .form-page select,
.application-form input:not([type=checkbox]), .application-form textarea {
  width: 100%; box-sizing: border-box; min-height: 52px; padding: .75rem .9rem;
  font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--ink);
}
.form-page textarea, .application-form textarea { min-height: 8rem; resize: vertical; }
.form-page form > .button, .application-submit .button { justify-self: start; margin-top: .4rem; }
.optional { font-weight: 400; color: #5f615c; font-size: .82em; }
.privacy-note, .field-error { margin: .2rem 0 0; font-size: .85rem; }
.privacy-note { color: #5f615c; }
.field-error { color: #a3231b; font-weight: 600; }
.form-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.apply-hero { max-width: 44rem; margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--gutter) 1.4rem; display: grid; gap: 1rem; }
.apply-hero h1 { margin: 0; font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.03; }
.application-form { max-width: 44rem; margin: 0 auto; padding: 0 var(--gutter) clamp(3rem, 8vw, 6rem); display: grid; gap: 2rem; }
.application-form fieldset { margin: 0; border: 1px solid var(--ink); background: var(--white); padding: 1.4rem; display: grid; gap: 1.1rem; }
.application-form legend { padding: 0 .5rem; font-weight: 700; }
.application-form .field { display: grid; gap: .45rem; font-weight: 600; }
.form-grid { display: grid; gap: 1.1rem; }
.check-row { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; font-weight: 400; }
.check-row input { min-height: auto; margin-top: .2rem; }
.application-submit { display: grid; gap: .8rem; }
.form-page .checkbox-field { grid-template-columns: auto 1fr; gap: .6rem; align-items: start; font-weight: 400; }
.form-page .checkbox-field input { width: auto; min-height: auto; margin-top: .25rem; }
.report-link { margin: 1rem 0 0; font-size: .85rem; }
.report-link a { color: #5f615c; }
.faq-list { display: grid; gap: .8rem; }
.faq-item { border: 1px solid var(--ink); background: var(--white); padding: 1rem 1.2rem; }
.faq-item summary { font-weight: 700; cursor: pointer; }
.faq-item summary::marker { color: var(--acid); }
.faq-item p { margin: .8rem 0 0; }

/* Directory, profile, member, success */
.directory-page, .profile-page { padding: clamp(2.5rem, 6vw, 5rem) var(--gutter); display: grid; gap: 2.4rem; }
.directory-intro { display: grid; gap: 1rem; max-width: 46rem; }
.directory-intro h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.03; }
.directory-intro p { margin: 0; }
.presence { font-weight: 700; }
.directory-intro form { margin-top: .4rem; }
.profile-filters { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; padding: 1.2rem; border: 1px solid var(--ink); background: var(--white); }
.profile-filters label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
.profile-filters select, .profile-filters input { min-height: 46px; padding: .5rem .7rem; font: inherit; border: 1px solid var(--ink); background: var(--paper); }
.profile-filters button, .directory-intro form button { min-height: 46px; padding: .5rem 1.1rem; border: 1px solid var(--ink); background: var(--acid); font: inherit; font-weight: 700; cursor: pointer; }
.empty-state { padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; display: grid; gap: 1rem; justify-items: center; text-align: center; background: var(--white); border: 1px solid var(--ink); box-shadow: 6px 6px 0 var(--acid); }
.empty-state h2 { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.05; }
.empty-state p { margin: 0; max-width: 34rem; }
.empty-state .button { margin-top: .4rem; }
.profile-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.profile-card { margin: 0; border: 1px solid var(--ink); background: var(--white); }
.profile-card a { display: grid; text-decoration: none; color: inherit; height: 100%; }
.profile-card img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; border-bottom: 1px solid var(--ink); display: block; }
.profile-card__copy { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .35rem; align-content: start; }
.profile-card__copy h2, .profile-card__copy h3 { margin: 0; font-size: 1.2rem; }
.profile-card__copy p { margin: 0; color: #5f615c; }
.text-link { font-weight: 700; color: #4d6300; margin-top: .3rem; }
.demo-label { justify-self: start; display: inline-block; padding: .2rem .55rem; background: var(--blue); border: 1px solid var(--ink); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge-reviewed { justify-self: start; display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; background: var(--acid); border: 1px solid var(--ink); border-radius: 999px; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.badge-reviewed__check { display: inline-flex; align-items: center; justify-content: center; width: 1.05em; height: 1.05em; border-radius: 999px; background: var(--ink); color: var(--acid); font-size: .74em; line-height: 1; }
.directory-page section > h2, .profile-detail__copy h2 { font-size: 1.35rem; }
.profile-detail { display: grid; gap: 2rem; }
.profile-detail__image img { width: 100%; height: auto; border: 1px solid var(--ink); display: block; }
.profile-detail__copy { display: grid; gap: 1.1rem; align-content: start; }
.profile-detail__copy h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; }
.profile-detail__copy section { display: grid; gap: .3rem; }
.profile-detail__copy section h2 { margin: 0; font-size: 1.05rem; }
.profile-detail__copy section p, .profile-detail__copy > p { margin: 0; }
.profile-meta { color: #5f615c; font-weight: 600; }
.admin-card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.admin-card { margin: 0; padding: 1.1rem 1.2rem; border: 1px solid var(--ink); background: var(--white); display: grid; gap: .4rem; }
.admin-card h3 { margin: 0; font-size: 1.1rem; }
.admin-card p { margin: 0; }
.success-page, .apply-success { max-width: 40rem; margin: 0 auto; padding: clamp(3.5rem, 9vw, 7rem) var(--gutter); display: grid; gap: 1.1rem; text-align: center; justify-items: center; }
.success-page h1, .apply-success h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; }
.success-page .button, .apply-success .button { margin-top: .6rem; }

@media (min-width: 48rem) {
  .site-header[data-enhanced] .nav-toggle { display: none; }
  .profile-detail { grid-template-columns: 1fr 1fr; align-items: start; }
  .site-header nav, .site-header[data-enhanced] nav { display: flex; position: static; padding: 0; align-items: center; gap: clamp(1.3rem, 3vw, 2.8rem); border: 0; }
  .site-header nav a { padding: .5rem 0; }
  .nav-apply { padding: .7rem 1rem !important; border: 1px solid var(--ink); }
  .hero { grid-template-columns: minmax(24rem, .82fr) 1.18fr; }
  .hero__copy { padding-right: 2rem; }
  .hero h1 { font-size: clamp(4.7rem, 8.8vw, 9.3rem); }
  .hero__media { height: 100%; display: flex; flex-direction: column; }
  .hero__media img { height: 100%; min-height: 38rem; }
  .manifesto { grid-template-columns: .3fr 1.6fr .7fr; }
  .editorial-grid { grid-template-columns: 1.55fr .9fr; align-items: start; }
  .feature-card--profile { margin-top: 9rem; }
  .section-head a { display: inline; }
  .how ol { display: grid; grid-template-columns: repeat(3, 1fr); }
  .how li { padding: 1.5rem; grid-template-columns: 1fr; border-right: 1px solid var(--ink); }
  .how li:first-child { padding-left: 0; }
  .how li:last-child { border-right: 0; }
  .eligibility { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .field--wide { grid-column: 1 / -1; }
  .launch-story { grid-template-columns: .25fr 1.5fr .75fr; }
  .site-footer { grid-template-columns: 1fr 1fr; }
  .site-footer > div { justify-content: flex-end; }
  .copyright { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Accessible error identification (WCAG 3.3.1 Error Identification, 4.1.3 Status Messages) */
.error-summary { max-width: 44rem; margin: 0 auto 2rem; padding: 1.2rem 1.4rem; background: var(--white); border: 2px solid var(--ink); border-left: 6px solid #a3231b; }
.error-summary h2 { margin: 0 0 .6rem; font-size: 1.1rem; }
.error-summary ul { margin: 0; padding-left: 1.15rem; display: grid; gap: .3rem; }
.error-summary a { color: #a3231b; font-weight: 600; }
.error-summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.field-convention { margin: .2rem 0 0; font-size: .85rem; color: #5f615c; }
.form-timing { margin: 0; font-weight: 600; }
.apply-jump { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .4rem 0 0; font-size: .85rem; font-weight: 600; }

/* Card hover + focus-within lift (echoes the .button--primary offset-shadow language) */
@media (prefers-reduced-motion: no-preference) {
  .profile-card, .feature-card, .admin-card { transition: transform .16s ease, box-shadow .16s ease; }
  .profile-card:hover, .profile-card:focus-within,
  .feature-card:hover, .feature-card:focus-within,
  .admin-card:hover, .admin-card:focus-within { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
}

/* Dark mode: flip the palette vars, then re-theme the hexes that don't reference them */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f2efe6;
    --paper: #141513;
    --white: #20211e;
    --blue: #243b45;
    --line: rgba(242, 239, 230, .2);
  }
  .nav-apply, .text-link { color: var(--acid); }
  .copyright, .optional, .privacy-note, .profile-card__copy p, .profile-meta, .field-convention { color: #a8a89e; }
  .field-error { color: #f28b82; }
  .error-summary { border-left-color: #f28b82; }
  .error-summary a { color: #f28b82; }
  .skip-link { color: var(--paper); }
  /* Keep dark ink text on the bright acid accent surfaces (acid stays an accent) */
  .button--primary, .hero__count strong, .manifesto, .badge-reviewed,
  .profile-filters button, .directory-intro form button { color: #191a18; }
  .badge-reviewed__check { background: #191a18; }
  /* .button--dark would flip to a light button; keep it a distinct dark button */
  .button--dark { background: #0e0f11; color: var(--ink); border-color: var(--ink); }
}
