/* Clean, a sealed HexSight page. Fonts come from this site (the sealed rules block font services).
   Night look: near-black with one electric yellow. */
@font-face { font-family: "Archivo"; src: url(/private/fonts/archivo.woff2) format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Martian Mono"; src: url(/private/fonts/martian-mono.woff2) format("woff2"); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url(/private/fonts/schibsted-grotesk.woff2) format("woff2"); font-weight: 400 900; font-display: swap; }

:root {
  --bg: #111114; --surface: #1a1a1f; --raised: #24242b; --sunk: #0b0b0d; --line: #30303a;
  --ink: #f8f6ef; --soft: #c2bfb5; --dim: #96938b;
  --y: #f2e205; --on-y: #141417; --good: #4cd884; --bad: #ff6b6b;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --pane-h: calc(100vh - 314px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 85% -10%, #2a2812 0%, transparent 60%), var(--bg);
  color: var(--ink); font: 16px/1.5 var(--body); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-stretch: 90%; }
[tabindex="-1"]:focus { outline: none; }

/* ---- top bar ---- */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px clamp(16px, 4vw, 40px); }
.mark svg { width: 26px; height: 26px; display: block; color: var(--ink); }
.brand { font: 600 15px/1 var(--display); font-stretch: 112%; letter-spacing: .01em; }
.brand b { color: var(--y); font-weight: 800; }
.seal {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  font: 500 12px/1.2 var(--mono); color: var(--soft);
}
.seal i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.seal[data-state="sealed"] i { background: var(--good); box-shadow: 0 0 10px var(--good); }
.seal[data-state="open"] { border-color: var(--bad); color: var(--bad); }
.seal[data-state="open"] i { background: var(--bad); }

/* ---- logo link and the shared tools row (this block is the same in lookback.css and clean.css, and a test keeps them equal) ---- */
.home { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: inherit; text-decoration: none; }
.home:focus-visible, .tools-row a:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
.tools-row { max-width: 1280px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 16px; }
.tools-row nav { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); }
.tools-row a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 14px 0 0; color: var(--soft); font: 600 14px/1.2 var(--body); text-decoration: none; }
.tools-row a:hover { color: var(--ink); text-decoration: underline; }
.tools-row a[aria-current="page"] { color: var(--y); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ---- views ---- */
.stage { padding: 4px clamp(16px, 4vw, 40px) 32px; max-width: 1280px; margin: 0 auto; }
.stage > section { display: none; }
.stage[data-view="start"] .start,
.stage[data-view="reading"] .reading,
.stage[data-view="results"] .results,
.stage[data-view="oops"] .oops { display: grid; animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---- start ---- */
.start { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 36px); align-items: start; }
h1 { font: 800 clamp(32px, 5vw, 58px)/1 var(--display); font-stretch: 118%; letter-spacing: -.01em; margin: 14px 0 14px; text-wrap: balance; }
.lede { color: var(--soft); max-width: 48ch; margin: 0 0 20px; font-size: 17px; }

.slot { display: block; position: relative; border-radius: 14px; padding: 6px; cursor: pointer;
  background: linear-gradient(180deg, #2b2b33, #17171b); box-shadow: 0 1px 0 rgba(255,255,255,.07) inset, 0 18px 40px -18px #000; }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.well { display: grid; justify-items: center; gap: 6px; text-align: center; padding: clamp(22px, 4vw, 36px) 16px; border-radius: 10px; background: var(--sunk);
  box-shadow: inset 0 2px 10px #000, inset 0 0 0 1px #000, 0 0 0 0 var(--y); transition: box-shadow .25s ease, background .25s ease; }
.eye { width: 54px; height: 54px; color: var(--soft); transition: transform .3s ease, color .3s ease; }
.pupil { fill: var(--y); transition: transform .3s ease; transform-origin: 12px 12px; }
.slot-main { font: 700 21px/1.2 var(--display); font-stretch: 110%; }
.slot-sub { color: var(--dim); font-size: 14px; }
.pick { margin-top: 8px; padding: 9px 16px; border-radius: 8px; background: var(--y); color: var(--on-y); font-weight: 700; font-size: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 6px 14px -6px var(--y); }
.slot:hover .eye, .slot.over .eye { color: var(--ink); transform: scale(1.06); }
.slot.over .well { background: #16150a; box-shadow: inset 0 2px 10px #000, inset 0 0 0 1px var(--y), 0 0 0 6px rgba(242,226,5,.12); }
.slot.over .pupil { transform: scale(1.25); }
.slot:focus-within .well { box-shadow: inset 0 2px 10px #000, inset 0 0 0 2px var(--y); }
.reads { margin-top: 14px; color: var(--soft); font-size: 15px; font-weight: 600; }

.looks { padding: 20px; border-radius: 14px; background: linear-gradient(180deg, var(--raised), var(--surface));
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 50px -30px #000; border: 1px solid #2a2a31; display: grid; gap: 16px; margin-top: 14px; }
.looks h3 { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--soft); padding-top: 14px; border-top: 1px solid var(--line); }
.looks h2 { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--y); }
.kinds { display: grid; gap: 12px; }
.kinds dt { font: 700 16px/1.2 var(--display); font-stretch: 108%; }
.kinds dd { color: var(--soft); font-size: 14.5px; margin-top: 2px; }
.checks { display: grid; gap: 10px; margin-top: -4px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 14.5px; }
.checks b { font-weight: 700; }
.checks em { font-style: normal; color: var(--soft); }
.checks li > i { width: 22px; height: 22px; border-radius: 6px; margin-top: 1px; background: var(--sunk); box-shadow: inset 0 1px 3px #000; position: relative; }
.checks li > i::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--dim); transition: background .3s, box-shadow .3s; }
.checks li[data-ok="1"] > i::after { background: var(--good); box-shadow: 0 0 8px var(--good); }
.checks li[data-ok="0"] > i::after { background: var(--bad); box-shadow: 0 0 8px var(--bad); }
.checks li[data-ok="0"] em { color: var(--bad); }
.checks li[data-ok="note"] > i::after { background: transparent; box-shadow: inset 0 0 0 2px var(--dim); }

/* ---- reading ---- */
.reading { justify-items: center; text-align: center; gap: 18px; padding: clamp(40px, 12vh, 120px) 0; }
.reading h2 { font: 800 28px/1.1 var(--display); font-stretch: 115%; }
.sweep { width: min(360px, 80vw); height: 8px; border-radius: 4px; background: var(--sunk); box-shadow: inset 0 1px 3px #000; overflow: hidden; }
.sweep i { display: block; height: 100%; width: 35%; background: linear-gradient(90deg, #b8ab00, var(--y)); animation: sweep 1.1s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateX(0); } to { transform: translateX(185%); } }

/* ---- shared buttons ---- */
.ghost, .tool { padding: 9px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600;
  transition: border-color .2s, background .2s, transform .15s; }
.ghost:hover:not(:disabled), .tool:hover:not(:disabled) { border-color: #55555f; background: var(--raised); }
.ghost:active:not(:disabled), .tool:active:not(:disabled) { transform: translateY(1px); }
.ghost:focus-visible, .tool:focus-visible, #cv:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
button:disabled { opacity: .45; cursor: not-allowed; }

/* ---- results layout ---- */
.results { grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.main-col, .side-col { min-width: 0; display: grid; gap: 12px; align-content: start; }

.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.file-line { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1 1 160px; }
.fname { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; unicode-bidi: isolate; }
.fsize { color: var(--dim); font-size: 12px; white-space: nowrap; }
.headline { display: grid; gap: 6px; }
.headline h2 { display: flex; gap: 14px; align-items: center; font: 800 clamp(20px, 2.4vw, 26px)/1.1 var(--display); font-stretch: 115%; }
.big { flex: none; font-size: clamp(48px, 7vw, 76px); line-height: .9; font-weight: 700; letter-spacing: -.04em; color: var(--y); }
.lbl { min-width: 0; overflow-wrap: anywhere; }
.sub { margin-top: 4px; color: var(--soft); font-size: 14.5px; }

/* ---- the list of finds ---- */
.finds { display: grid; gap: 6px; }
.results[data-kind="photo"] .finds#finds, .results[data-kind="heic"] .finds#finds { max-height: max(220px, calc(100vh - 534px)); overflow: auto; padding-right: 2px; }
.finds li { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid #2a2a31; display: grid; gap: 2px;
  animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.f-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.f-top b { font-weight: 700; font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.tag { flex: none; font: 600 11px/1 var(--mono); padding: 5px 7px; border-radius: 6px; background: var(--y); color: var(--on-y); text-transform: uppercase; letter-spacing: .06em; }
.tag.done { background: #17301f; color: var(--good); }
.f-val { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; unicode-bidi: isolate; }
.f-why { color: var(--soft); font-size: 13.5px; line-height: 1.4; }
.note { color: var(--dim); font-size: 13.5px; }
.note:empty { display: none; }

/* ---- the save band ---- */
.save-band { border-radius: 16px; padding: 18px; color: var(--on-y); display: grid; gap: 10px;
  background: linear-gradient(135deg, var(--y) 0%, #e9d600 60%, #cdbd00 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 30px 60px -36px rgba(242,226,5,.6); }
.save { justify-self: stretch; padding: 15px 20px; border-radius: 10px; border: 0; background: var(--on-y); color: var(--y);
  font: 800 18px/1 var(--display); font-stretch: 108%; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 10px 24px -12px #000;
  transition: transform .15s ease, box-shadow .2s ease; }
.save:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 14px 28px -12px #000; }
.save:active:not(:disabled) { transform: translateY(1px); }
.save:focus-visible { outline: 3px solid var(--on-y); outline-offset: 3px; }
.save-msg { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.save-msg:empty { display: none; }
.fine { font-size: 13.5px; color: #38360c; }
.fine:empty { display: none; }

/* ---- photo editor ---- */
.editor { display: grid; gap: 10px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.count { margin-left: auto; color: var(--soft); font-size: 12px; }
.canvas-wrap { display: grid; place-items: center; padding: 10px; border-radius: 14px; background: var(--sunk);
  box-shadow: inset 0 2px 10px #000, inset 0 0 0 1px #1d1d22; min-height: 200px; }
#cv { display: block; max-width: 100%; max-height: var(--pane-h); width: auto; height: auto; border-radius: 6px;
  cursor: crosshair; background: #000;
  /* pinch-zoom lets the browser zoom with two fingers and nothing else. It does not allow one-finger
     panning, so a one-finger drag reaches the page script as pointer events and draws a box. When a
     second finger lands, the browser takes over the zoom and sends pointercancel, which drops the
     half-drawn box. */
  touch-action: pinch-zoom; }
.hint { color: var(--dim); font-size: 13.5px; }

/* ---- panels on the left ---- */
.panel { padding: 18px; border-radius: 14px; background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid #2a2a31; display: grid; gap: 10px; }
.panel h3, .needs h3 { font: 800 clamp(19px, 2.2vw, 24px)/1.15 var(--display); font-stretch: 110%; }
.panel p { color: var(--soft); font-size: 15px; }
.panel.yellow { background: linear-gradient(135deg, var(--y) 0%, #e9d600 60%, #cdbd00 100%); color: var(--on-y); border-color: transparent;
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 30px 60px -36px rgba(242,226,5,.6); }
.panel.yellow p { color: #2a2909; font-weight: 500; }
.slot2 { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 10px;
  background: var(--on-y); color: var(--ink); cursor: pointer; font-weight: 600; font-size: 14.5px; transition: transform .15s ease, box-shadow .2s ease; }
.slot2 b { padding: 8px 14px; border-radius: 8px; background: var(--y); color: var(--on-y); font-size: 14px; }
.slot2 input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.slot2.over { box-shadow: 0 0 0 3px var(--ink); }
.slot2:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }

.needs { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid #3a3714;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 24px 50px -34px #000; }
.needs-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chip { padding: 7px 11px; border-radius: 8px; background: var(--y); color: var(--on-y); font-weight: 700; font-size: 15px; }
.needs-sub { color: var(--soft); font-size: 14.5px; }
.needs-sub:empty { display: none; }
.finds.kept li { background: var(--raised); }

.warn { padding: 10px 12px; border-radius: 10px; background: #2a1414; border: 1px solid var(--bad); color: #ffd0d0; font-weight: 600; font-size: 14.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- error ---- */
.oops { justify-items: start; gap: 10px; padding: 40px 0; max-width: 580px; }
.oops h2 { font: 800 28px/1.1 var(--display); font-stretch: 115%; }
.oops p { color: var(--soft); margin: 0 0 8px; }

/* ---- phone ---- */
@media (max-width: 860px) {
  .start, .results { grid-template-columns: 1fr; }
  .looks { margin-top: 0; }
  #cv { max-height: 62vh; }
  .count { margin-left: 0; flex: 1 0 100%; }
  .results[data-kind="photo"] .finds#finds, .results[data-kind="heic"] .finds#finds { max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
  .seal { margin-left: 0; flex: 1 1 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
