/* ==========================================================================
   Quiet Logic Solutions — v2 design preview
   Idea: Complexity → Clarity. Editorial serif headlines, technical-drawing
   details (figure labels, hairlines, faint grid), quiet progressive motion.
   No dependencies: system fonts, modern CSS, small vanilla JS.
   ========================================================================== */

:root {
  /* Brand navy */
  --navy-950: #00122b;
  --navy-900: #001736;
  --navy-800: #001c41;
  --navy-700: #082859;
  --navy-600: #103875;
  --navy-500: #1e4d94;
  --navy-200: #c2d4ec;
  --navy-100: #e2ecf7;
  --navy-50:  #f0f5fb;

  /* Slate */
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50:  #f8fafc;
  --white:     #ffffff;

  /* Accents (used sparingly) */
  --blue: #2563eb;
  --sky: #0284c7;
  --emerald: #10b981;
  --error-red: #b91c1c;
  --error-red-light: #fee2e2;
  --success-green: #15803d;
  --success-green-light: #dcfce7;

  /* Lines */
  --line: color-mix(in srgb, var(--navy-800) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--navy-800) 22%, transparent);
  --grid-line: color-mix(in srgb, var(--navy-800) 6%, transparent);

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, ui-serif, Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --step-hero: clamp(2.6rem, 1.5rem + 4.2vw, 4.75rem);
  --step-h2: clamp(2rem, 1.4rem + 2vw, 3rem);
  --step-h3: 1.25rem;

  /* Layout */
  --container: 1160px;
  --gutter: clamp(1rem, 0.5rem + 2vw, 1.5rem);
  --header-height: 68px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --shadow-card: 0 1px 2px rgba(0, 28, 65, 0.04), 0 8px 24px -12px rgba(0, 28, 65, 0.12);
  --shadow-lifted: 0 2px 4px rgba(0, 28, 65, 0.04), 0 20px 40px -16px rgba(0, 28, 65, 0.22);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==========================================================================
   Dark theme
   The palette variables are remapped, so components keep their own rules.
   Sections that are already dark (navy band, footer) keep the light-theme
   values so their white-on-navy styling stays the same.
   ========================================================================== */
:root { color-scheme: light; }

:root[data-theme="dark"] {
  color-scheme: dark;

  --white:     #0d1a2e;   /* surfaces: cards, header, form */
  --slate-50:  #07101e;   /* page background */
  --slate-100: #112139;
  --slate-200: #1b2c47;
  --slate-300: #2b3e5d;
  --slate-400: #6c7d98;
  --slate-500: #8a99b1;
  --slate-600: #a7b3c7;
  --slate-700: #c3cddc;
  --slate-800: #dbe2ed;
  --slate-900: #eef2f8;

  --navy-800:  #e8eef8;   /* headings, primary text, primary button */
  --navy-700:  #ffffff;
  --navy-600:  #a5c4ff;
  --navy-500:  #7fa8f2;
  --navy-200:  #2d4a78;
  --navy-100:  #18305a;
  --navy-50:   #10223f;

  --blue: #4f8bff;
  --success-green: #4ade80;
  --success-green-light: rgba(34, 197, 94, 0.14);
  --error-red: #f87171;
  --error-red-light: rgba(239, 68, 68, 0.14);

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px -14px rgba(0, 0, 0, 0.7);
  --shadow-lifted: 0 2px 4px rgba(0, 0, 0, 0.35), 0 22px 44px -18px rgba(0, 0, 0, 0.8);
}

/* Already-dark sections keep their original palette */
:root[data-theme="dark"] :is(.band, .site-footer, .compare-switch) {
  --white: #ffffff;
  --slate-50: #f8fafc;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --navy-800: #001c41;
  --navy-200: #c2d4ec;
  --navy-50: #f0f5fb;
}

:root[data-theme="dark"] .band { background-color: #0a1b36; }
:root[data-theme="dark"] .site-footer { background-color: #040a14; }

/* Small fixes for hard-coded light colours */
:root[data-theme="dark"] .brand-logo,
:root[data-theme="dark"] .footer-logo { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16); }
:root[data-theme="dark"] .mockup-topbar { background-color: #14243d; }
:root[data-theme="dark"] .trip-preview-ledger { background-color: #0f1e34; }
:root[data-theme="dark"] .form-control.is-invalid { background-color: rgba(239, 68, 68, 0.08); }
:root[data-theme="dark"] .form-status.success { border-color: rgba(74, 222, 128, 0.4); }
:root[data-theme="dark"] .form-status.error { border-color: rgba(248, 113, 113, 0.4); }
:root[data-theme="dark"] .slide-mini-canvas { background: linear-gradient(135deg, #1e3a6b 0%, #102a52 100%); --white: #ffffff; --navy-100: #e2ecf7; }
:root[data-theme="dark"] .worship-btn-mock:not(.outline) { color: #0d1a2e; }
:root[data-theme="dark"] .sort-dot.answer { stroke: #052e1f; }

/* Theme switch button */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--navy-800);
  cursor: pointer;
  transition: border-color 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.theme-toggle:hover { border-color: var(--navy-600); background-color: var(--navy-50); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Smooth cross-fade when switching themes (where supported) */
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 350ms; }

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-800);
  background-color: var(--slate-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: calc(var(--header-height) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* overflow-x: clip keeps the sticky header working */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  background-color: var(--slate-50);
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
main:focus { outline: none; }

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

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: clip;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--navy-800);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Shared technical-drawing label */
.fig-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: color-mix(in srgb, var(--white) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  view-transition-name: site-header;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.brand-name {
  font-size: 1.0625rem;
  font-weight: 650;
  color: var(--navy-800);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--slate-600);
  padding: 0.5rem 0.125rem;
  transition: color 150ms var(--ease-out);
}

.nav-link:hover,
.nav-link.active { color: var(--navy-800); }

@media (min-width: 821px) {
  .nav-link:not(.nav-btn) {
    background-image: linear-gradient(var(--navy-800), var(--navy-800));
    background-size: 0 1.5px;
    background-position: 50% 100%;
    background-repeat: no-repeat;
    transition: color 150ms var(--ease-out), background-size 250ms var(--ease-out);
  }
  .nav-link.active:not(.nav-btn) { background-size: 100% 1.5px; }
}

.nav-link.nav-btn {
  background-color: var(--navy-800);
  color: var(--white);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
}

.nav-link.nav-btn:hover { background-color: var(--navy-700); }

.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hamburger-bar {
  display: block;
  width: 18px;
  height: 2px;
  background-color: var(--navy-800);
  border-radius: 2px;
  transition: transform 250ms var(--ease-out), opacity 250ms var(--ease-out);
}

@media (max-width: 820px) {
  .mobile-nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background-color: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 1.25rem var(--gutter) 1.5rem;
    box-shadow: 0 16px 24px rgba(0, 28, 65, 0.08);
  }

  .site-nav.is-open { display: block; }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
  }

  .nav-link { display: block; font-size: 1.0625rem; padding: 0.6rem 0; }
  .nav-link.nav-btn { text-align: center; margin-top: 0.5rem; padding: 0.7rem 1rem; }

  .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(2) { opacity: 0; }
  .mobile-nav-toggle[aria-expanded="true"] .hamburger-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out), transform 150ms var(--ease-out);
}

.btn-icon { transition: transform 200ms var(--ease-out); }
.btn:hover .btn-icon { transform: translateX(3px); }

.btn-primary { background-color: var(--navy-800); color: var(--white); }
.btn-primary:hover { background-color: var(--navy-700); }

.btn-secondary {
  background-color: var(--white);
  color: var(--navy-800);
  border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--navy-600); }

.btn-on-dark { background-color: var(--white); color: var(--navy-800); }
.btn-on-dark:hover { background-color: var(--navy-50); }

/* ==========================================================================
   Section heading pattern: "01 —— How we help"
   ========================================================================== */
.section {
  padding-block: clamp(4rem, 3rem + 4vw, 7rem);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.section-index {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy-500);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--line);
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--step-h2);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--navy-800);
  max-width: 22ch;
}

.section-intro {
  margin-top: 1rem;
  max-width: 60ch;
  font-size: 1.0625rem;
  color: var(--slate-600);
}

.section-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 4rem;
  margin-bottom: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

.section-top > div {
  flex: 1 1 30rem;
  min-width: 0;
}

.section-aside {
  flex: 0 1 24rem;
  font-size: 1rem;
  color: var(--slate-600);
  padding-bottom: 0.35rem;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 2rem + 6vw, 7.5rem) clamp(4rem, 3rem + 4vw, 7rem);
  background-color: var(--white);
  border-bottom: 1px solid var(--line);
  overflow: clip;
}

/* Faint drafting grid, fading out toward the edges */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
  mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2.5rem, 1rem + 4vw, 5rem);
  align-items: center;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-500);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: var(--step-hero);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--navy-800);
  margin-bottom: 1.75rem;
}

.hero-title em {
  font-style: italic;
  color: var(--navy-600);
}

.hero-subtext {
  font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  color: var(--slate-700);
  line-height: 1.5;
  max-width: 34rem;
  margin-bottom: 0.875rem;
}

.hero-invitation {
  font-size: 1rem;
  color: var(--slate-600);
  max-width: 34rem;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero figure: Complexity → Clarity */
.hero-figure {
  background-color: color-mix(in srgb, var(--white) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: clip;
}

.figure-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
}

.clarity-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 520 / 380;
}

.clarity-svg .thread {
  fill: none;
  stroke: var(--navy-800);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0.55;
}

.clarity-svg .thread.key {
  stroke: var(--blue);
  stroke-width: 2;
  opacity: 1;
}

.clarity-svg .node {
  fill: var(--white);
  stroke: var(--navy-800);
  stroke-width: 1.4;
}

.clarity-svg .node.key {
  fill: var(--blue);
  stroke: var(--blue);
}

.clarity-svg .link {
  stroke: var(--navy-800);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.4;
}

/* Scatter → Sort */
.clarity-svg .sort-guide {
  stroke: var(--navy-800);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  opacity: 0.22;
}

.clarity-svg .sort-dot {
  stroke: var(--white);
  stroke-width: 1.25;
}

.clarity-svg .sort-dot.answer {
  stroke: #ecfdf5;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.55));
}

.clarity-svg .sort-ripple,
.clarity-svg .sort-answer-ring {
  fill: none;
  stroke-width: 1.5;
  opacity: 0;
}

.clarity-svg .sort-answer-ring { stroke: var(--emerald); stroke-width: 2; }

.clarity-svg .sort-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  fill: var(--slate-500);
}

.clarity-svg .sort-guides,
.clarity-svg .sort-labels,
.clarity-svg .sort-callout { opacity: 0; }

.clarity-svg .sort-leader {
  fill: none;
  stroke: var(--emerald);
  stroke-width: 1.25;
}

.clarity-svg .sort-leader-dot { fill: var(--emerald); }

.clarity-svg .sort-callout-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  fill: #059669;
}

:root[data-theme="dark"] .clarity-svg .sort-callout-label { fill: #34d399; }

.clarity-svg .sort-sweep { opacity: 0; transition: opacity 250ms var(--ease-out); }

.clarity-svg .settle {
  transition: opacity 700ms var(--ease-out);
}

.clarity-svg.is-tangled .settle { opacity: 0; }

.figure-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1rem;
  border-top: 1px solid var(--line);
}

.figure-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.figure-toggle:hover { color: var(--navy-800); border-color: var(--navy-600); }
.figure-toggle[hidden] { display: none; }
.figure-toggle .icon-play { display: none; }
.figure-toggle[aria-label="Play animation"] .icon-play { display: block; }
.figure-toggle[aria-label="Play animation"] .icon-pause { display: none; }

.figure-caption .state { color: var(--navy-600); }

/* Hero entrance (load-time, once) */
@media (prefers-reduced-motion: no-preference) {
  .hero-content > * {
    animation: rise 800ms var(--ease-out) both;
  }
  .hero-content > :nth-child(2) { animation-delay: 80ms; }
  .hero-content > :nth-child(3) { animation-delay: 160ms; }
  .hero-content > :nth-child(4) { animation-delay: 220ms; }
  .hero-content > :nth-child(5) { animation-delay: 280ms; }
  .hero-figure { animation: rise 900ms 200ms var(--ease-out) both; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 560px; }
}

@media (max-width: 640px) {
  .hero-actions .btn { width: 100%; }
}

/* ==========================================================================
   Hero background animation (Fig. 00, full-bleed, no labels)
   ========================================================================== */
.hero {
  isolation: isolate;
  min-height: clamp(560px, 84vh, 780px);
  display: grid;
  align-items: center;
}

.hero > .container { position: relative; z-index: 1; }
.hero-grid { grid-template-columns: minmax(0, 1fr); }
.hero-content { max-width: 640px; }

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-bg .clarity-svg {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
}

/* Soft fade behind the text so it stays readable while items fly past */
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    var(--white) 0%,
    color-mix(in srgb, var(--white) 88%, transparent) 36%,
    color-mix(in srgb, var(--white) 40%, transparent) 50%,
    transparent 60%);
}

.hero-motion-toggle {
  position: absolute;
  z-index: 2;
  right: max(1rem, calc((100% - var(--container)) / 2 + var(--gutter)));
  bottom: 1.25rem;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1px solid var(--line-strong);
  background-color: color-mix(in srgb, var(--white) 85%, transparent);
  color: var(--slate-600);
  cursor: pointer;
  transition: color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.hero-motion-toggle:hover { color: var(--navy-800); border-color: var(--navy-600); }
.hero-motion-toggle[hidden] { display: none; }
.hero-motion-toggle .icon-play { display: none; }
.hero-motion-toggle.is-paused .icon-play { display: block; }
.hero-motion-toggle.is-paused .icon-pause { display: none; }

@media (max-width: 899px) {
  /* The sorted grid sits below the text on narrow screens */
  .hero {
    min-height: 0;
    padding-bottom: 300px;
  }
  .hero-bg::after {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--white) 92%, transparent) 0%,
      color-mix(in srgb, var(--white) 82%, transparent) 55%,
      transparent 70%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .hero-bg {
      animation: hero-bg-away linear both;
      animation-timeline: view();
      animation-range: exit 0% exit 100%;
    }
  }
}

@keyframes hero-bg-away { to { opacity: 0.3; } }

/* ==========================================================================
   Services — editorial columns that lift into panels on hover
   ========================================================================== */
.services { background-color: var(--slate-50); }

.services-list {
  --service-pad: min(1.5rem, var(--gutter));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  /* Panels extend past the text column so the text stays aligned with the heading */
  margin-inline: calc(-1 * var(--service-pad));
}

.service {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem var(--service-pad) 1.5rem;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: background-color 250ms var(--ease-out), box-shadow 250ms var(--ease-out);
}

/* Top rule: navy, turns blue and thickens on hover */
.service::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--service-pad);
  right: var(--service-pad);
  height: 2px;
  background-color: var(--navy-800);
  transition: background-color 250ms var(--ease-out), left 300ms var(--ease-out), right 300ms var(--ease-out), height 200ms var(--ease-out);
}

.service:hover,
.service:focus-within {
  background-color: var(--white);
  box-shadow: var(--shadow-card);
}

.service:hover::before,
.service:focus-within::before {
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--blue);
}

.service-top {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.service-icon-box {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background-color: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
  transition: background-color 250ms var(--ease-out), color 250ms var(--ease-out), border-color 250ms var(--ease-out);
}

.service:hover .service-icon-box,
.service:focus-within .service-icon-box {
  background-color: var(--navy-800);
  border-color: var(--navy-800);
  color: var(--white);
}

.service-num { color: var(--navy-500); }

.service-title {
  font-size: var(--step-h3);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--navy-800);
  margin-bottom: 0.5rem;
}

.service-text {
  flex: 1;
  color: var(--slate-600);
  line-height: 1.7;
  max-width: 34ch;
}

.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--navy-800);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color 200ms var(--ease-out), color 200ms var(--ease-out);
}

.service-link span { transition: transform 200ms var(--ease-out); }

.service:hover .service-link { color: var(--blue); }
.service-link:hover { text-decoration-color: currentColor; }
.service:hover .service-link span { transform: translateX(4px); }

@media (max-width: 700px) {
  .services-list { grid-template-columns: 1fr; gap: 0.75rem; }
  .service-text { max-width: none; }
}

/* ==========================================================================
   Selected work — bento grid with container-query tiles
   ========================================================================== */
.work { background-color: var(--white); border-block: 1px solid var(--line); }

.bento {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.25rem;
}

.tile {
  container-type: inline-size;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: clip;
  transition: border-color 200ms var(--ease-out), box-shadow 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.tile--feature { grid-column: span 4; }
.tile--side    { grid-column: span 2; }

.tile:hover {
  border-color: var(--navy-200);
  box-shadow: var(--shadow-lifted);
  transform: translateY(-2px);
}

/* Whole tile is clickable via the title link; show focus on the tile */
.tile-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tile-title a:focus-visible { outline: none; }

.tile:has(.tile-title a:focus-visible) {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.tile-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tile-media {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem;
  background-color: var(--slate-50);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 22px 22px;
  border-bottom: 1px solid var(--line);
}

.tile-media-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tile-media .mockup-window {
  width: 100%;
  margin-block: auto;
  box-shadow: var(--shadow-card);
}

.illustrative-tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--slate-600);
  background-color: var(--white);
  border: 1px dashed var(--slate-300);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem 1.375rem 1.375rem;
}

.tile-kind { color: var(--slate-500); }

.tile-title {
  font-size: 1.3125rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--navy-800);
}

.tile-text {
  font-size: 0.9375rem;
  color: var(--slate-600);
  line-height: 1.65;
}

.tile-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 0.5rem;
}

.tile-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.tile-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-800);
}

.tile-more span {
  display: inline-block;
  transition: transform 200ms var(--ease-out);
}

.tile:hover .tile-more span { transform: translateX(3px); }

/* External link sits above the stretched title link */
.tile-ext {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tile-ext:hover { color: var(--navy-800); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--success-green);
  background-color: var(--success-green-light);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-full);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
  .status-dot { animation: pulse 2.4s ease-in-out infinite; }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success-green) 45%, transparent); }
  50%      { box-shadow: 0 0 0 5px color-mix(in srgb, var(--success-green) 0%, transparent); }
}

/* Previews respond to the space they're given, not the viewport */
.tile-media { container-type: inline-size; }

@container (max-width: 440px) {
  .worship-preview-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .slide-mini-canvas { min-height: 72px; }
  .module-cards-row { grid-template-columns: minmax(0, 1fr) !important; }
  .mockup-title-bar { font-size: 0.625rem; }
  .tile-media .schedule-title,
  .tile-media .schedule-sub,
  .tile-media .step-label { white-space: normal; }
}

/* Feature tile: bigger preview once there's room */
@container (min-width: 560px) {
  .tile--feature .tile-media { padding: 1.5rem 2rem 2rem; }
  .tile--feature .mockup-window { zoom: 1.25; }
  .tile--feature .tile-body { padding: 1.5rem 2rem 1.75rem; }
  .tile--feature .tile-title { font-family: var(--font-serif); font-weight: 400; font-size: 2rem; letter-spacing: -0.02em; }
  .tile--feature .tile-text { font-size: 1rem; max-width: 52ch; }
}

@media (max-width: 960px) {
  .tile--feature { grid-column: 1 / -1; }
  .tile--side { grid-column: span 3; }
}

@media (max-width: 640px) {
  .bento { gap: 1rem; }
  .tile--side { grid-column: 1 / -1; }
}

/* ==========================================================================
   Examples of our work — three compact groups
   ========================================================================== */
.work-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.work-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  padding: 1.5rem;
  background-color: var(--slate-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.work-group-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.work-group-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--navy-50);
  border: 1px solid var(--navy-100);
  color: var(--navy-700);
}

.work-group-title {
  font-size: var(--step-h3);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--navy-800);
}

.work-group-text {
  color: var(--slate-600);
  line-height: 1.7;
}

.work-group-note,
.work-group-examples {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.work-group-note {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  color: var(--slate-700);
}

.work-group-examples { color: var(--slate-700); }
.work-group-examples .fig-label { display: block; margin-bottom: 0.35rem; }

.work-group-examples a {
  font-weight: 600;
  color: var(--navy-800);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 150ms var(--ease-out), text-decoration-color 150ms var(--ease-out);
}

.work-group-examples a:hover { color: var(--blue); text-decoration-color: currentColor; }
.work-group-sep { color: var(--slate-400); }

@media (max-width: 900px) {
  .work-groups { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .work-groups .work-group:nth-child(2) { animation-range: entry 8% cover 33%; }
    .work-groups .work-group:nth-child(3) { animation-range: entry 16% cover 38%; }
  }
}

/* ==========================================================================
   About + How we work — dark band
   ========================================================================== */
.band {
  position: relative;
  background-color: var(--navy-950);
  color: var(--white);
  overflow: clip;
}

.band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
  pointer-events: none;
}

.band .container { position: relative; }
.band .section-index { color: #93c5fd; }
.band .section-kicker { color: var(--slate-400); }
.band .section-head::after { background-color: rgba(255, 255, 255, 0.14); }
.band .section-title { color: var(--white); }
.band :focus-visible { outline-color: #93c5fd; }

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 5vw, 6rem);
  align-items: start;
}

.about-prose {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.75rem;
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--slate-300);
  max-width: 34rem;
}

.steps { display: grid; }

.step {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0 1.25rem;
  padding-block: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.step:last-child { border-bottom: 1px solid rgba(255, 255, 255, 0.14); }

.step-numeral {
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1;
  color: var(--navy-200);
  opacity: 0.85;
}

.step-title {
  font-size: 1.1875rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin-bottom: 0.375rem;
}

.step-text {
  color: var(--slate-300);
  line-height: 1.65;
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .step-numeral { font-size: 2.125rem; }
}

/* ==========================================================================
   Contact
   ========================================================================== */
.contact { background-color: var(--slate-50); overflow-x: clip; }

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2.5rem, 1rem + 4vw, 5rem);
  align-items: start;
}

.contact-aside { position: sticky; top: calc(var(--header-height) + 2rem); }

.preview-notice {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
  padding: 1rem 1.125rem;
  border: 1px dashed var(--slate-300);
  border-radius: var(--radius-md);
  background-color: var(--white);
  font-size: 0.875rem;
  color: var(--slate-700);
}

.preview-notice svg { flex-shrink: 0; color: var(--navy-600); margin-top: 2px; }

.contact-form {
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 0.75rem + 2vw, 2.25rem);
  box-shadow: var(--shadow-card);
}

.form-instructions {
  font-size: 0.8125rem;
  color: var(--slate-600);
  margin-bottom: 1.25rem;
}

.form-status {
  padding: 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.form-status[hidden] { display: none; }
.form-status.success { background-color: var(--success-green-light); border: 1px solid #86efac; color: var(--success-green); }
.form-status.error { background-color: var(--error-red-light); border: 1px solid #fca5a5; color: var(--error-red); }

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.4rem;
}

.required-indicator { color: var(--error-red); }
.optional-tag { font-size: 0.75rem; font-weight: 400; color: var(--slate-500); }

.form-control {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--slate-900);
  background-color: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.form-control:focus {
  outline: none;
  background-color: var(--white);
  border-color: var(--navy-600);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent);
}

.form-control.is-invalid { border-color: var(--error-red); background-color: #fffafb; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.15); }

textarea.form-control { resize: vertical; field-sizing: content; min-height: 8rem; }

.field-hint { display: block; font-size: 0.8125rem; color: var(--slate-500); margin-top: 0.35rem; }
.field-error { display: block; font-size: 0.8125rem; color: var(--error-red); margin-top: 0.35rem; min-height: 1.1rem; }

.form-submit-row { padding-top: 0.5rem; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-aside { position: static; }
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .btn-submit { width: 100%; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background-color: var(--navy-950);
  color: var(--white);
  padding-block: 4rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer :focus-visible { outline-color: #93c5fd; }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 3rem;
  padding-bottom: 2.5rem;
}

.footer-brand-row { display: inline-flex; align-items: center; gap: 0.75rem; }
.footer-logo { border-radius: 6px; }
.footer-brand-title { font-size: 1.0625rem; font-weight: 650; }
.footer-tagline { margin-top: 1rem; font-family: var(--font-serif); font-size: 1.125rem; color: var(--slate-300); }

.footer-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }

.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-400);
  margin-bottom: 1rem;
}

.footer-col ul { display: grid; gap: 0.75rem; }
.footer-col a { font-size: 0.9375rem; color: var(--slate-300); }
.footer-col a:hover { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
  font-size: 0.8125rem;
  color: var(--slate-400);
}

@media (max-width: 768px) {
  .footer-grid, .footer-nav { grid-template-columns: 1fr; gap: 2rem; }
}

/* ==========================================================================
   Case study pages
   ========================================================================== */
.case-hero {
  position: relative;
  padding-block: 2.5rem clamp(3.5rem, 2.5rem + 3vw, 5.5rem);
  background-color: var(--white);
  border-bottom: 1px solid var(--line);
  overflow: clip;
}

.case-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 60% 80% at 80% 50%, #000 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 80% at 80% 50%, #000 15%, transparent 70%);
  pointer-events: none;
}

.case-hero .container { position: relative; }

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--slate-500);
  margin-bottom: 2.5rem;
}

.breadcrumb li + li::before { content: "/"; margin-right: 0.5rem; color: var(--slate-400); }
.breadcrumb a { color: var(--slate-600); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumb a:hover { color: var(--navy-800); }

.case-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}

.case-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 1.75rem + 3vw, 4rem);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--navy-800);
  margin: 0.75rem 0 1.25rem;
}

.case-lead {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--slate-700);
  margin-bottom: 2rem;
}

.case-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.case-facts dt { margin-bottom: 0.25rem; }
.case-facts dd { font-size: 0.9375rem; font-weight: 500; color: var(--navy-800); }

.case-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }

.case-figure {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: clip;
  box-shadow: var(--shadow-card);
}

.case-figure .tile-media { border-bottom: 0; padding: 1.25rem; }

@container (min-width: 480px) {
  .case-figure .mockup-window { zoom: 1.15; }
}

.case-figure { container-type: inline-size; }

.case-body { padding-block: clamp(3.5rem, 2.5rem + 3vw, 5.5rem); background-color: var(--slate-50); }

.case-columns {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 5rem);
}

.case-toc { position: sticky; top: calc(var(--header-height) + 2rem); align-self: start; }
.case-toc ol { display: grid; gap: 0.625rem; margin-top: 1rem; }
.case-toc a { font-size: 0.9375rem; color: var(--slate-600); }
.case-toc a:hover { color: var(--navy-800); text-decoration: underline; text-underline-offset: 3px; }

.case-main { max-width: 44rem; }

.case-section + .case-section { margin-top: 3.5rem; }

.case-section h2 {
  font-family: var(--font-serif);
  font-size: 1.875rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  color: var(--navy-800);
  margin: 0.5rem 0 1rem;
}

.case-section p { font-size: 1.0625rem; line-height: 1.75; color: var(--slate-700); }
.case-section p + p { margin-top: 1rem; }

.feature-list { display: grid; gap: 0; border-top: 1px solid var(--line); }

.feature-list li {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: 0.25rem 1.5rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  color: var(--slate-700);
  line-height: 1.6;
}

.feature-list strong { font-weight: 600; color: var(--navy-800); }

.independence-note {
  margin-top: 3.5rem;
  padding: 1.25rem 1.5rem;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--navy-600);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  color: var(--slate-600);
}

.case-cta { padding-block: clamp(3.5rem, 2.5rem + 3vw, 5rem); }

.case-cta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.case-cta h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.case-cta p { color: var(--slate-300); font-size: 1.0625rem; }

.case-next { background-color: var(--white); border-top: 1px solid var(--line); }

.case-next-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.case-next a {
  display: grid;
  gap: 0.375rem;
  padding: 2rem 0;
  color: var(--navy-800);
}

.case-next a strong {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.015em;
}

.case-next a:hover strong { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.case-next .next-link { text-align: right; padding-left: 1.5rem; border-left: 1px solid var(--line); }

@media (max-width: 900px) {
  .case-hero-grid { grid-template-columns: 1fr; }
  .case-columns { grid-template-columns: 1fr; }
  .case-toc { display: none; }
}

@media (max-width: 640px) {
  .case-actions .btn { width: 100%; }
  .feature-list li { grid-template-columns: 1fr; }
  .case-next-inner { grid-template-columns: 1fr; }
  .case-next .next-link { text-align: left; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* ==========================================================================
   Scroll motion — scrubbed by the scroll position, so every effect plays
   forwards when scrolling down and in reverse when scrolling back up.
   Progressive enhancement: without support (or with reduced motion) the
   page is simply static and fully visible.
   ========================================================================== */

/* Reading-progress line along the bottom of the header */
.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--sky), var(--blue) 60%, var(--emerald));
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* Smooth page-to-page transitions; previews morph between home and case pages */
  @view-transition { navigation: auto; }

  ::view-transition-group(*) {
    animation-duration: 450ms;
    animation-timing-function: var(--ease-out);
  }

  @supports (animation-timeline: view()) {
    /* Header: progress line fills; header firms up after the first scroll */
    .scroll-progress {
      animation: progress-fill linear both;
      animation-timeline: scroll(root block);
    }

    .site-header {
      animation: header-firm linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 160px;
    }

    .brand-logo {
      animation: logo-tuck linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 160px;
    }

    /* Hero: text and figure ease away as you leave, and return as you come back */
    .hero::before {
      animation: grid-pan linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 100vh;
    }

    .hero-content {
      animation: hero-away linear both;
      animation-timeline: view();
      animation-range: exit -15% exit 95%;
    }

    .hero-figure {
      animation: rise 900ms 200ms var(--ease-out) both, figure-away linear both;
      animation-timeline: auto, view();
      animation-range: normal, exit -10% exit 100%;
    }

    /* Content rises in as it enters (and sinks back when scrolled past upwards) */
    .reveal {
      animation: rise-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 28%;
    }

    .services-list .service:nth-child(2),
    .bento .tile:nth-child(2),
    .bento .tile:nth-child(4),
    .steps .step:nth-child(2) { animation-range: entry 8% cover 33%; }

    .services-list .service:nth-child(3),
    .steps .step:nth-child(3) { animation-range: entry 16% cover 38%; }

    /* Service icons draw themselves in as each column enters */
    .service { view-timeline: --service block; }

    .service-icon-box :is(path, rect, circle) {
      stroke-dasharray: 1;
      animation: icon-draw linear both;
      animation-timeline: --service;
      animation-range: entry 25% cover 45%;
    }

    @media (min-width: 861px) {
      .contact-aside.reveal { animation-name: in-left; }
      .contact-form.reveal  { animation-name: in-right; }
    }

    /* Section headings: the rule draws across; titles fade up as they leave the top */
    .section-head { view-timeline: --head block; }

    .section-head::after {
      transform-origin: 0 50%;
      animation: draw-line linear both;
      animation-timeline: --head;
      animation-range: entry 30% cover 45%;
    }

    .section-title {
      animation: title-cycle linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }

    /* Previews drift gently inside their tiles (parallax) */
    .tile-media .mockup-window {
      animation: float-y linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }

    /* Navy band: grid drifts; each step's numeral comes into focus mid-screen */
    .band { view-timeline: --band block; }

    .band::before {
      animation: grid-pan linear both;
      animation-timeline: --band;
    }

    .step-numeral {
      transform-origin: 0 60%;
      animation: numeral-focus linear both;
      animation-timeline: view();
      animation-range: cover 15% cover 85%;
    }

    /* About text lights up word by word as you read (words split by v2.js) */
    .about-prose .word {
      animation: word-light linear both;
      animation-timeline: view();
      animation-range: cover 5% cover 38%;
    }
  }
}

@keyframes progress-fill { to { transform: scaleX(1); } }

@keyframes header-firm {
  to {
    background-color: color-mix(in srgb, var(--white) 96%, transparent);
    box-shadow: 0 8px 28px -14px rgba(0, 28, 65, 0.28);
  }
}

@keyframes logo-tuck { to { scale: 0.88; } }

@keyframes grid-pan {
  from { background-position: center 0; }
  to   { background-position: center 88px; }
}

@keyframes hero-away {
  to { opacity: 0.1; translate: 0 -70px; }
}

@keyframes figure-away {
  to { opacity: 0.25; scale: 0.93; translate: 0 -40px; }
}

@keyframes rise-in {
  from { opacity: 0; translate: 0 56px; scale: 0.97; }
  to   { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes in-left {
  from { opacity: 0; translate: -48px 0; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes in-right {
  from { opacity: 0; translate: 48px 0; }
  to   { opacity: 1; translate: 0 0; }
}

@keyframes icon-draw {
  from { stroke-dashoffset: 1; }
  to   { stroke-dashoffset: 0; }
}

@keyframes draw-line {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@keyframes title-cycle {
  0%   { opacity: 0; translate: 0 28px; }
  22%  { opacity: 1; translate: 0 0; }
  82%  { opacity: 1; translate: 0 0; }
  100% { opacity: 0.15; translate: 0 -24px; }
}

@keyframes float-y {
  from { translate: 0 26px; }
  to   { translate: 0 -26px; }
}

@keyframes numeral-focus {
  0%, 100% { color: var(--navy-200); opacity: 0.45; scale: 1; }
  50%      { color: #93c5fd; opacity: 1; scale: 1.2; }
}

@keyframes word-light {
  from { color: rgba(203, 213, 225, 0.25); }
  to   { color: #e2e8f0; }
}

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

/* ==========================================================================
   Illustrative mockup internals (shared with v1)
   ========================================================================== */

/* Real app screenshots (sample data) on detail pages */
.app-shots {
  display: grid;
  gap: 0.75rem;
  width: 100%;
  margin-block: auto;
}

.app-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md, 10px);
  border: 1px solid var(--line, #e2e8f0);
  box-shadow: var(--shadow-card);
  background-color: #ffffff;
}
:root {
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem;
}
/* Mockup Window Styling */
.mockup-window {
  background-color: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-300);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  min-width: 0;
}

.mockup-topbar {
  background-color: #f1f4f8;
  border-bottom: 1px solid var(--slate-200);
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mockup-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.mockup-dot.red { background-color: #ef4444; opacity: 0.7; }
.mockup-dot.yellow { background-color: #f59e0b; opacity: 0.7; }
.mockup-dot.green { background-color: #10b981; opacity: 0.7; }

.mockup-title-bar {
  margin-left: var(--space-2);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--slate-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.mockup-body {
  padding: var(--space-4);
  background-color: var(--white);
  font-size: 0.8125rem;
  min-width: 0;
}

/* 1. TRIPnTRIKS Mockup */
.trip-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--slate-100);
  margin-bottom: var(--space-3);
}

.trip-name {
  display: block;
  font-weight: 700;
  color: var(--navy-800);
}

.trip-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--slate-500);
}

.trip-preview-schedule {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.schedule-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  min-width: 0;
}

.schedule-item.active {
  border-left: 3px solid var(--navy-800);
}

.schedule-time {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--navy-700);
  min-width: 44px;
  flex-shrink: 0;
}

.schedule-details {
  flex: 1;
  min-width: 0;
}

.schedule-title {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-sub {
  display: block;
  font-size: 0.65625rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.trip-preview-ledger {
  background-color: #fafbfc;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--slate-200);
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.71875rem;
  margin-bottom: 0.25rem;
}

.ledger-label { color: var(--slate-600); }
.ledger-val { font-weight: 700; color: var(--navy-800); }

.ledger-progress {
  height: 4px;
  background-color: var(--slate-200);
  border-radius: 2px;
  overflow: hidden;
}

.ledger-bar {
  height: 100%;
  background-color: var(--navy-800);
  border-radius: 2px;
}

/* 2. Project Immanuel Mockup */
.immanuel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--slate-100);
  gap: var(--space-2);
}

.immanuel-book {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy-800);
}

.immanuel-audio-pill {
  font-size: 0.6875rem;
  font-weight: 600;
  background-color: var(--navy-50);
  color: var(--navy-700);
  border: 1px solid var(--navy-200);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.immanuel-text-preview {
  background-color: var(--slate-50);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--slate-200);
  margin-bottom: var(--space-3);
}

.immanuel-quote {
  font-size: 0.78125rem;
  font-style: italic;
  color: var(--slate-700);
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.immanuel-ref {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--navy-700);
}

.immanuel-study-features {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.immanuel-feature-pill {
  font-size: 0.6875rem;
  color: var(--slate-600);
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

/* 3. Worship Presentation Builder Mockup */
.worship-preview-layout {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: var(--space-3);
  align-items: stretch;
}

.worship-order-col {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.order-col-header {
  font-size: 0.65625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--slate-500);
  margin-bottom: 0.2rem;
}

.order-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.6875rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  color: var(--slate-700);
  min-width: 0;
}

.order-step.active {
  border-color: var(--navy-600);
  background-color: var(--navy-50);
  font-weight: 600;
}

.step-num {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--slate-300);
  color: var(--slate-700);
  font-size: 0.5625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.order-step.active .step-num {
  background-color: var(--navy-800);
  color: var(--white);
}

.step-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.worship-preview-deck {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.slide-mini-canvas {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--white);
  padding: 0.8rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100px;
  text-align: center;
  min-width: 0;
}

.slide-mini-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy-100);
  margin-bottom: 0.3rem;
}

.slide-mini-text {
  font-size: 0.6875rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
}

.worship-actions-bar {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.worship-btn-mock {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  background-color: var(--navy-800);
  color: var(--white);
  border-radius: 4px;
  text-align: center;
  flex: 1;
  white-space: nowrap;
}

.worship-btn-mock.outline {
  background-color: var(--white);
  border: 1px solid var(--slate-300);
  color: var(--slate-700);
}

@media (max-width: 580px) {
  .worship-preview-layout {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
}

/* 4. Practical AI Workshop Mockup */
.workshop-preview-box {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.workshop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--slate-100);
  padding-bottom: var(--space-2);
  gap: var(--space-2);
}

.workshop-topic {
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--navy-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.workshop-pill {
  font-size: 0.65625rem;
  font-weight: 600;
  background-color: var(--navy-100);
  color: var(--navy-800);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
}

.module-cards-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.module-card {
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  padding: 0.45rem;
  min-width: 0;
}

.module-badge {
  font-size: 0.5625rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--navy-600);
  margin-bottom: 0.15rem;
}

.module-name {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.2rem;
  overflow-wrap: break-word;
}

.module-desc {
  font-size: 0.625rem;
  line-height: 1.25;
  color: var(--slate-600);
  overflow-wrap: break-word;
}

@media (max-width: 580px) {
  .module-cards-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

/* 5. JuanMundo Mockup (community directory) */
.dir-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.35rem 0.35rem 0.6rem;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  margin-bottom: var(--space-3);
  min-width: 0;
}

.dir-search-icon { color: var(--slate-500); font-size: 0.75rem; flex-shrink: 0; }

.dir-search-text {
  flex: 1;
  min-width: 0;
  font-size: 0.71875rem;
  color: var(--slate-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-search-btn {
  flex-shrink: 0;
  font-size: 0.65625rem;
  font-weight: 600;
  color: var(--white);
  background-color: var(--navy-800);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.dir-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: var(--space-3);
}

.dir-chip {
  font-size: 0.65625rem;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  background-color: var(--slate-50);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.dir-chip.active {
  color: var(--navy-800);
  border-color: var(--navy-200);
  background-color: var(--navy-50);
  font-weight: 600;
}

.dir-listing {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background-color: var(--white);
  min-width: 0;
}

.dir-listing + .dir-listing { margin-top: 0.35rem; }

.dir-listing.pending {
  border-style: dashed;
  background-color: var(--slate-50);
}

.dir-avatar {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  background-color: var(--navy-800);
  color: var(--white);
  font-size: 0.625rem;
  font-weight: 700;
}

.dir-avatar.alt { background-color: var(--navy-500); }
.dir-avatar.new { background-color: var(--slate-300); color: var(--slate-700); }

.dir-info { flex: 1; min-width: 0; }

.dir-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-meta {
  display: block;
  font-size: 0.65625rem;
  color: var(--slate-500);
}

.dir-badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 600;
  color: #92400e;
  background-color: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}


/* ==========================================================================
   WordPress theme additions
   Maps WordPress block markup onto the v2 design.
   ========================================================================== */

/* No automatic block spacing; the design sets its own */
.wp-site-blocks > *,
:where(.is-layout-flow) > * { margin-block: 0; }

/* Sticky header sits below the admin bar when logged in */
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

/* Section kicker as a single paragraph: number from a counter, rule after */
.site-main { counter-reset: qls-section; }

p.section-head {
  counter-increment: qls-section;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-500);
}

p.section-head::before {
  content: counter(qls-section, decimal-leading-zero);
  font-weight: 600;
  color: var(--navy-500);
}

.band p.section-head { color: var(--slate-400); }
.band p.section-head::before { color: #93c5fd; }

/* Buttons from the core Button block */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.wp-block-button[class*="is-style-qls-"] .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.8rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.wp-block-button.is-style-qls-primary .wp-block-button__link { background-color: var(--navy-800); color: var(--white); }
.wp-block-button.is-style-qls-primary .wp-block-button__link::after { content: "→"; transition: transform 200ms var(--ease-out); }
.wp-block-button.is-style-qls-primary .wp-block-button__link:hover { background-color: var(--navy-700); }
.wp-block-button.is-style-qls-primary .wp-block-button__link:hover::after { transform: translateX(3px); }

.wp-block-button.is-style-qls-secondary .wp-block-button__link { background-color: var(--white); color: var(--navy-800); border-color: var(--line-strong); }
.wp-block-button.is-style-qls-secondary .wp-block-button__link:hover { border-color: var(--navy-600); }

.wp-block-button.is-style-qls-on-dark .wp-block-button__link { background-color: var(--white); color: var(--navy-800); }
.wp-block-button.is-style-qls-on-dark .wp-block-button__link:hover { background-color: var(--navy-50); }

@media (max-width: 640px) {
  .hero-actions .wp-block-button,
  .hero-actions .wp-block-button__link { width: 100%; }
}

/* Service next-step links written as paragraphs */
p.service-link { margin-top: 1.25rem; }
p.service-link a { color: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color 200ms var(--ease-out); }
p.service-link a:hover { text-decoration-color: currentColor; }

/* Case study content from the editor */
.case-section h2 { scroll-margin-top: calc(var(--header-height) + 1.5rem); }
.feature-list li > strong { padding-right: 0.5rem; }

/* Simple pages and 404 */
.page-body { padding-block: clamp(3rem, 2rem + 3vw, 5rem); }
.page-body .wp-block-post-content > * + * { margin-top: 1rem; }
.page-body .wp-block-post-content :is(p, li) { font-size: 1.0625rem; line-height: 1.75; color: var(--slate-700); }
.page-body .wp-block-post-content h2 { font-family: var(--font-serif); font-weight: 400; font-size: 1.75rem; color: var(--navy-800); margin-top: 2.5rem; }

/* A project without a coded preview shows its featured image */
.tile-media .work-image { width: 100%; height: auto; margin-block: auto; border-radius: var(--radius-md); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.tile-media .work-placeholder { margin-block: auto; display: grid; place-items: center; min-height: 160px; border: 1px dashed var(--slate-300); border-radius: var(--radius-md); }

/* A plugin form placed in the contact block */
.contact-form-plugin { background-color: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(1.25rem, 0.75rem + 2vw, 2.25rem); box-shadow: var(--shadow-card); }

/* Fluent Forms inside the contact block, styled like the site's own form */
.contact-form-plugin .ff-el-group { margin-bottom: 1.25rem; }
.contact-form-plugin .ff-el-input--label { margin-bottom: 0.4rem; }
.contact-form-plugin .ff-el-input--label label { font-size: 0.875rem; font-weight: 600; color: var(--navy-800); }
.contact-form-plugin .ff-el-is-required.asterisk-right label::after { color: var(--error-red); margin-left: 0.2rem; }
.contact-form-plugin .ff-el-form-control {
  width: 100%;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--slate-900);
  background-color: var(--slate-50);
  border: 1px solid var(--slate-300);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  box-shadow: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background-color 150ms var(--ease-out);
}
.contact-form-plugin .ff-el-form-control:focus {
  outline: none;
  background-color: var(--white);
  border-color: var(--navy-600);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent);
}
.contact-form-plugin textarea.ff-el-form-control { min-height: 8rem; resize: vertical; }
.contact-form-plugin .ff-el-help-message { font-size: 0.8125rem; font-style: normal; color: var(--slate-500); margin-top: 0.35rem; }
.contact-form-plugin .ff-el-is-error .ff-el-form-control { border-color: var(--error-red); }
.contact-form-plugin .error.text-danger { font-size: 0.8125rem; color: var(--error-red); margin-top: 0.35rem; }
.contact-form-plugin .ff-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.8rem 1.4rem;
  border: 0;
  border-radius: var(--radius-full);
  background-color: var(--navy-800) !important;
  color: var(--white) !important;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out);
}
.contact-form-plugin .ff-btn-submit::after { content: "→"; }
.contact-form-plugin .ff-btn-submit:hover { background-color: var(--navy-700) !important; }
.contact-form-plugin .ff-message-success {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--success-green) 40%, transparent);
  border-radius: var(--radius-md);
  background-color: var(--success-green-light);
  color: var(--success-green);
  box-shadow: none;
  font-weight: 500;
}
.contact-form-plugin .form-privacy { margin-top: 1rem; font-size: 0.8125rem; color: var(--slate-500); }
.contact-form-plugin .form-privacy a { color: var(--navy-800); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 560px) { .contact-form-plugin .ff-btn-submit { width: 100%; justify-content: center; } }
