/* ==========================================================================
   Manifest — marketing + legal site

   Near-white ground with the colour carried by tinted, generously rounded
   panels, rather than a wash across the whole page. Cool green rather than
   cream, so the brand gold reads as the single warm accent instead of part of a
   warm monochrome.

   The brand gold (#BC9A54) is never used for text — it is about 2.3:1 on white.
   Body links and the display accent use --gold-deep; small gold labels sitting
   on --tint use --gold-label, which is deeper again because the tint costs
   roughly 0.5:1 of contrast.
   ========================================================================== */

:root {
  /* Near-white ground: the colour is carried by tinted panels rather than by
     washing the whole page, which keeps large areas of type feeling open. */
  --ground: #fbfcfa;
  --ground-2: #f3f6f2;
  --surface: #ffffff;
  --tint: #eaf1ea;
  --ink: #17251f;
  --ink-2: #3c4c45;
  --sage: #5b6b62;
  --sage-soft: #93a29a;
  --gold: #bc9a54;
  /* Slightly deeper than the brand gold so body links still clear 4.5:1 on a
     near-white ground — the brand value alone is about 2.3:1. */
  --gold-deep: #8a6d33;
  /* Small gold text sitting on --tint, which is darker than --ground and so
     costs about 0.5:1 of contrast. Kept separate from --gold-deep so the
     display accent in the hero doesn't have to lose its warmth for it. */
  --gold-label: #7a6029;
  --rule: #e6ece6;
  --rule-strong: #d3dcd4;

  --radius: 14px;
  --radius-lg: 22px;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--2: 0.6875rem;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.1875rem;
  --step-2: clamp(1.45rem, 2.4vw, 1.85rem);
  --step-3: clamp(1.85rem, 3.8vw, 2.6rem);
  --step-4: clamp(2.4rem, 6vw, 4.4rem);

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3.5rem);
  --shell: 74rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #121a18;
    --ground-2: #182220;
    --surface: #1a2422;
    --tint: #1e2b27;
    --ink: #e9eeea;
    --ink-2: #bbc7c1;
    --sage: #95a69e;
    --sage-soft: #6d7f77;
    --gold: #c9a961;
    --gold-deep: #d8bb79;
    --gold-label: #d8bb79;
    --rule: #253230;
    --rule-strong: #334440;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--ink);
}

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  color: var(--ink);
  padding: 0.75rem 1rem;
  z-index: 50;
}

.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* --- masthead ----------------------------------------------------------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.25rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 40;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark-mark {
  width: 1.85rem;
  height: 1.85rem;
  object-fit: contain;
  flex: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.9rem, 2.4vw, 1.9rem);
  font-size: var(--step--1);
}

.nav-link {
  color: var(--ink-2);
  text-decoration: none;
}

/* In-page anchors are a convenience; Privacy, Terms and Sign in are not. Drop
   the anchors first when the bar gets tight, then tighten the rest so the bar
   still fits a 320px screen without wrapping. */
@media (max-width: 47.99rem) {
  .nav-link--anchor {
    display: none;
  }
}

@media (max-width: 30rem) {
  .nav {
    gap: 0.7rem;
  }
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--ground);
  font-family: var(--body);
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.button:hover {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.button--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.button--ghost:hover {
  border-color: var(--ink);
  background: transparent;
}

.button--lg {
  padding: 0.8rem 1.4rem;
  font-size: var(--step-0);
}

@media (max-width: 30rem) {
  .masthead-in .button {
    padding: 0.5rem 0.85rem;
  }
}

/* --- generic sections --------------------------------------------------- */

.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  border-top: 1px solid var(--rule);
}

.section--plain {
  border-top: 0;
}

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
}

.eyebrow-rule {
  display: inline-block;
  width: 1.6rem;
  height: 1px;
  background: var(--gold);
  vertical-align: 0.32em;
  margin-right: 0.7rem;
}

.h2 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 72;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.12;
  letter-spacing: -0.012em;
  max-width: 26ch;
}

.lede {
  margin: 0;
  max-width: var(--measure);
  color: var(--ink-2);
  font-size: var(--step-1);
  line-height: 1.6;
}

.lede--spaced {
  margin-top: 2rem;
}

/* --- hero --------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(4rem, 11vw, 9rem) clamp(3rem, 7vw, 5.5rem);
}

.hero-in {
  position: relative;
  z-index: 1;
}

.hero-title {
  margin: 0 0 1.5rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 144;
  font-weight: 400;
  font-size: var(--step-4);
  line-height: 1.04;
  letter-spacing: -0.022em;
  max-width: 21ch;
  text-wrap: balance;
}

.hero-title em {
  font-style: italic;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 144;
  color: var(--gold-deep);
}

.hero-lede {
  margin: 0 0 2.25rem;
  max-width: 40rem;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
}

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

/* Ambient lotus, bleeding off the top-right. Decorative only. */
.hero-lotus {
  position: absolute;
  top: -18%;
  right: -14%;
  width: min(42rem, 68vw);
  height: auto;
  color: var(--gold);
  /* Lower than it looks like it should be: the same opacity reads considerably
     stronger against a near-white ground than against a tinted one. */
  opacity: 0.09;
  pointer-events: none;
  z-index: 0;
}

@media (prefers-color-scheme: dark) {
  .hero-lotus {
    opacity: 0.1;
  }
}

/* --- the chain (signature element) -------------------------------------- */

.chain {
  list-style: none;
  margin: 2.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 2.25rem 1.5rem;
  grid-template-columns: 1fr;
  counter-reset: stage;
}

@media (min-width: 62rem) {
  .chain {
    grid-template-columns: repeat(4, 1fr);
    gap: 0 1.5rem;
  }
}

.stage {
  position: relative;
  padding-top: 1.9rem;
}

/* Node sits on the thread; the thread itself is the ::after of each stage. */
.stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0.55rem;
  height: 0.55rem;
  background: var(--gold);
  transform: rotate(45deg);
  z-index: 1;
}

.stage::after {
  content: "";
  position: absolute;
  background: var(--gold);
  opacity: 0.55;
  transform-origin: top center;
  transform: scaleY(0);
  transition: transform 0.7s var(--ease);
  /* vertical thread on narrow screens */
  top: 0.55rem;
  left: 0.24rem;
  width: 1px;
  height: calc(100% + 2.25rem - 0.55rem);
}

.stage:last-child::after {
  display: none;
}

.chain.is-drawn .stage::after {
  transform: scaleY(1);
}

@media (min-width: 62rem) {
  .stage::after {
    top: 0.24rem;
    left: 0.55rem;
    width: calc(100% + 1.5rem - 0.55rem);
    height: 1px;
    transform-origin: left center;
    transform: scaleX(0);
  }

  .chain.is-drawn .stage::after {
    transform: scaleX(1);
  }
}

.chain.is-drawn .stage:nth-child(1)::after {
  transition-delay: 0.05s;
}
.chain.is-drawn .stage:nth-child(2)::after {
  transition-delay: 0.3s;
}
.chain.is-drawn .stage:nth-child(3)::after {
  transition-delay: 0.55s;
}

.stage-src {
  margin: 0 0 0.35rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sage);
}

.stage-title {
  margin: 0 0 0.9rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 30, "WONK" 0, "opsz" 40;
  font-weight: 500;
  font-size: var(--step-1);
  line-height: 1.25;
}

/* Reserve two lines so the field blocks below line up across all four stages,
   whether a title wraps or not. */
@media (min-width: 62rem) {
  .stage-title {
    min-height: 2.5em;
  }
}

.stage-fields {
  margin: 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.45rem;
}

.field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: var(--step--1);
}

.field dt {
  color: var(--sage);
}

.field dd {
  margin: 0;
  color: var(--ink);
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chain-legend {
  margin: 2.5rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--sage);
}

/* --- capability groups -------------------------------------------------- */

.groups {
  margin-top: 2.75rem;
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 54rem) {
  .groups {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.75rem 2rem;
  }
}

.group-head {
  margin: 0 0 1.4rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule-strong);
  font-family: var(--mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.4rem;
}

.item-title {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 30;
  font-weight: 500;
  font-size: var(--step-0);
  line-height: 1.35;
}

.item-body {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-2);
}

/* --- data handling ----------------------------------------------------- */

/* Tinted cards with air between them, rather than white cells divided by
   hairlines. The colour lives here instead of in the page background. */
.data-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 48rem) {
  .data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.data-cell {
  background: var(--tint);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 2.8vw, 2.1rem);
}

.data-term {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-label);
}

.data-body {
  margin: 0;
  font-size: var(--step--1);
  line-height: 1.6;
  color: var(--ink-2);
}

/* --- footer ------------------------------------------------------------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2.5rem, 5vw, 3.75rem);
  background: var(--ground-2);
}

.footer-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.75rem;
}

.footer-brand {
  max-width: 22rem;
}

.footer-note {
  margin: 0.75rem 0 0;
  font-size: var(--step--1);
  color: var(--sage);
}

.footer-nav {
  display: grid;
  gap: 0.55rem;
  font-size: var(--step--1);
}

.footer-nav a {
  color: var(--ink-2);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

/* --- legal documents ---------------------------------------------------- */

.doc {
  padding-block: clamp(3rem, 7vw, 5rem);
}

.doc-shell {
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.doc-title {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 96;
  font-weight: 400;
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.018em;
}

.doc-meta {
  margin: 0 0 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--step--1);
  color: var(--sage);
}

.doc-intro {
  margin: 0 0 2.5rem;
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-2);
}

.doc-body {
  counter-reset: sec;
}

.doc-body h2 {
  counter-increment: sec;
  margin: 2.75rem 0 0.85rem;
  font-family: var(--display);
  font-variation-settings: "SOFT" 20, "WONK" 0, "opsz" 48;
  font-weight: 500;
  font-size: var(--step-2);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.doc-body h2::before {
  content: counter(sec) " ";
  font-family: var(--mono);
  font-size: 0.62em;
  font-weight: 400;
  color: var(--gold-deep);
  margin-right: 0.6rem;
  vertical-align: 0.14em;
}

.doc-body h3 {
  margin: 1.9rem 0 0.6rem;
  font-family: var(--body);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.4;
}

.doc-body p,
.doc-body li {
  color: var(--ink-2);
}

.doc-body p {
  margin: 0 0 1.1rem;
}

.doc-body ul {
  margin: 0 0 1.1rem;
  padding-left: 1.1rem;
}

.doc-body li {
  margin-bottom: 0.55rem;
  padding-left: 0.25rem;
}

.doc-body li::marker {
  color: var(--gold);
}

.doc-body strong {
  color: var(--ink);
  font-weight: 600;
}

.doc-body code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--ground-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.08em 0.34em;
}

.callout {
  margin: 1.5rem 0 1.75rem;
  padding: 1.25rem 1.5rem;
  background: var(--tint);
  border: 0;
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout p {
  margin: 0;
  font-size: var(--step--1);
}

.callout p + p {
  margin-top: 0.7rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
  font-size: var(--step--1);
}

.doc-table th,
.doc-table td {
  text-align: left;
  vertical-align: top;
  /* Generous right padding so adjacent cells can't visually run together —
     these columns wrap onto several lines each. The last column drops it so the
     table still ends flush with the body text. */
  padding: 0.7rem 1.5rem 0.7rem 0;
  border-bottom: 1px solid var(--rule);
}

.doc-table th:last-child,
.doc-table td:last-child {
  padding-right: 0;
}

.doc-table th {
  font-family: var(--mono);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  white-space: nowrap;
}

.doc-table td {
  color: var(--ink-2);
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.5rem;
}

/* --- page-load reveal --------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(0.9rem);
  animation: rise 0.85s var(--ease) forwards;
}

.reveal--1 { animation-delay: 0.05s; }
.reveal--2 { animation-delay: 0.16s; }
.reveal--3 { animation-delay: 0.27s; }
.reveal--4 { animation-delay: 0.38s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

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

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

  .stage::after,
  .chain.is-drawn .stage::after {
    transition: none;
    transform: none;
  }

  .button {
    transition: none;
  }
}
