/* Design tokens and component styles. */

/* foundations */
:root {
  color-scheme: light dark;

  --text-primary: light-dark(#1d1d1f, #f5f5f7);
  --text-secondary: light-dark(#636366, #a1a1a6);
  --text-tertiary: light-dark(#1d1d1f4d, #f5f5f74d);
  --text-primary-on: light-dark(#f5f5f7, #1d1d1f);
  --text-secondary-on: light-dark(#aeaeb2, #5c5c60);
  --fill-primary: light-dark(#1d1d1f, #f5f5f7);
  --fill-primary-on: light-dark(#f5f5f7, #1d1d1f);
  --fill-secondary: light-dark(#1d1d1f80, #f5f5f780);
  --fill-tertiary: light-dark(#e8e8ea, #2a2a2d);
  --fill-segment: light-dark(#3a3a3c, #e2e2e4);
  --fill-system-green: #00a665;
  --fill-system-orange: #ff4d00;
  --fill-system-red: light-dark(#da2f35, #f1555b);
  --transparent-primary: light-dark(#1d1d1f4d, #f5f5f74d);
  --stroke-primary: light-dark(#1d1d1f24, #f5f5f724);
  --stroke-secondary: light-dark(#1d1d1f12, #f5f5f712);
  --stroke-primary-on: light-dark(#f5f5f71a, #1d1d1f1a);
  --stroke-composer: light-dark(#f5f5f780, #1d1d1f80);
  --stroke-system-orange: #ff4d0026;
  --hover-wash: light-dark(#1d1d1f0d, #f5f5f70d);
  --hover-wash-primary-on: light-dark(#f9f9fa26, #1d1d1f14);

  /* The hero is light text over a dark surface in both themes. */
  --hero-surface: #161f39;
  --hero-text: #f5f5f7;
  --hero-text-muted: #f5f5f7cc;
  --hero-scrim-strong: rgb(22 31 57 / 0.78);
  --hero-scrim-soft: rgb(22 31 57 / 0.3);
  --hero-scrim-side: rgb(22 31 57 / 0.45);
  --hero-glass: rgb(22 31 57 / 0.42);
  --hero-glass-faint: rgb(22 31 57 / 0.35);
  --hero-glass-stroke: rgb(245 245 247 / 0.28);

  --mat-regular: light-dark(rgb(255 255 255 / 0.56), rgb(29 29 31 / 0.55));
  --mat-thin: light-dark(rgb(255 255 255 / 0.22), rgb(29 29 31 / 0.4));
  --mat-agent: light-dark(rgb(255 255 255 / 0.84), rgb(29 29 31 / 0.66));
  --mat-inverse: color-mix(in srgb, var(--fill-primary) 86%, transparent);
  --ui-blur: blur(50px) saturate(1.6);
  --ui-shadow: 0 8px 40px #1d1d1f1f;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --lh: 1.3;
  --weight-light: 300;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 600;
  --size-caption: 12px;
  --size-meta: 13px;
  --size-small: 14px;
  --size-body: 15px;
  --size-prose: 16px;
  --size-heading: 20px;
  --size-figure: clamp(24px, 3vw, 32px);
  --size-title: clamp(26px, 3vw, 32px);
  --size-display: clamp(34px, 5vw, 48px);
  --size-lede: clamp(16px, 1.7vw, 20px);

  --type-caption: var(--weight-regular) var(--size-caption)/var(--lh) var(--sans);
  --type-tag: var(--weight-medium) var(--size-caption)/var(--lh) var(--sans);
  --type-small: var(--weight-regular) var(--size-small)/var(--lh) var(--sans);
  --type-label: var(--weight-medium) var(--size-small)/var(--lh) var(--sans);
  --type-body: var(--weight-regular) var(--size-body)/var(--lh) var(--sans);
  --type-body-strong: var(--weight-medium) var(--size-body)/var(--lh) var(--sans);
  --type-heading: var(--weight-medium) var(--size-heading)/var(--lh) var(--sans);
  --type-lede: var(--weight-medium) var(--size-lede)/var(--lh) var(--sans);
  --type-figure: var(--weight-regular) var(--size-figure)/var(--lh) var(--sans);
  --type-title: var(--weight-regular) var(--size-title)/var(--lh) var(--sans);
  --type-display: var(--weight-medium) var(--size-display)/var(--lh) var(--sans);
  --type-numeral: var(--weight-regular) 48px/1 var(--sans);

  --r-s: 12px;
  --r-m: 16px;
  --r-l: 24px;
  --r-xl: 32px;
  --r-pill: 100px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-quick: 160ms;
  --dur-draw: 1400ms;

  --page-max: 1120px;
  --gutter: clamp(16px, 3vw, 32px);
  --tap: 44px;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fill-primary-on);
  color: var(--text-primary);
  font: var(--type-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
figure { margin-inline: 0; }
a { color: inherit; }
b, strong { font-weight: var(--weight-bold); }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
small { font-size: max(var(--size-caption), 0.85em); }
.sub { color: var(--text-secondary); }

:focus-visible { outline: 2px solid var(--fill-primary); outline-offset: 3px; border-radius: 6px; }

/* page */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-inline: var(--gutter);
  padding-block: 12px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

.glass {
  background: var(--mat-inverse);
  -webkit-backdrop-filter: var(--ui-blur);
  backdrop-filter: var(--ui-blur);
  border: 1px solid var(--stroke-primary-on);
}
.nav {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  z-index: 20;
  justify-self: center;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border-radius: var(--r-pill);
  box-shadow: var(--ui-shadow);
}
.nav :focus-visible { outline-color: var(--fill-primary-on); }
.seg {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-radius: var(--r-pill);
  background: var(--fill-segment);
}
.seg::-webkit-scrollbar { display: none; }
.seg a {
  flex: none;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font: var(--type-label);
  color: var(--text-secondary-on);
  text-decoration: none;
  white-space: nowrap;
}
.seg a:hover { color: var(--text-primary-on); }
.seg a[aria-current="true"] { background: var(--fill-primary-on); color: var(--text-primary); }
.theme-btn {
  flex: none;
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--hover-wash-primary-on);
  color: var(--text-primary-on);
  cursor: pointer;
}
.theme-btn:hover { box-shadow: inset 0 0 0 100px var(--hover-wash-primary-on); }
.theme-btn::before { content: ""; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; background: linear-gradient(to right, light-dark(currentColor, transparent) 50%, light-dark(transparent, currentColor) 50%); }
@media (max-width: 599px) {
  .seg a { display: flex; align-items: center; min-height: var(--tap); }
  .theme-btn { width: var(--tap); height: var(--tap); }
}

/* footer */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--stroke-secondary);
  font-size: var(--size-small);
  color: var(--text-secondary);
}
.foot strong { color: var(--text-primary); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px; }
.foot nav a {
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--fill-tertiary);
  color: var(--text-primary);
  font: var(--type-tag);
  text-decoration: none;
}
.foot nav a:hover { box-shadow: inset 0 0 0 100px var(--hover-wash); }
@media (max-width: 599px) {
  .foot nav a { display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); }
}

/* chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: var(--r-pill);
  font: var(--type-tag);
  max-width: 100%;
  background: var(--fill-tertiary);
  color: var(--text-secondary);
  vertical-align: middle;
}
.chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1.5px var(--text-tertiary);
}
.chip--solid { background: var(--fill-primary); color: var(--text-primary-on); }
.chip--solid::before { background: var(--fill-system-green); box-shadow: none; }

/* button, link and links */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border-radius: var(--r-s);
  background: var(--fill-primary-on);
  color: var(--text-primary);
  border: 1px solid var(--stroke-primary);
  font: var(--type-tag);
  text-decoration: none;
  max-width: 100%;
  transition: box-shadow var(--dur-quick) ease;
}
.btn:hover { box-shadow: inset 0 0 0 100px var(--hover-wash); }
.btn[target="_blank"]::after { content: "\2197"; font-size: 11px; color: var(--text-secondary); }
.link {
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--stroke-primary);
  text-underline-offset: 3px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.link:hover { text-decoration-color: currentColor; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
@media (pointer: coarse), (max-width: 599px) { .btn { min-height: var(--tap); padding-inline: 14px; } }
@media (max-width: 599px) {
  .link { display: inline-flex; align-items: center; min-width: var(--tap); min-height: var(--tap); margin: -13px 0; vertical-align: middle; }
}

/* text and fineprint */
.prose { display: grid; gap: 12px; max-width: 68ch; font-size: var(--size-prose); }
.fineprint { font-size: var(--size-small); color: var(--text-secondary); max-width: 70ch; }

/* hero */
.hero {
  position: relative;
  min-height: clamp(460px, 64vh, 660px);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: var(--hero-text);
  isolation: isolate;
  box-shadow: var(--ui-shadow);
  background: var(--hero-surface);
}
/* Without a photo: a neutral gradient, as tall as its copy. */
.hero:not(:has(.hero__img)) {
  min-height: 0;
  background:
    radial-gradient(120% 140% at 90% 0%, rgb(84 104 160 / 0.55) 0%, transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgb(40 52 88 / 0.9) 0%, transparent 60%),
    var(--hero-surface);
}
.hero:not(:has(.hero__img))::after { background: linear-gradient(to right, var(--hero-scrim-side) 0%, transparent 60%); }
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 40% 60%;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--hero-scrim-strong) 0%, var(--hero-scrim-soft) 42%, transparent 66%),
    linear-gradient(to right, var(--hero-scrim-side) 0%, transparent 60%);
}
.hero__copy {
  display: grid;
  gap: 14px;
  max-width: 40rem;
  padding: clamp(24px, 4vw, 48px);
  padding-bottom: clamp(28px, 3.4vw, 44px);
}
.hero__eyebrow {
  justify-self: start;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--hero-glass);
  border: 1px solid var(--hero-glass-stroke);
  -webkit-backdrop-filter: var(--ui-blur);
  backdrop-filter: var(--ui-blur);
  font: var(--type-label);
}
.hero h1 { font: var(--type-display); letter-spacing: 0; }
.hero h1 em { font-style: normal; }
.hero__sub { font: var(--type-lede); max-width: 34ch; }
.hero__meta { font-size: var(--size-small); color: var(--hero-text-muted); }
@media (max-width: 760px) {
  .hero { flex-direction: column; justify-content: flex-end; align-items: stretch; min-height: 0; }
  .hero__copy { padding-top: 260px; padding-bottom: 28px; }
  .hero:not(:has(.hero__img)) .hero__copy { padding-top: clamp(24px, 4vw, 48px); }
}

/* callout */
.callout {
  max-width: 420px;
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
  border-radius: var(--r-l);
  background: var(--mat-agent);
  -webkit-backdrop-filter: var(--ui-blur);
  backdrop-filter: var(--ui-blur);
  border: 1px solid var(--stroke-composer);
  box-shadow: var(--ui-shadow);
  color: var(--text-primary);
  font-size: var(--size-small);
}
.callout__head { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-weight: var(--weight-medium); }
.callout__lead { font-size: var(--size-body); }
.callout .fineprint { font-size: var(--size-caption); }
.callout .btn { justify-self: start; }

/* section */
.section {
  padding-block: clamp(40px, 6vw, 72px) clamp(16px, 2vw, 24px);
  border-top: 1px solid var(--stroke-secondary);
  scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 72px);
  min-width: 0;
}
.section > * + * { margin-top: clamp(20px, 2.4vw, 28px); }
.section > .head + * { margin-top: 0; }
.head {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 10px 40px;
  align-items: end;
  margin-bottom: clamp(24px, 3vw, 36px);
}
.head__eyebrow { grid-column: 1 / -1; font: var(--type-label); color: var(--text-secondary); }
.head h2 { font: var(--type-title); }
.head__sub { justify-self: end; font-size: var(--size-body); color: var(--text-secondary); max-width: 44ch; text-align: right; }
@media (max-width: 900px) { .head { grid-template-columns: 1fr; } .head__sub { justify-self: start; text-align: left; } }

/* steps */
.step {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) minmax(220px, 0.78fr);
  gap: 16px 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--stroke-secondary);
}
.step > * { min-width: 0; }
.steps > .step:last-child { border-bottom: 0; }
.step p + p { margin-top: 8px; }
.step__num { font: var(--type-numeral); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.step__eyebrow { margin-top: 8px; font: var(--type-label); color: var(--text-secondary); }
.step h3 { font: var(--type-heading); margin-bottom: 12px; }
.step__pills { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.step__pills li {
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--stroke-primary);
  font-size: var(--size-meta);
  color: var(--text-secondary);
  max-width: 100%;
}
.step__pills b { color: var(--text-primary); font-weight: var(--weight-bold); }
.step__panel {
  align-self: start;
  margin: 0;
  padding: 16px 18px;
  border-radius: var(--r-m);
  background: var(--fill-tertiary);
  font-size: var(--size-small);
}
.step__panel dt { font-size: var(--size-caption); color: var(--text-secondary); margin-bottom: 2px; }
.step__panel dd { margin: 0 0 12px; }
.step__panel dd:last-child { margin-bottom: 0; }
.step__panel .fineprint { display: block; margin-top: 6px; font-size: var(--size-caption); }
.step__panel .btn { margin-top: 8px; }
@media (min-width: 901px) {
  .step:not(:has(> .step__panel)) { grid-template-columns: 112px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .step { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .step__intro { display: flex; align-items: baseline; gap: 14px; }
  .step__num { font-size: 40px; }
  .step__eyebrow { margin-top: 0; }
}

/* aside */
.aside {
  max-width: 62ch;
  padding: 20px 22px;
  border: 1.5px dashed var(--stroke-primary);
  border-radius: var(--r-m);
}
.aside h3 { font: var(--type-heading); margin-bottom: 6px; }
