/* Sieve — sieve.photo
   The picture edit: plates run to the edge, the ground is the dark of a room
   where you look at pictures, the caption is one thin line. The photographs
   carry the color; the interface stays quiet. Palette and type from
   README/design/DESIGN_v7.md section 1. */

/* ---------- tokens ---------- */

:root {
  color-scheme: dark;

  --wall: #201E1B;
  --wall-lit: #36322B;
  --floor: #151412;
  --lamp: #FFF0D2;
  --tape: #A6DCFF;
  --ink: #EDE8DF;
  --ink-2: #A39E95;
  --ink-3: #6A655D;
  --edge: #332F29;

  /* the focus mark, overridable inside a colored region */
  --mark: var(--tape);

  /* 4-unit spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 128px;

  --measure: 62ch;
  --page: 1120px;
  --page-wide: 1320px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- reset ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: Archivo, "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 450;
  line-height: 1.6;
  font-synthesis-weight: none;
  overflow-x: hidden;
}

img { max-width: 100%; }

[hidden] { display: none !important; }

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

p { margin: 0; }

ul, ol { margin: 0; padding: 0; }

figure { margin: 0; }

/* ---------- browser surfaces ---------- */

::selection { background: var(--lamp); color: var(--wall); }

* {
  caret-color: var(--tape);
  accent-color: var(--tape);
  -webkit-tap-highlight-color: transparent;
}

html { scrollbar-color: #3E3931 var(--floor); scrollbar-width: thin; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--floor); }
::-webkit-scrollbar-thumb { background: #3E3931; border: 3px solid var(--floor); }
::-webkit-scrollbar-thumb:hover { background: #554F45; }

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

/* The app's focus mark: a tape corner, top left and bottom right.
   Only on elements that can render a pseudo-element: never on <input>,
   which keeps the plain outline above. */
.corner { position: relative; }

.corner:focus-visible { outline: none; }

.corner:focus-visible::after {
  content: "";
  position: absolute;
  inset: -6px;
  pointer-events: none;
  background:
    linear-gradient(var(--mark), var(--mark)) left top / 12px 2px no-repeat,
    linear-gradient(var(--mark), var(--mark)) left top / 2px 12px no-repeat,
    linear-gradient(var(--mark), var(--mark)) right bottom / 12px 2px no-repeat,
    linear-gradient(var(--mark), var(--mark)) right bottom / 2px 12px no-repeat;
}

/* ---------- shared layout ---------- */

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

.page.wide { max-width: var(--page-wide); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--lamp);
  color: var(--wall);
  padding: var(--s3) var(--s4);
  font-weight: 700;
}

.skip:focus { left: var(--s4); top: var(--s3); }

/* ---------- navigation ---------- */

.nav {
  position: relative;
  z-index: 3;
  background: var(--floor);
  border-bottom: 1px solid var(--edge);
}

.nav .page {
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--s5);
  max-width: var(--page-wide);
}

.wordmark {
  font-size: 19px;
  font-weight: 800;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.wordmark .dot { color: var(--ink-2); font-weight: 500; }

.nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: var(--s2);
}

.nav a:hover { color: var(--ink); }

.nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--tape);
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--s5);
  border: 1px solid var(--lamp);
  background: var(--lamp);
  color: var(--wall);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  white-space: nowrap;
  touch-action: manipulation;
  transition: transform 120ms var(--ease-out), background-color 120ms var(--ease-out);
}

.btn:hover { background: #FFF8E8; }
.btn:active { transform: scale(0.97); }

.btn:disabled { opacity: 0.55; cursor: default; }
.btn:disabled:active { transform: none; }

.btn-quiet {
  border-color: var(--edge);
  background: transparent;
  color: var(--ink);
}

.btn-quiet:hover { background: #2A2723; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--s2);
}

.field {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--s4);
  background: var(--floor);
  border: 1px solid var(--edge);
  border-radius: 2px;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

.field::placeholder { color: var(--ink-2); }
.field:hover { border-color: #4A443C; }

/* ---------- the waitlist ---------- */

.waitlist-row { display: flex; gap: var(--s2); }
.waitlist-row .field { flex: 1 1 auto; min-width: 0; }
.waitlist-row .btn { flex: 0 0 auto; }

.error {
  margin-top: var(--s3);
  max-width: 46ch;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--lamp);
}

.field[aria-invalid="true"] { border-color: var(--lamp); }

.joined {
  margin: 0;
  padding-left: var(--s4);
  box-shadow: inset 3px 0 0 var(--tape);
  font-size: 19px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ---------- hero: type left, one plate bleeding right ---------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--edge);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: var(--s9);
  align-items: center;
  min-height: min(88vh, 800px);
  padding-left: max(var(--s6), calc((100% - var(--page-wide)) / 2 + var(--s6)));
}

.hero-say { padding-block: var(--s8); }

h1 {
  font-size: clamp(40px, 4.6vw, 66px);
  letter-spacing: -0.042em;
}

.lede {
  margin-top: var(--s5);
  max-width: 40ch;
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink-2);
}

.waitlist { margin-top: var(--s7); max-width: 44ch; }

.hero-shot {
  position: relative;
  align-self: stretch;
  min-height: 320px;
  border-left: 1px solid var(--edge);
}

.hero-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

/* a scrim so the caption clears contrast on any frame */
.hero-shot::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 140px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(12, 11, 9, 0.72), rgba(12, 11, 9, 0));
}

.hero-shot figcaption {
  z-index: 1;
  position: absolute;
  left: var(--s5);
  right: var(--s5);
  bottom: var(--s5);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.95), 0 0 18px rgba(0, 0, 0, 0.8);
}

/* ---------- the wall: the one authored moment ---------- */

.night {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--edge);
  padding-block: var(--s9) var(--s8);
}

.night-grid { display: block; }

.night-say { max-width: 60ch; }

.night-say p {
  margin-top: var(--s5);
  color: var(--ink-2);
  font-size: 18px;
  line-height: 1.55;
  max-width: 56ch;
}

.fineprint {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.wall { position: relative; margin-top: var(--s8); }

.pool {
  position: absolute;
  left: -10%;
  right: -10%;
  top: -22%;
  height: 108%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    50% 50% at 50% 46%,
    rgba(255, 240, 210, 0.30) 0%,
    rgba(255, 240, 210, 0.15) 40%,
    rgba(255, 240, 210, 0.05) 68%,
    rgba(255, 240, 210, 0) 100%
  );
  transition: opacity 700ms var(--ease-out-expo);
}

.wall.lit .pool { opacity: 1; }

/* the picks, standing off the wall under the light */
.picks {
  position: relative;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
  padding-top: 26px;
}

/* the rest, lying flat in the box below */
.wall-floor {
  display: grid;
  grid-template-columns: minmax(0, 680px) minmax(0, 1fr);
  gap: var(--s8);
  align-items: end;
  margin-top: var(--s8);
}

.rest {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s3);
}

.wall-floor .fineprint { text-align: right; padding-bottom: var(--s2); }

.fr { position: relative; }

.fr img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: brightness(0.5) saturate(0.72);
  transition: filter 200ms var(--ease-out);
}

.fr.picked img { filter: none; }

.fr figcaption {
  margin-top: var(--s2);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fr.picked figcaption { color: var(--ink); }

/* the photographer's tape, holding the picked frame to the wall */
.tapeband {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--tape);
  z-index: 1;
}

.fr.picked {
  transform: translateY(0);
  transition: transform 700ms var(--ease-out-expo), box-shadow 700ms var(--ease-out-expo);
}

.wall.lit .fr.picked {
  transform: translateY(-24px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 22px 40px rgba(0, 0, 0, 0.55);
}

/* ---------- bands ---------- */

.band { border-bottom: 1px solid var(--edge); }
.band-floor { background: var(--floor); }

.band .page { padding-block: var(--s9); }

h2 {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.034em;
}

/* ---------- how it works ---------- */

.steps {
  margin-top: var(--s8);
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s8);
}

.step { border-top: 2px solid var(--edge); padding-top: var(--s5); }

.stepnum {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--lamp);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s3);
}

.step h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.022em;
}

.step p { margin-top: var(--s3); color: var(--ink-2); }

/* ---------- the plates ---------- */

.plates { border-bottom: 1px solid var(--edge); padding-bottom: var(--s7); }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
}

.tiles img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.platecap {
  margin-top: var(--s6);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 74ch;
  font-variant-numeric: tabular-nums;
}

/* ---------- facts ---------- */

.facts {
  margin-top: var(--s8);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s7) var(--s8);
}

.fact dt {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.fact dd {
  margin: var(--s2) 0 0;
  color: var(--ink-2);
  max-width: 42ch;
}

/* ---------- the closing band, in tape ---------- */

.join {
  --mark: #14130F;
  background: var(--tape);
  color: #14130F;
}

.join-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
  gap: var(--s8);
  align-items: end;
  padding-block: var(--s9);
}

.join h2 { color: #14130F; }

.join-say p {
  margin-top: var(--s4);
  color: #33403F;
  font-size: 17px;
}

.join .waitlist { margin-top: 0; max-width: none; }

.join label { color: #33403F; }

.join .field {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(20, 19, 15, 0.35);
  color: #14130F;
}

.join .field::placeholder { color: #4A5654; }
.join .field:hover { border-color: rgba(20, 19, 15, 0.7); }
.join .field[aria-invalid="true"] { border-color: #7A1B1B; }

.join .btn {
  background: #14130F;
  border-color: #14130F;
  color: var(--lamp);
}

.join .btn:hover { background: #2B2822; border-color: #2B2822; }

.join .error { color: #7A1B1B; }

.join .joined {
  box-shadow: inset 3px 0 0 #14130F;
  color: #14130F;
}

.join *:not(.btn) { caret-color: #14130F; }

/* ---------- prose (docs, terms, privacy) ---------- */

.prose { max-width: var(--measure); }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(30px, 4vw, 44px); }
.prose h2 { margin-top: var(--s8); font-size: 27px; scroll-margin-top: 76px; }
.prose h3 { margin-top: var(--s6); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; scroll-margin-top: 76px; }
.prose p { margin-top: var(--s4); color: var(--ink); }
.prose ul { margin-top: var(--s4); list-style: none; }
.prose li { padding-left: var(--s5); margin-top: var(--s3); position: relative; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 2px;
  background: var(--ink-3);
}
.prose a { color: var(--ink); text-decoration-color: var(--tape); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--tape); }
.prose a.btn { color: var(--wall); text-decoration: none; }
.prose a.btn:hover { color: var(--wall); }
.prose strong { font-weight: 700; }

/* two prose columns side by side */
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s7) var(--s8);
  align-items: start;
}

.lead { margin-top: var(--s6); color: var(--ink-2); max-width: 52ch; }
.action { margin-top: var(--s6); }

.note {
  margin-top: var(--s3);
  max-width: 46ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2);
}

.note a { color: var(--ink); text-decoration-color: var(--tape); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.note a:hover { color: var(--tape); }

.keys {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid var(--edge);
  border-radius: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.draftnote {
  margin-top: var(--s5);
  padding: var(--s4) var(--s5);
  background: var(--floor);
  border: 1px solid var(--edge);
  color: var(--ink);
  max-width: var(--measure);
}

.updated { margin-top: var(--s3); font-size: 13px; color: var(--ink-2); }

/* two-column docs with a contents list */

.withtoc {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s9);
  align-items: start;
  padding-block: var(--s8) var(--s10);
}

.toc { position: sticky; top: var(--s5); }

.toc h2 {
  font-size: 13px;
  font-weight: 700;
  font-stretch: 100%;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  margin: 0 0 var(--s3);
}

.toc ul { list-style: none; }

.toc li + li { margin-top: var(--s2); }

.toc a {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding-block: 2px;
}

.toc a:hover { color: var(--ink); }

/* ---------- footer ---------- */

.foot {
  background: var(--floor);
  border-top: 1px solid var(--edge);
}

.foot .page {
  padding-block: var(--s7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s5) var(--s6);
  align-items: baseline;
}

.foot nav { display: flex; flex-wrap: wrap; gap: var(--s5); margin-right: auto; }

.foot a {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.foot a:hover { color: var(--ink); }

.foot small { font-size: 12px; color: var(--ink-2); max-width: 52ch; line-height: 1.5; }

/* ---------- narrow ---------- */

@media (max-width: 1080px) {
  .hero-grid { gap: var(--s7); grid-template-columns: minmax(0, 480px) minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { gap: var(--s6); }
}

@media (max-width: 900px) {
  .page { padding-inline: var(--s5); }

  /* the plate goes first, the way a picture story opens */
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    padding-left: 0;
  }

  .hero-say { padding: var(--s7) var(--s5) var(--s8); order: 2; }
  .hero-shot { order: 1; height: 42vh; min-height: 260px; max-height: 340px; border-left: 0; border-bottom: 1px solid var(--edge); }
  .hero-shot img { object-position: 50% 46%; }

  h1 { font-size: clamp(34px, 9vw, 46px); }
  .lede { font-size: 17px; }
  .waitlist { margin-top: var(--s6); }

  .night { padding-block: var(--s8) var(--s7); }
  .wall { margin-top: var(--s6); }

  /* the first pick takes the full width, the way it does in the app */
  .picks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .picks > li:first-child { grid-column: 1 / -1; }
  .wall.lit .fr.picked { transform: translateY(-14px); }

  .wall-floor { grid-template-columns: minmax(0, 1fr); gap: var(--s5); margin-top: var(--s6); }
  .rest { gap: var(--s2); }
  .wall-floor .fineprint { text-align: left; padding-bottom: 0; }

  .steps { grid-template-columns: minmax(0, 1fr); gap: var(--s6); margin-top: var(--s6); }
  .pair { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: var(--s5); margin-top: var(--s6); }
  .fact dd { max-width: none; }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .join-grid { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-block: var(--s8); }

  .withtoc { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-block: var(--s6) var(--s8); }
  .toc { position: static; padding-bottom: var(--s5); border-bottom: 1px solid var(--edge); }
  .toc ul { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
  .toc li + li { margin-top: 0; }

  .band .page { padding-block: var(--s8); }

  .waitlist-row { flex-wrap: wrap; }
  .waitlist-row .field { flex-basis: 100%; }
  .waitlist-row .btn { width: 100%; }
}

@media (max-width: 560px) {
  .nav .page { gap: var(--s4); }
  .nav a { font-size: 14px; }
  .rest .fr figcaption { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
