/* Sieve — sieve.photo
   The edit wall: prints on a dark wall, one lamp, the photographer's tape.
   Palette and type inherited 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;

  /* 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;

  --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; }

/* ---------- 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(--tape); 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 tape 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(--tape), var(--tape)) left top / 12px 2px no-repeat,
    linear-gradient(var(--tape), var(--tape)) left top / 2px 12px no-repeat,
    linear-gradient(var(--tape), var(--tape)) right bottom / 12px 2px no-repeat,
    linear-gradient(var(--tape), var(--tape)) right bottom / 2px 12px no-repeat;
}

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

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

.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);
}

.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: 44px;
  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: 44px;
  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; }

/* ---------- hero ---------- */

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

.hero .page {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 490px) minmax(0, 1fr);
  gap: var(--s8);
  align-items: center;
  padding-block: var(--s8);
  min-height: 560px;
}

h1 {
  font-size: clamp(38px, 4.2vw, 60px);
  letter-spacing: -0.038em;
}

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

.waitlist { margin-top: var(--s6); max-width: 42ch; }

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

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

/* the waitlist answers, in place */

.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: 17px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* ---------- the wall ---------- */

.wall {
  position: relative;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: var(--s6);
  margin-right: calc(var(--s10) * -1);
}

.pool {
  position: absolute;
  left: -90px;
  right: -90px;
  top: -150px;
  height: 420px;
  pointer-events: none;
  background: radial-gradient(
    52% 50% at 50% 47%,
    rgba(255, 240, 210, 0.30) 0%,
    rgba(255, 240, 210, 0.16) 38%,
    rgba(255, 240, 210, 0.055) 66%,
    rgba(255, 240, 210, 0) 100%
  );
}

.lit, .rest { position: relative; display: flex; }
.lit { gap: var(--s4); align-items: flex-end; }
.rest { gap: var(--s3) var(--s3); flex-wrap: wrap; }

.print { margin: 0; }

.paper {
  background: #2B2822;
  border-radius: 1px;
  position: relative;
}

.lit .paper {
  width: 104px;
  height: 70px;
  background: #4C463C;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 18px 32px rgba(0, 0, 0, 0.5);
}

.lit .print:nth-child(2) .paper { height: 88px; width: 62px; }
.lit .print:nth-child(4) .paper { background: #575044; }
.lit .print:nth-child(5) .paper { background: #423C33; }

.rest .paper { width: 66px; height: 44px; background: #2A2721; }
.rest .print:nth-child(3n) .paper { background: #262320; }
.rest .print:nth-child(4n) .paper { background: #2F2B25; }
.rest .print:nth-child(7n) .paper { width: 34px; }

.cap { height: 30px; padding-top: var(--s1); }
.rest .cap { height: 16px; }

.num {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.rest .num { font-size: 9px; }

/* the photographer's marks, in tape */
.stars { display: flex; gap: 2px; height: 8px; margin-bottom: 3px; }

.star {
  width: 8px;
  height: 8px;
  background: var(--tape);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.tapeband {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--tape);
}

.rejected { opacity: 0.4; }

.cross { position: absolute; inset: 0; }

.cross::before,
.cross::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 10%;
  width: 2px;
  height: 80%;
  background: var(--tape);
}

.cross::before { transform: translateX(-50%) rotate(38deg); }
.cross::after { transform: translateX(-50%) rotate(-38deg); }

/* the one authored moment: the light comes up */
@media (prefers-reduced-motion: no-preference) {
  .pool { animation: lightup 700ms var(--ease-out-expo) both; }
  .lit .paper { animation: standup 700ms var(--ease-out-expo) both; }
}

@keyframes lightup {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes standup {
  from { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 0 0 rgba(0, 0, 0, 0); }
  to { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 18px 32px rgba(0, 0, 0, 0.45); }
}

/* ---------- steps (stacked) ---------- */

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

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

h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.steps { margin-top: var(--s7); border-top: 1px solid var(--edge); }

.step {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 58ch);
  gap: var(--s7);
  padding-block: var(--s6);
  border-bottom: 1px solid var(--edge);
}

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

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

/* ---------- measure block ---------- */

.measure { max-width: var(--measure); }

.claim {
  max-width: 54ch;
  font-size: 19px;
  line-height: 1.55;
}

.claim + .claim { margin-top: var(--s5); color: var(--ink-2); font-size: 16px; }

.claims { margin-top: var(--s6); max-width: var(--measure); }

/* ---------- facts (grid) ---------- */

.facts {
  margin-top: var(--s7);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s6) 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: 46ch;
}

/* ---------- 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 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: 46ch; line-height: 1.5; }

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

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

  .hero .page {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s8);
    padding-block: var(--s7);
    min-height: 0;
  }

  /* the lit row runs off the edge: the wall continues past the viewport */
  .wall { margin-right: calc(var(--s5) * -1); gap: var(--s5); }
  .lit { flex-wrap: nowrap; }
  .pool { top: -100px; height: 300px; left: -40px; right: -40px; }
  .rest .paper { width: 58px; height: 38px; }
  .rest .print:nth-child(7n) .paper { width: 30px; }

  .step { grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .pair { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .facts { grid-template-columns: minmax(0, 1fr); gap: var(--s5); }

  .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(--s7); }

  .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; }
  .lit .paper { width: 88px; height: 60px; }
  .lit .print:nth-child(2) .paper { width: 52px; height: 72px; }
}

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