/* Inter 5.3.0, latin subset, variable weight. SIL Open Font License: /fonts/Inter-OFL.txt */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/inter-5.3.0-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Colors. Light is the default; dark applies when the system asks for it
   (unless the visitor picked light) or when the visitor picked dark.
   theme-init.js sets data-theme before the first paint. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f6f7f9;
  --ink: #0f1a2a;
  --text: #475467;
  --muted: #667085;
  --line: #e7e9ee;
  --line-strong: #d3d8e0;
  --accent: #2856d6;
  --button-bg: #0f1a2a;
  --button-fg: #ffffff;
  --header-bg: rgb(255 255 255 / 0.8);
  --menu-shadow: 0 1px 2px rgb(15 26 42 / 0.06), 0 12px 32px -12px rgb(15 26 42 / 0.22);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1119;
    --surface: #111925;
    --ink: #eef2f7;
    --text: #b3bdca;
    --muted: #8793a4;
    --line: #1c2532;
    --line-strong: #2a3545;
    --accent: #8fb0ff;
    --button-bg: #eef2f7;
    --button-fg: #0b1119;
    --header-bg: rgb(11 17 25 / 0.78);
    --menu-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -12px rgb(0 0 0 / 0.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1119;
  --surface: #111925;
  --ink: #eef2f7;
  --text: #b3bdca;
  --muted: #8793a4;
  --line: #1c2532;
  --line-strong: #2a3545;
  --accent: #8fb0ff;
  --button-bg: #eef2f7;
  --button-fg: #0b1119;
  --header-bg: rgb(11 17 25 / 0.78);
  --menu-shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 40px -12px rgb(0 0 0 / 0.6);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

.container {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding-inline: 2rem;
  }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 20;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-fg);
  font-size: 0.875rem;
  font-weight: 500;
}

.skip-link:focus {
  top: 0.75rem;
}

.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--ink);
  font-size: 0.9875rem;
  font-weight: 600;
  letter-spacing: -0.012em;
}

.brand-mark {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--ink);
}

.brand-mark-letter {
  fill: var(--bg);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav {
  display: none;
  gap: 1.75rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 450;
  transition: color 0.15s ease;
}

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

@media (min-width: 560px) {
  .site-nav {
    display: flex;
  }
}

/* Theme menu. Hidden without JavaScript, because it can't work without it:
   the page then simply follows the system setting. */
.theme {
  position: relative;
  display: none;
}

.js .theme {
  display: block;
}

.theme-button {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.125rem;
  padding: 0 0.625rem 0 0.6875rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.theme-button:hover,
.theme-button[aria-expanded="true"] {
  background: var(--surface);
}

.theme-button .chevron {
  width: 0.75rem;
  height: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.theme-button[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

/* The button shows the icon for the current choice. */
.theme-button .icon-current {
  display: none;
}

:root[data-theme-pref="system"] .theme-button .icon-system,
:root[data-theme-pref="light"] .theme-button .icon-light,
:root[data-theme-pref="dark"] .theme-button .icon-dark {
  display: block;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 10rem;
  margin: 0;
  padding: 0.3125rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: var(--menu-shadow);
  transform-origin: top right;
  animation: menu-in 0.14s ease-out;
}

.theme-menu[hidden] {
  display: none;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9063rem;
  text-align: left;
  cursor: pointer;
}

.theme-option:hover,
.theme-option:focus-visible {
  background: var(--surface);
  color: var(--ink);
  outline: none;
}

.theme-option .check {
  margin-left: auto;
  visibility: hidden;
  color: var(--ink);
}

.theme-option[aria-checked="true"] {
  color: var(--ink);
}

.theme-option[aria-checked="true"] .check {
  visibility: visible;
}

/* Buttons and links */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 500;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.button-primary {
  background: var(--button-bg);
  color: var(--button-fg);
}

.button-primary:hover {
  opacity: 0.86;
}

.button-secondary {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.button-secondary:hover {
  background: var(--surface);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 0.125rem;
  transition: border-color 0.15s ease;
}

.text-link:hover {
  border-color: var(--ink);
}

.external {
  width: 0.8125rem;
  height: 0.8125rem;
}

/* Hero */
.hero {
  padding-block: clamp(5rem, 13vw, 9.5rem) clamp(4.5rem, 10vw, 7.5rem);
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(2.75rem, 1.3rem + 5.6vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.042em;
}

.lede {
  max-width: 36rem;
  margin-top: 1.75rem;
  font-size: clamp(1.125rem, 1.02rem + 0.4vw, 1.3125rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
}

/* Sections: the title sits in a left column on wide screens. */
.section {
  border-top: 1px solid var(--line);
  padding-block: clamp(4rem, 9vw, 6.5rem);
}

.split {
  display: grid;
  gap: 2rem;
}

@media (min-width: 900px) {
  .split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 4rem;
  }
}

.section h2 {
  font-size: clamp(1.625rem, 1.3rem + 1vw, 2.125rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
}

.section-intro {
  max-width: 24rem;
  margin-top: 0.875rem;
  color: var(--muted);
}

/* Principles: plain rows, not cards. */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.rows li {
  display: grid;
  gap: 0.375rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .rows li {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 2rem;
  }
}

.rows h3 {
  font-size: 1.0625rem;
  letter-spacing: -0.012em;
}

/* Product */
.product {
  margin-top: 3rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.product-copy {
  display: grid;
  gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

@media (min-width: 900px) {
  .product-copy {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 4rem;
  }
}

.product h3 {
  font-size: 1.375rem;
  letter-spacing: -0.02em;
}

.product-role {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.product-copy p:last-child {
  max-width: 40rem;
  margin-top: 1rem;
}

.product-shot {
  margin: 0;
  border-top: 1px solid var(--line);
  background: #000000;
}

.product-shot img {
  width: 100%;
}

/* On narrow screens the full-width chart gets too small to read, so show
   the net worth figure and the start of the chart instead. */
@media (max-width: 639px) {
  .product-shot img {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: left top;
  }
}

.product-caption {
  padding: 0.75rem clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8125rem;
}

.after-product {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Company facts */
.company p {
  max-width: 40rem;
}

.facts {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
}

.facts div {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: 1.5rem;
  padding-block: 0.875rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9688rem;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  color: var(--ink);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 2rem 2.5rem;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  transition: color 0.15s ease;
}

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

/* Single-message pages: 404 and the card pages the Worker builds. */
.notice {
  max-width: 34rem;
  margin: 0 auto;
  padding: clamp(5rem, 16vh, 9rem) 1.25rem 4rem;
  text-align: center;
}

.notice h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.028em;
}

.notice p {
  margin-top: 1rem;
  color: var(--muted);
}

.notice .button {
  margin-top: 2rem;
}

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

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