@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Pixel";
  src: url("fonts/GeistPixel-Square.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0D0D0F;
  --panel: #141417;
  --paper: #F2EEE6;
  --muted: #8C8679;
  --accent: #FF4F1F;
  --accent-hover: #FF6A40;
  --hairline: rgba(242, 238, 230, 0.12);
  --hairline-strong: rgba(242, 238, 230, 0.26);

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --pixel: "Geist Pixel", "Geist Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 48px);
  --section-space: clamp(72px, 10vw, 136px);
  --radius: 4px;

  /* A dashed rule like the tear lines on a receipt. */
  --dash: repeating-linear-gradient(90deg, var(--hairline-strong) 0 4px, transparent 4px 9px);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

p,
li,
figcaption {
  text-wrap: pretty;
}

h1,
h2 {
  text-wrap: balance;
}

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

p,
ul,
ol,
figure,
blockquote,
pre,
h1,
h2,
h3 {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--hairline-strong);
  text-underline-offset: 0.22em;
  transition: text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: currentColor;
}

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

code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: rgba(242, 238, 230, 0.07);
  overflow-wrap: anywhere;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

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

.js .nojs-only,
.no-js [data-copy],
.no-js .tablist {
  display: none !important;
}

/* Header */

.beta {
  padding: 9px var(--gutter);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--muted);
  text-align: center;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark .colon {
  flex: none;
  width: auto;
  height: 1.2em;
}

.logo-dot {
  fill: var(--accent);
}

.wordmark .tick {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: clamp(16px, 3vw, 32px);
  font-size: 0.9375rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 120ms ease;
}

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

/* Hero */

.hero {
  padding-block: clamp(40px, 7vw, 88px) 0;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  margin-bottom: clamp(20px, 3vw, 32px);
}

.headline {
  font-weight: 600;
  font-size: clamp(2.375rem, 6.2vw, 5rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.row {
  display: flex;
  align-items: baseline;
}

.row + .row {
  margin-top: 0.08em;
}

.row-took {
  color: var(--accent);
}

/* Dotted leader between a label and its value, like a printed total. */
.leader {
  flex: 1 1 0;
  min-width: 1.25rem;
  height: 0.09em;
  margin-inline: 0.28em;
  background-image: repeating-linear-gradient(90deg, currentColor 0 0.09em, transparent 0.09em 0.3em);
  opacity: 0.4;
}

.value {
  font-family: var(--pixel);
  font-weight: 400;
  font-size: 1.08em;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(32px, 4vw, 48px);
  background: var(--dash) top left / 100% 1px no-repeat;
}

.lede {
  font-size: clamp(1.1875rem, 1.8vw, 1.4375rem);
  line-height: 1.5;
  letter-spacing: -0.01em;
  max-width: 34ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease;
}

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

.button:active {
  transform: translateY(1px);
}

.quiet-link {
  font-size: 1rem;
  color: var(--paper);
}

.hint {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.hero-receipt img {
  width: 100%;
}

.hero-receipt figcaption,
.chart figcaption,
.fine {
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--muted);
}

/* The receipt image has a 5% ink margin around the paper. Line the caption up with the paper. */
.hero-receipt figcaption {
  margin-top: 6px;
  padding-inline: 5%;
}

/* Copied state */

.is-copied .label {
  animation: settle 180ms ease-out;
}

@keyframes settle {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sections */

.section {
  padding-top: var(--section-space);
}

.section > .wrap {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
}

.section > .wrap::before {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  margin-bottom: clamp(32px, 4vw, 56px);
  background: var(--dash);
}

.section-head {
  grid-column: 1 / 5;
}

.section-body {
  grid-column: 5 / -1;
  min-width: 0;
}

h2 {
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  max-width: 11ch;
  padding-right: 16px;
}

h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.section-body > p,
.section-body > .lead {
  max-width: 62ch;
}

.section-body > * + * {
  margin-top: 24px;
}

.section-body > .fine {
  margin-top: 16px;
}

.lead {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
}

/* Tabs and code panels */

.tabs {
  margin-top: 32px;
}

.tablist {
  display: flex;
  gap: 4px;
  margin-bottom: -1px;
}

.tab {
  position: relative;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.875rem;
  cursor: pointer;
}

.tab:hover {
  color: var(--paper);
}

.tab[aria-selected="true"] {
  border-color: var(--hairline);
  background: var(--panel);
  color: var(--accent);
}

.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 6px;
  height: 2px;
  background: var(--accent);
}

.panel {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--panel);
}

.js .tabs .panel {
  border-top-left-radius: 0;
}

.no-js .panel + .panel {
  margin-top: 16px;
}

.panel[hidden] {
  display: none;
}

.panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  padding: 6px 8px 6px 16px;
  background: var(--dash) bottom left / 100% 1px no-repeat;
}

.panel-bar p {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.copy {
  flex: none;
  min-width: 76px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}

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

.copy.is-copied {
  border-color: var(--accent);
  color: var(--accent);
}

.code {
  margin: 0;
  padding: 18px 16px 20px;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}

.code code {
  padding: 0;
  font-size: inherit;
  background: none;
}

.code-long {
  max-height: 440px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--hairline-strong) transparent;
  scrollbar-width: thin;
}

/* Totals */

.totals {
  margin-top: 40px;
}

.total {
  display: flex;
  align-items: baseline;
  padding-block: 18px 16px;
  background: var(--dash) bottom left / 100% 1px no-repeat;
}

.total:first-child {
  background:
    var(--dash) top left / 100% 1px no-repeat,
    var(--dash) bottom left / 100% 1px no-repeat;
}

.total-label {
  flex: 0 1 auto;
  max-width: 24ch;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--paper);
}

.total .leader {
  height: 2px;
  min-width: 24px;
  margin-inline: 12px;
  background-image: repeating-linear-gradient(90deg, var(--muted) 0 2px, transparent 2px 7px);
  opacity: 0.7;
}

.total-value {
  flex: none;
  font-family: var(--pixel);
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.total-value .unit {
  font-size: 0.5em;
  color: var(--muted);
}

/* Chart and table */

.chart {
  margin-top: 56px;
}

.chart figcaption {
  margin-top: 14px;
}

.small-only {
  display: none;
}

.table-wrap {
  margin-top: 40px;
  overflow-x: auto;
}

.said-took {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.said-took th {
  padding: 0 12px 12px 0;
  font-weight: 400;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  background: var(--dash) bottom left / 100% 1px no-repeat;
}

.said-took td {
  padding: 13px 12px 13px 0;
  background: var(--dash) bottom left / 100% 1px no-repeat;
}

.said-took .num {
  padding-right: 0;
  text-align: right;
}

/* Lists: rules between items, and above the list when text comes before it. */

.points li,
.steps li {
  padding-block: 16px;
}

.points li + li,
.steps li + li,
.section-body > * + .points {
  background: var(--dash) top left / 100% 1px no-repeat;
}

.points li:first-child,
.steps li:first-child {
  padding-top: 0;
}

.section-body > * + .points li:first-child {
  padding-top: 16px;
}

.points li:last-child,
.steps li:last-child {
  padding-bottom: 0;
}

.points strong {
  font-weight: 600;
}

.steps {
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 8px;
}

.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--muted);
}

.steps h3,
.steps p {
  grid-column: 2;
  max-width: 62ch;
}

.steps p {
  margin-top: 4px;
  color: var(--paper);
}

.panel-static {
  margin-top: 32px;
}

/* Why I built this */

.message {
  padding: 20px 22px;
  border-left: 2px solid var(--accent);
  background: var(--panel);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.message p {
  font-family: var(--mono);
  font-size: clamp(1rem, 1.6vw, 1.1875rem);
  line-height: 1.5;
}

.posts {
  font-size: 0.9375rem;
  color: var(--muted);
}

.posts li {
  padding-block: 12px;
  background: var(--dash) bottom left / 100% 1px no-repeat;
}

.posts li:first-child {
  background:
    var(--dash) top left / 100% 1px no-repeat,
    var(--dash) bottom left / 100% 1px no-repeat;
}

.posts a {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--paper);
}

/* Footer */

.site-footer {
  margin-top: var(--section-space);
  padding-block: 32px 48px;
}

.site-footer .wrap {
  padding-top: 32px;
  background: var(--dash) top left / calc(100% - 2 * var(--gutter)) 1px no-repeat;
  background-position: var(--gutter) 0;
}

.footer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer-list a {
  color: var(--paper);
}

/* Narrower screens */

@media (max-width: 960px) {
  .section-head,
  .section-body {
    grid-column: 1 / -1;
  }

  .section-head {
    margin-bottom: 28px;
  }

  h2 {
    max-width: none;
  }

  .hero-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  }
}

@media (max-width: 720px) {
  .hero-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-receipt {
    max-width: 440px;
  }

  .headline .row {
    flex-wrap: wrap;
  }

  .headline .phrase {
    flex-basis: 100%;
  }

  .row + .row {
    margin-top: 0.3em;
  }

  .total {
    flex-wrap: wrap;
    row-gap: 6px;
  }

  .total-label {
    flex-basis: 100%;
    max-width: none;
  }

  .total .leader {
    margin-left: 0;
  }

  .small-only {
    display: inline;
  }

  .steps li {
    grid-template-columns: 28px minmax(0, 1fr);
  }
}

@media (max-width: 420px) {
  .eyebrow {
    font-size: 0.75rem;
  }

  .nav {
    gap: 14px;
    font-size: 0.875rem;
  }

  .wordmark {
    font-size: 0.8125rem;
    gap: 0.75em;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
