:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #5a5a5a;
  --line: #000000;
  --hairline: rgba(0, 0, 0, 0.12);
  --inverse-bg: #000000;
  --inverse-fg: #ffffff;
  --max: 1180px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 0;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #ffffff;
    --muted: #a8a8a8;
    --line: #ffffff;
    --hairline: rgba(255, 255, 255, 0.16);
    --inverse-bg: #ffffff;
    --inverse-fg: #000000;
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.2s var(--ease);
}

a:hover {
  opacity: 0.6;
}

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  border: 0;
  z-index: 100;
}
.skip-link:focus {
  top: 1rem;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: saturate(140%) blur(8px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  border: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover {
  opacity: 1;
}

.brand__mark {
  display: inline-block;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

@media (prefers-color-scheme: dark) {
  .brand__mark {
    filter: invert(1);
  }
}

.brand__name {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  line-height: 1.05;
  font-weight: 600;
  text-transform: uppercase;
}

.brand__row {
  display: inline-flex;
  gap: 0.4rem;
}

.brand__row--secondary {
  color: var(--muted);
}

.nav__list {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
  font-size: 0.95rem;
}

.nav__list a {
  border-bottom-color: transparent;
}
.nav__list a:hover {
  border-bottom-color: currentColor;
  opacity: 1;
}

.nav__cta {
  border: 1px solid var(--fg);
  padding: 0.45rem 0.85rem;
}
.nav__cta:hover {
  background: var(--fg);
  color: var(--bg);
  border-bottom-color: var(--fg);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--fg);
  width: 40px;
  height: 36px;
  cursor: pointer;
  position: relative;
}

.nav__bars,
.nav__bars::before,
.nav__bars::after {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 2px;
  background: var(--fg);
  content: "";
}
.nav__bars {
  top: 50%;
  transform: translateY(-50%);
}
.nav__bars::before {
  top: -7px;
}
.nav__bars::after {
  top: 7px;
}

@media (max-width: 760px) {
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav__list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--hairline);
    padding: 0.5rem var(--gutter) 1rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
  }
  .nav__list li {
    border-top: 1px solid var(--hairline);
  }
  .nav__list a {
    display: block;
    padding: 0.9rem 0;
  }
  .nav__cta {
    border: 1px solid var(--fg);
    margin-top: 0.75rem;
    text-align: center;
  }

  .nav[data-open="true"] .nav__list {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--hairline);
}

.hero__inner {
  position: relative;
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  z-index: 1;
}

.hero__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(
    circle at 70% 30%,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 0) 70%
  );
  -webkit-mask-image: radial-gradient(
    circle at 70% 30%,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 0) 70%
  );
  pointer-events: none;
  z-index: 0;
}

.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}

.hero__title {
  font-size: clamp(2.4rem, 6.4vw, 5.25rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 1.25rem;
  max-width: 16ch;
}

.hero__lede {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 2rem;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.25rem;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--fg);
  border-bottom-width: 1px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease),
    transform 0.18s var(--ease);
  cursor: pointer;
  letter-spacing: -0.005em;
}

.btn--primary {
  background: var(--fg);
  color: var(--bg);
}
.btn--primary:hover {
  background: var(--bg);
  color: var(--fg);
  opacity: 1;
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
}
.btn--ghost:hover {
  background: var(--fg);
  color: var(--bg);
  opacity: 1;
}

.hero__stats {
  list-style: none;
  margin: 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--hairline);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 560px;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.stat__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stat__label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  border-bottom: 1px solid var(--hairline);
}

.section--alt {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
}
.section--alt .eyebrow {
  color: rgba(255, 255, 255, 0.6);
}
.section--alt .card {
  border-color: rgba(255, 255, 255, 0.18);
}
.section--alt .card:hover {
  background: var(--inverse-fg);
  color: var(--inverse-bg);
}

.section__head {
  margin-bottom: 2.5rem;
}

.section h2 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-weight: 700;
  margin: 0;
  max-width: 22ch;
}

.section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 800px) {
  .section__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 4rem;
    align-items: start;
  }
}

.section__body p {
  font-size: 1.05rem;
  color: var(--fg);
  margin: 0 0 1rem;
  max-width: 60ch;
}
.section__body p:last-child {
  margin-bottom: 0;
}

/* ---------- Cards ---------- */

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

@media (min-width: 720px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  padding: 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.cards .card:last-child,
.cards .card:nth-last-child(-n + 1) {
  border-right: 0;
}

@media (min-width: 720px) {
  .cards .card:nth-child(2n) {
    border-right: 0;
  }
  .cards .card:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 719.98px) {
  .card {
    border-right: 0;
  }
  .cards .card:last-child {
    border-bottom: 0;
  }
}

.card__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.55);
  margin: 0 0 1.25rem;
  text-transform: uppercase;
}

.card__title {
  font-size: 1.3rem;
  letter-spacing: -0.015em;
  margin: 0 0 0.6rem;
  font-weight: 600;
}

.card__body {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 42ch;
}

/* ---------- Principles ---------- */

.principles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--hairline);
}

@media (min-width: 720px) {
  .principles {
    grid-template-columns: 1fr 1fr;
  }
}

.principles li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.25rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--hairline);
}

@media (min-width: 720px) {
  .principles li {
    padding: 1.75rem 1.5rem 1.75rem 0;
  }
  .principles li:nth-child(odd) {
    border-right: 1px solid var(--hairline);
    padding-right: 2rem;
  }
  .principles li:nth-child(even) {
    padding-left: 2rem;
  }
}

.principles__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--muted);
  font-size: 0.95rem;
  padding-top: 0.15rem;
}

.principles p {
  margin: 0;
  max-width: 50ch;
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 1.5rem 0 2.5rem;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer a {
  border-bottom-color: transparent;
}
.site-footer a:hover {
  border-bottom-color: currentColor;
  opacity: 1;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}
