/* ============================================================
   First Quadrant Inc. — site styles

   Design system: the first quadrant of a coordinate plane, set as
   an editorial index rather than a card deck. Structure comes from
   hairline rules, numerals, and a two-column section header; gold
   is reserved for the plotted point, never used as general trim.

   Brand tokens mirror /branding/tokens.css.
   ============================================================ */

:root {
  /* -------- brand (source of truth: branding/tokens.css) -------- */
  --green:       #17392B;
  --green-deep:  #0E2419;
  --navy:        #0F1722;
  --navy-deep:   #0A0F17;
  --cream:       #F2EFE6;
  --gold:        #B48B3E;
  --gold-soft:   #C9A961;

  /* -------- light surfaces --------
     Kept within a few percent lightness of each other so raised and
     sunken panels read as the same paper, not as separate colours. */
  --paper:        #F2EFE6;
  --paper-raised: #FAF8F2;
  --paper-sunk:   #EBE7DB;

  /* -------- ink: near-black, warmed toward the brand green -------- */
  --ink:   #14231B;
  --ink-2: #47544C;
  --ink-3: #6E7A72;

  /* -------- text on dark -------- */
  --on-dark:   #F2EFE6;
  --on-dark-2: rgba(242, 239, 230, 0.74);
  --on-dark-3: rgba(242, 239, 230, 0.48);

  /* -------- rules: three weights, chosen by how much separation is needed -------- */
  --line-1: rgba(20, 35, 27, 0.09);
  --line-2: rgba(20, 35, 27, 0.16);
  --line-3: rgba(20, 35, 27, 0.32);
  --line-i1: rgba(242, 239, 230, 0.11);
  --line-i2: rgba(242, 239, 230, 0.2);

  /* -------- type -------- */
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans:  "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --t--2: 0.6875rem;   /* 11px  micro label */
  --t--1: 0.8125rem;   /* 13px  label */
  --t-0:  0.9375rem;   /* 15px  small text */
  --t-1:  1.0625rem;   /* 17px  body */
  --t-2:  1.25rem;     /* 20px  lede */
  --t-3:  1.5rem;      /* 24px  h3 */
  --t-4:  clamp(1.75rem, 1.3rem + 1.6vw, 2.4rem);    /* row heading */
  --t-5:  clamp(2.25rem, 1.5rem + 2.9vw, 3.5rem);    /* h2 */
  --t-6:  clamp(2.75rem, 1.4rem + 5.6vw, 5.25rem);   /* h1 */

  /* -------- space: 4px base, mathematically related -------- */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;     --s-10: 8rem;

  /* -------- shape: radius scales with the element it is on -------- */
  --r-1: 2px;   /* inputs, small controls */
  --r-2: 4px;   /* buttons */
  --r-3: 8px;   /* images, panels */

  /* -------- depth: blur is twice the offset, hue borrowed from the ink -------- */
  --shadow-1: 0 1px 2px rgba(20, 35, 27, 0.04), 0 2px 4px rgba(20, 35, 27, 0.03);
  --shadow-2: 0 2px 4px rgba(20, 35, 27, 0.04), 0 6px 12px rgba(20, 35, 27, 0.05),
              0 12px 24px rgba(20, 35, 27, 0.04);
  --shadow-3: 0 4px 8px rgba(14, 36, 25, 0.05), 0 12px 24px rgba(14, 36, 25, 0.07),
              0 28px 56px rgba(14, 36, 25, 0.07);

  /* -------- motion --------
     ease: things entering or revealing. ease-in-out: things moving across
     the screen. ease-soft: colour and hover only. Never ease-in. */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-soft:   cubic-bezier(0.25, 0.1, 0.25, 1);
  --fast: 140ms;
  --med:  240ms;
  --slow: 480ms;

  --max: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-1);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  /* tracking tightens as size grows, loosens as it shrinks */
  text-wrap: balance;
  overflow-wrap: break-word;
  margin: 0;
}
h1 { font-size: var(--t-6); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: var(--t-5); line-height: 1.04; letter-spacing: -0.025em; }
h3 { font-size: var(--t-3); line-height: 1.22; letter-spacing: -0.012em; }
h1 em, h2 em { font-style: italic; font-weight: 400; color: var(--gold); }

p { margin: 0 0 var(--s-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

::selection { background: var(--gold); color: var(--green-deep); }
:root { accent-color: var(--gold); }

/* ---------- focus: one visible system, tuned per surface ----------
   The ring settles outward when focus lands and pulls in on press, which
   is what makes a keyboard focus state feel deliberate rather than default. */
:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: var(--r-1);
}
:not(:active):focus-visible { outline-offset: 5px; }
@media (prefers-reduced-motion: no-preference) {
  :focus-visible { transition: outline-offset 145ms var(--ease-soft); }
}
.section-dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--gold-soft); }

/* A 1px rule is 2 to 3 device pixels on a high-density screen, so a
   hairline-led layout renders heavier there than intended. Lowering the
   alpha is perceptually equivalent to a thinner line and carries no
   sub-pixel rendering risk. */
@media (min-resolution: 2dppx) {
  :root {
    --line-1: rgba(20, 35, 27, 0.07);
    --line-2: rgba(20, 35, 27, 0.13);
    --line-3: rgba(20, 35, 27, 0.26);
    --line-i1: rgba(242, 239, 230, 0.09);
    --line-i2: rgba(242, 239, 230, 0.16);
  }
}

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gold); color: var(--green-deep);
  padding: var(--s-3) var(--s-4); font-size: var(--t--1); font-weight: 600;
}
.skip-link:focus { left: var(--s-2); top: var(--s-2); }

/* ---------- labels ----------
   The label text sits in ink; only the leading tick is gold, so gold
   stays a marker rather than becoming the colour of all small text. */
.eyebrow {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0 0 var(--s-5);
  font-size: var(--t--1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--ink-2);
}
.eyebrow::before {
  content: ""; flex: none; width: 22px; height: 1px; background: var(--gold);
}
.eyebrow-invert { color: var(--on-dark-2); }

.lede {
  font-size: var(--t-2); line-height: 1.5; color: var(--ink-2);
  letter-spacing: -0.005em;
}
.section-dark .lede { color: var(--on-dark-2); }

.tagline {
  margin-top: var(--s-6);
  font-size: var(--t--1); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.25em;
  color: var(--gold);
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background var(--slow) var(--ease-soft), box-shadow var(--slow) var(--ease-soft);
}
.site-header.scrolled {
  background: rgba(14, 36, 25, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: inset 0 -1px 0 var(--line-i1);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: var(--s-4); }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark { flex: none; }
/* The wordmark carries more weight than page headings so it holds its own
   at small size; headings sit at 500 because Playfair's heavier weights
   thicken and lose their hairlines at display sizes. */
.brand-text {
  font-family: var(--serif); font-size: 1.18rem; font-weight: 600;
  letter-spacing: -0.012em; color: var(--cream);
}

.nav-links { display: flex; align-items: center; gap: var(--s-6); }
.nav-links a {
  position: relative; text-decoration: none;
  font-size: var(--t--1); font-weight: 500; letter-spacing: 0.02em;
  color: var(--on-dark-2);
  transition: color var(--fast) var(--ease-soft);
}
.nav-links a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 100%;
  background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--med) var(--ease);
}
.nav-links a:not(.nav-cta):hover { color: var(--cream); }
.nav-links a:not(.nav-cta):hover::after { transform: scaleX(1); }

.nav-cta {
  border: 1px solid var(--line-i2); border-radius: var(--r-2);
  padding: 0.6rem 1.1rem; color: var(--cream) !important;
  transition: background var(--med) var(--ease-soft), border-color var(--med) var(--ease-soft), color var(--med) var(--ease-soft);
}
.nav-cta:hover { background: var(--gold); border-color: var(--gold); color: var(--green-deep) !important; }

/* ---------- mobile menu (details/summary, works without JS) ---------- */
.menu { display: none; position: relative; }
.menu summary {
  list-style: none; cursor: pointer;
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line-i2); border-radius: var(--r-2);
}
.menu summary::-webkit-details-marker { display: none; }
.menu-bars { display: grid; gap: 5px; width: 18px; }
.menu-bars i { display: block; height: 1px; background: var(--cream); transition: transform var(--med) var(--ease); }
.menu[open] .menu-bars i:first-child { transform: translateY(3px) rotate(45deg); }
.menu[open] .menu-bars i:last-child  { transform: translateY(-3px) rotate(-45deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px;
  display: flex; flex-direction: column;
  background: var(--green-deep); border: 1px solid var(--line-i1); border-radius: var(--r-3);
  padding: var(--s-2); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.menu-panel a {
  text-decoration: none; color: var(--on-dark-2);
  padding: 0.7rem 0.9rem; border-radius: var(--r-1);
  font-size: var(--t-0);
}
.menu-panel a:hover { color: var(--cream); background: rgba(242, 239, 230, 0.06); }
.menu-panel a:last-child {
  margin-top: var(--s-2); padding-top: 0.9rem;
  border-top: 1px solid var(--line-i1); color: var(--gold-soft);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  /* horizontal padding is twice the vertical */
  padding: 0.9rem 1.8rem; border-radius: var(--r-2);
  font-family: var(--sans); font-size: var(--t--1); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: background var(--med) var(--ease-soft), color var(--med) var(--ease-soft),
              border-color var(--med) var(--ease-soft);
}
.btn-gold { background: var(--gold); color: var(--green-deep); }
.btn-gold:hover { background: var(--gold-soft); }
.btn-ghost { color: var(--cream); border-color: var(--line-i2); }
.btn-ghost:hover { border-color: var(--cream); background: rgba(242, 239, 230, 0.06); }

/* ---------- link with a trailing rule ---------- */
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  text-decoration: none; font-weight: 600; font-size: var(--t-0);
  color: var(--ink);
  padding-bottom: 3px;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size var(--med) var(--ease), color var(--med) var(--ease-soft);
}
.link-arrow svg { color: var(--gold); }
.link-arrow:hover { background-size: 0% 1px; color: var(--gold); }

/* ---------- coordinate grid + grain on dark surfaces ---------- */
.grid-overlay {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--line-i1) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-i1) 1px, transparent 1px);
  background-size: 88px 88px;
  opacity: 0.34;
  -webkit-mask-image: radial-gradient(120% 100% at 12% 0%, #000 30%, transparent 82%);
          mask-image: radial-gradient(120% 100% at 12% 0%, #000 30%, transparent 82%);
}
/* A trace of grain. On the dark fields it stops them banding; on the cream
   it is the difference between a flat fill and something that reads as paper.
   fractalNoise + a single octave is grain; more octaves turn cloudy. */
:root {
  --grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* One grain layer for the whole page: soft-light reads correctly over both
   the cream and the green, so the paper texture is continuous. */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9; pointer-events: none;
  background-image: var(--grain); background-size: 180px;
  opacity: 0.05; mix-blend-mode: soft-light;
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center;
  min-height: min(92vh, 780px);
  padding: 10rem 0 6rem;
  background: linear-gradient(158deg, #1A3F2F 0%, #17392B 48%, var(--green-deep) 100%);
  color: var(--on-dark);
}
.hero-plot {
  position: absolute; z-index: 0; pointer-events: none;
  right: 0; bottom: 0;
  width: min(56%, 760px); height: auto;
}
.hero-inner { position: relative; z-index: 2; }
.hero h1 { color: var(--cream); max-width: 15ch; }
.hero-sub {
  max-width: 46ch; margin: var(--s-5) 0 var(--s-7);
  font-size: var(--t-2); line-height: 1.52; color: var(--on-dark-2);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* Axis captions live inside the plot so they can never drift away from the
   axes they name when the viewport changes. */
.plot-label {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.24em;
  fill: rgba(242, 239, 230, 0.42);
}

/* ---------- sections ----------
   One continuous paper field with hairline separators, rather than
   alternating background colours: fewer hard divides, more rhythm. */
.section { position: relative; padding: var(--s-9) 0; }
/* The separator is drawn on the section itself rather than inside the
   container, so it cannot become a stray grid item in the sections whose
   container is a grid. */
.section-rule::before {
  content: ""; position: absolute; top: 0; left: 50%;
  width: calc(min(100%, var(--max)) - var(--gutter) * 2);
  height: 1px; background: var(--line-2);
  transform: translateX(-50%);
}
.section-dark {
  background: var(--green);
  color: var(--on-dark); overflow: hidden;
  padding: 7rem 0;
}
.section-dark > .container { position: relative; z-index: 2; }
.section-dark h2, .section-dark h3 { color: var(--cream); }
.section-contact { background: var(--navy); }

/* ---------- two-column section header ----------
   Heading left, lede right on the same baseline. This is what fills
   the width that a single centred or left-only header leaves empty. */
.s-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-5) var(--s-8);
  align-items: end;
  margin-bottom: var(--s-8);
}
.s-head-l .eyebrow { margin-bottom: var(--s-4); }
.s-head-r { max-width: 42ch; }

/* ---------- services as an index, not a card grid ---------- */
.index-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.index-row {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s-6);
  padding: var(--s-7) 0;
  border-bottom: 1px solid var(--line-2);
  transition: background var(--med) var(--ease-soft);
}
.index-num {
  font-family: var(--serif); font-size: var(--t-2);
  color: var(--ink-3); line-height: 1.1; padding-top: 0.35rem;
  transition: color var(--med) var(--ease-soft);
}
.index-main h3 { font-size: var(--t-4); letter-spacing: -0.02em; margin-bottom: var(--s-3); }
.index-main p { color: var(--ink-2); max-width: 34ch; margin: 0; }
.index-meta {
  list-style: none; margin: 0; padding: 0.35rem 0 0;
  display: flex; flex-direction: column; gap: 0.55rem;
}
.index-meta li {
  font-size: var(--t-0); color: var(--ink-2);
  padding-bottom: 0.55rem; border-bottom: 1px solid var(--line-1);
}
.index-meta li:last-child { border-bottom: 0; padding-bottom: 0; }
/* The section rule below already closes the list, so the final row does not
   need its own line. Two hairlines that close together read as a mistake. */
.index-row:last-child { border-bottom: 0; }

@media (hover: hover) {
  .index-row:hover { background: var(--paper-raised); }
  .index-row:hover .index-num { color: var(--gold); }
}

/* ---------- deliverables ---------- */
.deliverables {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6);
}
.deliverable { padding-top: var(--s-4); border-top: 1px solid var(--line-3); }
.d-num {
  display: block; margin-bottom: var(--s-4);
  font-family: var(--serif); font-size: var(--t--1); letter-spacing: 0.06em;
  color: var(--gold);
}
.deliverable h3 { font-size: var(--t-3); margin-bottom: var(--s-2); }
.deliverable p { font-size: var(--t-0); color: var(--ink-2); margin: 0; }

/* ---------- case study ---------- */
/* Retool's approach to the same problem: a dark product UI on a warm light
   page reads best as a small, tightly-cropped tile with a hairline and almost
   no framing. A big dark stage competes with the page; this sits inside it. */
.case-title { display: flex; align-items: center; gap: 0.7rem; }
.case-logo { flex: none; width: 40px; height: 40px; }

.case-aside { display: flex; flex-direction: column; gap: var(--s-6); }
.case-visual { margin: 0; }
.case-stage {
  display: block; overflow: clip;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  box-shadow: var(--shadow-1);
  transition: border-color var(--med) var(--ease-soft);
}
.case-stage img { width: 100%; }
@media (hover: hover) { .case-stage:hover { border-color: var(--gold); } }
.case-visual figcaption {
  margin-top: var(--s-3);
  font-size: var(--t--1); line-height: 1.5; color: var(--ink-3);
}

.case-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-8);
  align-items: start;
}
.case-copy p { color: var(--ink-2); max-width: 52ch; }
.case-copy .link-arrow { margin-top: var(--s-3); }

.spec { margin: 0; }
.spec-row {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--s-4);
  padding: 0.85rem 0; border-top: 1px solid var(--line-2);
}
.spec-row:last-child { border-bottom: 1px solid var(--line-2); }
.spec dt {
  font-size: var(--t--1); text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); padding-top: 0.15rem;
}
.spec dd { margin: 0; font-size: var(--t-0); }

.built-with {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem;
  margin: var(--s-8) 0 0; padding-top: var(--s-5);
  border-top: 1px solid var(--line-1);
  font-size: var(--t-0); color: var(--ink-2);
}
.built-label {
  font-size: var(--t--2); text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--ink-3);
}

/* ---------- process ---------- */
.steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-6);
}
.step { position: relative; padding-top: var(--s-6); border-top: 1px solid var(--line-i2); }
.step::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold); transform: translateY(-50%);
}
.step-num {
  position: absolute; top: var(--s-5); right: 0;
  font-family: var(--serif); font-size: var(--t--1); letter-spacing: 0.06em;
  color: var(--on-dark-3);
}
.step h3 { font-size: var(--t-3); margin-bottom: var(--s-2); }
.step p { font-size: var(--t-0); color: var(--on-dark-2); margin: 0; }

/* ---------- about ---------- */
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: var(--s-9); align-items: center;
}
.about-copy h2 { margin-bottom: var(--s-5); }
.about-copy p { color: var(--ink-2); max-width: 54ch; }
.quadrant-diagram { width: min(280px, 100%); margin: 0 auto; }
.qd-label {
  font-family: var(--serif); font-size: 15px; fill: var(--ink-2);
  letter-spacing: 0.08em;
}
.qd-dim { fill: var(--ink-3); opacity: 0.55; }

.industries { margin-top: var(--s-9); }
.industries .eyebrow { margin-bottom: var(--s-5); }
/* Multi-column rather than grid so an odd number of entries flows down the
   first column and continues in the next, the way an index does, instead of
   leaving a hole in a fixed row. */
.industry-list {
  list-style: none; margin: 0; padding: 0;
  columns: 3; column-gap: var(--s-7);
  border-top: 1px solid var(--line-2);
}
.industry-list li {
  padding: 0.9rem 0; border-bottom: 1px solid var(--line-1);
  font-size: var(--t-0); color: var(--ink-2);
}

/* ---------- FAQ ---------- */
.faq-grid {
  display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: var(--s-8);
  align-items: start;
}
.faq-head { position: sticky; top: 7rem; }
.faq-list { border-top: 1px solid var(--line-2); }
.faq-item { border-bottom: 1px solid var(--line-2); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-5);
  padding: var(--s-5) 0;
  font-family: var(--serif); font-size: var(--t-3); font-weight: 500;
  letter-spacing: -0.012em;
  transition: color var(--fast) var(--ease-soft);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--gold); }
.faq-plus { position: relative; flex: none; width: 14px; height: 14px; }
.faq-plus::before, .faq-plus::after {
  content: ""; position: absolute; background: var(--gold);
  transition: transform var(--med) var(--ease);
}
.faq-plus::before { top: 6.5px; left: 0; width: 14px; height: 1px; }
.faq-plus::after  { left: 6.5px; top: 0; width: 1px; height: 14px; }
.faq-item[open] .faq-plus::after { transform: scaleY(0); }
.faq-body { padding-bottom: var(--s-5); }
.faq-body p { color: var(--ink-2); max-width: 62ch; font-size: var(--t-0); }

/* Animating to an intrinsic height where the browser allows it. The panel
   still opens instantly everywhere else, so nothing depends on this. */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    :root { interpolate-size: allow-keywords; }
    .faq-item::details-content {
      height: 0; overflow: clip;
      transition: height 200ms var(--ease-soft), content-visibility 200ms allow-discrete;
    }
    .faq-item[open]::details-content { height: auto; }
  }
}

/* ---------- contact ---------- */
.contact-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
  gap: var(--s-9);
  align-items: start;
}
.contact-copy { display: flex; flex-direction: column; gap: var(--s-8); }
.contact-copy h2 { margin-bottom: var(--s-5); }
.contact-copy .lede { max-width: 40ch; }
.contact-details { padding-top: var(--s-6); border-top: 1px solid var(--line-i1); }
.contact-email {
  display: inline-block; text-decoration: none;
  font-family: var(--serif); font-size: clamp(1.2rem, 0.9rem + 1.1vw, 1.65rem);
  letter-spacing: -0.015em; color: var(--gold-soft);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
  background-repeat: no-repeat; background-position: 0 100%; background-size: 0% 1px;
  padding-bottom: 4px;
  transition: background-size var(--med) var(--ease);
}
.contact-email:hover { background-size: 100% 1px; }
.contact-loc {
  margin: var(--s-4) 0 0;
  font-size: var(--t--2); text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--on-dark-3);
}

.contact-form {
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-6);
  background: rgba(242, 239, 230, 0.03);
  border: 1px solid var(--line-i1); border-radius: var(--r-3);
}
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label {
  font-size: var(--t--2); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--on-dark-2);
}
.field label .opt {
  text-transform: none; letter-spacing: 0.02em; font-weight: 400;
  color: var(--on-dark-3);
}
.field input, .field textarea {
  font-family: var(--sans); font-size: var(--t-0); color: var(--cream);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line-i1); border-radius: var(--r-1);
  padding: 0.75rem 0.9rem; resize: vertical;
  transition: border-color var(--fast) var(--ease-soft);
}
.field input::placeholder, .field textarea::placeholder { color: var(--on-dark-3); }
.field input:hover, .field textarea:hover { border-color: var(--line-i2); }
.field input:focus-visible, .field textarea:focus-visible { outline-offset: 1px; }
/* Honeypot. The contact function discards any submission that fills this in,
   so it must exist in the form, stay off-screen, and stay out of the tab order. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn { margin-top: var(--s-2); }
.form-note { margin: 0; min-height: 1.3em; font-size: var(--t-0); color: var(--gold-soft); }
.form-note.error { color: #E9A79A; }
.contact-form button[disabled] { opacity: 0.6; cursor: default; }

/* ---------- footer ---------- */
.site-footer { background: var(--navy-deep); color: var(--on-dark-2); padding: var(--s-8) 0 var(--s-6); }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.4fr);
  gap: var(--s-7);
  padding-bottom: var(--s-8); border-bottom: 1px solid var(--line-i1);
}
.footer-mark { margin-bottom: var(--s-4); }
.footer-name { font-family: var(--serif); font-size: 1.15rem; color: var(--cream); margin: 0 0 var(--s-2); }
.footer-tag {
  margin: 0; font-size: var(--t--2); text-transform: uppercase; letter-spacing: 0.22em;
  color: var(--gold-soft);
}
.footer-col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.6rem; }
.footer-heading {
  margin: 0 0 var(--s-2); color: var(--cream);
  font-size: var(--t--2); font-weight: 600; text-transform: uppercase; letter-spacing: 0.18em;
}
.footer-col a {
  text-decoration: none; font-size: var(--t-0); color: var(--on-dark-2);
  transition: color var(--fast) var(--ease-soft);
}
.footer-col a:hover { color: var(--gold-soft); }
.footer-muted { margin: 0; font-size: var(--t-0); color: var(--on-dark-3); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3);
  padding-top: var(--s-5); font-size: var(--t--1);
}
.footer-bottom p { margin: 0; }
.footer-bottom .footer-muted { text-transform: uppercase; letter-spacing: 0.18em; font-size: var(--t--2); }

/* ---------- scroll position, plotted along an axis ----------
   Progressive enhancement only: where scroll-driven animation is supported
   the reading position is drawn as a value on the x-axis, which is the same
   idea the hero states. Everywhere else the element simply never appears. */
.scroll-axis { display: none; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .scroll-axis {
      display: block; position: fixed; inset: 0 0 auto 0; z-index: 60;
      height: 1px; background: var(--gold); transform-origin: 0 50%;
      animation: axis-progress auto linear;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes axis-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- reveal ----------
   Applied to section-level blocks only, and a short distance. Long
   fade-ups on every element are the single most template-like motion
   on the web, so the list of things that move is deliberately short. */
.reveal { opacity: 0; transform: translateY(10px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity var(--slow) var(--ease-soft), transform var(--slow) var(--ease);
}
.index-row.in:nth-child(2) { transition-delay: 60ms; }
.index-row.in:nth-child(3) { transition-delay: 120ms; }

/* grid/flex children holding wide content */
.hero-inner > *, .s-head > *, .about-grid > *, .case-body > *, .contact-inner > *,
.faq-grid > *, .index-row > *, .deliverables > *, .steps > *, .footer-grid > * { min-width: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .s-head { grid-template-columns: 1fr; gap: var(--s-4); align-items: start; }
  .s-head-r { max-width: 52ch; }
  .index-row { grid-template-columns: 3rem minmax(0, 1fr); row-gap: var(--s-5); }
  .index-meta { grid-column: 2; }
  .deliverables { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
  .case-body { grid-template-columns: 1fr; gap: var(--s-7); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-7) var(--s-6); }
  .about-grid { grid-template-columns: 1fr; gap: var(--s-7); }
  .about-side { order: -1; }
  .quadrant-diagram { width: min(220px, 60%); margin: 0; }
  .faq-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .faq-head { position: static; }
  .contact-inner { grid-template-columns: 1fr; gap: var(--s-8); }
  .industry-list { columns: 2; }
}

@media (max-width: 760px) {
  .nav-links { display: none; }
  .menu { display: block; }
  /* The plot crosses the copy at narrow widths, so it steps aside. */
  .hero-plot { display: none; }
  .hero { min-height: 0; padding: 8.5rem 0 var(--s-9); }
  .section { padding: var(--s-8) 0; }
  .section-rule > .container::before { margin-bottom: var(--s-8); }
  .section-dark { padding: var(--s-8) 0; }
  .s-head { margin-bottom: var(--s-7); }
  .hero-actions .btn { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .deliverables, .steps { grid-template-columns: 1fr; }
  .industry-list { columns: 1; }
  .index-row { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--s-6); }
  .spec-row { grid-template-columns: 1fr; gap: 0.25rem; }
  h2 br, h1 br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .reveal.in { transition: none; }
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
