/* Gesso website. Plain CSS, no build step. Tokens first, then type, layout, sections.
   Radius rule: buttons are pills, pictures have 4px corners, nothing else is rounded. */

@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-500-italic.woff2") format("woff2"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --ground: #edeae3;      /* plaster */
  --raised: #e3dfd6;      /* a picture slot before its picture arrives */
  --ink: #262421;
  --muted: #6b665e;
  --rule: rgba(38, 36, 33, 0.16);
  --accent: #99492f;      /* fired clay; italics and links only */
  --button: #262421;
  --button-ink: #f1eee8;
  --grain: 0.055;

  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 72px);
  --section: clamp(96px, 14vw, 200px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1b1a18;
    --raised: #262421;
    --ink: #ece8e0;
    --muted: #a39d93;
    --rule: rgba(236, 232, 224, 0.16);
    --accent: #d39378;
    --button: #ece8e0;
    --button-ink: #1b1a18;
    --grain: 0.07;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The primed surface: one fixed layer of grain over everything, never on a scrolling box. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
@media (prefers-color-scheme: dark) { body::after { mix-blend-mode: screen; } }

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 40px); }

/* Type */
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; margin: 0; }
h1 { font-size: clamp(2.9rem, 7.2vw, 6.25rem); line-height: 1.04; letter-spacing: -0.015em; }
h2 { font-size: clamp(2.1rem, 4.4vw, 3.75rem); line-height: 1.1; letter-spacing: -0.01em; }
h3 { font-size: clamp(1.4rem, 2vw, 1.75rem); line-height: 1.2; }
h1 .quiet { display: block; }
h1 em, h2 em { font-style: italic; color: var(--accent); }
.quiet { color: var(--muted); }
p { margin: 0; }
.lede { font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 1.6; color: var(--muted); max-width: 44ch; }
.note { font-size: 0.875rem; color: var(--muted); }

/* Header */
.site-header { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.wordmark {
  display: block; width: 104px; aspect-ratio: 800 / 187; background: var(--ink);
  -webkit-mask: url("../images/wordmark.png") center / contain no-repeat;
  mask: url("../images/wordmark.png") center / contain no-repeat;
}
.wordmark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 40px); font-size: 0.9375rem; }
.site-nav a { text-decoration: none; }
@media (max-width: 640px) { .site-nav a:not(.button) { display: none; } }

/* Button: one shape, one label, everywhere. */
.button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85em 1.5em; border-radius: 999px;
  background: var(--button); color: var(--button-ink);
  font-family: var(--sans); font-size: 0.9375rem; font-weight: 500; line-height: 1;
  text-decoration: none; white-space: nowrap;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.button:hover { color: var(--button-ink); opacity: 0.86; }
.button:active { transform: scale(0.98); }
.button.small { padding: 0.7em 1.15em; font-size: 0.875rem; }
/* Before release the pill is a label, not a link. Swap back to the <a> on release day (site/README.md). */
.button.soon, .button.soon:hover { cursor: default; opacity: 1; }
.button.soon:active { transform: none; }

/* Pictures. Every slot has a fixed shape, so a photograph drops in without moving anything. */
.frame { margin: 0; }
.frame .pic {
  position: relative; overflow: hidden; border-radius: 4px; background: var(--raised);
  aspect-ratio: var(--ratio, 3 / 2);
}
.frame .pic img, .frame .pic picture { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--muted); }
.frame figcaption b { font-weight: 500; color: var(--ink); }
/* A slot waiting for its photograph says what belongs in it. Remove .awaiting with the picture. */
.pic.awaiting::after {
  content: attr(data-wants);
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  font-size: 0.8125rem; color: var(--muted);
}
.pic.awaiting { background: linear-gradient(160deg, var(--raised), color-mix(in srgb, var(--raised) 70%, var(--ground))); }

/* Hero */
.hero { padding-top: clamp(40px, 7vw, 96px); }
.hero-copy { grid-column: 1 / span 9; }
.hero-copy .lede { margin-top: 28px; }
.hero-copy .button { margin-top: 32px; }
.hero-picture { grid-column: 1 / -1; margin-top: clamp(40px, 6vw, 80px); --ratio: 21 / 10; }

/* Statement */
.statement { padding-top: var(--section); }
.statement p { grid-column: 5 / -1; font-family: var(--serif); font-size: clamp(1.6rem, 3.1vw, 2.75rem); line-height: 1.25; letter-spacing: -0.005em; }

section { scroll-margin-top: 24px; }
.section { padding-top: var(--section); }
.section-head { max-width: 30ch; }
.section-head + .lede, .section-head .lede { margin-top: 20px; }

/* Spaces: an uneven wall of rooms */
.spaces-grid { margin-top: clamp(40px, 6vw, 88px); row-gap: clamp(40px, 6vw, 96px); align-items: end; }
.spaces-grid .a { grid-column: 1 / span 8; --ratio: 3 / 2; }
.spaces-grid .b { grid-column: 9 / -1; --ratio: 4 / 5; }
.spaces-grid .c { grid-column: 2 / span 4; --ratio: 1 / 1; }
.spaces-grid .d { grid-column: 7 / -1; --ratio: 16 / 10; }
.spaces-grid .e { grid-column: 1 / -1; --ratio: 21 / 9; }

/* Finishes: a sample board. Names on the left, the picture on the right. */
.finishes-board { margin-top: clamp(40px, 6vw, 88px); align-items: start; }
.finish-list { grid-column: 1 / span 4; list-style: none; margin: 0; padding: 0; }
.finish-list button {
  display: block; width: 100%; padding: 6px 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-family: var(--serif); font-size: clamp(1.9rem, 3.6vw, 3.25rem); line-height: 1.15; color: var(--muted);
  transition: color 0.3s var(--ease);
}
.finish-list button:hover { color: var(--ink); }
.finish-list button[aria-pressed="true"] { color: var(--ink); font-style: italic; }
.finish-view { grid-column: 6 / -1; --ratio: 16 / 9; }
.finish-view figcaption { min-height: 3.2em; max-width: 52ch; }

/* Through the day: four frames in a row, scrolls sideways on a phone */
.day-strip { margin-top: clamp(40px, 6vw, 88px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 24px); }
.day-strip .frame { --ratio: 4 / 5; }

/* The collection */
.collection-figures { margin-top: clamp(40px, 6vw, 80px); display: flex; flex-wrap: wrap; gap: clamp(32px, 7vw, 120px); }
.figure-number { font-variant-numeric: lining-nums; font-family: var(--serif); font-size: clamp(3rem, 7vw, 6rem); line-height: 1; letter-spacing: -0.02em; }
.figure-label { margin-top: 8px; font-size: 0.9375rem; color: var(--muted); }
.plates { margin-top: clamp(48px, 7vw, 104px); row-gap: 40px; align-items: start; }
.plates .p1 { grid-column: 1 / span 5; --ratio: 4 / 3; }
.plates .p2 { grid-column: 6 / span 4; --ratio: 1 / 1; margin-top: clamp(0px, 6vw, 96px); }
.plates .p3 { grid-column: 10 / -1; --ratio: 3 / 4; }
.sources { margin-top: clamp(48px, 7vw, 96px); grid-column: 1 / span 8; font-family: var(--serif); font-size: clamp(1.3rem, 2.1vw, 1.9rem); line-height: 1.35; }
.sources-wrap .note { grid-column: 1 / span 6; margin-top: 20px; }

/* Particulars: three short groups, one rule above the set */
.particulars { margin-top: clamp(40px, 6vw, 80px); border-top: 1px solid var(--rule); padding-top: 32px; row-gap: 40px; }
.particulars > div { grid-column: span 4; }
.particulars h3 { margin-bottom: 12px; }
.particulars p { color: var(--muted); max-width: 34ch; }
.particulars p + p { margin-top: 8px; }

/* Closing */
.closing { padding-top: var(--section); padding-bottom: clamp(72px, 10vw, 140px); }
.closing h2 { font-size: clamp(2.6rem, 6.4vw, 5.5rem); line-height: 1.05; max-width: 16ch; }
.closing .button { margin-top: 36px; }

.site-footer { font-variant-numeric: lining-nums; border-top: 1px solid var(--rule); padding: 28px 0 40px; display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; font-size: 0.875rem; color: var(--muted); }
.site-footer nav { display: flex; gap: 24px; }
.site-footer a { text-decoration: none; }

/* Text pages: privacy, support, not found */
.page { padding: clamp(48px, 8vw, 112px) 0 var(--section); }
.page-body { grid-column: 4 / span 7; }
.page-body h1 { font-size: clamp(2.6rem, 5.6vw, 4.5rem); }
.page-body .updated { margin-top: 16px; }
.page-body h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); margin-top: 56px; }
.page-body p, .page-body ul { margin-top: 16px; max-width: 64ch; }
.page-body ul { padding-left: 1.1em; }
.page-body li + li { margin-top: 8px; }
.page-body a { color: var(--accent); }

/* Motion: pictures and blocks rise a few pixels as they come into view, once. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
  .js [data-reveal].seen { opacity: 1; transform: none; }
  .finish-view .pic img { transition: opacity 0.5s var(--ease); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* One column below 820px, declared per block. */
@media (max-width: 820px) {
  .hero-copy, .statement p, .finish-list, .finish-view, .sources, .sources-wrap .note, .page-body,
  .spaces-grid .a, .spaces-grid .b, .spaces-grid .c, .spaces-grid .d, .spaces-grid .e,
  .plates .p1, .plates .p2, .plates .p3 { grid-column: 1 / -1; }
  .plates .p2 { margin-top: 0; }
  .hero-picture { --ratio: 4 / 3; }
  .spaces-grid .e { --ratio: 3 / 2; }
  .finish-list { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 24px; }
  .finish-list button { width: auto; font-size: 1.75rem; }
  .day-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .particulars > div { grid-column: 1 / -1; }
}
