/* v1 "Time scrub". Tokens:
   ink #1E2622 text | paper #F5F6F2 page | muted #535C57 secondary text
   rule #D5D9D2 lines | tape #F2C230 button + handle only | ground #18201C hero panel */
:root {
  --ink: #1e2622;
  --paper: #f5f6f2;
  --white: #fff;
  --muted: #535c57;
  --rule: #d5d9d2;
  --tape: #f2c230;
  --tape-hover: #e3b21c;
  --ground: #18201c;
  --on-ground: #eef1ec;
  --on-ground-muted: #c3cbc5;
  --err: #a3311a;
  --err-on-ground: #ffb8a6;

  --f: "Schibsted Grotesk", system-ui, sans-serif;
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-lg: 1.25rem;
  --t-h3: 1.1875rem;
  --t-h2: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem);
  --t-h1: clamp(2.25rem, 1.3rem + 3.6vw, 4.25rem);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r: 4px;
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1120px;
  /* Left edge of .wrap content, so hero text and page body share one column line. */
  --edge: max(var(--gutter), calc((100vw - var(--maxw)) / 2 + var(--gutter)));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-base)/1.55 var(--f);
  overflow-x: hidden;
}
::selection { background: var(--tape); color: var(--ink); }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p, ul, ol, dl, dd { margin: 0; }
p, li, dd { text-wrap: pretty; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--ground);
  color: var(--on-ground);
  height: clamp(640px, 100svh, 880px);
  display: grid;
  overflow: hidden;
}
@property --pos { syntax: "<percentage>"; inherits: true; initial-value: 68%; }
@keyframes sweep { from { --pos: 94%; } }
.compare.intro-sweep { animation: sweep 1.8s cubic-bezier(.16, 1, .3, 1) .3s backwards; }
@media (prefers-reduced-motion: reduce) { .compare.intro-sweep { animation: none; } }
.compare {
  position: absolute;
  inset: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.shot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  pointer-events: none;
  -webkit-user-drag: none;
}
.after { clip-path: inset(0 0 0 var(--pos)); }
.divider {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  margin-left: -1px;
  background: var(--tape);
  box-shadow: 0 0 0 1px rgb(24 32 28 / 0.35);
  pointer-events: none;
  z-index: 2;
}
.handle {
  position: absolute;
  left: var(--pos);
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: var(--s2);
  border-radius: 999px;
  outline: none;
  z-index: 3;
}
.knob {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--tape);
  color: var(--ink);
  box-shadow: 0 2px 4px rgb(0 0 0 / 0.25), 0 8px 24px rgb(0 0 0 / 0.3);
  transition: transform 160ms cubic-bezier(.16, 1, .3, 1);
}
.compare:hover .knob, .is-dragging .knob { transform: scale(1.08); }
.handle:focus-visible .knob { outline: 3px solid var(--white); outline-offset: 3px; }
.tag { font-variant-numeric: tabular-nums; }
.tag {
  font-weight: 700;
  font-size: var(--t-sm);
  letter-spacing: 0.01em;
  padding: 3px 10px;
  border-radius: var(--r);
  background: rgb(24 32 28 / 0.82);
  color: var(--white);
  white-space: nowrap;
}
.credit {
  position: absolute;
  left: var(--edge);
  bottom: var(--s5);
  z-index: 2; /* above the text panel's gradient */
  font-size: var(--t-sm);
  color: var(--on-ground);
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.6);
  pointer-events: none;
  white-space: nowrap;
}

.panel {
  position: relative;
  z-index: 1;
  align-self: stretch;
  width: calc(var(--edge) + clamp(440px, 40vw, 540px));
  padding: var(--s6) var(--s7) var(--s8) var(--edge);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(90deg, rgb(20 27 24 / 0.8) 0%, rgb(20 27 24 / 0.74) 55%, rgb(20 27 24 / 0) 100%);
  pointer-events: none;
}
.panel > * { pointer-events: auto; }
.brand {
  position: absolute;
  top: var(--s6);
  left: var(--edge);
  font-weight: 800;
  font-size: var(--t-lg);
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--white);
}
.panel h1 {
  font-size: var(--t-h1);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 11ch;
  color: var(--white);
}
.lede {
  margin-top: var(--s5);
  font-size: var(--t-lg);
  line-height: 1.5;
  color: var(--on-ground);
  max-width: 34ch;
}
form.search {
  margin-top: var(--s6);
  display: flex;
  gap: var(--s2);
  max-width: 520px;
}
form.search input {
  flex: 1; min-width: 0;
  height: 56px;
  padding: 0 var(--s4);
  font: 500 var(--t-base) var(--f);
  color: var(--ink);
  background: var(--white);
  border: 0;
  border-radius: var(--r);
  caret-color: var(--ink);
}
form.search input::placeholder { color: #66706a; }
form.search input:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }
button {
  font: 700 var(--t-base) var(--f);
  height: 56px;
  padding: 0 var(--s5);
  border: 0;
  border-radius: var(--r);
  background: var(--tape);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease-out;
}
button:hover { background: var(--tape-hover); }
button[disabled] { cursor: progress; background: #d9c37e; color: #3a3f3b; }
form.search[data-checked="1"] button { background: transparent; color: var(--white); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 0.7); }
form.search[data-checked="1"] button:hover { background: rgb(255 255 255 / 0.1); }
.hero button:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
.hint { margin-top: var(--s3); font-size: var(--t-sm); color: var(--on-ground-muted); }
.err { margin-top: var(--s4); font-weight: 600; color: var(--err-on-ground); max-width: 46ch; }

/* ---------- Result ---------- */
.results:has(#result[hidden]) { display: none; }
.results { background: var(--white); border-bottom: 1px solid var(--rule); }
.result { padding-top: 96px; padding-bottom: 96px; scroll-margin-top: var(--s4); }
#matched { font-size: var(--t-h2); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; max-width: 24ch; }
.where { margin-top: var(--s2); font-weight: 600; color: var(--ink); }
.count { margin-top: var(--s3); font-size: var(--t-lg); color: var(--muted); max-width: 60ch; }
.result-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: var(--s7); align-items: start; }
.result-grid:has(.scrub[hidden]) { grid-template-columns: 1fr; }
.result-grid:has(.scrub:not([hidden])) .frames { display: none; }
.scrub[hidden] { display: none; }
.frame { position: relative; }
.frame img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--rule); border-radius: 2px; }
.frame-label { position: absolute; left: var(--s3); top: var(--s3); padding: 3px 10px; border-radius: var(--r); background: rgb(24 32 28 / 0.82); color: var(--white); font-weight: 700; }
/* Axis and slider share a 26 px inset so the 26 px thumb never overhangs the photo edge. */
.axis { position: relative; height: 44px; margin: var(--s4) 26px 0; border-top: 2px solid var(--ink); }
.tick { position: absolute; top: -2px; width: 1px; height: 7px; background: var(--rule); transform: translateX(-0.5px); font-size: 0; }
.tick.flown { height: 12px; width: 2px; background: var(--ink); font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tick.flown::after { content: attr(data-y); position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-size: 0.75rem; }
.tick.flown::after { color: var(--muted); }
.tick.on { background: var(--tape); width: 4px; height: 14px; }
.tick.on::after { color: var(--ink); font-weight: 800; }
/* 44 px tall hit area; its centre sits on the axis line (axis 44 px + 2 px border above). */
#scrub-range { display: block; width: calc(100% - 26px); margin: -66px 13px 0; height: 44px; background: transparent; position: relative; z-index: 1; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
#scrub-range::-webkit-slider-runnable-track { height: 44px; background: transparent; }
#scrub-range::-moz-range-track { height: 44px; background: transparent; }
#scrub-range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: 9px; border-radius: 50%; background: var(--tape); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
#scrub-range::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: var(--tape); box-shadow: 0 1px 3px rgb(0 0 0 / 0.35); }
#scrub-range:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.axis-note { margin-top: var(--s4); font-size: var(--t-sm); color: var(--muted); }
.frames {
  margin: var(--s6) 0 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: var(--s4) var(--s3);
}
.frames:empty { display: none; }
.frames img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: var(--rule); }
.frames .yr { display: block; margin-top: var(--s2); font-weight: 700; font-variant-numeric: tabular-nums; }
.frames .res { display: block; font-size: var(--t-sm); color: var(--muted); }
.buy { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--rule); }
.buy[hidden] { display: none; }
.buy button { height: 60px; padding: 0 var(--s6); font-size: var(--t-lg); }
.terms { margin-top: var(--s3); font-size: var(--t-sm); color: var(--muted); max-width: 44ch; }
.buy ul { margin-top: var(--s5); padding-left: 1.1em; color: var(--muted); max-width: 52ch; }
.buy li + li { margin-top: var(--s2); }

/* ---------- Sections ---------- */
.block { padding: 96px 0; border-top: 1px solid var(--rule); }
.results + .block { border-top: 0; }
.block h2 { font-size: var(--t-h2); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.block h3 { font-size: var(--t-h3); font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.intro { margin-top: var(--s4); color: var(--muted); font-size: var(--t-lg); max-width: 56ch; }

.block-white { background: var(--white); }
.shot-wrap { position: relative; }
.shot-wrap .chip { position: absolute; left: var(--s3); top: var(--s3); padding: 2px 8px; border-radius: var(--r); background: rgb(24 32 28 / 0.82); color: var(--white); font-size: var(--t-sm); font-weight: 600; }
.sample-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s5) var(--s7); align-items: start; }
.sample-head .intro { margin-top: 0; }
.report { margin: var(--s7) 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); }
.report img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; background: var(--rule); }
.report .date { margin-top: var(--s4); font-weight: 800; font-size: var(--t-h3); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.report .note { margin-top: var(--s2); color: var(--muted); max-width: 40ch; }
.report .is-change .note { color: var(--ink); }
.report .is-change .date::after { content: "Change"; display: inline-block; margin-left: var(--s3); padding: 1px 8px; vertical-align: 2px; font-size: var(--t-sm); font-weight: 700; letter-spacing: 0; background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); border-radius: var(--r); }
.report-foot { margin-top: var(--s5); font-size: var(--t-sm); color: var(--muted); max-width: 70ch; }

.limits {
  margin-top: var(--s7);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s7);
}
.limits h3 { padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); }
.limits ul { margin-top: var(--s4); padding-left: 1.1em; max-width: 46ch; }
.limits li + li { margin-top: var(--s3); }
.limits li::marker { color: var(--muted); }

.faq { margin-top: var(--s6); max-width: 760px; }
.faq > div { padding: var(--s5) 0; border-top: 1px solid var(--rule); }
.faq > div:last-child { border-bottom: 1px solid var(--rule); }
.faq dt { font-weight: 700; font-size: var(--t-h3); }
.faq dd { margin-top: var(--s2); color: var(--muted); max-width: 64ch; }

footer { padding: var(--s6) 0 var(--s7); font-size: var(--t-sm); color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4); }
footer nav { display: flex; gap: var(--s5); }
footer a { padding: var(--s2) 0; }

/* ---------- Narrow ---------- */
@media (max-width: 900px) {
  .hero { display: block; height: auto; }
  .compare { position: relative; inset: auto; aspect-ratio: 1 / 1; max-height: 70svh; width: 100%; }
  .handle { top: 50%; }
  .knob { width: 48px; height: 48px; }
  .credit { bottom: var(--s3); left: var(--s3); font-size: 0.8125rem; max-width: 58%; color: var(--white); padding: 4px 10px; border-radius: var(--r); background: rgb(24 32 28 / 0.78); }
  .brand { position: absolute; top: var(--s4); left: var(--gutter); z-index: 2; padding: 4px 10px; margin-left: -10px; border-radius: var(--r); background: rgb(24 32 28 / 0.78); font-size: 1.0625rem; }
  .panel { position: static; width: auto; background: var(--ground); padding: var(--s6) var(--gutter) var(--s7); }
  .panel .brand { position: absolute; }
  .panel h1 { max-width: 14ch; }
  .sample-head, .result-grid { grid-template-columns: 1fr; }
  /* On one column, read the answer first, then the photo, then the buy box. */
  .result-grid { gap: 0; }
  .result-text { display: contents; }
  .result-text > * { order: 1; }
  .scrub { order: 2; margin-top: var(--s5); }
  .result-text > .buy { order: 3; }
  .report { grid-template-columns: 1fr 1fr; }
  .report li:first-child { display: none; }
  .limits { grid-template-columns: 1fr; gap: var(--s6); }
  .block { padding: var(--s8) 0 var(--s7); }
}
@media (max-width: 560px) {
  form.search { flex-direction: column; }
  form.search input { flex: none; width: 100%; }
  form.search button, .buy button { width: 100%; }
  .frames { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .report { grid-template-columns: 1fr; }
  .report li:first-child { display: block; }
  .lede, .count, .intro { font-size: var(--t-base); }
  .tick.flown::after { content: none; }
  .tick.flown.alt::after { content: attr(data-short); }
  .tick.flown:first-child::after, .tick.flown:last-child::after { content: attr(data-y); }
  .axis { margin-top: 40px; }
  .tick.on::after { content: attr(data-y); top: auto; bottom: 24px; padding: 1px 6px; border-radius: var(--r); background: var(--ink); color: var(--white); }
  .block, .result { padding-top: 72px; padding-bottom: 72px; }
  .result { padding-top: var(--s7); padding-bottom: var(--s7); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 560px) { .wide-only { display: none; } }
