/* Lookback, a sealed HexSight page. Fonts are served 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: #b9b6ac; --dim: #7d7a72;
  --y: #f2e205; --on-y: #141417; --good: #4cd884; --bad: #ff5c5c;
  --display: "Archivo", "Arial Narrow", sans-serif;
  --body: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "Martian Mono", ui-monospace, monospace;
  --r: 10px;
}
* { 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; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-stretch: 90%; }

/* ---- 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: 8px clamp(16px, 4vw, 40px) 40px; max-width: 1180px; 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(34px, 5.4vw, 64px)/.98 var(--display); font-stretch: 118%; letter-spacing: -.01em;
  margin: 18px 0 14px; text-wrap: balance;
}
.lede { color: var(--soft); max-width: 46ch; margin: 0 0 22px; 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, 38px) 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 20px/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); }

.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.steps { margin: 0; color: var(--dim); font-size: 14px; flex: 1 1 260px; }
.steps b { color: var(--soft); font-weight: 600; }
.ghost { 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 { border-color: #4a4a55; background: var(--raised); }
.ghost:active { transform: translateY(1px); }
.ghost:focus-visible, .kind:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }

.proof { margin-top: 18px; 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; }
.proof h2 { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--y); margin: 0 0 14px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 15px; }
.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); }
[tabindex="-1"]:focus { outline: none; }
.offline-line { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--sunk); box-shadow: inset 0 1px 3px #000; font-size: 14px; color: var(--soft); }
.offline-line a { color: var(--y); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.offline-line a:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; border-radius: 2px; }
.limit { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13.5px; }
.limit b { color: var(--soft); }

/* ---- reading ---- */
.reading { justify-items: center; text-align: center; padding: clamp(30px, 8vh, 80px) 0; }
.sheets { position: relative; width: 150px; height: 112px; margin-bottom: 18px; }
.sheets i { position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(180deg, #2c2c34, #1b1b20); border: 1px solid #383842; }
.sheets i:nth-child(1) { transform: translate(-18px, 14px) rotate(-6deg); opacity: .5; }
.sheets i:nth-child(2) { transform: translate(-6px, 6px) rotate(-2deg); opacity: .75; }
.sheets i:nth-child(3) { transform: translate(8px, -2px) rotate(3deg); }
.sheets i:nth-child(4) { background: repeating-linear-gradient(180deg, transparent 0 12px, rgba(255,255,255,.06) 12px 14px), linear-gradient(180deg, #33333c, #22222a); animation: shuffle 1.1s ease-in-out infinite; }
.scanline { position: absolute; left: -10px; right: -10px; height: 2px; top: 0; background: var(--y); box-shadow: 0 0 14px 2px rgba(242,226,5,.7); animation: scan 1.1s ease-in-out infinite alternate; }
@keyframes scan { to { top: 100%; } }
@keyframes shuffle { 50% { transform: translateY(-4px); } }
.reading h2 { font: 800 28px/1.1 var(--display); font-stretch: 115%; margin: 0 0 8px; }
.meter { margin: 0 0 16px; color: var(--soft); font-size: 15px; }
.meter .num { color: var(--ink); }
.dim { color: var(--dim); }
.bar { width: min(420px, 90vw); height: 8px; border-radius: 4px; background: var(--sunk); box-shadow: inset 0 1px 3px #000; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b8ab00, var(--y)); transition: width .3s ease; }

/* ---- results ---- */
.results { gap: 16px; }
.band { border-radius: 16px; padding: clamp(18px, 3vw, 28px); color: var(--on-y);
  background: linear-gradient(135deg, var(--y) 0%, #e9d600 60%, #c9b900 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 30px 60px -36px rgba(242,226,5,.6); display: grid; gap: 18px; }
.headline { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.big { margin: 0; font-size: clamp(64px, 11vw, 120px); line-height: .85; font-weight: 700; letter-spacing: -.04em; }
.headline h2 { font: 800 clamp(22px, 3vw, 32px)/1.05 var(--display); font-stretch: 115%; margin: 0; }
.headline .sub { margin: 6px 0 0; font-size: 15px; color: #3a3810; }
.band.clean { background: linear-gradient(135deg, #2a2a31, #1d1d22); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.band.clean .sub { color: var(--soft); }
.band.clean .big { color: var(--good); }

.kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.kind { text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: rgba(20,20,23,.9); color: var(--ink);
  display: grid; gap: 6px; box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 8px 16px -10px rgba(0,0,0,.6); transition: transform .15s, background .2s; }
.kind:hover { transform: translateY(-1px); }
.kind[aria-pressed="true"] { background: #000; box-shadow: 0 0 0 2px var(--on-y), 0 1px 0 rgba(255,255,255,.08) inset; }
.kind .k-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 14px; font-weight: 600; }
.kind .num { font-size: 18px; color: var(--y); }
.kind .k-bar { height: 4px; border-radius: 2px; background: #2c2c33; overflow: hidden; }
.kind .k-bar i { display: block; height: 100%; background: var(--y); transform-origin: left; animation: grow .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.list-head h3 { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--soft); margin: 0; }
.tools { display: flex; gap: 8px; }
.chats { list-style: none; margin: 0; padding: 0; border-radius: 12px; background: var(--surface); border: 1px solid #26262d; overflow: hidden; }
.chats li { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid #24242b; }
.chats li:first-child { border-top: 0; }
.chats li[hidden] { display: none; }
.chats .day { font: 500 12px/1 var(--mono); color: var(--dim); }
.chats .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: filter .25s; }
.chats .title.hidden-title { font-weight: 500; font-style: italic; color: var(--dim); }
.hide-names .chats .title { filter: blur(7px); user-select: none; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag { font: 500 12px/1 var(--mono); padding: 6px 8px; border-radius: 6px; background: #2a2a12; color: var(--y); white-space: nowrap; }
.tag.soft { background: var(--raised); color: var(--soft); }
.worth { border-radius: 12px; }
.worth summary { cursor: pointer; color: var(--soft); font-size: 14px; padding: 6px 2px; }
.worth .chats { margin-top: 8px; }
.note { color: var(--dim); font-size: 13.5px; margin: 0; }

/* ---- fixes ---- */
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.block-head h3 { font: 700 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--soft); margin: 0; }
.block-head p { margin: 0; color: var(--dim); font-size: 14px; }
.fixes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.fix { border-radius: 14px; padding: 18px 18px 16px; display: grid; gap: 10px; align-content: start;
  background: linear-gradient(180deg, var(--raised), var(--surface)); border: 1px solid #2c2c34;
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 20px 40px -30px #000; transition: opacity .3s, transform .3s; }
.fix-top { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.fix h4 { margin: 0; font: 800 19px/1.15 var(--display); font-stretch: 110%; }
.fix .count { font: 600 12px/1 var(--mono); color: var(--on-y); background: var(--y); border-radius: 6px; padding: 6px 8px; white-space: nowrap; }
.fix .why { margin: 0; color: var(--soft); font-size: 14.5px; }
.fix ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.fix ol li { counter-increment: s; display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 14.5px; align-items: start; }
.fix ol li::before { content: counter(s); font: 600 12px/26px var(--mono); text-align: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--sunk); color: var(--y); box-shadow: inset 0 1px 3px #000; }
.fix .small { margin: 0; color: var(--dim); font-size: 13px; }
.done-btn { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--sunk); font-size: 13.5px; font-weight: 600; transition: background .2s, border-color .2s; }
.done-btn i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--dim); position: relative; transition: background .2s, border-color .2s; }
.done-btn[aria-pressed="true"] { border-color: #2f5e43; background: #13261b; color: var(--good); }
.done-btn[aria-pressed="true"] i { background: var(--good); border-color: var(--good); }
.done-btn[aria-pressed="true"] i::after { content: ""; position: absolute; left: 3.5px; top: 0; width: 4px; height: 8px; border: solid #0b0b0d; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.done-btn:focus-visible { outline: 2px solid var(--y); outline-offset: 2px; }
.fix.done { opacity: .55; }
.fix.done h4 { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--good); }
.cleanup .fix { background: var(--surface); }
.progress-line { display: flex; align-items: center; gap: 10px; color: var(--soft); font-size: 14px; }
.progress-line .track { width: 120px; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; box-shadow: inset 0 1px 2px #000; }
.progress-line .track i { display: block; height: 100%; width: 0; background: var(--good); transition: width .35s ease; }

/* ---- keep a record ---- */
.keep { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
.keep-card { border-radius: 14px; padding: 18px; background: var(--surface); border: 1px solid #26262d; display: grid; gap: 10px; align-content: start; }
.keep-card h4 { margin: 0; font: 800 19px/1.15 var(--display); font-stretch: 110%; }
.keep-card p { margin: 0; color: var(--soft); font-size: 14.5px; }
.keep-card .small { color: var(--dim); font-size: 13px; min-height: 1em; }
.keep-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; cursor: pointer; display: inline-flex; align-items: center; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--y); outline-offset: 2px; }
.compare { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.cmp { border-radius: 10px; background: var(--sunk); box-shadow: inset 0 1px 3px #000; padding: 12px; display: grid; gap: 4px; font-size: 13.5px; color: var(--soft); }
.cmp .num { font-size: 26px; color: var(--ink); line-height: 1; }
.cmp:first-child .num { color: var(--good); }
.cmp:nth-child(2) .num { color: var(--y); }
.compare p { grid-column: 1 / -1; font-size: 14px; }

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

/* ---- phone ---- */
@media (max-width: 820px) {
  .start { grid-template-columns: 1fr; }
  .keep { grid-template-columns: 1fr; }
  .proof { margin-top: 0; }
  .chats li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .chats li { grid-template-columns: minmax(0, 1fr); }
  .chats .day { grid-column: 1 / -1; }
  .tags { grid-column: 1 / -1; justify-content: flex-start; }
}
@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; }
}

.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; }
.file-btn[aria-disabled="true"], button:disabled { opacity: .45; cursor: not-allowed; }
