/* ================================
   NEXT500 visual system
   This file controls the whole website look: colors, layout, cards, forms.
   ================================ */

/* CSS variables keep brand colors and spacing editable in one place. */
:root {
  --paper: #efefec;
  --paper-2: #e7ebe8;
  --white: #ffffff;
  --ink: #111110;
  --graphite: #20211e;
  --muted: #6d6d68;
  --soft: #9a9a92;
  --line: rgba(17, 17, 16, 0.14);
  --accent: #3344e8;
  --accent-2: #5261ff;
  --green: #176b5d;
  --green-soft: #dcebe6;
  --shadow: 0 22px 80px rgba(17, 17, 16, 0.12);
  --max: 1240px;
  --radius: 6px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

/* Border-box sizing makes widths predictable across components. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Smooth scrolling makes anchor navigation feel deliberate. */
html {
  scroll-behavior: smooth;
}

/* Body defines the base font, background, and antialiasing for the whole site. */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Images are responsive by default and never overflow their containers. */
img {
  display: block;
  max-width: 100%;
}

/* Links inherit color unless a component gives them a stronger style. */
a {
  color: inherit;
}

/* Inputs inherit font settings so forms look consistent with the rest of the UI. */
input,
textarea,
button {
  font: inherit;
}

/* Screen-reader text stays accessible while visually hidden. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link appears only on keyboard focus for accessibility. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  text-decoration: none;
}

/* Focused skip link moves into view. */
.skip-link:focus {
  transform: translateY(0);
}

/* ================================
   Header and navigation
   ================================ */

/* Fixed header keeps navigation available during long scrolling. */
.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 100;
  background: rgba(243, 242, 238, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

/* JavaScript adds this class after the user scrolls a little. */
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(17, 17, 16, 0.08);
}

/* Nav aligns logo, links, and CTA inside the max content width. */
.nav {
  width: min(100%, var(--max));
  height: 72px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

/* Logo uses a dedicated SVG asset so the mark stays crisp at every size. */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.logo-image {
  display: block;
  width: 160px;
  height: auto;
  flex: none;
}

/* Desktop menu is a horizontal list. */
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Standard nav links are quiet until hovered. */
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 180ms ease;
}

/* Hover state gives clear feedback without visual noise. */
.nav-links a:hover {
  color: var(--ink);
}

/* Header CTA gets a filled treatment to anchor conversion. */
.nav-links .nav-cta {
  color: var(--white);
  background: var(--ink);
  padding: 11px 17px;
}

/* CTA hover shifts to the blue accent used across the site. */
.nav-links .nav-cta:hover {
  color: var(--white);
  background: var(--accent);
}

/* Mobile toggle is hidden on desktop. */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}

/* Toggle bars are simple and readable at small sizes. */
.nav-toggle span:not(.sr-only) {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--ink);
}

/* ================================
   Shared layout and typography
   ================================ */

/* section-shell gives first-screen sections room below the fixed header. */
.section-shell {
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 150px 32px 96px;
}

/* section-pad creates consistent vertical rhythm for content bands. */
.section-pad {
  padding: 124px 32px;
}

/* section-inner constrains normal sections to the same site width. */
.section-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
}

/* Two-column layout is reused for hook-style sections. */
.two-col {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 84px;
  align-items: start;
}

/* Eyebrows label sections and keep the premium editorial rhythm. */
.eyebrow,
.section-label {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}

/* Large headings use Georgia to echo the reference's editorial style. */
h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.04;
}

/* h1 has fixed sizes adjusted only through media queries, not viewport scaling. */
h1 {
  max-width: 880px;
  font-size: 76px;
}

/* h2 is smaller than h1 but still expressive. */
h2 {
  font-size: 48px;
}

/* h3 is used for cards and compact explanatory blocks. */
h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}

/* Paragraphs default to a muted color and comfortable reading width. */
p {
  margin: 0;
  color: var(--muted);
}

/* Buttons use text labels because they represent clear commands. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

/* Primary button is the main action style. */
.btn-primary {
  background: var(--ink);
  color: var(--white);
}

/* Primary hover uses the brand accent. */
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

/* Ghost button is for secondary navigation. */
.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

/* Ghost hover gives a quiet filled state. */
.btn-ghost:hover {
  background: var(--white);
}

/* Light button is used on dark backgrounds. */
.btn-light {
  background: var(--white);
  color: var(--ink);
}

/* Light button hover stays subtle in CTA sections. */
.btn-light:hover {
  transform: translateY(-1px);
  background: var(--green-soft);
}

/* Section headings keep intro text aligned and readable. */
.section-heading {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(320px, 1fr);
  gap: 76px;
  align-items: start;
  margin-bottom: 64px;
}

.section-heading .section-label {
  grid-column: 1;
  margin-top: 10px;
}

.section-heading h2 {
  grid-column: 2;
  grid-row: 1 / span 2;
}

/* Section heading paragraphs are intentionally concise. */
.section-heading > p:last-child {
  grid-column: 1;
  font-size: 17px;
  line-height: 1.7;
}

/* ================================
   Hero
   ================================ */

/* Hero grid splits promise and visual proof. */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
  gap: 72px;
  align-items: center;
  min-height: 680px;
}

/* Hero lead gives the decision-maker context after the headline. */
.hero-lead {
  max-width: 620px;
  margin-top: 30px;
  font-size: 20px;
  line-height: 1.65;
}

/* Hero buttons sit below the main promise. */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 36px;
}

/* Hero panel is a product-like visual, not a decorative card. */
.hero-panel {
  padding: 28px;
  background: var(--graphite);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 90px rgba(17, 17, 16, 0.18);
}

/* Panel top line displays product and duration. */
.panel-topline {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  color: rgba(255, 255, 255, 0.7);
}

/* Duration is highlighted as the tangible timeframe. */
.panel-topline strong {
  color: var(--white);
}

/* Impact meter is a compact bar chart. */
.impact-meter {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

/* Each meter bar uses an inline --height value from the template. */
.impact-meter span {
  height: var(--height);
  min-height: 28px;
  background: linear-gradient(180deg, var(--accent-2), var(--green));
}

/* Panel list explains what the chart represents. */
.panel-list {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

/* Each panel item is separated for scanability. */
.panel-list p {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.72);
}

/* Panel numbers remain bright to guide the eye. */
.panel-list strong {
  color: var(--white);
}

/* ================================
   Hook section
   ================================ */

/* White hook band separates the problem narrative from the hero. */
.hook {
  background: var(--white);
}

/* Sticky copy keeps the section headline visible while scanning points. */
.sticky-copy {
  position: sticky;
  top: 110px;
}

/* Stacked points use borders instead of nested cards. */
.stacked-points {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

/* Point rows make the problem narrative easy to skim. */
.point {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 18px;
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

/* Point numbers use mono styling to echo the reference. */
.point > span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 12px;
}

/* Point body text is deliberately restrained. */
.point p {
  margin-top: 9px;
  line-height: 1.7;
}

/* ================================
   Cards and result sections
   ================================ */

/* Results band returns to the warm base color. */
.results {
  position: relative;
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.results-intro {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr);
  gap: 80px;
  align-items: start;
  margin-bottom: 28px;
}

.results-intro > p {
  max-width: 560px;
  font-size: 17px;
  line-height: 1.7;
}

.ri-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
}

.ri-row-label {
  margin-right: 4px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ri-tag {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.ri-dot {
  color: var(--soft);
  font-size: 11px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Generic card grid supports 3-card and 4-card layouts. */
.card-grid {
  display: grid;
  gap: 18px;
}

/* Three-column card layout for cases and insights. */
.card-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

/* Four-column card layout for focused services. */
.card-grid.four {
  grid-template-columns: repeat(4, 1fr);
}

/* Result cards emphasize metrics and commercial outcome. */
.result-card,
.service-card,
.insight-card {
  min-height: 280px;
  padding: 26px;
  border: 1px solid var(--line);
  background: var(--white);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.result-card {
  position: relative;
  overflow: hidden;
  min-height: auto;
  padding: 0;
  cursor: default;
}

/* Card hover adds subtle depth without changing layout. */
.result-card:hover,
.service-card:hover,
.insight-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Small card label gives context before the headline. */
.card-kicker,
.service-body > span,
.insight-card > span {
  display: block;
  margin-bottom: 24px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

/* Large metric is the primary proof point in result cards. */
.metric {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-family: var(--serif);
  font-size: 48px;
  line-height: 1;
}

/* Metric sublabel explains what the number means. */
.metric-sub {
  display: block;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

/* Card paragraph spacing stays compact. */
.result-card p,
.service-card p,
.insight-card p {
  margin-top: 12px;
  line-height: 1.65;
}

.case-trigger {
  width: fit-content;
  margin-top: auto;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

.case-trigger:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.rc-gradient-bar {
  width: 100%;
  height: 4px;
}

.rc-gradient-bar.g1 {
  background: linear-gradient(90deg, var(--accent) 0%, #7b7eff 100%);
}

.rc-gradient-bar.g2 {
  background: linear-gradient(90deg, var(--accent) 0%, #56ccf2 100%);
}

.rc-gradient-bar.g3 {
  background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
}

.rc-body {
  padding: 32px 36px 36px;
}

.rc-tag {
  margin-bottom: 24px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rc-metric {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 56px;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0;
}

.rc-metric-sub {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 13px;
}

.rc-divider {
  height: 1px;
  margin-bottom: 20px;
  background: var(--line);
}

.rc-title {
  margin-bottom: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.rc-desc {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.results-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  align-items: center;
  margin-top: 36px;
}

.results-disclaimer {
  max-width: 620px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  line-height: 1.5;
}

.link-underline {
  width: fit-content;
  padding: 0 0 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.link-underline:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Links inside service and insight cards act as contextual CTAs. */
.service-card a,
.insight-card a {
  display: inline-block;
  margin-top: 22px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.service-card {
  padding: 0;
  overflow: hidden;
}

.service-image {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper);
}

.service-image img,
.insight-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(82%) contrast(1.04);
  transition: transform 420ms ease, filter 420ms ease;
}

.service-card:hover .service-image img,
.insight-card:hover img {
  transform: scale(1.025);
  filter: grayscale(48%) contrast(1.04);
}

.service-body {
  padding: 24px;
}

/* ================================
   Flagship product
   ================================ */

/* Flagship band uses graphite to signal a major offer. */
.flagship {
  background: var(--graphite);
  color: var(--white);
  padding: 132px 18px;
}

.flagship .section-inner,
.team .section-inner,
.approach .section-inner {
  width: min(100%, 1540px);
}

.flagship h2,
.team h2 {
  max-width: 620px;
  font-size: 76px;
  letter-spacing: 0;
}

/* Muted text changes on the dark background. */
.flagship p,
.flagship .section-label {
  color: rgba(255, 255, 255, 0.72);
}

/* Flagship content is split between copy and deliverables. */
.flagship-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.74fr) minmax(0, 1.26fr);
  gap: 96px;
  align-items: start;
}

.flagship-copy {
  padding-top: 36px;
}

/* Flagship intro paragraph keeps width readable. */
.flagship-copy p {
  max-width: 520px;
  margin: 28px 0 38px;
  font-size: 22px;
  line-height: 1.72;
}

/* Deliverables are separate cells, not nested cards. */
.deliverables {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  min-height: 528px;
}

/* Each deliverable explains one tangible output. */
.deliverables > div {
  min-height: 264px;
  padding: 38px 36px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

/* Deliverable number is a quiet orientation marker. */
.deliverables span {
  display: block;
  margin-bottom: 34px;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 12px;
}

/* Deliverable text is muted to keep hierarchy clear. */
.deliverables p {
  margin-top: 14px;
  font-size: 20px;
  line-height: 1.68;
}

.deliverables h3 {
  font-size: 28px;
  line-height: 1.15;
}

/* ================================
   Services and approach
   ================================ */

/* Services band uses a cool tint to avoid a one-note beige palette. */
.services {
  background: var(--paper-2);
}

/* Approach returns to white for clarity around the roadmap. */
.approach {
  background: var(--white);
  padding-top: 150px;
  padding-bottom: 142px;
}

.approach .section-heading {
  grid-template-columns: minmax(280px, 0.55fr) minmax(420px, 1fr);
  min-height: 270px;
  align-items: center;
  margin-bottom: 58px;
}

.approach .section-heading h2 {
  max-width: 640px;
  font-size: 76px;
}

.approach .section-heading > p:last-child {
  max-width: 760px;
  font-size: 22px;
}

/* Roadmap is a four-step grid with a shared top border. */
.roadmap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

/* Roadmap step is a structured block with stable height. */
.roadmap-step {
  min-height: 350px;
  padding: 36px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Roadmap number is the visual anchor for each step. */
.roadmap-number {
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 12px;
}

/* Period label clarifies timing. */
.roadmap-step small {
  display: block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 16px;
}

.roadmap-step h3 {
  font-size: 28px;
  line-height: 1.15;
}

/* Roadmap copy keeps implementation language practical. */
.roadmap-step p {
  margin-top: 18px;
  font-size: 18px;
  line-height: 1.68;
}

/* ================================
   Team and map sections
   ================================ */

/* Team section uses a dark background to mark credibility and operators. */
.team {
  background: #101511;
  color: var(--white);
  padding: 132px 26px;
}

/* Team muted text is adjusted for dark contrast. */
.team p,
.team .section-label {
  color: rgba(255, 255, 255, 0.72);
}

/* Team grid separates narrative from operator capabilities. */
.team-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 108px;
  align-items: start;
}

.team-grid > div:first-child {
  padding-top: 36px;
}

/* Team intro paragraph gets breathing room. */
.team-grid > div:first-child p {
  max-width: 560px;
  margin-top: 28px;
  font-size: 22px;
  line-height: 1.75;
}

/* Operator list uses compact rows for repeated capabilities. */
.operator-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
}

/* Operator cells are not decorative cards; they are capability blocks. */
.operator-list article {
  min-height: 256px;
  padding: 42px 36px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: #101511;
}

/* Operator role tag. */
.operator-list span {
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 12px;
}

/* Operator capability heading. */
.operator-list strong {
  display: block;
  margin-top: 34px;
  font-size: 26px;
}

/* Operator description. */
.operator-list p {
  margin-top: 14px;
  font-size: 19px;
  line-height: 1.7;
}

/* ================================
   Insights and contact
   ================================ */

/* Insights section stays white to feel editorial and readable. */
.insights {
  background: var(--white);
}

/* Insight cards are slightly shorter because they link to future materials. */
.insight-card {
  min-height: 230px;
  padding: 0;
  overflow: hidden;
}

.insight-card img {
  height: 190px;
  aspect-ratio: auto;
}

.insight-card > span {
  margin: 22px 24px 18px;
}

.insight-card h3 {
  margin: 0 24px;
}

.insight-card a {
  margin: 22px 24px 26px;
}

/* Contact is a full dark conversion band. */
.contact {
  padding: 112px 32px;
  background: #101511;
  color: var(--white);
}

/* Contact layout pairs final pitch with lead form. */
.contact-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 0.9fr);
  gap: 76px;
  align-items: start;
}

/* Contact copy is readable on dark background. */
.contact-copy p {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 18px;
  line-height: 1.7;
}

/* Lead form uses a clean stacked layout. */
.lead-form {
  display: grid;
  gap: 16px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--white);
  color: var(--ink);
}

/* Labels group form captions with fields. */
.lead-form label,
.lead-fields label {
  display: grid;
  gap: 8px;
}

/* Form label text is small and muted. */
.lead-form span,
.lead-fields span {
  color: var(--muted);
  font-size: 13px;
}

/* Inputs use a consistent dark/light neutral style. */
.lead-form input,
.lead-form textarea,
.lead-fields input,
.diagnostic-form input[type="text"] {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #f8f8f6;
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

/* Textarea gets a stable minimum height. */
.lead-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* Placeholder color is readable but subdued. */
.lead-form input::placeholder,
.lead-form textarea::placeholder,
.lead-fields input::placeholder,
.diagnostic-form input[type="text"]::placeholder {
  color: var(--soft);
}

/* Focus state shows which field is active. */
.lead-form input:focus,
.lead-form textarea:focus,
.lead-fields input:focus,
.diagnostic-form input[type="text"]:focus {
  border-color: var(--accent-2);
}

/* ================================
   Diagnostic page
   ================================ */

/* Diagnostic hero is smaller than homepage hero but keeps the same rhythm. */
.diagnostic-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 72px;
  align-items: end;
}

/* Diagnostic hero paragraph gives context under the headline. */
.diagnostic-hero p:not(.eyebrow) {
  max-width: 660px;
  margin-top: 26px;
  font-size: 19px;
  line-height: 1.7;
}

/* Diagnostic note is a trust-building expectation box. */
.diagnostic-note {
  padding: 24px;
  border-left: 4px solid var(--accent);
  background: var(--white);
  box-shadow: var(--shadow);
}

/* Note title is kept simple. */
.diagnostic-note strong {
  display: block;
  margin-bottom: 10px;
}

/* Diagnostic body separates the form from the result panel. */
.diagnostic-body {
  background: var(--white);
}

/* Main diagnostic layout keeps result visible beside questions. */
.diagnostic-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 44px;
  align-items: start;
}

/* Diagnostic form uses a stacked rhythm with clear separators. */
.diagnostic-form {
  display: grid;
  gap: 24px;
}

/* Form head introduces the question set. */
.form-head {
  padding-bottom: 10px;
}

/* Question block is a bordered section, not a nested card stack. */
.question-block {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--paper);
}

/* Legend carries question number and title. */
.question-block legend {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 0;
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}

/* Question number gives scan structure. */
.question-block legend span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

/* Question hint is placed directly under the legend. */
.question-block > p {
  margin-top: 10px;
}

/* Options are stacked to keep labels readable on all widths. */
.option-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

/* Radio card makes the whole answer row clickable. */
.radio-card {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}

/* Native radio stays visible for clarity and accessibility. */
.radio-card input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

/* Selected option receives a stronger border through modern :has support. */
.radio-card:has(input:checked) {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* Lead fields on diagnostic page use light inputs instead of dark contact inputs. */
.lead-fields {
  display: grid;
  gap: 14px;
}

/* Diagnostic lead field captions need dark-page styling here. */
.lead-fields span {
  color: var(--muted);
}

/* Light diagnostic inputs override the shared dark contact fields. */
.lead-fields input,
.diagnostic-form input[type="text"] {
  border-color: var(--line);
  background: var(--white);
  color: var(--ink);
}

/* Placeholder override for light diagnostic fields. */
.lead-fields input::placeholder,
.diagnostic-form input[type="text"]::placeholder {
  color: var(--soft);
}

/* Result panel stays sticky on long forms. */
.diagnostic-result {
  position: sticky;
  top: 104px;
  padding: 28px;
  background: var(--graphite);
  color: var(--white);
}

/* Result panel muted copy. */
.diagnostic-result p,
.diagnostic-result .section-label {
  color: rgba(255, 255, 255, 0.72);
}

/* Score circle is a compact visual indicator. */
.score-circle {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  margin: 18px 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

/* Score number is the visual priority. */
.score-circle strong {
  display: block;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1;
}

/* Score caption is intentionally small. */
.score-circle span {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

/* Focus box highlights the suggested starting point. */
.focus-box {
  margin: 22px 0;
  padding: 18px;
  background: rgba(82, 97, 255, 0.18);
  border: 1px solid rgba(82, 97, 255, 0.34);
}

/* Focus box label. */
.focus-box span {
  display: block;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

/* Next steps are numbered by the browser and stay compact. */
.next-steps {
  display: grid;
  gap: 12px;
  margin: 24px 0;
  padding-left: 20px;
  color: rgba(255, 255, 255, 0.76);
}

/* Preview list is shown before the diagnostic is submitted. */
.result-preview {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.76);
}

/* ================================
   Simple pages, footer, flash
   ================================ */

/* Simple pages center a single message block. */
.simple-page {
  min-height: 70vh;
  display: grid;
  place-items: center;
}

/* Simple card keeps thank-you and 404 messages readable. */
.simple-card {
  max-width: 760px;
  padding: 44px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* Simple page paragraph spacing. */
.simple-card p:not(.eyebrow) {
  margin-top: 24px;
  font-size: 18px;
  line-height: 1.7;
}

/* Flash messages sit below the fixed header. */
.flash-stack {
  position: fixed;
  top: 86px;
  right: 24px;
  z-index: 120;
  display: grid;
  gap: 10px;
}

/* Flash box baseline styling. */
.flash {
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

/* Success flash uses green as a positive signal. */
.flash-success {
  border-color: rgba(23, 107, 93, 0.28);
}

/* Footer uses dark background and compact columns. */
.footer {
  background: #0f100f;
  color: var(--white);
  padding: 64px 32px 28px;
}

/* Footer columns share the same width as the site. */
.footer-inner {
  width: min(100%, var(--max));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 42px;
}

/* Footer brand description stays muted. */
.footer-brand p {
  max-width: 340px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.55);
}

.logo-footer .logo-image {
  width: 168px;
}

/* Footer column layout. */
.footer-col {
  display: grid;
  align-content: start;
  gap: 11px;
}

/* Footer headings are small labels. */
.footer-col h4 {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.32);
  font-size: 13px;
}

/* Footer links and spans share styling. */
.footer-col a,
.footer-col span,
.footer-link-button {
  color: rgba(255, 255, 255, 0.64);
  text-decoration: none;
  font-size: 14px;
}

.footer-link-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Footer link hover improves discoverability. */
.footer-col a:hover,
.footer-link-button:hover {
  color: var(--white);
}

/* Footer bottom line separates legal info. */
.footer-bottom {
  width: min(100%, var(--max));
  margin: 48px auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 13px;
}

.sticky-cta {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 120;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 1fr auto 34px;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #101511;
  color: var(--white);
  box-shadow: 0 18px 70px rgba(17, 17, 16, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.sticky-cta.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sticky-cta-copy {
  display: grid;
  gap: 4px;
}

.sticky-cta-copy strong {
  font-size: 15px;
}

.sticky-cta-copy span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
}

.sticky-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  line-height: 1;
}

/* Modal overlay is used for partner requests. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  padding: 24px;
  align-items: center;
  justify-content: center;
}

.modal.is-open {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 16, 15, 0.68);
  backdrop-filter: blur(8px);
}

.modal-dialog {
  position: relative;
  width: min(100%, 620px);
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  padding: 34px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.modal-dialog h2 {
  margin-bottom: 24px;
  font-size: 36px;
}

.modal-dialog-compact {
  width: min(100%, 540px);
}

.modal-intro {
  margin: -12px 0 24px;
  line-height: 1.65;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.modal-form {
  display: grid;
  gap: 16px;
}

.modal-form label,
.auth-form label,
.admin-form label {
  display: grid;
  gap: 8px;
}

.modal-form span,
.auth-form span,
.admin-form span {
  color: var(--muted);
  font-size: 13px;
}

.modal-form input,
.modal-form textarea,
.auth-form input,
.admin-form input,
.admin-form textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  padding: 12px 14px;
  outline: none;
}

.modal-form textarea,
.admin-form textarea {
  resize: vertical;
}

.modal-form input:focus,
.modal-form textarea:focus,
.auth-form input:focus,
.admin-form input:focus,
.admin-form textarea:focus {
  border-color: var(--accent);
}

body.modal-open {
  overflow: hidden;
}

/* Admin and employee login pages. */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 120px 20px 72px;
  background: var(--paper);
}

.auth-card {
  width: min(100%, 460px);
  padding: 36px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin-bottom: 14px;
  font-size: 42px;
}

.auth-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  background: #f4f5f4;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 34px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: #eef1ef;
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 4px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

.admin-brand img {
  width: 34px;
  height: 34px;
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.admin-nav a,
.admin-sidebar-bottom a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 16px;
  color: var(--graphite);
  text-decoration: none;
  border-radius: 0;
  border-left: 3px solid transparent;
}

.admin-nav a:hover,
.admin-sidebar-bottom a:hover {
  background: rgba(23, 107, 93, 0.08);
}

.admin-nav a.is-active {
  background: #d9e4dd;
  border-left-color: var(--green);
  color: var(--green);
  font-weight: 700;
}

.admin-sidebar-bottom {
  display: grid;
  gap: 6px;
}

.admin-content {
  min-width: 0;
  padding: 34px 42px 96px;
}

.admin-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  margin-bottom: 30px;
  min-height: 118px;
  padding: 26px 30px;
  background: var(--white);
  border: 1px solid var(--line);
}

.admin-topbar h1 {
  margin-top: 4px;
  font-family: var(--sans);
  font-size: 28px;
  line-height: 1.2;
}

.admin-topbar p:last-child {
  max-width: 720px;
  margin-top: 8px;
  font-size: 15px;
}

.admin-kpi {
  min-width: 66px;
  min-height: 66px;
  display: grid;
  align-content: center;
  place-items: center;
  background: var(--ink);
  color: var(--white);
}

.admin-kpi span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
}

.admin-kpi strong {
  font-size: 20px;
}

.admin-panel {
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--white);
}

.admin-topbar-rich {
  align-items: stretch;
}

.admin-topbar-rich .btn {
  align-self: center;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.admin-overview-grid-tight {
  margin-bottom: 18px;
}

.admin-stat-card {
  min-height: 136px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
}

.admin-stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.admin-stat-card strong {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1;
}

.admin-stat-card p {
  font-size: 13px;
  line-height: 1.5;
}

.admin-split {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(360px, 1.28fr);
  gap: 20px;
}

.admin-split-balanced {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.admin-compact-panel {
  min-height: 360px;
}

.admin-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-section-head h2 {
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.2;
}

.admin-muted {
  color: var(--muted);
  line-height: 1.6;
}

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

.source-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}

.source-row span {
  color: var(--graphite);
}

.source-row strong {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--white);
  font-size: 14px;
}

.source-bars {
  display: grid;
  gap: 18px;
}

.source-bar-row {
  display: grid;
  gap: 9px;
}

.source-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--graphite);
  font-size: 14px;
}

.source-bar-label strong {
  color: var(--ink);
}

.source-bar-track {
  height: 10px;
  overflow: hidden;
  background: #e2e4df;
}

.source-bar-track span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.admin-chart {
  min-height: 238px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-chart-column {
  min-height: 210px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 10px;
  align-items: end;
  text-align: center;
}

.admin-chart-bar {
  position: relative;
  min-height: 12px;
  display: grid;
  place-items: start center;
  width: 100%;
  background: var(--ink);
  color: var(--white);
}

.admin-chart-bar span {
  transform: translateY(-22px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.admin-chart-column small {
  color: var(--muted);
  font-size: 11px;
}

.admin-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}

.admin-action-card {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}

.admin-action-card:hover {
  border-color: var(--green);
  background: #f8faf7;
}

.admin-action-card span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.admin-action-card strong {
  font-size: 17px;
}

.admin-action-card small {
  color: var(--muted);
  line-height: 1.5;
}

.mini-leads-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.mini-lead {
  display: grid;
  gap: 5px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.mini-lead strong {
  font-size: 16px;
}

.mini-lead span,
.mini-lead small {
  color: var(--muted);
}

.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.source-chip-row span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  background: #eef1ef;
  color: var(--graphite);
  font-size: 12px;
}

.empty-state-large {
  min-height: 280px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 16px;
  padding: 42px;
}

.empty-state-large h2 {
  font-family: var(--sans);
  font-size: 26px;
}

.admin-leads-panel {
  padding: 0;
  background: transparent;
  border: 0;
}

.admin-form {
  display: grid;
  gap: 18px;
}

.meta-grid {
  display: grid;
  gap: 18px;
}

.meta-item {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.meta-item h3 {
  font-size: 18px;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(280px, 0.85fr);
  gap: 18px;
}

.settings-grid-single {
  grid-template-columns: minmax(280px, 820px);
}

.settings-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.settings-card-wide {
  grid-column: 1 / -1;
}

.settings-card-head {
  display: grid;
  gap: 7px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-card-head > span {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 12px;
}

.settings-card-head h2 {
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1.2;
}

.settings-card-head p,
.field-help {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.code-textarea,
.admin-secret-input {
  font-family: var(--mono);
  font-size: 13px;
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.template-help {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--white);
}

.template-help > span {
  color: var(--muted);
  font-size: 13px;
}

.template-help > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-help code {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 8px;
  background: #eef1ef;
  color: var(--graphite);
  font-size: 12px;
}

.leads-toolbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: var(--white);
}

.leads-toolbar > div {
  display: grid;
  gap: 3px;
}

.leads-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.admin-secondary-link {
  color: var(--green);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}

.leads-list {
  display: grid;
  border: 1px solid var(--line);
  background: var(--white);
}

.lead-card {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(180px, 0.78fr) minmax(240px, 1fr);
  gap: 22px;
  align-items: start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.lead-card:last-child {
  border-bottom: 0;
}

.lead-main {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  min-width: 0;
}

.lead-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--white);
  font-weight: 800;
}

.lead-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lead-title-row h3 {
  font-size: 18px;
}

.lead-main p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.lead-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.lead-source {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  background: #eef1ef;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.lead-id-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  background: var(--ink);
  color: var(--white);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.lead-contact {
  display: grid;
  gap: 5px;
  color: var(--graphite);
  font-size: 14px;
}

.lead-contact span {
  overflow-wrap: anywhere;
}

.lead-contact small,
.lead-time {
  color: var(--muted);
  font-size: 13px;
}

.lead-delete-form {
  margin-top: 6px;
}

.danger-link-button {
  width: fit-content;
  padding: 0 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(156, 43, 43, 0.45);
  background: transparent;
  color: #9c2b2b;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.danger-link-button:hover {
  border-color: #9c2b2b;
}

.lead-summary {
  color: var(--graphite);
  line-height: 1.55;
}

.lead-fields-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.lead-fields-grid > div {
  min-height: 78px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 14px;
  background: #f8f8f6;
}

.lead-fields-grid span {
  color: var(--muted);
  font-size: 12px;
}

.lead-fields-grid strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.lead-details {
  grid-column: 1 / -1;
}

.lead-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

.payload-block {
  overflow-x: auto;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f8f8f6;
  color: var(--graphite);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.empty-state {
  padding: 24px;
  border: 1px dashed var(--line);
  background: var(--paper);
}

/* ================================
   Landing polish
   ================================ */

.rc-action {
  width: fit-content;
  margin-top: auto;
  padding: 0 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.rc-action:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.result-media {
  height: 190px;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

.result-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(84%) contrast(1.08);
  transition: transform 420ms ease, filter 420ms ease;
}

.result-card:hover .result-media img {
  transform: scale(1.025);
  filter: grayscale(40%) contrast(1.05);
}

.case-fact-grid {
  display: grid;
  gap: 1px;
  margin: 22px 0;
  background: var(--line);
}

.case-fact-grid > div {
  display: grid;
  gap: 6px;
  padding: 13px 0;
  background: var(--white);
}

.case-fact-grid span {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-fact-grid strong {
  color: var(--graphite);
  font-size: 14px;
  line-height: 1.45;
}

.rc-action {
  margin-top: 22px;
}

.flagship-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 0 36px;
  background: rgba(255, 255, 255, 0.14);
}

.flagship-metrics > div {
  display: grid;
  gap: 6px;
  padding: 16px;
  background: var(--graphite);
}

.flagship-metrics strong {
  color: var(--white);
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
}

.flagship-metrics span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.contact-bullets {
  display: grid;
  gap: 11px;
  margin-top: 28px;
}

.contact-bullets span {
  padding-left: 16px;
  border-left: 2px solid var(--accent-2);
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

/* ================================
   Motion
   ================================ */

/* Reveal elements start slightly lower and transparent. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms ease, transform 620ms ease;
}

/* JavaScript adds is-visible when elements enter the viewport. */
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Delay helpers stagger nearby elements. */
.delay-1 { transition-delay: 90ms; }
.delay-2 { transition-delay: 180ms; }
.delay-3 { transition-delay: 270ms; }

/* Reduced motion users get content immediately without animation. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ================================
   Responsive rules
   ================================ */

/* Tablet layout reduces columns and type sizes. */
@media (max-width: 1080px) {
  h1 {
    font-size: 58px;
  }

  h2 {
    font-size: 40px;
  }

  .hero-grid,
  .section-heading,
  .two-col,
  .flagship-grid,
  .team-grid,
  .contact-inner,
  .diagnostic-hero-grid,
  .diagnostic-layout {
    grid-template-columns: 1fr;
  }

  .sticky-copy,
  .diagnostic-result {
    position: static;
  }

  .section-heading .section-label,
  .section-heading h2,
  .section-heading > p:last-child {
    grid-column: 1;
    grid-row: auto;
  }

  .flagship h2,
  .team h2 {
    font-size: 54px;
  }

  .approach .section-heading h2 {
    font-size: 58px;
  }

  .lead-card {
    grid-template-columns: 1fr;
  }

  .admin-overview-grid,
  .admin-split,
  .admin-action-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .results-intro {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lead-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-grid.four,
  .roadmap {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile navigation and one-column cards. */
@media (max-width: 760px) {
  .nav {
    padding: 0 18px;
  }

  .logo-image {
    width: 142px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 72px;
    right: 0;
    left: 0;
    display: none;
    padding: 22px 18px;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(243, 242, 238, 0.98);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 10px 0;
  }

  .nav-links .nav-cta {
    text-align: center;
  }

  .section-shell {
    padding: 120px 20px 72px;
  }

  .section-pad,
  .contact {
    padding: 78px 20px;
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 34px;
  }

  .hero-grid {
    min-height: auto;
    gap: 42px;
  }

  .hero-panel {
    margin-top: 10px;
  }

  .impact-meter {
    height: 120px;
  }

  .panel-list {
    display: none;
  }

  .hero-lead,
  .diagnostic-hero p:not(.eyebrow) {
    font-size: 17px;
  }

  .section-heading,
  .card-grid.three,
  .card-grid.four,
  .results-grid,
  .deliverables,
  .operator-list,
  .roadmap {
    grid-template-columns: 1fr;
  }

  .ri-row {
    gap: 8px;
    margin-bottom: 28px;
  }

  .rc-body {
    padding: 26px 24px 28px;
  }

  .rc-metric {
    font-size: 46px;
  }

  .results-footer {
    gap: 18px;
  }

  .result-card {
    min-height: auto;
  }

  .service-card,
  .insight-card {
    min-height: auto;
  }

  .service-image {
    aspect-ratio: 16 / 9;
  }

  .service-body {
    padding: 22px;
  }

  .deliverables {
    min-height: auto;
    border: 0;
  }

  .deliverables > div {
    min-height: auto;
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .deliverables span {
    margin-bottom: 16px;
  }

  .deliverables p {
    font-size: 16px;
  }

  .roadmap {
    border: 0;
  }

  .roadmap-step {
    min-height: auto;
    padding: 26px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .roadmap-step p {
    font-size: 16px;
  }

  .operator-list {
    border: 0;
  }

  .operator-list article {
    min-height: auto;
    padding: 28px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  }

  .operator-list strong {
    margin-top: 18px;
    font-size: 22px;
  }

  .operator-list p {
    font-size: 16px;
  }

  .hero-panel,
  .lead-form,
  .diagnostic-result,
  .simple-card {
    padding: 22px;
  }

  .contact-inner,
  .section-heading {
    gap: 36px;
  }

  .sticky-cta {
    right: 14px;
    bottom: 14px;
    left: 14px;
    width: auto;
    grid-template-columns: 1fr 34px;
  }

  .sticky-cta .btn {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
  }

  .sticky-close {
    align-self: start;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
  }

  .flash-stack {
    right: 14px;
    left: 14px;
  }

  .flash {
    max-width: none;
  }

  .modal {
    padding: 14px;
  }

  .modal-dialog,
  .auth-card,
  .admin-panel {
    padding: 22px;
  }

  .modal-dialog h2,
  .auth-card h1,
  .admin-topbar h1 {
    font-size: 26px;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .admin-content {
    padding: 24px 20px 72px;
  }

  .admin-topbar {
    display: grid;
    padding: 22px;
  }

  .admin-overview-grid,
  .admin-split,
  .admin-action-grid {
    grid-template-columns: 1fr;
  }

  .source-chip-row {
    justify-content: flex-start;
  }

  .admin-kpi {
    width: 74px;
  }

  .leads-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* Small phones get slightly tighter headings and buttons. */
@media (max-width: 430px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 30px;
  }

  .hero-actions,
  .btn {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .result-media {
    height: 160px;
  }

  .case-fact-grid {
    margin: 18px 0;
  }

  .rc-desc {
    display: none;
  }

  .results-footer .btn {
    width: 100%;
  }

  .flagship-metrics {
    grid-template-columns: 1fr;
  }

  .contact-bullets {
    margin-top: 22px;
  }
}
