@font-face {
  font-family: Jost;
  src: url("../fonts/jost.woff2") format("woff2");
  font-weight: 300 500;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* ---------- tokens ---------- */

:root {
  color-scheme: dark light;
  --bg: #0d0d0f;
  --surface: #16161a;
  --border: #2a2a31;
  --rail: #34343c;
  --screen: #0b0b0d;
  --text: #f3f3f4;
  --muted: #8b8b95;
  --accent: #ff7f5a;
  --accent-hover: #ff9677;
  --accent-ink: #ff7f5a;
  --on-accent: #0d0d0f;
  --glow-warm: #3a2a2c;
  --glow-cool: #1c262f;
  --shadow: rgb(0 0 0 / 60%);

  --font-sans: Jost, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --step-label: .8125rem;
  --step-small: .9375rem;
  --step-0: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
  --step-1: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.25rem);
  --step-email: clamp(1.5rem, 1rem + 2.5vw, 2.5rem);
  --step-display: clamp(1.875rem, 1.1rem + 4.2vw, 4rem);
  --lh-display: 1.04;
  --lh-heading: 1.15;
  --lh-body: 1.6;
  --tracking-display: -.02em;
  /* Jost averages .42em per character of prose (its 0-wide `ch` is .6em): 29.5em is about 70 characters. */
  --measure: 29.5em;

  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --gutter: clamp(1.25rem, .75rem + 2.5vw, 2.5rem);
  --container: 68rem;
  --radius-control: 12px;
  --radius-focus: 6px;
  --target: 44px;

  /* The rail continues the stem of the K in the 2rem header lockup; text lines up with the wordmark. */
  --logo-height: 2rem;
  --rail-x: .375rem;
  --indent: 2.8rem;
  --commit: .5625rem;
  --label-lh: 1.25rem;

  --dur-fast: 120ms;
  --dur-slow: 640ms;
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #ebebeb;
    --surface: #fff;
    --border: #dcdcdc;
    --rail: #c9c9cf;
    --screen: #fff;
    --text: #0d0d0f;
    --muted: #5f5f66;
    --accent-ink: #a84124;
    --glow-warm: #f3e1da;
    --glow-cool: #dfe5ea;
    --shadow: rgb(13 13 15 / 22%);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0s;
    --dur-slow: 0s;
  }
}

/* ---------- base ---------- */

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

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-size: var(--step-0);
  line-height: var(--lh-body);
  background:
    radial-gradient(min(72vw, 52rem) min(48vw, 34rem) at 0 0, var(--glow-warm), transparent 70%),
    radial-gradient(min(72vw, 52rem) min(48vw, 34rem) at 100% 0, var(--glow-cool), transparent 70%),
    var(--bg);
  background-repeat: no-repeat;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  transform: translateY(calc(-100% - var(--space-4)));
}

.skip-link:focus-visible {
  transform: none;
}

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- header and footer ---------- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-3);
}

.logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: var(--target);
}

.logo img {
  display: block;
  width: auto;
  max-width: 100%;
  height: var(--logo-height);
  object-fit: contain;
  object-position: left center;
}

.nav ul {
  display: flex;
  gap: var(--space-1);
  margin: 0 calc(-1 * var(--space-3)) 0 0;
  padding: 0;
  list-style: none;
}

.nav a,
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--muted);
  transition: color var(--dur-fast);
}

.nav a {
  padding-inline: var(--space-3);
  font-size: var(--step-small);
  text-decoration: none;
}

.nav a:hover,
.site-footer a:hover {
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .875rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: var(--space-5);
  padding-block: var(--space-3);
}

.site-footer a {
  text-underline-offset: 3px;
}

.site-footer a[aria-current="page"] {
  color: var(--text);
}

/* ---------- section labels and the rail ---------- */

.section {
  position: relative;
  padding-top: var(--pad-top);
  padding-bottom: var(--pad-bottom);
}

.label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--step-label);
  font-weight: 400;
  line-height: var(--label-lh);
}

.commit {
  flex: none;
  width: var(--commit);
  height: var(--commit);
  border: 1.5px solid currentColor;
  border-radius: 2.5px;
}

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

.hero {
  --pad-top: clamp(2rem, 1rem + 4vw, 5rem);
  --pad-bottom: clamp(3rem, 2rem + 4vw, 6rem);
}

.hero-text {
  container-type: inline-size;
}

.display {
  font-size: var(--step-display);
  font-weight: 500;
  line-height: var(--lh-display);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

.display .line-2 {
  display: block;
  color: var(--muted);
  font-weight: 300;
}

/* The first line is 9.03em wide in Jost 500: the cap keeps it on one line without nowrap,
   which would push it under the illustration once a reader widens letter spacing.
   The 1.875rem floor lets the headline grow and wrap when the reader enlarges text. */
@supports (width: 1cqi) {
  .display {
    font-size: min(var(--step-display), max(100cqi / 9.3, 1.875rem));
  }
}

.lead {
  max-width: 34ch;
  margin-top: var(--space-5);
  color: var(--muted);
  font-size: var(--step-1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target);
  margin-top: var(--space-6);
  padding-inline: var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  text-decoration: none;
  transition: background-color var(--dur-fast);
}

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

.button svg {
  transition: transform var(--dur-fast);
}

.button:hover svg {
  transform: translateX(2px);
}

.phone {
  display: none;
}

/* ---------- about ---------- */

.about {
  --pad-top: clamp(2rem, 1.5rem + 3vw, 4rem);
  --pad-bottom: clamp(2.5rem, 2rem + 2vw, 3.5rem);
}

.statement {
  max-width: 16ch;
  font-size: var(--step-2);
  font-weight: 500;
  line-height: var(--lh-heading);
  text-wrap: balance;
}

.body {
  max-width: 44ch;
  margin-top: var(--space-4);
  color: var(--muted);
}

.facts {
  max-width: 44ch;
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

/* Inline, so that a long row wraps like text; the separator trails its item and wraps with it. */
.facts dt,
.facts dd {
  display: inline;
}

.facts dt {
  margin-inline-end: var(--space-3);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--step-label);
}

.facts dd:not(:last-of-type)::after {
  content: "\a0·";
  content: "\a0·" / "";
}

/* ---------- contact ---------- */

.contact {
  --pad-top: clamp(3rem, 2rem + 4vw, 5.5rem);
  --pad-bottom: clamp(3.5rem, 2rem + 6vw, 8rem);
}

.email {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}

.email a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--accent-ink);
  font-size: var(--step-email);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: -.01em;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .2em;
  overflow-wrap: anywhere;
}

.copy {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding-inline: var(--space-4);
  border: 1px solid var(--muted);
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text);
  font: 500 var(--step-small) / 1 var(--font-sans);
  cursor: pointer;
  transition: border-color var(--dur-fast);
}

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

.copy[hidden] {
  display: none;
}

.copy [data-when] {
  display: none;
}

.copy:not([data-state]) [data-when="idle"],
.copy[data-state="copied"] [data-when="copied"],
.copy[data-state="failed"] [data-when="failed"] {
  display: contents;
}

.contact .body {
  font-size: var(--step-small);
}

/* Screen readers hear every result; a failure is also shown, since it asks the reader to act. */
.copy-status[data-state="failed"] {
  position: static;
  width: auto;
  height: auto;
  margin: var(--space-3) 0 0;
  overflow: visible;
  clip-path: none;
  white-space: normal;
  color: var(--text);
  font-size: var(--step-small);
}

/* ---------- text pages: privacy and 404 ---------- */

.page {
  --pad-top: clamp(2rem, 1rem + 4vw, 4.5rem);
  --pad-bottom: clamp(3.5rem, 2rem + 6vw, 7rem);
}

.page h1 {
  font-size: var(--step-2);
  font-weight: 500;
  line-height: var(--lh-heading);
  letter-spacing: -.01em;
}

.page .meta {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--step-small);
}

.prose {
  font-size: min(var(--step-0), 1.125rem);
  overflow-wrap: anywhere;
}

.prose > * {
  max-width: var(--measure);
}

.prose h2 {
  margin-top: var(--space-7);
  font-size: var(--step-1);
  font-weight: 500;
  line-height: var(--lh-heading);
}

.prose h3 {
  margin-top: var(--space-5);
  font-size: var(--step-0);
  font-weight: 500;
}

.prose p,
.prose ul {
  margin-top: var(--space-3);
}

.prose ul {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: var(--space-1);
}

.prose a {
  color: var(--accent-ink);
  text-underline-offset: 3px;
}

.prose code {
  font-family: var(--font-mono);
  font-size: .875em;
}

.prose strong {
  font-weight: 500;
}

/* ---------- wider screens: rail and illustration ---------- */

@media (min-width: 40em) {
  .section {
    padding-left: calc(var(--gutter) + var(--indent));
  }

  .label {
    position: relative;
  }

  .label .commit {
    position: absolute;
    left: calc(var(--rail-x) - var(--indent) - var(--commit) / 2);
  }

  /* Rail segments run between the commits, so the hollow commits never sit on a line. */
  .rail > .section + .section::before,
  .rail > .section:not(:last-child)::after {
    content: "";
    position: absolute;
    left: calc(var(--gutter) + var(--rail-x) - .5px);
    width: 1px;
    background: var(--rail);
  }

  .rail > .section + .section::before {
    top: 0;
    height: calc(var(--pad-top) + var(--label-lh) / 2 - var(--commit) / 2);
  }

  .rail > .section:not(:last-child)::after {
    top: calc(var(--pad-top) + var(--label-lh) / 2 + var(--commit) / 2);
    bottom: 0;
  }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(9.375rem, 6rem + 9vw, 15rem);
    column-gap: clamp(1.5rem, 4vw, 4rem);
  }

  .phone {
    display: block;
    position: relative;
  }

  .phone svg {
    position: absolute;
    top: calc(-1 * var(--space-2));
    left: 0;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 28px 36px var(--shadow));
  }
}

@media (max-width: 39.99em) {
  .nav .wide-only {
    display: none;
  }

  .button {
    display: flex;
  }
}

/* ---------- illustration ---------- */

.phone .frame {
  fill: var(--surface);
  stroke: var(--border);
}

.phone .screen,
.phone .commit-open {
  fill: var(--screen);
}

.phone .island {
  fill: #000;
}

.phone .ink {
  fill: var(--text);
}

.phone .ink-line,
.phone .commit-open {
  stroke: var(--text);
}

.phone .faint {
  fill: var(--muted);
}

.phone .accent {
  fill: var(--accent);
}

.phone .branch {
  fill: none;
  stroke: var(--accent);
}

.phone text {
  font-family: var(--font-sans);
  font-weight: 500;
}

.phone .mono {
  font-family: var(--font-mono);
  font-weight: 400;
}

@media (prefers-reduced-motion: no-preference) {
  .phone .branch {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw var(--dur-slow) var(--ease-in-out) 300ms forwards;
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- forced colours and print ---------- */

@media (forced-colors: active) {
  body {
    background: Canvas;
  }

  .commit {
    border-color: CanvasText;
  }

  .rail > .section + .section::before,
  .rail > .section:not(:last-child)::after {
    background: CanvasText;
  }

  .phone {
    display: none;
  }
}

@media print {
  :root {
    --bg: #fff;
    --text: #000;
    --muted: #333;
    --accent-ink: #000;
    --border: #999;
  }

  body {
    background: none;
  }

  .skip-link,
  .nav,
  .phone,
  .copy {
    display: none;
  }
}
