/* ============================================================
   Cleverpath Solutions — "Evergreen Ledger" design system
   A typeset engineering field journal: warm paper, forest ink,
   rust folios. Display: Fraunces. Body: Public Sans.
   ============================================================ */

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/FrauncesVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fraunces";
  src: url("/assets/fonts/FrauncesItalicVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Public Sans";
  src: url("/assets/fonts/PublicSansVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Paper */
  --paper: #faf7ee;
  --paper-deep: #f2edde;
  --surface: #fffdf7;

  /* Ink */
  --ink: #1c2a1e;
  --body-ink: #444b40;
  --muted: #6c6a5c;

  /* Brand */
  --forest: #174726;
  --forest-deep: #103a1c;
  --forest-soft: #e7efe4;
  --rust: #a65432; /* ~5.0:1 on --paper — do NOT lighten (WCAG floor) */
  --rust-deep: #8a4326;
  --rust-soft: #f6e7d8;
  --amber: #e0a458; /* dark-panel highlights only — fails contrast on paper */

  /* Dark plate (hero panel, closing, footer) */
  --plate: #14361f;
  --plate-deep: #0f2a17;
  --cream: #f3eedd; /* 11.4:1 on --plate */
  --cream-dim: #c9d3c2;

  /* Semantics — errors stay red; rust is brand-only, never error */
  --success: #2e6e3f;
  --success-soft: #e4efde;
  --warn: #8a5a12; /* 4.96:1 on --warn-soft — AA floor, do not lighten */
  --warn-soft: #f6ead2;
  --error: #b03a2e;
  --error-soft: #fdecea;

  --border: #e0d8c3;
  --border-deep: #c9a989;

  /* Shape & elevation — print-flat */
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(28, 42, 30, 0.06);
  --shadow-md: 0 8px 22px rgba(28, 42, 30, 0.09);
  --shadow-lg: 0 20px 48px rgba(28, 42, 30, 0.18);

  /* Type */
  --font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
}

/* ------------------------------------------------------------
   Base
   ------------------------------------------------------------ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--body-ink);
  /* laid-paper grain at whisper volume */
  background-image: radial-gradient(rgba(28, 42, 30, 0.035) 1px, transparent 1px);
  background-size: 26px 26px;
  background-color: var(--paper);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: #f0d9b8;
  color: var(--ink);
}

a {
  color: var(--rust);
  text-decoration: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--display);
  font-weight: 580;
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

h1 {
  font-size: clamp(2.4rem, 4.8vw, 3.6rem);
  line-height: 1.06;
}

h2 {
  font-size: clamp(1.65rem, 3vw, 2.3rem);
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* the one sanctioned Fraunces flourish: hero italic phrase */
.accent-phrase {
  font-style: italic;
  font-weight: 540;
  font-variation-settings: "SOFT" 0, "WONK" 1;
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(166, 84, 50, 0.6);
  text-underline-offset: 7px;
}

p {
  margin: 0;
  overflow-wrap: anywhere;
}

.shell {
  width: min(100% - 48px, 1140px);
  margin-inline: auto;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--forest);
  color: var(--cream);
  font-weight: 600;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 0;
}

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

/* warm surfaces are dark in the plate sections — switch to cream */
.pipe-panel :focus-visible,
.closing :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--amber);
}

/* ------------------------------------------------------------
   Buttons — letterpress
   ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease,
    border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--forest);
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(28, 42, 30, 0.25);
}

.btn-primary:hover {
  background: var(--forest-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 #0b2a14;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--ink);
}

.btn-secondary:hover {
  color: var(--rust-deep);
  border-color: var(--rust);
  background: var(--rust-soft);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--rust);
  font-weight: 600;
}

.btn-ghost:hover {
  color: var(--rust-deep);
}

.btn-ghost .icon {
  width: 18px;
  height: 18px;
  transition: transform 160ms ease;
}

.btn-ghost:hover .icon {
  transform: translateX(4px);
}

/* ------------------------------------------------------------
   Header / navigation — cream masthead
   ------------------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 238, 0.96);
  backdrop-filter: blur(12px);
  /* double hairline rule, masthead-style */
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 0 -3px var(--border);
  transition: box-shadow 200ms ease;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 0 -3px var(--border), 0 10px 24px rgba(28, 42, 30, 0.08);
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 4px;
  background: var(--forest);
  color: var(--cream);
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.brand-copy {
  display: grid;
  line-height: 1.2;
}

.brand-name {
  font-family: var(--display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

.brand-tagline {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  font-variant-caps: all-small-caps;
  color: var(--rust);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-toggle .close-glyph {
  display: none;
}

.nav-toggle[aria-expanded="true"] .open-glyph {
  display: none;
}

.nav-toggle[aria-expanded="true"] .close-glyph {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.site-nav > a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 13px;
  color: var(--body-ink);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 160ms ease;
}

.site-nav > a:not(.btn):hover {
  color: var(--forest);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--rust);
  text-underline-offset: 6px;
}

.site-nav > a[aria-current="page"] {
  color: var(--forest);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--rust);
  text-underline-offset: 6px;
}

.site-nav .btn {
  margin-left: var(--space-3);
  min-height: 42px;
  padding-inline: 18px;
  font-size: 0.95rem;
}

/* ------------------------------------------------------------
   Sections — alternating cream sheets, folio-numbered
   ------------------------------------------------------------ */

main {
  counter-reset: folio;
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section-alt {
  /* denser grain, offset half a cell so textures never align */
  background-image: radial-gradient(rgba(28, 42, 30, 0.045) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 13px 13px;
  background-color: var(--paper-deep);
  border-block: 4px double var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

/* banknote ornament under centered heads: double rule + rust point */
.section-head.center::after {
  content: "";
  display: block;
  width: 72px;
  height: 9px;
  margin: 22px auto 0;
  background:
    radial-gradient(circle 3px at 50% 50%, var(--rust) 2.5px, transparent 3px),
    linear-gradient(var(--border), var(--border)) 0 0 / 100% 1px no-repeat,
    linear-gradient(var(--border), var(--border)) 0 100% / 100% 1px no-repeat;
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  color: var(--rust);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* folio numbers on journal sections (hero/page-hero eyebrows exempt) */
.section .section-head .eyebrow::before {
  counter-increment: folio;
  content: "No. " counter(folio, decimal-leading-zero) " — ";
  color: var(--muted);
}

.lede {
  margin-top: var(--space-4);
  font-size: 1.125rem;
  color: var(--body-ink);
  max-width: 60ch;
}

.section-head.center .lede {
  margin-inline: auto;
}

/* ------------------------------------------------------------
   Badges & pills
   ------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-amber {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ------------------------------------------------------------
   Cards — print-flat
   ------------------------------------------------------------ */

.card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px);
    border-color: var(--border-deep);
    box-shadow: var(--shadow-md);
  }
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: var(--space-4);
  border: 1.5px solid var(--forest);
  border-radius: 999px;
  background: transparent;
  color: var(--forest);
}

/* quiet engraved variation — kills the identical-grid sameness */
.grid-3 .card:nth-child(even) .card-icon,
.grid-2 .card:nth-child(even) .card-icon {
  border-color: var(--rust);
  background: var(--rust-soft);
  color: var(--rust-deep);
}

.card-icon .icon {
  width: 26px;
  height: 26px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* numbered pain-point cards — letterpress folios */
.num-card {
  position: relative;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.num-card .num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: var(--space-3);
  border: 1px solid var(--rust);
  border-radius: 999px;
  background: transparent;
  color: var(--rust);
  font-family: var(--display);
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 560;
  font-variant-numeric: oldstyle-nums;
}

.num-card p {
  font-weight: 500;
  color: var(--ink);
}

/* ------------------------------------------------------------
   Check lists
   ------------------------------------------------------------ */

.check-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.check-list li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  line-height: 1.45;
}

.check-list .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--success);
}

/* ------------------------------------------------------------
   Tier cards
   ------------------------------------------------------------ */

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
  align-items: stretch;
}

.tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tier-card.highlighted {
  border: 2px solid var(--forest);
  box-shadow: var(--shadow-md);
}

.tier-card.waitlist {
  border: 1px dashed var(--border-deep);
}

/* a printed "recommended" bookmark, not a pill */
.tier-flag {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border: 1px solid var(--border-deep);
  border-radius: 4px;
  background: var(--paper);
  color: var(--rust-deep);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.85rem;
  font-weight: 560;
  white-space: nowrap;
}

.tier-kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
}

.tier-card h3 {
  font-size: 1.35rem;
}

.tier-card .check-list {
  flex: 1;
}

.tier-foot {
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-weight: 600;
  color: var(--ink);
}

/* ------------------------------------------------------------
   Stats (ROI) — almanac entries
   ------------------------------------------------------------ */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.stat {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-top: 3px solid var(--rust);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
}

.stat-label {
  display: block;
  margin-bottom: var(--space-3);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-before {
  display: block;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--muted);
}

.stat-before::before {
  content: "was ";
}

.stat-after {
  display: block;
  margin-top: 2px;
  font-family: var(--display);
  font-size: clamp(1.7rem, 2.7vw, 2.35rem);
  font-weight: 560;
  font-variant-numeric: oldstyle-nums;
  letter-spacing: -0.01em;
  color: var(--forest);
  line-height: 1.1;
}

.stat-note {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.85rem;
  color: var(--body-ink);
}

/* ------------------------------------------------------------
   Tables — operational surfaces keep tabular discipline
   ------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.compare-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.compare-table th,
.compare-table td {
  padding: 14px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.compare-table thead th {
  background: var(--paper-deep);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.compare-table tbody th {
  color: var(--forest);
  font-weight: 600;
  white-space: nowrap;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

/* ------------------------------------------------------------
   Pipeline — the engraved plate (animated hero centerpiece)
   ------------------------------------------------------------ */

.pipe-panel {
  position: relative;
  margin-top: clamp(36px, 5vw, 56px);
  padding: clamp(24px, 3.5vw, 44px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 164, 88, 0.1), transparent 60%),
    radial-gradient(800px 400px at 5% 110%, rgba(166, 84, 50, 0.08), transparent 55%),
    var(--plate);
  box-shadow: inset 0 0 0 1px rgba(243, 238, 221, 0.12), var(--shadow-lg);
  overflow: hidden;
}

.pipe-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(243, 238, 221, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.pipe-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.pipe-title {
  color: var(--cream);
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 560;
  letter-spacing: 0.01em;
}

.worker-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.worker-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 1px solid rgba(243, 238, 221, 0.22);
  border-radius: 999px;
  background: rgba(243, 238, 221, 0.06);
  color: var(--cream);
  font-size: 0.85rem;
  font-weight: 600;
}

.worker-pill .icon {
  width: 18px;
  height: 18px;
  color: var(--amber);
}

.worker-pill small {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.pipe {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipe-node {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 12px;
  border: 1px solid rgba(243, 238, 221, 0.16);
  border-radius: 10px;
  background: rgba(243, 238, 221, 0.05);
  text-align: center;
  transition: opacity 360ms ease, border-color 360ms ease,
    box-shadow 360ms ease, transform 360ms ease, background-color 360ms ease;
}

.pipe-node .node-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(243, 238, 221, 0.1);
  color: var(--cream-dim);
  transition: background-color 360ms ease, color 360ms ease;
}

.pipe-node .node-icon .icon {
  width: 26px;
  height: 26px;
}

.pipe-node h3 {
  font-family: var(--font);
  font-variation-settings: normal;
  color: var(--cream);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
}

.pipe-node p {
  color: var(--cream-dim);
  font-size: 0.78rem;
  line-height: 1.35;
}

.pipe-node .node-check {
  position: absolute;
  top: -9px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--amber);
  background: var(--plate-deep);
  color: var(--amber);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 280ms ease, transform 280ms ease;
}

.pipe-node .node-check .icon {
  width: 14px;
  height: 14px;
}

/* SAP's own logo blue — a brand citation, not a theme leak */
.sap-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 32px;
  background: #0a6ed1;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  transform: skewX(-10deg);
  border-radius: 3px;
}

.pipe-link {
  position: relative;
  flex: 0 0 34px;
  align-self: center;
  height: 2px;
  margin-inline: 2px;
  background: rgba(243, 238, 221, 0.18);
  border-radius: 2px;
  overflow: visible;
}

.pipe-link::before {
  /* fill line — warm ember gradient */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--amber), var(--rust));
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
}

.pipe-link::after {
  /* traveling ember */
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 9px;
  height: 9px;
  margin-top: -4.5px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 10px 2px rgba(224, 164, 88, 0.8);
  opacity: 0;
}

/* Animated states (only under .pipe--animated; default = finished/static) */
.pipe--animated .pipe-node {
  opacity: 0.38;
}

.pipe--animated .pipe-node.is-active {
  opacity: 1;
  border-color: var(--amber);
  background: rgba(224, 164, 88, 0.1);
  box-shadow: 0 0 0 1px var(--amber), 0 0 24px rgba(224, 164, 88, 0.35);
  transform: scale(1.04);
}

.pipe--animated .pipe-node.is-active .node-icon {
  background: var(--rust);
  color: var(--cream);
}

.pipe--animated .pipe-node.is-done {
  opacity: 0.85;
}

.pipe--animated .pipe-node.is-done .node-check {
  opacity: 1;
  transform: scale(1);
}

.pipe--animated .pipe-link.is-flowing::before {
  animation: link-fill 700ms ease forwards;
}

.pipe--animated .pipe-link.is-flowing::after {
  animation: pulse-travel 700ms ease forwards;
}

.pipe--animated .pipe-link.is-filled::before {
  transform: scaleX(1);
}

@keyframes link-fill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes pulse-travel {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateX(26px);
  }
}

/* the figure caption — this plate is an engraving in a journal */
.pipe-caption {
  position: relative;
  min-height: 28px;
  margin-top: var(--space-5);
  text-align: center;
  color: var(--cream);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.98rem;
  font-weight: 480;
  letter-spacing: 0.01em;
}

.pipe-caption::before {
  content: "Fig. 1 — ";
  color: var(--amber);
}

/* colophon row */
.pipe-controls {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(243, 238, 221, 0.16);
}

.pipe-controls span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream-dim);
  font-size: 0.82rem;
  line-height: 1.3;
}

.pipe-controls .icon {
  width: 20px;
  height: 20px;
  color: var(--amber);
}

.pipe-controls strong {
  color: var(--cream);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  position: relative;
  padding-block: clamp(56px, 7vw, 96px) clamp(48px, 6vw, 80px);
  background: linear-gradient(180deg, var(--paper-deep), var(--paper) 70%);
  border-bottom: 4px double var(--border);
  overflow: hidden;
}

.hero-copy {
  max-width: 800px;
  margin-inline: auto;
  text-align: center;
}

/* the positioning line — an ink-stamped label, not a whispered kicker */
.hero-copy .eyebrow {
  display: inline-block;
  margin-bottom: var(--space-5);
  padding: 9px 20px;
  border: 1.5px solid var(--rust);
  border-radius: 4px;
  background: var(--rust-soft);
  color: var(--rust-deep);
  font-size: clamp(0.92rem, 1.2vw, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 0 1px 2px rgba(28, 42, 30, 0.08);
}

.hero-copy h1 {
  margin-bottom: var(--space-4);
}

.hero-copy .lede {
  margin-inline: auto;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

/* trust strip — a row of engraved seals */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.trust-strip > div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.trust-strip > div:last-child {
  border-right: 0;
}

.trust-strip .icon {
  width: 24px;
  height: 24px;
  color: var(--forest);
}

.trust-strip strong {
  display: block;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.2;
}

.trust-strip small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

/* ------------------------------------------------------------
   Steps (How It Works rows + engagement steps)
   ------------------------------------------------------------ */

.step-rows {
  display: grid;
  gap: var(--space-5);
  max-width: 860px;
  margin-inline: auto;
}

.step-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.step-row .step-num {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--forest);
  border-radius: var(--radius);
  background: transparent;
  color: var(--forest);
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 560;
  font-variant-numeric: oldstyle-nums;
}

.step-row h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.gate-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* scroll-reveal (class added by JS only when motion allowed) */
.reveal-ready .step-row {
  opacity: 0;
  transform: translateY(16px);
}

.reveal-ready .step-row.is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 500ms ease, transform 500ms ease;
}

/* ------------------------------------------------------------
   FAQ
   ------------------------------------------------------------ */

.faq {
  display: grid;
  gap: var(--space-3);
  max-width: 800px;
  margin-inline: auto;
}

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 16px 20px;
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

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

.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--rust);
  border-radius: 999px;
  background: transparent;
  color: var(--rust);
  font-size: 1.1rem;
  font-weight: 600;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details > div {
  padding: 0 20px 18px;
  color: var(--body-ink);
}

.faq a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------
   Forms (contact)
   ------------------------------------------------------------ */

.form-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: var(--space-7);
  align-items: start;
}

.contact-form {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 71, 38, 0.16);
}

.field input:user-invalid,
.field textarea:user-invalid {
  border-color: var(--error);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-note {
  font-size: 0.85rem;
  color: var(--muted);
}

.form-error {
  display: none;
  padding: 12px 16px;
  border-radius: 4px;
  background: var(--error-soft);
  color: var(--error);
  font-size: 0.92rem;
}

.form-error a {
  color: inherit;
  text-decoration: underline;
}

.form-error.is-visible {
  display: block;
}

.form-success {
  padding: var(--space-6);
  border: 1px solid var(--success);
  border-radius: var(--radius-lg);
  background: var(--success-soft);
  text-align: center;
}

.form-success h3 {
  margin-bottom: var(--space-2);
  color: var(--success);
}

.contact-aside {
  display: grid;
  gap: var(--space-4);
}

.contact-aside .card {
  display: grid;
  gap: 4px;
}

.contact-aside .card a {
  font-weight: 600;
}

.next-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--body-ink);
}

/* ------------------------------------------------------------
   Closing CTA band — forest plate
   ------------------------------------------------------------ */

.closing {
  padding-block: clamp(64px, 9vw, 110px);
  background:
    radial-gradient(900px 400px at 50% 120%, rgba(166, 84, 50, 0.3), transparent 65%),
    var(--plate);
  text-align: center;
}

.closing h2 {
  color: var(--cream);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
}

.closing p {
  max-width: 56ch;
  margin: var(--space-4) auto 0;
  color: var(--cream-dim);
  font-size: 1.05rem;
}

.closing .hero-ctas {
  margin-top: var(--space-6);
}

.closing .btn-primary {
  background: var(--rust);
  color: #fff;
}

.closing .btn-primary:hover {
  background: var(--rust-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 0 #6e351e;
}

.closing .btn-secondary {
  background: transparent;
  border-color: rgba(243, 238, 221, 0.45);
  color: var(--cream);
}

.closing .btn-secondary:hover {
  background: rgba(243, 238, 221, 0.08);
}

/* ------------------------------------------------------------
   Footer — the colophon, one shade deeper than the plate
   ------------------------------------------------------------ */

.site-footer {
  background: var(--plate-deep);
  border-top: 4px double rgba(243, 238, 221, 0.18);
  color: var(--cream-dim);
  padding-block: var(--space-8) var(--space-5);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: var(--space-7);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(243, 238, 221, 0.12);
}

.footer-grid h3 {
  position: relative;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  color: var(--cream);
  font-family: var(--font);
  font-variation-settings: normal;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.footer-grid h3::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 24px;
  height: 2px;
  background: var(--rust);
}

.footer-grid nav,
.footer-contact {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.footer-grid a {
  color: var(--cream-dim);
  transition: color 160ms ease;
}

.footer-grid a:hover {
  color: var(--cream);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.site-footer .brand {
  color: var(--cream);
  margin-bottom: var(--space-3);
}

.site-footer .brand-mark {
  background: var(--cream);
  color: var(--plate-deep);
}

.site-footer .brand-tagline {
  color: var(--amber);
}

.footer-blurb {
  max-width: 36ch;
  font-size: 0.95rem;
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-5);
  font-size: 0.85rem;
  color: var(--cream-dim);
}

.linkedin-chip {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(243, 238, 221, 0.4);
  border-radius: 4px;
  color: var(--cream);
  font-weight: 700;
}

.linkedin-chip:hover {
  border-color: var(--cream);
  color: var(--cream);
}

/* ------------------------------------------------------------
   Misc page helpers
   ------------------------------------------------------------ */

.page-hero {
  padding-block: clamp(48px, 6vw, 80px);
  background: linear-gradient(180deg, var(--paper-deep), var(--paper));
  border-bottom: 4px double var(--border);
}

.page-hero .section-head {
  margin-bottom: 0;
}

.illustrative-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-4);
  padding: 6px 14px;
  border: 1px solid rgba(138, 90, 18, 0.35);
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 0.8rem;
  font-weight: 600;
}

.fineprint {
  margin-top: var(--space-4);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--muted);
  max-width: 70ch;
}

.error-page {
  min-height: 50vh;
  display: grid;
  place-content: center;
  text-align: center;
  gap: var(--space-4);
  padding-block: var(--space-9);
}

.error-page .hero-ctas {
  justify-content: center;
}

/* shield art (security page) — engraved forest & rust */
.shield-art svg {
  width: min(100%, 200px);
  margin-inline: auto;
  color: var(--forest);
}

.shield-art .circuit {
  fill: none;
  stroke: rgba(166, 84, 50, 0.36);
  stroke-width: 2;
}

.shield-art .big-shield {
  fill: rgba(23, 71, 38, 0.09);
  stroke: var(--forest);
  stroke-width: 5;
}

.shield-art rect,
.shield-art path:not(.circuit):not(.big-shield) {
  fill: none;
  stroke: var(--forest);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1080px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .trust-strip > div:nth-child(2) {
    border-right: 0;
  }

  .trust-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 980px) {
  /* pipeline goes vertical */
  .pipe {
    flex-direction: column;
    align-items: stretch;
    max-width: 480px;
    margin-inline: auto;
  }

  .pipe-node {
    flex-direction: row;
    text-align: left;
    gap: var(--space-4);
    padding: 14px 16px;
  }

  .pipe-node .node-text {
    min-width: 0;
  }

  .pipe-link {
    flex: 0 0 28px;
    width: 2px;
    height: 28px;
    align-self: center;
    margin-inline: 0;
  }

  .pipe-link::before {
    background: linear-gradient(180deg, var(--amber), var(--rust));
    transform: scaleY(0);
    transform-origin: top center;
  }

  .pipe--animated .pipe-link.is-filled::before {
    transform: scaleY(1);
  }

  .pipe--animated .pipe-link.is-flowing::before {
    animation-name: link-fill-v;
  }

  .pipe--animated .pipe-link.is-flowing::after {
    animation-name: pulse-travel-v;
  }

  .pipe-link::after {
    top: 0;
    left: 50%;
    margin-top: 0;
    margin-left: -4.5px;
  }

  .pipe-controls {
    grid-template-columns: 1fr;
  }

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

  .tier-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin-inline: auto;
  }

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

@keyframes link-fill-v {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes pulse-travel-v {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

@media (max-width: 860px) {
  .js-enabled .nav-toggle {
    display: block;
  }

  .js-enabled .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: var(--space-4);
    background: var(--paper);
    border-bottom: 4px double var(--border);
    box-shadow: var(--shadow-md);
  }

  .js-enabled .site-nav.is-open {
    display: flex;
  }

  .js-enabled .site-nav .btn {
    margin: var(--space-2) 0 0;
  }

  /* no-JS fallback: nav wraps below the brand */
  html:not(.js-enabled) .nav-wrap {
    flex-wrap: wrap;
    padding-block: var(--space-3);
  }

  html:not(.js-enabled) .site-nav {
    flex-wrap: wrap;
    margin-left: 0;
  }

  .brand-tagline {
    display: none;
  }
}

@media (max-width: 720px) {
  .grid-2,
  .stat-grid,
  .trust-strip {
    grid-template-columns: 1fr;
  }

  .trust-strip > div {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .trust-strip > div:last-child {
    border-bottom: 0;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .step-row {
    grid-template-columns: 44px 1fr;
    gap: var(--space-4);
  }

  .step-row .step-num {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .hero-ctas .btn {
    width: 100%;
  }
}

/* ------------------------------------------------------------
   Reduced motion
   ------------------------------------------------------------ */

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .pipe *,
  .pipe *::before,
  .pipe *::after {
    animation: none !important;
    transition: none !important;
  }
}
