/*
 * The app's own surfaces, lifted straight out of Stacks/Assets.xcassets so the site and the app
 * are the same room rather than two rooms painted from memory.
 */
:root {
  --canvas: #F7F2EA;
  --surface: #ECE4D8;
  --card: #EFE8DD;
  --mat: #EFE8DD;
  --ink: #2B2520;
  --ink-soft: #6B6157;
  --hairline: #DDD2C3;
  --brand: #C45D3E;
  --accent: #A94D2E;
  --shadow: rgba(43, 37, 32, 0.10);

  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1080px;
  --gutter: 24px;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #14110E;
    --surface: #221C17;
    --card: #1D1814;
    /* The app keeps the mat pale in the dark, so a cut-out thing still sits on paper. */
    --mat: #E9E0D2;
    --ink: #F2E9DC;
    --ink-soft: #A69886;
    --hairline: #2E2721;
    --accent: #EB9B72;
    --shadow: rgba(0, 0, 0, 0.45);
  }
}

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

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

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; }

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
}

/* ── Type ─────────────────────────────────────────────────────────────── */

h1, h2, h3, .wordmark, .pull, .mat-title, .num {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(38px, 6.2vw, 64px);
  line-height: 1.06;
  margin: 0 0 20px;
}

h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  margin: 0 0 14px;
}

h3 {
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 8px;
}

p { margin: 0 0 16px; }

.lede {
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-soft);
  max-width: 54ch;
  margin-bottom: 24px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

.note {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 16px 0 0;
}

.aside {
  font-size: 15px;
  color: var(--ink-soft);
  border-left: 2px solid var(--hairline);
  padding-left: 14px;
  margin: 24px 0 0;
  max-width: 48ch;
}

.wordmark {
  font-style: italic;
  font-size: 24px;
  text-decoration: none;
  color: var(--ink);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row-centre { justify-content: center; }

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-solid {
  background: var(--accent);
  color: var(--canvas);
}
.btn-solid:hover { background: var(--brand); }

.btn-quiet {
  border-color: var(--hairline);
  color: var(--ink);
}
.btn-quiet:hover { border-color: var(--ink-soft); }

/* ── Bar ──────────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--hairline);
}

.bar-inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.bar-nav {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-size: 15px;
}
.bar-nav a {
  color: var(--ink-soft);
  text-decoration: none;
}
.bar-nav a:hover { color: var(--ink); }

.bar-cta { padding: 9px 16px; font-size: 15px; }

@media (max-width: 760px) {
  .bar-nav { display: none; }
  .bar-cta { margin-left: auto; }
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { padding: clamp(48px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ── The shelf ────────────────────────────────────────────────────────── */

.shelf {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 22px 22px 26px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}

/* The board the things stand on, which is the whole reason a shelf reads as a shelf. */
.shelf-edge {
  height: 10px;
  margin: 0 8px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(var(--hairline), color-mix(in srgb, var(--hairline) 55%, transparent));
  box-shadow: 0 10px 18px -10px var(--shadow);
}

.tile h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  margin: 10px 0 2px;
}

.tile p {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
}

/* The app mats anything without a picture of its own and sets its name in the serif. */
.mat {
  aspect-ratio: 1;
  background: var(--mat);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  display: grid;
  place-items: center;
  padding: 16px;
  box-shadow: 0 1px 2px var(--shadow);
}

/* Placeholder artwork: drawn rather than photographed, so nothing here belongs to anybody. Ink
   on the pale mat in both themes, because the mat itself stays pale in the dark. */
.glyph {
  width: 46%;
  height: auto;
  fill: none;
  stroke: #8C7F70;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.glyph .fill { fill: #8C7F70; stroke: none; }

/* ── Strip ────────────────────────────────────────────────────────────── */

.strip {
  border-block: 1px solid var(--hairline);
  background: var(--surface);
}
.strip p {
  margin: 0;
  padding: 18px 0;
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
}

/* ── Bands ────────────────────────────────────────────────────────────── */

.band { padding: clamp(56px, 8vw, 96px) 0; }
.band-quiet { background: var(--surface); border-block: 1px solid var(--hairline); }

.band-head { margin-bottom: clamp(28px, 4vw, 44px); }
.band-head .lede { margin-bottom: 0; }

/* Four of them, so two by two rather than three across and one left standing on its own. */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 32px);
}
.card p { color: var(--ink-soft); margin: 0; }

/* ── Taste ────────────────────────────────────────────────────────────── */

.taste-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

@media (max-width: 900px) {
  .taste-grid { grid-template-columns: 1fr; }
}

.ticks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  max-width: 48ch;
}
.ticks li {
  position: relative;
  padding-left: 26px;
  color: var(--ink-soft);
}
.ticks li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.matches {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px;
}

.match {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0 8px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-family: var(--serif);
  font-size: 17px;
}

.who { display: flex; flex-direction: column; line-height: 1.3; }
.who span { font-size: 13px; color: var(--ink-soft); }

.score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.1;
  color: var(--accent);
}
.score span {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
}
/* A faint resemblance gets a line, not a headline. The app does the same thing. */
.score.faint { color: var(--ink-soft); font-size: 17px; }

.scale {
  height: 3px;
  border-radius: 2px;
  background: var(--hairline);
  overflow: hidden;
  margin-bottom: 10px;
}
.scale span {
  display: block;
  height: 100%;
  background: var(--accent);
}
.scale span.faint { background: var(--ink-soft); }

/* ── Steps ────────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 28px;
  counter-reset: step;
}

.steps li { border-top: 1px solid var(--hairline); padding-top: 18px; }
.steps p { color: var(--ink-soft); margin: 0; }

.num {
  display: block;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ── Close ────────────────────────────────────────────────────────────── */

.close {
  padding: clamp(64px, 9vw, 104px) 0;
  text-align: center;
  border-top: 1px solid var(--hairline);
}

.pull {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.2;
  max-width: 20ch;
  margin: 0 auto 16px;
}

.close .lede { margin-inline: auto; margin-bottom: 28px; }

/* ── Foot ─────────────────────────────────────────────────────────────── */

.foot {
  border-top: 1px solid var(--hairline);
  background: var(--surface);
  padding: 32px 0;
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
}

.foot nav { display: flex; flex-wrap: wrap; gap: 18px; font-size: 15px; }
.foot nav a { color: var(--ink-soft); text-decoration: none; }
.foot nav a:hover { color: var(--ink); }

.foot p {
  margin: 0;
  margin-left: auto;
  font-size: 14px;
  color: var(--ink-soft);
}

@media (max-width: 700px) {
  .foot p { margin-left: 0; width: 100%; }
}

/* ── Prose, for the pages that are mostly words ───────────────────────── */

.prose { padding: clamp(40px, 6vw, 72px) 0 clamp(56px, 8vw, 96px); }
.prose .wrap { max-width: 720px; }
.prose h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 8px; }
.prose h2 { font-size: 24px; margin: 36px 0 10px; }
.prose h3 { font-size: 18px; margin: 24px 0 8px; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul { padding-left: 20px; margin: 0 0 16px; }
.prose li { margin-bottom: 8px; }
.prose a { color: var(--accent); }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 36px 0; }

.stamp {
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

/* ── Writing ──────────────────────────────────────────────────────────── */

.article-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(56px, 8vw, 96px);
}

.article-meta { border-bottom: 1px solid var(--hairline); padding-bottom: 24px; margin-bottom: 32px; }

.article-date {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.article-container h1 {
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.1;
  margin: 0 0 14px;
}

.article-excerpt {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

.article-content p,
.article-content li { color: var(--ink-soft); }
.article-content h2 { font-size: 26px; margin: 40px 0 12px; }
.article-content h3 { font-size: 20px; margin: 28px 0 8px; }
.article-content h4 { font-size: 17px; font-family: var(--sans); font-weight: 600; margin: 24px 0 6px; }
.article-content strong { color: var(--ink); font-weight: 600; }
.article-content em { font-style: italic; }
.article-content a { color: var(--accent); }
.article-content ul, .article-content ol { padding-left: 20px; margin: 0 0 18px; }
.article-content li { margin-bottom: 8px; }

.article-content blockquote {
  margin: 28px 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--accent);
}
.article-content blockquote p {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
  color: var(--ink);
  margin: 0;
}

.article-content pre {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
}

.back-link {
  display: inline-block;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  width: 100%;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
}
.back-link:hover { color: var(--ink); }

.blog-header {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter) clamp(24px, 3vw, 36px);
}
.blog-header h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 10px; }
.blog-header p { color: var(--ink-soft); max-width: 54ch; margin: 0; }

.blog-grid {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter) clamp(56px, 8vw, 96px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.blog-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease;
}
.blog-card:hover { border-color: var(--ink-soft); }
.blog-card h2 { font-size: 21px; line-height: 1.25; margin: 0 0 8px; }
.blog-card p { color: var(--ink-soft); font-size: 15px; margin: 0; }

.blog-card-date {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.blog-card-arrow { display: none; }
