/* ============================================================
   RUBRIC ADVISORY DESIGN SYSTEM
   Editorial paper. Warm, considered, single-column reading rhythm.
   Palette family related to sibling brand, distinct personality.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Palette. Warm paper, deep indigo, coral, sage. Bright by design. */
  --paper:            #faf7f2;      /* warm off-white, main background */
  --paper-2:          #f2ecdf;      /* cream, occasional section shift */
  --ink:              #231b3f;      /* deep indigo, primary text and headlines */
  --ink-2:            #3a305a;      /* softer indigo, secondary text */
  --muted:            #7a7292;      /* quiet indigo-grey, marginalia */
  --rule:             rgba(35, 27, 63, 0.14);
  --rule-soft:        rgba(35, 27, 63, 0.08);

  --coral:            #e86a4f;      /* bright coral, single accent */
  --coral-2:          #c9583f;      /* hover / pressed */
  --coral-soft:       rgba(232, 106, 79, 0.10);
  --coral-line:       rgba(232, 106, 79, 0.28);

  --sage:             #7a9b7d;      /* secondary accent for rules and marks */
  --sage-soft:        rgba(122, 155, 125, 0.18);

  /* Motion + shape */
  --radius:           4px;
  --radius-lg:        8px;
  --ease:             cubic-bezier(.2,.7,.2,1);
  --dur:              .4s;

  /* Typography */
  --f-serif:          "Newsreader", "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --f-body:           "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout. Narrower than Equiti to reinforce reading rhythm. */
  --nav-h:            64px;
  --reading:          720px;         /* single-column reading width */
  --wide:             920px;         /* wider blocks (nav, footer) */
  --wrap:             1080px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga" 1, "kern" 1;
}
img, svg { max-width: 100%; display: block; }
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--coral);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
a:hover {
  color: var(--coral-2);
  text-decoration-color: var(--coral-2);
}
hr { border: none; height: 1px; background: var(--rule); margin: 0; }
::selection { background: var(--coral); color: var(--paper); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-serif);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0;
  font-variation-settings: "opsz" 48;
  font-feature-settings: "liga" 1, "kern" 1;
}
h1 { font-variation-settings: "opsz" 96; font-weight: 400; }

/* Section eyebrow. Small, sage, uppercase, generous letter-spacing. */
.eyebrow {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 24px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--sage);
  vertical-align: middle;
  margin-right: 14px;
  transform: translateY(-1px);
}

.lede {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-2);
}
.lede--large {
  font-size: 22px;
  line-height: 1.55;
  color: var(--ink);
}

.margin-note {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
}

/* Type scale */
.h-display {
  font-size: clamp(48px, 6.5vw, 82px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96;
  font-feature-settings: "liga" 1, "kern" 1;
}
.h-section {
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.h-item {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* Emphasis in headlines. Coral only. Upright to avoid Fraunces italic
   swash-f at display sizes. Used sparingly. */
em.mark {
  font-style: normal;
  color: var(--coral);
  font-weight: 400;
}

/* ---------- Wrap and rhythm ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }
.reading { max-width: var(--reading); margin: 0 auto; padding: 0 32px; }
.wide { max-width: var(--wide); margin: 0 auto; padding: 0 32px; }

.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section--lg { padding: 128px 0; }

/* Optional cream shift for one section. Used sparingly. */
.section--cream { background: var(--paper-2); }

/* Section rule. Thin, horizontal, replaces the "big band" pattern. */
.section-rule {
  height: 1px;
  background: var(--rule);
  max-width: var(--wide);
  margin: 0 auto;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--rule-soft);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  height: 100%;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-word {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
  font-feature-settings: "liga" 1, "kern" 1;
}
.brand-word em {
  font-style: italic;
  color: var(--coral);
  font-weight: 400;
}
.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
  flex-shrink: 0;
}
.foot .brand-mark { width: 24px; height: 24px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-links a {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.nav-links a:hover { color: var(--coral); }
.nav-links a.active { color: var(--coral); }

.nav .cta-link {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 1px solid var(--coral);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.nav .cta-link:hover {
  color: var(--coral-2);
  border-color: var(--coral-2);
}
.nav .cta-link::after {
  content: " →";
  display: inline-block;
  margin-left: 4px;
  transition: transform var(--dur) var(--ease);
}
.nav .cta-link:hover::after {
  transform: translateX(3px);
}

.nav-offset { height: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 120px 0 96px;
  position: relative;
}
.hero-eyebrow {
  color: var(--sage);
}
.hero-headline {
  font-size: clamp(48px, 6.8vw, 88px);
  font-weight: 300;
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 40px;
  max-width: 16ch;
  font-variation-settings: "opsz" 96;
  font-feature-settings: "liga" 1, "kern" 1;
}
.hero-lede {
  font-size: 21px;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
  margin: 0 0 40px;
}

.hero-meta {
  display: flex;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  max-width: 62ch;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-meta > div {
  flex: 1 1 180px;
}
.hero-meta .label {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.hero-meta .value {
  font-family: var(--f-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.01em;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur) var(--ease),
              background var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn--primary {
  background: var(--coral);
  color: var(--paper);
  border-color: var(--coral);
}
.btn--primary:hover {
  background: var(--coral-2);
  border-color: var(--coral-2);
  color: var(--paper);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}
.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn .arrow { transition: transform var(--dur) var(--ease); display: inline-block; }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* ---------- Numbered narrative list ---------- */
/* Used for Recent work and Who this is for. Left-side number, right-side content. */
.narrative {
  display: grid;
  gap: 64px;
}
.narrative-item {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
}
.narrative-num {
  font-family: var(--f-serif);
  font-weight: 400;
  font-size: 44px;
  line-height: 1;
  color: var(--coral);
  font-variation-settings: "opsz" 120;
}
.narrative-note {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}
.narrative-body h3 {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 16px;
  letter-spacing: -0.005em;
}
.narrative-body p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 12px;
  max-width: 60ch;
}
.narrative-body p:last-child { margin-bottom: 0; }
.narrative-tag {
  display: inline-block;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 12px;
}

/* ---------- Timeline (How engagements work) ---------- */
.timeline {
  display: grid;
  gap: 48px;
  position: relative;
  padding-left: 32px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--rule);
}
.timeline-item {
  position: relative;
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 8px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--coral);
}
.timeline-item h4 {
  font-family: var(--f-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.timeline-item .kicker {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
  display: block;
}
.timeline-item p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0;
  max-width: 60ch;
}

/* ---------- Perspective / Sectors ---------- */
.perspective-sectors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0;
}
.sector-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
}
.sector-chip::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  margin-right: 10px;
}

/* ---------- Connect / CTA ---------- */
.connect {
  padding: 128px 0;
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
}
.connect-inner {
  max-width: var(--reading);
  margin: 0 auto;
  padding: 0 32px;
}
.connect h2 {
  font-family: var(--f-serif);
  font-size: clamp(36px, 4.2vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 24px;
  font-variation-settings: "opsz" 120;
}
.connect p {
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 40px;
  max-width: 60ch;
}

/* ---------- Footer ---------- */
.foot {
  padding: 48px 0 32px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.foot-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.foot p {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}
.foot .brand-word { font-size: 18px; }

/* ---------- Root-cause matrix ---------- */
.matrix {
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin-top: 24px;
}
.matrix-head {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 24px;
  padding: 20px 0 18px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.matrix-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
}
.matrix-row:last-child { border-bottom: 0; }
.matrix-row .symptom {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.matrix-row .assumed,
.matrix-row .actual {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-2);
}
.matrix-row .actual {
  color: var(--ink);
  border-left: 2px solid var(--coral);
  padding-left: 18px;
}

@media (max-width: 720px) {
  .matrix-head, .matrix-row { grid-template-columns: 1fr; gap: 8px; }
  .matrix-row .actual { border-left: 0; padding-left: 0; border-top: 2px solid var(--coral); padding-top: 12px; }
}

/* ---------- Page hero (for inner pages) ---------- */
.page-hero {
  padding: 120px 0 80px;
}
.page-hero .h-display {
  max-width: 20ch;
  margin: 24px 0 0;
}

/* ---------- Anchor cards (home page section links) ---------- */
.anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.anchor-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 32px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.anchor-card:hover {
  border-color: var(--coral);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(35,27,63,0.06);
  text-decoration: none;
}
.anchor-eyebrow {
  font-family: var(--f-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}
.anchor-card h3 {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 0;
}
.anchor-card p {
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  flex: 1;
}
.anchor-cta {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--coral);
  margin-top: 8px;
}
.anchor-cta .arrow { transition: transform var(--dur) var(--ease); display: inline-block; }
.anchor-card:hover .anchor-cta .arrow { transform: translateX(3px); }

/* ---------- Multi-page footer nav ---------- */
.foot-links {
  display: flex;
  gap: 24px;
  align-items: center;
}
.foot-links a {
  font-family: var(--f-body);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.foot-links a:hover { color: var(--coral); }

@media (max-width: 720px) {
  .anchor-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 20px; }
  .nav-links a:not(.cta-link) { display: none; }
  .foot-links { flex-wrap: wrap; gap: 16px; }
  .page-hero { padding: 80px 0 48px; }
}

/* ---------- Legal pages (privacy, terms) ---------- */
.legal {
  font-family: var(--f-body);
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.75;
}
.legal h2 {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin: 56px 0 16px;
}
.legal h2:first-of-type { margin-top: 8px; }
.legal p { margin: 0 0 16px; }
.legal ul {
  margin: 0 0 20px;
  padding-left: 22px;
}
.legal li {
  margin-bottom: 8px;
  line-height: 1.65;
}
.legal strong { color: var(--ink); font-weight: 600; }
.legal a { color: var(--ink); text-decoration-color: var(--coral); }

/* ---------- Contact form ---------- */
.form { display: grid; gap: 20px; margin-top: 8px; }
.form label {
  display: block;
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.form input,
.form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.5;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-soft);
  background: #fff;
}
.form textarea { min-height: 160px; resize: vertical; }
.form button[type="submit"] {
  margin-top: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--f-body);
}
.form-error {
  padding: 12px 16px;
  border: 1px solid var(--coral-line);
  border-radius: 6px;
  background: var(--coral-soft);
  color: var(--coral-2);
  font-size: 14px;
  line-height: 1.5;
}
.form-success {
  padding: 40px 0;
  border-top: 1px solid var(--rule);
}
.form-success h3 {
  font-family: var(--f-serif);
  font-weight: 500;
  font-size: 28px;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.005em;
}
.form-success p {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
}

/* ---------- Reveal on scroll (subtle) ---------- */
.reveal { opacity: 1; transform: none; transition: opacity .8s var(--ease); }
.reveal-armed { opacity: 0; }
.reveal-armed.in { opacity: 1; }
.reveal.delay-1 { transition-delay: .12s; }
.reveal.delay-2 { transition-delay: .24s; }
.reveal.delay-3 { transition-delay: .36s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-armed { opacity: 1; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .section--lg { padding: 96px 0; }
  .hero { padding: 72px 0 48px; }
  .hero-meta { gap: 24px; }
  .narrative-item { grid-template-columns: 1fr; gap: 12px; }
  .narrative-num { font-size: 32px; }
  .timeline { padding-left: 24px; }
  .timeline-item::before { left: -24px; }
  .connect { padding: 80px 0; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}
