/* Palette drawn from a US passport's interior security paper: engraved teal on
   pale guilloche green-grey, stamp red for failure. Georgia carries the
   document world; monospace carries anything that is a measurement. */
:root {
  --ink: #14202B;
  --ground: #E7EDEA;
  --panel: #F4F7F5;
  --rule: #C7D3CE;
  --muted: #61726F;
  --accent: #1F6F6A;
  --accent-soft: #D7E6E3;
  --fail: #A6402F;
  --fail-soft: #F0DCD7;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #E3EBE8;
    --ground: #0E171C;
    --panel: #16232A;
    --rule: #2A3B43;
    --muted: #90A5A1;
    --accent: #59B3AA;
    --accent-soft: #16332F;
    --fail: #E0806C;
    --fail-soft: #38211B;
  }
}
/* The page follows the phone's light/dark setting and offers no manual toggle,
   so there are deliberately no [data-theme] override blocks — there would be
   nothing to set the attribute. */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.75rem 1.15rem 3rem;
  min-height: 100svh;
}

.screen { display: none; }
.screen.is-active { display: flex; flex-direction: column; gap: 1.25rem; }

/* ---- setup ------------------------------------------------------------ */

header { display: flex; flex-direction: column; gap: .35rem; }

.eyebrow {
  font: 600 .7rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2 {
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }

.lede { margin: 0; font-size: 1.05rem; max-width: 30rem; }

.confirm {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}
.confirm li { border-bottom: 1px solid var(--rule); }
.confirm label {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem .15rem;
  cursor: pointer;
}
.confirm input {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--accent);
  flex: none;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
  border-left: 2px solid var(--accent);
  padding-left: .8rem;
}

.actions { display: flex; flex-direction: column; gap: .6rem; }

button {
  font: 600 1rem/1 system-ui, sans-serif;
  min-height: 48px;
  width: 100%;
  padding: .9rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 3px;
  background: var(--accent);
  color: var(--ground);
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(1.08); }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule);
}

/* ---- camera ----------------------------------------------------------- */

#camera.is-active {
  position: fixed;
  inset: 0;
  padding: 0;
  gap: 0;
  background: #05090B;
  z-index: 10;
}

#feed, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#feed { object-fit: cover; }
#overlay { pointer-events: none; }

.chips {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .3rem;
  padding: max(.8rem, env(safe-area-inset-top)) .6rem .6rem;
}
.chip {
  font: 600 .62rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .07em;
  text-transform: uppercase;
  text-align: center;
  padding: .5rem .15rem;
  border-radius: 2px;
  background: rgba(5, 9, 11, .6);
  color: #9FB0AD;
  border: 1px solid rgba(255, 255, 255, .14);
}
.chip.ok {
  background: var(--accent);
  color: #05090B;
  border-color: transparent;
}

.cue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(5.5rem, calc(env(safe-area-inset-bottom) + 5.5rem));
  margin: 0;
  padding: .9rem 1.1rem;
  text-align: center;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  font-weight: 600;
  color: #F2F6F5;
  background: rgba(5, 9, 11, .72);
  text-wrap: balance;
}

#cancel {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: max(1.25rem, calc(env(safe-area-inset-bottom) + 1rem));
  width: auto;
  background: transparent;
  color: #F2F6F5;
  border-color: rgba(255, 255, 255, .35);
}

/* ---- result ----------------------------------------------------------- */

#shot {
  width: 100%;
  max-width: 20rem;
  aspect-ratio: 1;
  object-fit: cover;
  align-self: center;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--panel);
}
[hidden] { display: none !important; }

.facts {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}
.facts td {
  padding: .6rem .15rem;
  border-bottom: 1px solid var(--rule);
}
.facts td:first-child { color: var(--muted); width: 40%; }
.facts td:last-child {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

/* Reduced motion is handled where the only motion actually lives: the capture
   ring is drawn on the overlay canvas, and app.js skips it entirely when the
   viewer has asked for less movement. There are no CSS animations to disable. */
