:root {
  --paper: #ffffff;
  --surface: #ffffff;
  --ink: #1d1a17;
  --muted: #6b645c;
  --faint: #9a9189;
  --line: #e4ddd3;
  --accent: #5c5c5c;
  --night: #171412;
  --night-ink: #f2f2f2;
  --footer: #2e2e2e;
  --night-muted: #b8b8b8;
  --gutter: clamp(16px, 5vw, 72px);
  --max: 1200px;
  --sans: "Lato", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12100e;
    --surface: #1b1815;
    --ink: #efe9e1;
    --muted: #a59c90;
    --faint: #7d756c;
    --line: #2e2924;
    --accent: #a6a6a6;
    --night: #0c0b0a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 300 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-weight: 300; line-height: 1.15; margin: 0; }
strong, b { font-weight: 700; }
p { margin: 0; }
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header {
  position: absolute; inset: 0 0 auto; z-index: 2;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  max-width: calc(var(--max) + 2 * var(--gutter)); margin: 0 auto; padding: 24px var(--gutter);
  color: #fff;
}
.logo { font: 900 24px/1 var(--sans); text-decoration: none; white-space: nowrap; }
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 3vw, 32px); font-size: 15px; font-weight: 400; }
.site-header nav a { text-decoration: none; opacity: .85; }
.site-header nav a:hover, .site-header nav a[aria-current] { opacity: 1; }
.site-header .nav-cta { opacity: 1; padding: 8px 16px; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; }
.site-header .nav-cta:hover { background: #fff; color: #1d1a17; }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--night); color: #fff; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,10,9,.5) 0%, rgba(12,10,9,.4) 45%, rgba(12,10,9,.82) 100%); }
.hero-inner { position: relative; z-index: 1; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.site-header { text-shadow: 0 1px 10px rgba(0,0,0,.3); }
.hero-home .hero-img { object-position: 50% 0%; }
.hero-about-img { object-position: 60% 70%; }
.site-footer .copy a { color: inherit; }
.hero-home .hero-inner { padding-top: clamp(96px, 11vw, 150px); padding-bottom: clamp(150px, 19vw, 260px); }
.hero-home h1 { font-size: clamp(30px, 3.6vw, 48px); }
.hero-pattern .hero-inner { padding-top: clamp(130px, 16vw, 200px); padding-bottom: clamp(40px, 6vw, 72px); }
.hero-pattern h1 { font-size: clamp(36px, 5.4vw, 68px); max-width: 18ch; }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #c9c9c9; margin-bottom: 18px; }
.eyebrow-light { color: #fff; }
.eyebrow a { text-decoration: none; color: inherit; }
.eyebrow a:hover { text-decoration: underline; }
.hero-sub { margin-top: 24px; font-size: clamp(17px, 1.6vw, 19px); color: rgba(255,255,255,.82); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 36px; }
.btn { display: inline-block; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; transition: background .15s, color .15s; }
.btn-ghost { border: 1px solid rgba(255,255,255,.45); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* Sections */
section h2 { font-size: clamp(30px, 3.6vw, 44px); }
.section-lead { margin-top: 18px; color: var(--muted); font-size: 18px; }
.how { padding: clamp(72px, 10vw, 128px) 0 clamp(40px, 6vw, 72px); }
.how-steps { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: how; }
.how-steps li { counter-increment: how; padding-top: 20px; border-top: 1px solid var(--line); }
.how-steps span { display: block; font: 900 21px/1.2 var(--sans); }
.how-steps span::before { content: "0" counter(how); display: block; margin-bottom: 10px; font: 700 13px/1 var(--sans); letter-spacing: .1em; color: var(--accent); }
.how-steps p { margin-top: 8px; color: var(--muted); }

.patterns { padding: clamp(40px, 6vw, 72px) 0 4px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 20px; }
.filters[hidden] { display: none; }
.filter { all: unset; cursor: pointer; padding: 4px 0; border-bottom: 1px solid transparent; font: 700 11px/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); transition: color .2s, border-color .2s; }
.filter:hover { color: var(--ink); }
.filter:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.filter[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.grid > li { transition: opacity .35s, transform .35s; }
.grid > li[hidden] { display: none; }
.grid > li.entering { opacity: 0; transform: scale(.97); }
.grid { list-style: none; margin: 32px 0 0; padding: 0 4px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.card { position: relative; display: block; aspect-ratio: 1; overflow: hidden; background: var(--night); color: #fff; text-decoration: none; }
.card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.12) 35%, rgba(0,0,0,.82) 100%); }
.card:hover img, .card:focus-visible img { transform: scale(1.04); }
.card-num, .card-body { position: absolute; z-index: 1; left: clamp(20px, 2.4vw, 36px); right: clamp(20px, 2.4vw, 36px); }
.card-num { top: clamp(18px, 2.2vw, 32px); font-size: 13px; font-weight: 700; letter-spacing: .1em; }
.card-body { bottom: clamp(20px, 2.4vw, 36px); }
.card-title { display: block; font: 300 clamp(26px, 2.6vw, 44px)/1.15 var(--sans); max-width: 12ch; }
.card-meta { display: block; margin-top: 8px; font-size: 14px; color: rgba(255,255,255,.75); }

/* Contribute */

/* Footer */
.site-footer { background: var(--footer); color: var(--night-muted); border-top: 1px solid rgba(255,255,255,.08); padding: 48px 0; font-size: 15px; }
.site-footer .wrap { display: grid; gap: 32px; }
.site-footer .logo { color: var(--night-ink); }
.logo-badge { display: block; width: auto; height: clamp(88px, 9vw, 120px); }
.hero-title { display: flex; flex-direction: column; align-items: center; gap: clamp(20px, 2.5vw, 32px); text-align: center; }
.hero-home .hero-sub { max-width: 640px; margin-left: auto; margin-right: auto; text-align: center; }
.hero-home .actions { justify-content: center; }
.hero-badge { flex: none; width: auto; height: clamp(180px, 22vw, 280px); }
.site-footer p { margin-top: 12px; max-width: 380px; }
.site-footer .copy { grid-column: 1 / -1; margin: 0; max-width: none; font-size: 13px; }
.footer-brand { display: flex; align-items: center; gap: clamp(20px, 3vw, 32px); }
.footer-brand .logo { flex: none; }
.footer-badge { display: block; width: auto; height: clamp(76px, 7vw, 96px); }
.site-footer .footer-brand p { margin: 0; max-width: 440px; }

/* Pattern page */
.article { display: grid; grid-template-columns: minmax(0, 720px) 260px; justify-content: space-between; gap: 64px; padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); }
.article section + section { margin-top: 56px; }
.article h2 { font: 900 21px/1.2 var(--sans); margin-bottom: 16px; }
.lead { font: 300 clamp(20px, 2vw, 23px)/1.55 var(--sans); }
.lead a, .article p a, .about a { color: var(--accent); text-underline-offset: 3px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 28px 0 28px 64px; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 22px; font: 300 40px/1 var(--sans); color: var(--accent); }
.steps h3 { font-size: 19px; font-weight: 700; line-height: 1.3; }
.steps p { margin-top: 8px; color: var(--muted); }
.credits { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.credits a { color: inherit; }
.reading { margin-top: 20px !important; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 16px; }
aside { position: sticky; top: 32px; align-self: start; }
.author { padding: 4px 0 0 24px; border-left: 1px solid var(--line); }
.label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.author img { width: 72px; height: 72px; border-radius: 50%; margin: 16px 0 12px; object-fit: cover; }
.author-name { font: 400 22px/1.2 var(--sans); }
.author-role { color: var(--muted); font-size: 15px; }
.jump { list-style: none; margin: 0; padding: 20px 0 4px 24px; border-left: 1px solid var(--line); font-size: 15px; color: var(--muted); display: grid; gap: 6px; }
.jump a { color: var(--accent); text-underline-offset: 3px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); padding-bottom: clamp(64px, 8vw, 104px); }
.pager a { display: flex; align-items: center; gap: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; transition: border-color .15s; }
.pager a:hover { border-color: var(--accent); }
.pager img { width: 80px; height: 80px; border-radius: 4px; object-fit: cover; flex: none; }
.pager span { font: 300 21px/1.25 var(--sans); }
.pager small { display: block; margin-bottom: 4px; font: 700 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.pager-next { flex-direction: row-reverse; text-align: right; }

/* About */
.about { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(64px, 8vw, 104px); }
.about > * { max-width: 760px; }
.about .lead + .lead { margin-top: 1em; }
.person { display: grid; grid-template-columns: 140px 1fr; gap: 32px; margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.person img { width: 140px; height: 140px; border-radius: 50%; object-fit: cover; }
.person h2 { font-size: 28px; }
.person p { margin-top: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .article { grid-template-columns: 1fr; gap: 48px; }
  aside { position: static; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .how-steps { grid-template-columns: 1fr; gap: 8px; }
  .hero-home .hero-img { object-position: 82% 50%; }
  .hero-about-img { object-position: 0% 70%; }
  .hero-home .hero-inner { padding-bottom: 240px; }
  .hero-title { gap: 20px; }
  .hero-badge { height: 180px; }
  .grid { grid-template-columns: 1fr; }
  .card { aspect-ratio: 4 / 3; }
  .pager { grid-template-columns: 1fr; }
  .pager img { width: 56px; height: 56px; }
  .pager span { font-size: 17px; }
  .steps li { padding-left: 48px; }
  .steps li::before { font-size: 32px; }
  .steps h3 { font-size: 18px; }
  .person { grid-template-columns: 1fr; gap: 20px; }
  .person img { width: 112px; height: 112px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .site-header .nav-cta { display: none; }
  .site-header .logo { font-size: 18px; }
  .site-header nav { gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card img { transition: none; }
}
