/* Flockwell design system — instrument-panel precision (Tesla/Apple-pinned
   direction, see .impeccable/surfaces/app.md for the full contract).
   Authored CSS, no utility framework: hairline borders over shadows,
   tabular numerals on every figure, one restrained accent, one signature
   entrance moment — not scattered per-element animation. */

:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --border: #e4e2dc;
  --border-strong: #c9c6bd;
  --accent: #0f4c81;
  --accent-contrast: #ffffff;
  --accent-tint: rgba(15, 76, 129, 0.06);
  --accent-border-tint: rgba(15, 76, 129, 0.22);
  /* Second accent — deliberately spent on a small number of real "moment"
     elements (a hero stat, a comparison-table win row, one highlighted
     number per page), never on chrome. Distinct from the paler
     status-attention amber used for banners. */
  --accent-warm: #a8631a;
  --accent-warm-contrast: #ffffff;
  --status-attention-bg: #fdf6e8;
  --status-attention-border: #ecd9a8;
  --status-attention-text: #8a6314;
  --status-error-bg: #fcecec;
  --status-error-border: #e8b4b4;
  --status-error-text: #8a2e2e;
  /* Inverted "dark module" — one high-contrast section per page at most,
     to break the monotone paper/white rhythm, never the default surface. */
  --surface-dark: #17160f;
  --text-on-dark: #f6f4ee;
  --text-on-dark-secondary: #b3afa2;
  --border-on-dark: #39372c;
  --radius: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 112px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

/* Cross-document View Transitions: a native crossfade between full page
   loads, zero JS, zero layout risk — Chrome/Edge/Safari animate it,
   Firefox just navigates normally (no error, no missing feature). This is
   the real mechanism, not an imitation of an SPA transition. */
@view-transition {
  navigation: auto;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scrollbar-color: var(--border-strong) var(--bg);
  scrollbar-width: thin;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.015em;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(15, 76, 129, 0.22);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.num {
  font-variant-numeric: tabular-nums;
}

/* One authored entrance moment — applied once to the page-level
   container, never per-section or per-card. */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Slow, continuous drift for a gradient background — never a hard loop,
   never fast enough to distract from the content sitting on top of it. */
@keyframes gradient-drift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Scroll-triggered reveal: one real entrance per section as it enters the
   viewport (see the IntersectionObserver in marketingShell.ts), not a
   per-element stagger. Respects prefers-reduced-motion by not existing at
   all when it's set — content simply renders visible, no JS branch needed. */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- App shell ---------- */

/* A real colored toolbar, not a white header with a thin accent line — the
   app gets the same brand presence as marketing, just without the moving
   gradient (Operate mode: the chrome announces the brand once, then gets
   out of the way of the work). The warm accent reappears here too, on the
   active nav indicator, so the app isn't blue-only while marketing is
   blue-and-warm. */
.app-header {
  background: linear-gradient(135deg, #0a3a63 0%, #0f4c81 60%, #12568d 100%);
  border-bottom: 3px solid var(--accent-warm);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Ambient shimmer: a soft diagonal band of light drifts slowly across every
   full-bleed brand-gradient surface — like light catching brushed metal.
   Layered on top of the existing gradient-drift motion, not replacing it.
   A pseudo-element's own background is confined to its own box regardless
   of the parent's overflow, so this never needs overflow:hidden on
   .app-header — which would otherwise clip the nav's dropdown panels. */
.app-header::after,
.marketing-hero::after,
.marketing-showcase::after,
.marketing-final-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.22) 50%, transparent 68%);
  background-size: 300% 300%;
  background-repeat: no-repeat;
}

@media (prefers-reduced-motion: no-preference) {
  .app-header::after,
  .marketing-hero::after,
  .marketing-showcase::after,
  .marketing-final-cta::after {
    /* Slow and soft on purpose — a wide, gentle glow drifting through on a
       long loop, not a flash. Ease-in-out so it also lingers at each end
       rather than snapping back, instead of one continuous constant-speed
       sweep. */
    animation: shimmer-sweep 16s ease-in-out infinite alternate;
  }
}

@keyframes shimmer-sweep {
  0% {
    background-position: -100% -100%;
  }
  100% {
    background-position: 200% 200%;
  }
}

.app-header .wordmark {
  color: #ffffff;
}

.app-header .org-meta {
  color: rgba(255, 255, 255, 0.75);
}

.app-header .logout-btn {
  color: rgba(255, 255, 255, 0.75);
}

.app-header .logout-btn:hover {
  color: #ffffff;
}

.app-header__top {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.wordmark {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text);
  text-decoration: none;
}

.wordmark--branded {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.app-nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

/* These sit directly on the app header's blue background (see
   .app-header above), so they're light-on-dark — the active indicator is
   the warm accent, not the blue accent, since blue-on-blue would vanish. */
.nav-link {
  padding: var(--space-2) 0 var(--space-3);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link.is-active {
  color: #ffffff;
  font-weight: 600;
  border-bottom-color: var(--accent-warm);
}

/* Grouped menu: each heading opens a panel of links. */
.nav-group {
  position: relative;
}

.nav-group__summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-2) 0 var(--space-3);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.68);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.nav-group__summary::-webkit-details-marker {
  display: none;
}

.nav-group__summary::after {
  content: "\25BE";
  margin-left: 4px;
  font-size: 13px;
  line-height: 1;
  opacity: 0.7;
}

.nav-group__summary:hover {
  color: #ffffff;
}

.nav-group.is-active > .nav-group__summary {
  color: #ffffff;
  font-weight: 600;
  border-bottom-color: var(--accent-warm);
}

.nav-group__panel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: var(--space-2) 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.nav-group__link {
  padding: var(--space-2) var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
}

.nav-group__link:hover {
  color: var(--accent);
  background: var(--accent-tint);
}

.nav-group__link.is-active {
  color: var(--text);
  font-weight: 600;
}

.org-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 0;
}

.org-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

@media (max-width: 480px) {
  .org-email {
    max-width: 110px;
  }
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.logout-btn:hover {
  color: var(--text);
}

.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-6) var(--space-5) var(--space-8);
  animation: rise-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--space-5);
}

/* ---------- Dashboard instrument strip ---------- */

/* Groups the strip by the same People/Money/Compliance categories the nav
   already uses (added 2026-10-10 after a design critique found the flat,
   ungrouped 12-row list failed the chunking/grouping cognitive-load check —
   staff already have a mental map of these categories from the nav itself). */
.instrument-group {
  margin-bottom: var(--space-5);
}

.instrument-group:last-child {
  margin-bottom: 0;
}

.instrument-group__label {
  margin: 0 0 var(--space-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* A hairline-separated row list, not a grid of cards: every entity stays a
   single scannable line, label left and count right, with the next row's
   detail revealed only on hover — progressive disclosure over a wall of
   same-size tiles. */
.instrument-strip {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--accent-border-tint);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.instrument-tile {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 13px var(--space-4);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 120ms ease, transform 160ms ease;
}

.instrument-tile:last-child {
  border-bottom: none;
}

.instrument-tile:hover {
  background: var(--accent-tint);
  transform: translateX(4px);
}

.instrument-tile:hover .instrument-tile__label {
  color: var(--accent);
}

.instrument-tile__value {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.instrument-tile__label {
  margin-top: 0;
  font-size: 13.5px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  font-weight: 500;
  transition: color 120ms ease;
}

/* ---------- Resource list + create layout ---------- */

.resource-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 860px) {
  .resource-layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.panel__title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* The generic list page's "Add new" form, collapsed behind a button
   instead of permanently open above the list. A native <details> element,
   same mechanism as the nav's grouped menus — no JS needed, and the
   browser's own open/close state means a rejected submission can force it
   open (see webResource.ts) without any extra client-side logic. */
.create-toggle {
  margin-bottom: 0;
}

.create-toggle summary {
  list-style: none;
}

.create-toggle summary::-webkit-details-marker {
  display: none;
}

.create-toggle[open] summary {
  margin-bottom: var(--space-5);
}

.create-toggle__open-label {
  display: none;
}

.create-toggle[open] .create-toggle__closed-label {
  display: none;
}

.create-toggle[open] .create-toggle__open-label {
  display: inline;
}

.create-toggle[open] summary {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.table-panel {
  background: var(--surface);
  border: 1px solid var(--accent-border-tint);
  border-radius: var(--radius);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
}

/* ---------- Forms ---------- */

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

.field:last-of-type {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
  font-weight: 500;
}

.input,
select.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.16);
}

.input:disabled {
  background: var(--bg);
  color: var(--text-secondary);
  cursor: not-allowed;
}

textarea.input {
  resize: vertical;
  min-height: 72px;
}

/* ---------- Buttons & links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  /* The secondary/default button: an accent-colored outline rather than
     the old invisible transparent-on-transparent style, so a non-primary
     action still reads as a deliberate, branded control, not a ghost. */
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--surface);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, opacity 120ms ease, transform 80ms ease;
  font-family: inherit;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-tint);
}

/* Tactile press feedback — a real-world button depresses; this one should too. */
.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  background: #0b3a63;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* The warm accent's one app-side job: marking an AI action as a distinct
   kind of button from an ordinary save/submit — "Draft with AI", "Suggest
   matches with AI". Same shape as .btn, warm instead of blue, so the two
   brand colors both have a real, consistent meaning in the app, not just
   on marketing. */
.btn-ai {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: var(--surface);
}

/* The generic .btn:disabled fade (opacity: 0.5) is right for a control with
   nothing left to do, but wrong here: these buttons' disabled state IS their
   status message ("Thinking…") for a multi-second AI round trip, and faded
   to 50% it measured under WCAG AA contrast (found on Ask during a design
   audit, 2026-10-10; reused here for Find Volunteers' own AI-match submit
   the same day, same reasoning) — exactly the moment a user most needs to
   read it. */
#ask-submit:disabled,
#match-submit:disabled {
  opacity: 1;
  cursor: wait;
}

.btn-ai:hover {
  background: rgba(168, 99, 26, 0.08);
}

.btn-full {
  width: 100%;
}

.link-muted {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}

.link-muted:hover {
  color: var(--text);
  text-decoration: underline;
}

/* For a link inline inside body copy (marketing-p, marketing-sub) — unlike
   .link-muted, this inherits the surrounding text's size instead of
   forcing 13px, which was shrinking linked words below their own
   sentence's size wherever .link-muted got reused inline. */
.link-inline {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.link-inline:hover {
  color: #0b3a63;
  text-decoration-color: #0b3a63;
}

/* Used on both links and buttons; the button resets keep a button from looking like a grey box. */
.link-action {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  margin-right: var(--space-4);
}

.link-action:hover {
  color: var(--accent);
  text-decoration: underline;
}

.link-danger {
  background: none;
  border: none;
  color: #9a3b3b;
  font-size: 12px;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.link-danger:hover {
  text-decoration: underline;
}

/* ---------- Tables ---------- */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: var(--space-3) var(--space-4);
  background: var(--accent-tint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  transition: background 120ms ease;
}

.data-table tbody tr:hover td {
  background: var(--accent-tint);
}

.data-table td.num {
  text-align: right;
}

/* An outflow (negative amount) differed from an inflow only by a leading
   "-" character — easy to miss in a dense table (Transactions design
   audit, 2026-10-12). */
.data-table td.num-negative {
  color: var(--status-attention-text);
}

/* A long free-text column rendered at full length used to size the whole
   column to its longest value, breaking the even row heights the rest of
   the list keeps (Programs design audit, 2026-10-12). Clamped to one line;
   the full value is still reachable via the cell's title attribute. */
.data-table td.cell-clamp {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-neutral,
.status-attention,
.status-resolved {
  font-weight: 600;
}

.status-neutral {
  color: var(--text-secondary);
}

.status-attention {
  color: var(--status-attention-text);
}

.status-resolved {
  color: var(--accent);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table .row-actions {
  text-align: right;
  white-space: nowrap;
}

.empty-state {
  padding: var(--space-6) var(--space-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ---------- Status banners ---------- */

.banner {
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  font-size: 13px;
  margin-bottom: var(--space-5);
  border: 1px solid;
  line-height: 1.5;
  animation: rise-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.banner-attention {
  background: var(--status-attention-bg);
  border-color: var(--status-attention-border);
  color: var(--status-attention-text);
}

.banner-error {
  background: var(--status-error-bg);
  border-color: var(--status-error-border);
  color: var(--status-error-text);
}

/* ---------- AI draft output ---------- */

.draft-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-6);
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.panel-narrow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  max-width: 640px;
}

/* ---------- Auth ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--space-5);
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  padding: var(--space-7) var(--space-6);
  animation: rise-in 240ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-wordmark {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 var(--space-6);
}

.auth-error {
  font-size: 13px;
  color: var(--status-error-text);
  margin: 0 0 var(--space-4);
}

.auth-footer {
  font-size: 13px;
  color: var(--text-secondary);
  margin: var(--space-5) 0 0;
}

/* ---------- Marketing (Persuade mode) ---------- */
/* Same tokens as the app shell — this is a surface inside the established
   world, not a new one. Persuade mode earns more scroll pacing and larger
   type than Operate, but the palette/material/type system is unchanged. */

.btn-lg {
  padding: 13px 24px;
  font-size: 14px;
}

.marketing-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Wider variant for grid sections that pair text with a visual — 880px
   reads well for pure prose, but crams a two-column hero/moment layout. */
.marketing-container--wide {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.marketing-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.marketing-header__top {
  max-width: 880px;
  margin: 0 auto;
  padding: var(--space-4) var(--space-5) var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.marketing-header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-shrink: 0;
}

.marketing-nav {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
}

.marketing-nav-link {
  padding: var(--space-2) 0 var(--space-3);
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.marketing-nav-link:hover {
  color: var(--text);
}

.marketing-nav-link.is-active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.marketing-timestamp {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 var(--space-3);
}

/* The hero is the one place both brand colors appear as a real field, not
   an accent: a deep-blue-to-warm diagonal, matching the logomark's own
   two-color relationship at full scale. Slow drift, not a loop you'd
   consciously notice — the content sitting on it is still the point. */
.marketing-hero {
  padding: var(--space-9) 0 var(--space-8);
  background: linear-gradient(135deg, #0a3a63 0%, #0f4c81 40%, #1a5f99 72%, var(--accent-warm) 100%);
  background-size: 200% 200%;
  color: var(--text-on-dark);
  position: relative;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .marketing-hero {
    animation: gradient-drift 20s ease-in-out infinite;
  }
}

.marketing-hero .marketing-timestamp {
  color: rgba(255, 255, 255, 0.65);
}

.marketing-hero .marketing-h1 {
  color: #ffffff;
}

.marketing-hero .marketing-sub {
  color: rgba(255, 255, 255, 0.82);
}

.marketing-hero .marketing-illustrative {
  color: rgba(255, 255, 255, 0.6);
}

.marketing-hero .marketing-hero-actions .link-muted {
  color: rgba(255, 255, 255, 0.75);
}

.marketing-hero .marketing-hero-actions .link-muted:hover {
  color: #ffffff;
}

.marketing-hero .btn-primary {
  border-color: var(--accent-warm);
  background: var(--accent-warm);
  color: var(--accent-warm-contrast);
}

.marketing-hero .btn-primary:hover {
  background: #8a5115;
}

.marketing-hero__visual {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.marketing-hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-8);
  align-items: center;
}

@media (max-width: 860px) {
  .marketing-hero__grid {
    grid-template-columns: 1fr;
  }
}

.marketing-hero__visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
}

.marketing-h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 var(--space-5);
  max-width: 14ch;
}

@media (max-width: 640px) {
  .marketing-h1 {
    font-size: 30px;
    max-width: none;
  }
}

.marketing-h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-4);
}

.marketing-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 62ch;
  margin: 0 0 var(--space-6);
}

.marketing-p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  max-width: 54ch;
}

.marketing-p--wide {
  max-width: 68ch;
}

.marketing-hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.marketing-moment {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border);
}

.marketing-moment__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.marketing-moment--reverse .marketing-moment__copy {
  order: 2;
}

@media (max-width: 760px) {
  .marketing-moment__grid {
    grid-template-columns: 1fr;
  }
  .marketing-moment--reverse .marketing-moment__copy {
    order: 0;
  }
}

.marketing-moment__visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}

.marketing-visual-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 var(--space-4);
}

.marketing-fake-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

.marketing-fake-ask {
  background: var(--bg);
  border-radius: var(--radius);
  padding: var(--space-4);
}

.marketing-fake-question {
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
  margin: 0 0 var(--space-3);
}

.marketing-fake-answer {
  font-size: 14px;
  margin: 0;
}

.marketing-illustrative {
  font-size: 11px;
  color: var(--text-secondary);
  margin: var(--space-3) 0 0;
}

.marketing-fake-letter {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  font-style: italic;
  margin: 0;
}

.marketing-close {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border);
}

/* Bold everywhere: the sign-up CTA — the single most important button on
   every marketing page — sits on the same full-bleed brand gradient as the
   showcase module, instead of defaulting back to plain paper right where
   the page asks for the action. The warm accent on the button, against the
   blue gradient, echoes the two-tone logomark rather than inventing a third
   color relationship. */
.marketing-final-cta {
  padding: var(--space-9) 0;
  text-align: center;
  background: linear-gradient(135deg, #0a3a63 0%, #0f4c81 55%, #1a5f99 100%);
  background-size: 200% 200%;
  color: var(--text-on-dark);
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .marketing-final-cta {
    animation: gradient-drift 18s ease-in-out infinite;
  }
}

.marketing-final-cta .marketing-h2 {
  color: #ffffff;
}

.marketing-final-cta .marketing-p {
  margin: 0 auto var(--space-6);
  max-width: 44ch;
  color: rgba(255, 255, 255, 0.78);
}

.marketing-final-cta a.link-inline {
  color: var(--text-on-dark);
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.marketing-final-cta a.link-inline:hover {
  color: var(--accent-warm);
  text-decoration-color: var(--accent-warm);
}

.marketing-final-cta .btn-primary {
  border-color: var(--accent-warm);
  background: var(--accent-warm);
  color: var(--accent-warm-contrast);
}

.marketing-final-cta .btn-primary:hover {
  background: #8a5115;
}

.marketing-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
}

.marketing-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: 13px;
  color: var(--text-secondary);
}

.marketing-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

/* ---------- Marketing interior pages ---------- */

.marketing-section {
  padding: var(--space-8) 0;
  border-bottom: 1px solid var(--border);
}

.marketing-section:last-of-type {
  border-bottom: none;
}

.marketing-page-hero {
  padding: var(--space-7) 0 var(--space-7);
  border-bottom: 1px solid var(--border);
}


.marketing-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

@media (max-width: 760px) {
  .marketing-feature-grid {
    grid-template-columns: 1fr;
  }
}

.marketing-feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  transition: border-color 160ms ease, background 160ms ease;
}

.marketing-feature-card:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.marketing-feature-card__title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

.marketing-feature-card__list {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.marketing-feature-card__list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}

.marketing-feature-card__list li:first-child {
  border-top: none;
  padding-top: 0;
}

.marketing-stat-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-5) 0;
}

.marketing-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  gap: var(--space-4);
}

@media (max-width: 560px) {
  /* A wrapped label + a nowrap value in a baseline-aligned row reads as
     interleaved garbage once the label wraps to two lines — stack
     instead of trying to keep them side by side. */
  .marketing-stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }
}

.marketing-stat-row:last-child {
  border-bottom: none;
}

.marketing-stat-row__label {
  color: var(--text);
}

.marketing-stat-row__value {
  color: var(--accent-warm);
  font-weight: 700;
  white-space: nowrap;
}

.marketing-checklist {
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.marketing-checklist li {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  max-width: 60ch;
}

.marketing-checklist li:first-child {
  border-top: none;
}

.marketing-checklist li strong {
  color: var(--text);
}

.marketing-faq-item {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
}

.marketing-faq-item:first-child {
  border-top: none;
  padding-top: 0;
}

.marketing-faq-item__q {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 var(--space-2);
  letter-spacing: -0.01em;
}

.marketing-faq-item__a {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
  max-width: 60ch;
}

.marketing-form {
  max-width: 440px;
}

.marketing-two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-7);
  align-items: start;
}

@media (max-width: 760px) {
  .marketing-two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- Dark "moment" module ---------- */
/* One high-contrast inverted section per page at most — a deliberate
   rhythm break, never the default surface. Spent on the content that
   most deserves visual weight (competitor cost reality, not chrome). */

.marketing-section-dark {
  background: var(--surface-dark);
  padding: var(--space-9) 0;
}

.marketing-section-dark .marketing-h2 {
  color: var(--text-on-dark);
}

.marketing-section-dark .marketing-p {
  color: var(--text-on-dark-secondary);
}

.marketing-section-dark .marketing-p strong {
  color: var(--text-on-dark);
}

.marketing-section-dark a.link-inline {
  color: var(--text-on-dark);
  text-decoration-color: var(--border-on-dark);
}

.marketing-section-dark a.link-inline:hover {
  color: var(--accent-warm);
  text-decoration-color: var(--accent-warm);
}

.marketing-section-dark .marketing-stat-table {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-on-dark);
}

.marketing-section-dark .marketing-stat-row {
  border-color: var(--border-on-dark);
}

.marketing-section-dark .marketing-stat-row__label {
  color: var(--text-on-dark-secondary);
}

.marketing-section-dark .marketing-stat-row__value {
  color: var(--accent-warm);
}

.marketing-big-number {
  font-size: 104px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  margin: 0 0 var(--space-4);
}

@media (max-width: 640px) {
  .marketing-big-number {
    font-size: 56px;
  }
}

/* ---------- Logomark ---------- */

.logomark {
  display: inline-flex;
  flex-shrink: 0;
}

/* The logomark's six rings are stroked with the blue accent (see
   LOGOMARK in html.ts) — invisible against the app header's own blue
   background. Only the app header needs this; the marketing header stays
   white, where the blue rings already read fine against it. */
.app-header .logomark g {
  stroke: rgba(255, 255, 255, 0.9);
}

/* ---------- Scroll-driven zoom ---------- */
/* Real scroll-linked motion via the CSS view-timeline spec — progressive
   enhancement, not a JS scroll handler: unsupported browsers simply show
   the image at rest (still correct, just without the zoom-in-on-scroll
   moment). This is the actual mechanism behind Apple's product-page
   reveal effect, not a decorative imitation of it. */
.scroll-zoom-frame {
  border-radius: calc(var(--radius) + 2px);
}

.scroll-zoom-image {
  display: block;
  width: 100%;
  height: auto;
  /* Clipping lives on the animated element itself, not a wrapping ancestor —
     an ancestor with overflow:hidden becomes its own scroll container and
     view() then tracks scroll progress against that (non-scrolling) box
     instead of the real page, silently freezing the animation at rest. */
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
}

@supports (animation-timeline: view()) {
  .scroll-zoom-image {
    animation-name: flockwell-scroll-zoom;
    animation-duration: auto; /* required: the default (0s) completes instantly regardless of scroll — "auto" is what lets a view() timeline actually drive progress */
    animation-timing-function: linear;
    animation-fill-mode: both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }

  @keyframes flockwell-scroll-zoom {
    from {
      transform: scale(1.18);
    }
    to {
      transform: scale(1);
    }
  }
}

/* ---------- Full-bleed color showcase ---------- */
/* The "way more color" section — a real saturated brand-color field, not
   an accent on a neutral ground. Persuade mode has explicit permission
   for this (DESIGN.md's Restrained strategy is the Operate-mode default,
   not a site-wide law); used once per page at most, same restraint
   principle as the dark module, just spent on color instead of contrast. */
.marketing-showcase {
  background: linear-gradient(135deg, #0a3a63 0%, #0f4c81 55%, #1a5f99 100%);
  background-size: 200% 200%;
  padding: var(--space-9) 0;
  color: var(--text-on-dark);
  position: relative;
}

@media (prefers-reduced-motion: no-preference) {
  .marketing-showcase {
    animation: gradient-drift 18s ease-in-out infinite;
  }
}

.marketing-showcase .marketing-h2 {
  color: #ffffff;
}

.marketing-showcase .marketing-p {
  color: rgba(255, 255, 255, 0.78);
}

.marketing-showcase__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-8);
  align-items: center;
}

@media (max-width: 860px) {
  .marketing-showcase__grid {
    grid-template-columns: 1fr;
  }
}

.marketing-showcase .scroll-zoom-frame {
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 64px rgba(5, 20, 35, 0.35);
}
