/* =============================================================================
   hyyryn-doorstep.css                                           21 Sep 2026
   The doorstep confirmation. A popup, at Sir's word, that opens over whatever
   page the homeowner's email or text lands on and asks one question about one
   photograph: is this what you can see?

   Prefix dst-. Every colour is a token; the fallback after each var() is the
   token's own value from tokens.css, so the popup reads the same on a page
   that has not declared the full set.

   Framing, by ruling 21: a job photographed is EVIDENCE, 3:2, square corners,
   no crop applied. The card around it takes the 14px card corner and sh-3,
   because it is an overlay.
============================================================================= */

.dst-scrim {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(10,22,40,.46);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: clamp(12px, 4vh, 48px) clamp(10px, 3vw, 40px);
  overflow-y: auto; overscroll-behavior: contain;
}
.dst-scrim[hidden] { display: none; }

.dst {
  position: relative; width: 100%; max-width: 980px; margin: auto 0;
  background: #fff; color: var(--ink, #1B2638);
  border-radius: 14px;
  box-shadow: var(--sh-3, 0 2px 4px rgba(10,22,40,.07), 0 12px 26px -10px rgba(10,22,40,.20), 0 38px 76px -34px rgba(10,22,40,.46));
  padding: clamp(20px, 3vw, 38px);
  animation: dstIn 300ms var(--stone, cubic-bezier(.16,1,.3,1)) both;
}
@keyframes dstIn { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }

.dst-x {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--cream, #FAF8F3);
  transition: background 160ms var(--ease, cubic-bezier(.25,.1,.25,1));
}
.dst-x:hover, .dst-x:focus-visible { background: var(--cream-3, #EFE8D4); }
.dst-x svg { width: 15px; height: 15px; stroke: var(--navy, #0A1628); fill: none; stroke-width: 1.8; }

.dst-k {
  display: block; margin: 0 0 9px;
  font: 500 9.5px/1.3 var(--sans, 'Inter', sans-serif);
  letter-spacing: .17em; text-transform: uppercase; color: var(--muted, #636976);
}
.dst-t {
  margin: 0 48px 6px 0;
  font-family: var(--serif-display, 'Libre Caslon Display', Georgia, serif);
  font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08;
  color: var(--navy, #0A1628);
}
.dst-lead {
  margin: 0 0 22px; max-width: 62ch;
  font: 400 15px/1.6 var(--serif, 'Libre Caslon Text', Georgia, serif);
  color: var(--ink, #1B2638);
}

/* ---- the pair. The one idea: the photograph you are judging sits beside the
   one you already agreed, so an after that is really a before is visible the
   moment the popup opens, before anybody has to argue about it. ---- */
.dst-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(12px, 1.6vw, 22px); align-items: start; }
.dst-pair.is-single { grid-template-columns: minmax(0, 1fr); }
.dst-fig { margin: 0; min-width: 0; }
.dst-ph {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  background: var(--cream-2, #F3EFE4);
  border-radius: 0;
}
.dst-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.dst-ph-none {
  display: grid; place-items: center; height: 100%; padding: 16px; text-align: center;
  font: 400 14px/1.5 var(--serif, Georgia, serif); color: var(--muted, #636976);
}
.dst-cap { display: flex; justify-content: space-between; gap: 12px; margin-top: 9px; }
.dst-cap b {
  font: 500 9.5px/1.3 var(--sans, 'Inter', sans-serif); letter-spacing: .17em;
  text-transform: uppercase; color: var(--navy, #0A1628);
}
.dst-cap span { font: 400 12.5px/1.4 var(--sans, 'Inter', sans-serif); color: var(--muted, #636976); text-align: right; }
.dst-fig.is-agreed .dst-cap b { color: var(--green, #0F5A4F); }

/* the doorstep window. A hairline under the photograph that shortens as the
   thirty minutes run out. It is a fact with a length, not a warning. */
.dst-win { margin-top: 12px; }
.dst-win-bar { height: 2px; background: var(--line, #E6E0D0); position: relative; overflow: hidden; }
.dst-win-bar i {
  position: absolute; inset: 0 auto 0 0; width: var(--dst-left, 100%);
  background: var(--navy, #0A1628); transition: width 1000ms linear;
}
.dst-win p { margin: 7px 0 0; font: 400 12.5px/1.45 var(--sans, 'Inter', sans-serif); color: var(--ink, #1B2638); }
.dst-seal { margin: 6px 0 0; font: 400 12px/1.45 var(--sans, 'Inter', sans-serif); color: var(--muted, #636976); overflow-wrap: anywhere; }

/* ---- actions ---- */
.dst-act { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.dst-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 28px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--navy, #0A1628); color: var(--cream, #FAF8F3);
  font: 500 10.5px/1 var(--sans, 'Inter', sans-serif); letter-spacing: .2em; text-transform: uppercase;
  transition: background 180ms var(--ease, cubic-bezier(.25,.1,.25,1));
}
.dst-btn:hover, .dst-btn:focus-visible { background: var(--navy-2, #152238); }
.dst-btn:disabled { background: var(--cream-3, #EFE8D4); color: var(--muted, #636976); cursor: not-allowed; box-shadow: inset 0 0 0 1px var(--line-2, #D8CFB8); }
.dst-quiet {
  background: none; border: 0; padding: 0 0 3px; cursor: pointer;
  font: 500 10px/1.3 var(--sans, 'Inter', sans-serif); letter-spacing: .15em; text-transform: uppercase;
  color: var(--navy, #0A1628); border-bottom: 1px solid var(--line-2, #D8CFB8);
}
.dst-quiet:hover, .dst-quiet:focus-visible { border-bottom-color: var(--navy, #0A1628); }

/* ---- the contest. It asks for a photograph first, because the server will
   refuse a contest without one, and a page that let you type a reason and
   then said no would be wasting the one minute that matters. ---- */
.dst-con { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line, #E6E0D0); }
.dst-con[hidden] { display: none; }
.dst-con h3 {
  margin: 0 0 6px; font-family: var(--serif-display, Georgia, serif); font-weight: 400;
  font-size: 26px; line-height: 1.15; color: var(--navy, #0A1628);
}
.dst-con > p { margin: 0 0 16px; max-width: 62ch; font: 400 15px/1.6 var(--serif, Georgia, serif); }
.dst-shot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(12px, 1.6vw, 22px); align-items: start; }
.dst-take {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  aspect-ratio: 3 / 2; cursor: pointer; text-align: center; padding: 14px;
  background: var(--cream, #FAF8F3); box-shadow: inset 0 0 0 1px var(--line-2, #D8CFB8);
  transition: background 180ms var(--ease, cubic-bezier(.25,.1,.25,1));
}
.dst-take:hover, .dst-take:focus-within { background: var(--cream-2, #F3EFE4); }
.dst-take svg { width: 26px; height: 26px; stroke: var(--navy, #0A1628); fill: none; stroke-width: 1.5; }
.dst-take b { font: 500 10px/1.3 var(--sans, 'Inter', sans-serif); letter-spacing: .15em; text-transform: uppercase; color: var(--navy, #0A1628); }
.dst-take span { font: 400 12.5px/1.4 var(--sans, 'Inter', sans-serif); color: var(--muted, #636976); }
.dst-take input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dst-take.has-shot { padding: 0; background: var(--cream-2, #F3EFE4); }
.dst-take.has-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dst-field label { display: block; margin: 0 0 9px; font: 500 9.5px/1.3 var(--sans, 'Inter', sans-serif); letter-spacing: .17em; text-transform: uppercase; color: var(--muted, #636976); }
.dst-field textarea {
  width: 100%; min-height: 104px; resize: vertical; box-sizing: border-box;
  border: 0; border-bottom: 1px solid var(--line-2, #D8CFB8); border-radius: 0; background: transparent;
  padding: 6px 0 10px; font: 400 15px/1.6 var(--serif, Georgia, serif); color: var(--ink, #1B2638);
}
.dst-field textarea:focus { outline: none; border-bottom-color: var(--navy, #0A1628); }

/* ---- the answered state. What an old link shows: no controls, one line of
   fact, the time it happened. Colour by meaning: green is a thing checked,
   the stop code is a thing refused. ---- */
.dst-done { display: flex; gap: 12px; align-items: flex-start; margin-top: 24px; padding: 16px 18px; border-left: 3px solid var(--green, #0F5A4F); background: var(--code-money-bg, rgba(15,90,79,.075)); }
.dst-done.is-contested { border-left-color: var(--danger, #A94442); background: var(--code-stop-bg, rgba(169,68,66,.075)); }
.dst-done.is-auto { border-left-color: var(--gold, #83632C); background: var(--code-wait-bg, rgba(131,99,44,.085)); }
.dst-done svg { flex: none; width: 20px; height: 20px; margin-top: 2px; stroke: var(--green, #0F5A4F); fill: none; stroke-width: 2; }
.dst-done.is-contested svg { stroke: var(--danger-ink, #7A3230); }
.dst-done.is-auto svg { stroke: var(--gold-ink, #5D4620); }
.dst-done p { margin: 0; font: 400 15px/1.55 var(--serif, Georgia, serif); color: var(--ink, #1B2638); }
.dst-done p b { font-weight: 700; }

.dst-say { margin: 14px 0 0; min-height: 1em; font: 400 13px/1.5 var(--sans, 'Inter', sans-serif); color: var(--danger-ink, #7A3230); }
.dst-say:empty { margin: 0; }
.dst-note { margin: 18px 0 0; font: 400 12.5px/1.5 var(--sans, 'Inter', sans-serif); color: var(--muted, #636976); }

.dst-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 720px) {
  .dst-pair, .dst-shot { grid-template-columns: minmax(0, 1fr); }
  /* on a phone the photograph being judged goes first; the agreed one follows
     as the reference, smaller, so the thumb reaches the answer sooner */
  .dst-pair .dst-fig.is-now { order: -1; }
  .dst-act .dst-btn { width: 100%; }
  .dst-act { justify-content: center; }
}

/* reduced motion: the card's visible state is produced by an animation, so
   its final state is declared, not merely the animation removed (ruling 23) */
@media (prefers-reduced-motion: reduce) {
  .dst { animation: none; opacity: 1; translate: 0 0; }
  .dst-win-bar i, .dst-btn, .dst-x, .dst-take { transition: none; }
}

/* ---- pass 2, from the first render, 21 Sep 2026 ---- */
/* focus is moved to the dialog so a screen reader starts at its title; the
   ring that drew round the whole card was that, not a design */
.dst:focus { outline: none; }
/* a title with no lead under it still needs air before the photographs */
.dst-t + .dst-pair { margin-top: 22px; }
@media (max-width: 720px) {
  /* the agreed photograph is the reference, not the question: smaller */
  .dst-pair .dst-fig.is-agreed { width: 62%; }
  /* and the answer stays under the thumb while the photographs scroll */
  .dst > .dst-act {
    position: sticky; bottom: calc(-1 * clamp(20px, 3vw, 38px)); z-index: 2;
    margin: 22px calc(-1 * clamp(20px, 3vw, 38px)) 0;
    padding: 14px clamp(20px, 3vw, 38px) 16px; background: #fff;
    box-shadow: 0 -1px 0 var(--line, #E6E0D0), 0 -12px 20px -16px rgba(10,22,40,.30);
  }
}
/* sentences are set in the reading face; only labels and controls are sans.
   The first render measured 17% serif, which is a dashboard, not a letter. */
.dst-win p, .dst-seal, .dst-note, .dst-cap span, .dst-take span { font-family: var(--serif, 'Libre Caslon Text', Georgia, serif); font-size: 13.5px; }

/* ══ THE ANSWER IN VIEW ═════════════════════════════════════════ 1 Oct 2026 ══
   On a 1366 by 860 screen a single starting photograph at 3:2 filled the
   popup and "Yes, this is what I see" sat below the fold: she could see the
   question and not the answer. The photograph is held to under half the
   screen's height, so both fit. */
.dst-pair.is-single .dst-ph { max-height: 44vh; aspect-ratio: auto; height: min(44vh, calc((min(100vw, 900px) - 64px) * 2 / 3)); }
@media (max-width: 600px) { .dst-pair.is-single .dst-ph { max-height: 38vh; } }

/* 1 Oct 2026: on a phone the close button cut the line above the title */
.dst-k { padding-right: 48px; }

/* ---- rp72, 6 Oct 2026: her own photograph, as a step once his is agreed.
   The contest's construction (a rule above, the reading face, one primary),
   quieter: it is an offer, not a question. ---- */
.dst-own { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line, #E6E0D0); }
.dst-own h3 { margin: 0 0 6px; font-family: var(--serif-display, Georgia, serif); font-weight: 400; font-size: 22px; line-height: 1.2; color: var(--navy, #0A1628); }
.dst-own > p { margin: 0; max-width: 62ch; font: 400 15px/1.6 var(--serif, Georgia, serif); color: var(--ink, #1B2638); }
.dst-own > p b { font-weight: 700; }
.dst-own .dst-act { margin-top: 16px; }
.dst-own-take { position: relative; }
.dst-own-take input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dst-own-take:focus-within { outline: 2px solid var(--navy, #0A1628); outline-offset: 3px; }
.dst-own .dst-say { margin: 10px 0 0; font: 400 13.5px/1.5 var(--serif, Georgia, serif); color: var(--muted, #636976); }
.dst-own.is-done { padding-top: 16px; }
