/* Shared design system. Page-specific styles live in landing.css and listings.css. */

:root {
  color-scheme: light;

  --paper: #faf8f4;
  --paper-2: #f0ece4;
  --ink: #171512;
  --ink-2: #4c4740;
  --ink-3: #6d675d;
  --line: #e6e1d7;
  --line-strong: #bdb7ab;
  --accent: #9c6a36;

  --on-dark: #fbf9f5;
  --on-dark-2: rgba(251, 249, 245, 0.74);
  --line-dark: rgba(251, 249, 245, 0.24);

  --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --gutter: clamp(16px, 3vw, 40px);
  --maxw: 1520px;
  --header-h: 72px;
  --radius: 3px;
  --section-y: clamp(80px, 12vw, 180px);

  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: clamp(1.125rem, 1.5vw, 1.375rem);
  --display-m: clamp(1.875rem, 3.4vw, 3.25rem);
  --section-title: clamp(2.5rem, 4.15vw, 3.95rem); /* every section heading, so they read as the same level */
  --display-l: clamp(2.5rem, 5.4vw, 5.25rem);
  --display-xl: clamp(3.25rem, 10vw, 10.5rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--header-h);
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, figure, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

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

/* Bronze is too dim to see on the dark sections. */

.site-footer :focus-visible,
.site-header.is-on-dark :focus-visible,
.btn--on-dark:focus-visible { outline-color: var(--on-dark); }

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

main { position: relative; z-index: 1; display: block; }

/* Layout */

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

.section { padding-block: var(--section-y); }

/* The thin vertical rules that run behind the page. Full-bleed media covers them. */

.rules {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.rules__inner {
  position: relative;
  height: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
}

.rules i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.rules i:nth-child(1) { left: 33.333%; }
.rules i:nth-child(2) { left: 66.666%; }

@media (max-width: 900px) {
  .rules { display: none; }
}

/* Type */

.display-xl,
.display-l,
.display-m {
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-wrap: balance;
}

.display-xl { font-size: var(--display-xl); font-weight: 300; line-height: 0.94; letter-spacing: -0.055em; }
.display-l { font-size: var(--display-l); }
.display-m { font-size: var(--display-m); line-height: 1.06; letter-spacing: -0.035em; }

/* The serif voice: a line or phrase set apart inside a large sans heading. It runs small for its
   size, so it is scaled up to sit level with the sans around it. */

.accent {
  font-family: var(--serif);
  font-size: 1.12em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.025em;
}

.lede { font-size: var(--text-lg); line-height: 1.4; color: var(--ink-2); letter-spacing: -0.012em; text-wrap: pretty; }

/* Small label with a dot. Add .eyebrow--rule for hairlines running out on both sides. */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--ink-3);
}

.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.eyebrow--rule { display: flex; justify-content: center; }

.eyebrow--rule > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 12px;
  background: var(--paper);
}

.eyebrow--rule::before { display: none; }

.eyebrow--rule > span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.eyebrow--rule {
  position: relative;
}

.eyebrow--rule::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: 1px;
  background: var(--line);
  z-index: -1;
}

/* Buttons */

/* The fill is a background image, so hover can wipe it up or down rather than fade it. */

.btn {
  --fill: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: linear-gradient(var(--fill), var(--fill)) 0 100% / 100% 100% no-repeat;
  color: var(--paper);
  font-size: 0.9375rem;
  letter-spacing: -0.005em;
  transition: background-size 0.55s var(--ease-out), color 0.25s linear, border-color 0.25s linear, transform 0.2s var(--ease-out);
}

/* The main action in a section. */

.btn--lg { min-height: 56px; padding: 0 32px; font-size: var(--text-md); }

/* Answers a press at once, before the page has had time to do anything else. */

.btn:active { transform: scale(0.97); transition-duration: 0.55s, 0.25s, 0.25s, 0.06s; }

.btn:hover { background-size: 100% 0; color: var(--ink); }

.btn--ghost { background-size: 100% 0; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background-size: 100% 100%; color: var(--paper); border-color: var(--ink); }

.btn--on-dark { --fill: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }
.btn--on-dark:hover { color: var(--on-dark); }

/* Small rounded tag, as used on listing images. */

.pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  font-size: 0.75rem;
  line-height: 1;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  color: var(--ink);
  transition: transform 0.6s var(--ease-out), color 0.3s linear, background-color 0.3s linear;
}

.site-header.is-hidden { transform: translateY(-100%); }
.site-header.is-on-dark { color: var(--on-dark); }

.site-header.is-scrolled:not(.is-on-dark) {
  background: rgba(250, 248, 244, 0.84);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: var(--maxw);
  height: var(--header-h);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header__brand { display: inline-flex; align-items: center; min-height: 44px; font-family: var(--serif); font-size: 1.5rem; line-height: 1; letter-spacing: -0.015em; white-space: nowrap; }

.site-header__nav { display: flex; align-items: center; gap: clamp(8px, 1.6vw, 20px); font-size: var(--text-sm); white-space: nowrap; }

/* The smallest phones can't fit the full company name and both links at full size. */

@media (max-width: 360px) {
  .site-header__inner { gap: 12px; }
  .site-header__brand { font-size: 1.25rem; }
  .site-header__nav { gap: 4px; font-size: var(--text-xs); }
  .site-header__nav a:last-child:nth-child(n) { padding-inline: 10px; }
}

.site-header__nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 6px;
}

.site-header__nav a::after {
  content: "";
  position: absolute;
  inset: auto 6px 9px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease-out);
}

.site-header__nav a:hover::after,
.site-header__nav a.is-here::after,
.site-header__nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* The last link is the main action, so it is boxed and sits at the far right, where it is easy to find. */

.site-header__nav a:last-child {
  padding-inline: 16px;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  transition: background-color 0.25s linear, color 0.25s linear, border-color 0.25s linear;
}

.site-header__nav a:last-child::after { display: none; }

.site-header__nav a:last-child:hover,
.site-header__nav a:last-child[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.site-header.is-on-dark .site-header__nav a:last-child:hover,
.site-header.is-on-dark .site-header__nav a:last-child[aria-current="page"] { background: var(--on-dark); border-color: var(--on-dark); color: var(--ink); }

/* Footer */

.site-footer {
  position: relative;
  z-index: 1;
  padding-block: clamp(56px, 7vw, 104px) clamp(16px, 2vw, 28px);
  background: var(--ink);
  color: var(--on-dark);
}

/* Same columns as the listing grid, so the links line up with the third column of cards. */

.site-footer__top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 32px calc(var(--gutter) * 2);
  padding-bottom: clamp(48px, 7vw, 112px);
}

.site-footer__tag { grid-column: span 2; }

.site-footer__tag {
  font-family: var(--serif);
  font-size: var(--display-m);
  font-style: italic;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.site-footer__nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: var(--text-md);
  color: var(--on-dark-2);
}

.site-footer__nav .btn { margin-bottom: 10px; }

.site-footer__nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  overflow-wrap: anywhere;
  text-decoration: underline transparent;
  text-underline-offset: 5px;
  transition: color 0.25s linear, text-decoration-color 0.25s linear;
}

.site-footer__nav a:not(.btn):hover { color: var(--on-dark); text-decoration-color: currentColor; }

/* The company name runs the full width of the page. The divisor is the name's width in ems, so a
   different name needs a different divisor. It rises out of its clipped line on scroll (motion.js). */

.site-footer > .wrap { container-type: inline-size; }

.site-footer__brand {
  overflow: hidden;
  padding-top: 0.06em;
  border-top: 1px solid var(--line-dark);
  font-family: var(--serif);
  font-size: min(calc((100vw - 2 * var(--gutter)) / 5.8), calc((var(--maxw) - 2 * var(--gutter)) / 5.8));
  font-size: calc(100cqw / 5.6);
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.site-footer__brand > span { display: block; }

@media (max-width: 600px) {
  .site-footer__top { grid-template-columns: minmax(0, 1fr); }
  .site-footer__tag { grid-column: auto; }
}

/* Accessibility */

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-sm);
  transform: translateY(-200%);
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Scroll reveals. motion.js animates these. If it never loads, the fallback animation still shows them. */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  animation: reveal-fallback 0.01s linear 3s forwards;
}

.motion-on [data-reveal] { animation: none; }

@keyframes reveal-fallback {
  to { opacity: 1; transform: none; }
}

/* Cross-fade between pages in browsers that support it. */

@view-transition { navigation: auto; }

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] { opacity: 1; transform: none; animation: none; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  @view-transition { navigation: none; }
}
