/* adsheet — a contact sheet. Paper and ink, a film-edge strip, frame numbers in edge print,
   and a grease-pencil ring around the frames you pick. Phone first; wider screens only add columns. */

:root {
  color-scheme: light dark;
  --paper: #f1ede4;
  --card: #fbf9f4;
  --ink: #15120f;
  --soft: #5d564c;
  --rule: #cfc7b8;
  --strip: #0f0e0c;
  --strip-ink: #f3c316;
  --go: #f3c316;
  --go-ink: #15120f;
  --pencil: #e0341b;
  --ok: #1d6b3a;
  --bad-bg: #fbe1dc;
  --bad-ink: #8f1d10;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, "Cascadia Mono", monospace;
  --gutter: max(16px, env(safe-area-inset-left));
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f0e0c;
    --card: #191714;
    --ink: #ece6da;
    --soft: #a59c8d;
    --rule: #3a352d;
    --strip: #000;
    --bad-bg: #3a1712;
    --bad-ink: #ffb1a4;
    --ok: #7fd49c;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--body);
  font-stretch: 100%;
  overflow-wrap: anywhere;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---- film edge strip ---- */
.strip {
  background: var(--strip);
  color: var(--strip-ink);
  font: 600 11px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.strip .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.strip a { text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; letter-spacing: 0.22em; }
.perf {
  height: 10px;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, var(--paper) 8px 20px) 0 2px / 100% 6px no-repeat,
    var(--strip);
}

/* ---- landing ---- */
.hero { padding: 28px 0 8px; }
.kicker { font: 600 11px/1.2 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); }
h1 {
  font-family: var(--display);
  font-stretch: 118%;
  font-weight: 850;
  font-size: clamp(2.15rem, 9.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin: 10px 0 14px;
  text-wrap: balance;
}
.lede { font-size: 1.08rem; color: var(--soft); max-width: 34rem; }

.slate {
  margin-top: 22px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 16px;
  position: relative;
  box-shadow: 6px 6px 0 var(--ink);
}
.slate label { display: block; font: 600 11px/1.2 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
.slate input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: 500 16px/1.3 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.slate input::placeholder { color: var(--soft); opacity: 0.8; }
.slate input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .pick:focus-within {
  outline: 3px solid var(--pencil);
  outline-offset: 2px;
}
.go {
  appearance: none;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  padding: 0 20px;
  font: 800 1.1rem/1 var(--display);
  font-stretch: 112%;
  letter-spacing: 0.01em;
  color: var(--go-ink);
  background: var(--go);
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.go:disabled { opacity: 0.55; cursor: default; }
.go:active:not(:disabled) { transform: translate(2px, 2px); }
.terms { margin-top: 12px; font-size: 0.92rem; color: var(--soft); }
.terms strong { color: var(--ink); }
.error { margin-top: 10px; padding: 10px 12px; background: var(--bad-bg); color: var(--bad-ink); border-radius: 4px; font-weight: 600; }

.section { padding: 36px 0 0; }
.section h2 {
  font-family: var(--display);
  font-stretch: 114%;
  font-weight: 800;
  font-size: clamp(1.45rem, 5.6vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 16px;
}
.proof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proof-grid figure { margin: 0; background: var(--strip); padding: 6px 6px 0; }
.proof-grid figcaption { font: 600 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--strip-ink); padding: 7px 2px; }

.claims { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.claims li { padding: 16px 0; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 4px 10px; }
.claims .n { font: 600 12px/1.6 var(--mono); color: var(--pencil); }
.claims h3 { font-size: 1.12rem; font-weight: 750; line-height: 1.25; }
.claims .doubt { grid-column: 2; font-style: italic; color: var(--soft); }
.claims .how { grid-column: 2; }

.rows { border-top: 2px solid var(--ink); }
.rows details { border-bottom: 1px solid var(--rule); }
.rows summary {
  list-style: none;
  cursor: pointer;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 650;
}
.rows summary::-webkit-details-marker { display: none; }
.rows summary::after { content: "+"; font: 400 1.5rem/1 var(--mono); color: var(--soft); }
.rows details[open] summary::after { content: "–"; }
.rows details p { padding: 0 0 16px; color: var(--soft); max-width: 44rem; }

footer { margin-top: 48px; padding: 20px 0 28px; border-top: 1px solid var(--rule); color: var(--soft); font-size: 0.9rem; }

/* ---- job page ---- */
.job-head { padding: 22px 0 6px; }
.job-head h1 { font-size: clamp(1.7rem, 7vw, 3rem); margin: 8px 0 8px; }
.job-head .sub { color: var(--soft); }
.steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 6px; font-size: 0.95rem; }
.steps li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); align-items: baseline; color: var(--soft); }
.steps li::before { content: "○"; font-family: var(--mono); }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "●"; color: var(--ok); }
.steps li.now { color: var(--ink); font-weight: 650; }
.steps li.now::before { content: "◐"; color: var(--pencil); }
.notice { margin-top: 14px; padding: 12px 14px; border-radius: 4px; background: var(--card); border: 1px solid var(--rule); }
.notice.bad { background: var(--bad-bg); color: var(--bad-ink); border-color: transparent; font-weight: 600; }
.notice[hidden] { display: none; }

.frames { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 20px 0 8px; }
.frame { background: var(--strip); padding: 8px 8px 0; min-width: 0; }
.pick { display: block; cursor: pointer; position: relative; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shot { display: block; position: relative; aspect-ratio: 1; background: #26231f; overflow: hidden; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .ring { position: absolute; inset: 3%; width: 94%; height: 94%; pointer-events: none; }
.shot .ring path {
  fill: none;
  stroke: var(--pencil);
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 330;
  stroke-dashoffset: 330;
  transition: stroke-dashoffset 0.32s ease-out;
}
.pick input:checked ~ .shot .ring path { stroke-dashoffset: 0; }
.edge {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  color: var(--strip-ink);
  font: 600 11px/1.3 var(--mono);
  letter-spacing: 0.06em;
}
.edge .num { font-size: 15px; letter-spacing: 0.1em; }
.edge .line { color: #e9e2d3; font-family: var(--body); font-size: 0.95rem; font-weight: 600; letter-spacing: 0; }
.edge .state { border: 1.5px solid currentColor; border-radius: 999px; padding: 6px 10px; text-transform: uppercase; white-space: nowrap; }
.pick input:checked ~ .edge .state { background: var(--pencil); border-color: var(--pencil); color: #fff; }
.frame.paid .edge .state { background: var(--strip-ink); border-color: var(--strip-ink); color: var(--strip); }
.frame .under { background: var(--card); margin: 0 -8px; padding: 0 12px; border: 1px solid var(--rule); border-top: 0; }
.frame details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 0.92rem; font-weight: 600; }
.frame details p { white-space: pre-wrap; padding-bottom: 12px; font-size: 0.95rem; color: var(--soft); }
.frame .get {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0 0 12px;
  font-weight: 800;
  text-decoration: none;
  color: var(--go-ink);
  background: var(--go);
  border: 2px solid var(--ink);
  border-radius: 4px;
}
.frame .get[hidden] { display: none; }
.copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  margin: 0 0 12px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.copy[hidden] { display: none; }
.extra-text { white-space: pre-wrap; color: var(--soft); max-width: 44rem; padding: 8px 0 12px; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.frame.working .shot { display: grid; place-items: center; color: #8f877a; font: 600 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; text-align: center; }
.frame.working .shot::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / 0.07) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: develop 1.8s linear infinite;
}
@keyframes develop { from { background-position: 180% 0; } to { background-position: -40% 0; } }
.frame.fresh { animation: arrive 0.45s ease-out; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.bar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--strip);
  color: #f1ede4;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 2px solid var(--strip-ink);
}
.bar[hidden] { display: none; }
.bar .count { display: block; font-weight: 800; font-size: 1.05rem; }
.bar .hint { display: block; font-size: 0.85rem; color: #c9c1b2; }
.bar .go { width: auto; margin: 0; min-width: 9.5rem; }
.bar .all { background: none; border: 0; color: var(--strip-ink); font: inherit; font-size: 0.85rem; text-decoration: underline; padding: 0; min-height: 44px; cursor: pointer; text-align: left; }
.bar .all[hidden] { display: none; }

.lost { padding: 48px 0; }

@media (min-width: 560px) {
  .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proof-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .slate { padding: 20px; }
}
@media (min-width: 760px) {
  .hero { padding-top: 48px; }
  .slate form, .slate .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: end; }
  .slate .go { width: auto; margin-top: 0; min-height: 52px; }
  .claims { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
@media (min-width: 960px) {
  .frames { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
  .frames { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .frame.working .shot::before, .frame.fresh { animation: none; }
  .shot .ring path { transition: none; }
  .go:active:not(:disabled) { transform: none; }
}
