:root {
  color-scheme: light;
  --paper: #e8e3d8;
  --paper-light: #f6f2e9;
  --paper-deep: #d6cfc0;
  --ink: #171713;
  --ink-soft: #5b584f;
  --line: rgba(23, 23, 19, .23);
  --accent: #df5339;
  --acid: #dbe74a;
  --blue: #465fba;
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, Helvetica Neue, Helvetica, Arial, sans-serif;
  --mono: SFMono-Regular, Consolas, Liberation Mono, monospace;
  --gutter: clamp(20px, 4vw, 64px);
  --max: 1680px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: .18em; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.skip-link {
  position: fixed;
  z-index: 20;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  background: var(--ink);
  color: white;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: 24px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.pixelgrade-mark { font-weight: 750; text-decoration: none; letter-spacing: -.04em; }
.site-header nav { display: flex; gap: clamp(18px, 3vw, 44px); font-size: 14px; }

.hero {
  position: relative;
  width: min(100%, var(--max));
  min-height: 760px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 140px) var(--gutter) 40px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "";
  position: absolute;
  right: var(--gutter);
  bottom: 124px;
  width: clamp(90px, 10vw, 164px);
  aspect-ratio: 1;
  border: 1px solid var(--ink);
  border-radius: 50%;
  box-shadow: inset 0 0 0 18px var(--paper), inset 0 0 0 19px var(--ink);
}
.hero-index, .eyebrow, .filters label > span, .dimension h4, .study-details h4 {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.hero-index { position: absolute; top: clamp(58px, 9vw, 142px); right: var(--gutter); }
.eyebrow { margin: 0 0 28px; }
.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-family: var(--serif);
  font-size: clamp(88px, 16vw, 244px);
  font-weight: 400;
  line-height: .69;
  letter-spacing: -.085em;
}
.hero h1 span { display: block; }
.hero h1 span:last-child { margin-left: .36em; font-style: italic; }
.hero-intro {
  display: grid;
  grid-template-columns: minmax(280px, 620px) minmax(220px, 380px);
  gap: clamp(32px, 7vw, 110px);
  margin: clamp(70px, 10vw, 150px) 18% 76px 26%;
}
.hero-intro p { margin: 0; font-size: clamp(20px, 2vw, 31px); line-height: 1.2; letter-spacing: -.035em; }
.hero-intro .hero-note { color: var(--ink-soft); font-family: var(--serif); font-size: clamp(17px, 1.4vw, 23px); font-style: italic; letter-spacing: 0; }
.hero-ledger { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--ink); }
.hero-ledger div { padding: 14px 18px 0 0; }
.hero-ledger dt { font-family: var(--serif); font-size: clamp(32px, 4vw, 62px); letter-spacing: -.04em; }
.hero-ledger dd { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.browser { width: min(100%, var(--max)); margin: 0 auto; }
.browser-heading {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: end;
  gap: var(--gutter);
  padding: clamp(72px, 10vw, 144px) var(--gutter) clamp(44px, 6vw, 84px);
}
.browser-heading .eyebrow { align-self: start; }
.browser-heading h2, .method h2 {
  margin: 0;
  max-width: 14ch;
  font-family: var(--serif);
  font-size: clamp(48px, 6.5vw, 104px);
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.055em;
}
.filters {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr) auto;
  gap: 1px;
  padding: 1px 0;
  background: var(--ink);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.filters label { display: grid; gap: 9px; padding: 14px var(--gutter) 15px 16px; background: var(--paper-light); }
.filters input, .filters select { width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 16px; }
.filters input::placeholder { color: #6f6a61; }
.reset-button { padding: 16px 26px; border: 0; background: var(--acid); color: var(--ink); cursor: pointer; font-weight: 700; }
.reset-button:hover { background: white; }
.result-bar { display: flex; justify-content: space-between; gap: 24px; padding: 17px var(--gutter); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.result-bar p { margin: 0; }

.study-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.study-card { min-width: 0; border-bottom: 1px solid var(--ink); }
.study-card:nth-child(odd) { border-right: 1px solid var(--ink); }
.card-poster {
  position: relative;
  display: grid;
  min-height: clamp(260px, 32vw, 500px);
  padding: clamp(22px, 3vw, 46px);
  overflow: hidden;
  background: var(--accent);
  border-bottom: 1px solid var(--ink);
}
.study-card:nth-child(4n + 2) .card-poster { background: var(--blue); color: white; }
.study-card:nth-child(4n + 3) .card-poster { background: var(--acid); }
.study-card:nth-child(4n + 4) .card-poster { background: var(--ink); color: var(--paper-light); }
.card-poster::before {
  content: "";
  position: absolute;
  right: -8%;
  top: 50%;
  width: 55%;
  height: 1px;
  background: currentColor;
  transform: rotate(-36deg);
  transform-origin: right;
}
.card-poster span, .card-poster i { position: relative; z-index: 1; font-family: var(--mono); font-size: 11px; font-style: normal; text-transform: uppercase; letter-spacing: .09em; }
.card-poster i { align-self: end; justify-self: end; }
.card-poster strong { position: relative; z-index: 1; align-self: center; max-width: 9ch; font-family: var(--serif); font-size: clamp(54px, 7vw, 112px); font-weight: 400; line-height: .82; letter-spacing: -.065em; }
.card-poster--illustrated { display: block; margin: 0; padding: 0; background: var(--ink); }
.study-card:nth-child(n) .card-poster--illustrated { color: white; }
.card-poster--illustrated::before { display: none; }
.card-poster--illustrated img { display: block; width: 100%; height: 100%; min-height: inherit; object-fit: cover; }
.card-poster--illustrated figcaption {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: clamp(22px, 3vw, 46px);
  background: linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, .58));
}
.card-body { padding: clamp(28px, 4vw, 58px) var(--gutter) clamp(36px, 5vw, 72px); }
.card-meta { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.card-body h3 { margin: 30px 0 18px; font-family: var(--serif); font-size: clamp(38px, 4vw, 66px); font-weight: 400; line-height: .95; letter-spacing: -.045em; }
.card-summary { max-width: 36em; margin: 0 0 40px; font-size: clamp(17px, 1.6vw, 23px); line-height: 1.35; letter-spacing: -.015em; }
.dimension { display: grid; grid-template-columns: minmax(112px, .7fr) 2fr; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); }
.dimension h4, .study-details h4 { margin: 4px 0 0; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag-list li { padding: 5px 8px; border: 1px solid var(--line); border-radius: 99px; font-size: 12px; }
details { margin-top: 24px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
summary { display: flex; justify-content: space-between; padding: 18px 0; cursor: pointer; font-weight: 700; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 20px; font-weight: 400; line-height: .8; }
details[open] summary::after { content: "−"; }
.study-details { padding: 6px 0 26px; }
.boundary-block { display: grid; grid-template-columns: minmax(112px, .7fr) 2fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--line); }
.boundary-block ul { margin: 0; padding-left: 18px; }
.boundary-block li + li { margin-top: 7px; }
.boundary-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.boundary-pair .boundary-block { display: block; }
.boundary-pair h4 { margin-bottom: 12px; }
.condition-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.condition-grid h4 { margin-bottom: 12px; }
.pattern-links { padding: 20px 0 0; border-top: 1px solid var(--line); }
.pattern-links h4 { margin-bottom: 14px; }
.pattern-links p { display: grid; grid-template-columns: minmax(120px, .8fr) 2fr; gap: 16px; margin: 9px 0; font-size: 13px; }
.pattern-links span { font-weight: 700; }
.source-link { display: flex; align-items: baseline; gap: 8px; margin-top: 22px; font-size: 14px; font-weight: 700; }
.source-link span:first-of-type { margin-left: auto; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; font-weight: 400; }
.empty-state { margin: 0; padding: 80px var(--gutter); border-bottom: 1px solid var(--ink); font-family: var(--serif); font-size: clamp(28px, 4vw, 56px); }

.method {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(42px, 8vw, 130px);
  width: min(100%, var(--max));
  margin: 0 auto;
  padding: clamp(80px, 12vw, 180px) var(--gutter);
  background: var(--paper-light);
  border-bottom: 1px solid var(--ink);
}
.method ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.method li { display: grid; grid-template-columns: 42px 1fr; gap: 4px 18px; padding: 20px 0; border-bottom: 1px solid var(--line); line-height: 1.45; }
.method li span { grid-row: 1 / 3; font-family: var(--mono); font-size: 11px; }
.method li strong { font-size: 18px; }

.site-footer { display: flex; justify-content: space-between; gap: 24px; width: min(100%, var(--max)); margin: 0 auto; padding: 26px var(--gutter) 44px; background: var(--paper-light); color: var(--ink-soft); font-size: 12px; }
.site-footer p { margin: 0; }

@media (max-width: 980px) {
  .hero { min-height: 680px; }
  .hero-intro { margin-left: 14%; margin-right: 12%; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .search-control { grid-column: 1 / -1; }
  .reset-button { min-height: 62px; }
  .study-grid { grid-template-columns: 1fr; }
  .study-card:nth-child(odd) { border-right: 0; }
  .card-poster { min-height: min(66vw, 520px); }
  .method { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .site-header { padding-top: 18px; padding-bottom: 18px; }
  .hero { min-height: 610px; padding-top: 62px; }
  .hero-index { top: 64px; }
  .hero h1 { font-size: clamp(70px, 25vw, 120px); line-height: .75; }
  .hero-intro { grid-template-columns: 1fr; gap: 20px; margin: 72px 52px 64px 0; }
  .hero-intro p { font-size: 20px; }
  .hero::after { right: -34px; bottom: 150px; width: 110px; }
  .hero-ledger dd { max-width: 11ch; font-size: 9px; }
  .browser-heading { grid-template-columns: 1fr; gap: 22px; }
  .filters { grid-template-columns: 1fr; }
  .filters .search-control { grid-column: auto; }
  .filters label { padding-right: var(--gutter); padding-left: var(--gutter); }
  .result-bar p:last-child { display: none; }
  .card-poster { min-height: 320px; }
  .card-poster strong { font-size: clamp(54px, 18vw, 82px); }
  .dimension, .boundary-block { grid-template-columns: 1fr; gap: 10px; }
  .boundary-pair, .condition-grid { grid-template-columns: 1fr; gap: 0; }
  .pattern-links p { grid-template-columns: 1fr; gap: 3px; }
  .source-link span:first-of-type { display: none; }
  .site-footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
