/* Shutter Count Checker (/shutter-count-checker).
   The page is an instrument: a counter window the count rolls into, odometer style, with the drop
   target built into the same card, all centred in one column. Every rule is under #sc (the page's
   <main>) except the @font-face blocks and .sc-offscreen, which the copy fallback appends to <body>.
   Loaded after app.css and public.css, so colours are their theme tokens; the counter window stays
   dark in both themes because it is a physical window, not a themed surface. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/geist-400.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/geist-600.woff2) format('woff2'); }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 700; font-display: swap; src: url(/static/fonts/geist-700.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url(/static/fonts/geist-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url(/static/fonts/geist-mono-500.woff2) format('woff2'); }

#sc {
  --sc-ok: #34d399;
  --sc-warn: #fbbf24;
  --sc-err: #f87171;
  --sc-win: #0b0b0d;
  --sc-digit: #f4f1ea;
  --sc-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sc-figures: 'Geist', system-ui, sans-serif;
  --sc-ease: cubic-bezier(.16, 1, .3, 1);
  display: block;
  overflow-x: clip;
  font-family: 'Geist', system-ui, -apple-system, "Segoe UI", sans-serif;
}
[data-theme="light"] #sc { --sc-ok: #047857; --sc-warn: #92400e; --sc-err: #b91c1c; }
#sc ::selection { background: rgba(var(--gold-rgb), .35); color: var(--text); }
#sc [hidden] { display: none !important; }
.pk-pub .sc-offscreen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── First viewport: one centred column. Title, then the instrument at full size, then the reassurance ── */
#sc .sc-top { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; max-width: var(--pk-max, 980px); box-sizing: border-box; margin: 0 auto; padding: 40px 24px 32px; }
#sc .sc-intro { max-width: 960px; }
#sc .sc-intro .pk-crumbs { margin-bottom: 16px; }
#sc .sc-intro h1 { margin: 0 0 16px; font-size: clamp(2.5rem, 6vw, 4.25rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.04;
  text-wrap: balance; color: var(--text); }
#sc .sc-lede { max-width: 58ch; margin: 0 auto; font-size: clamp(1.0625rem, 1.5vw, 1.1875rem); line-height: 1.6; color: var(--dim); }

/* The aperture drawn behind the instrument: crisp geometry, faded at its rim. It turns while a file is read. */
#sc .sc-iris { position: absolute; z-index: -1; top: calc(100% - 410px); left: 50%; width: min(1500px, 190vw); aspect-ratio: 1; transform: translate(-50%, -50%);
  fill: none; stroke: rgba(var(--gold-rgb), .22); stroke-width: 1; pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 96%); mask-image: radial-gradient(closest-side, #000 55%, transparent 96%); }
#sc .sc-iris circle { vector-effect: non-scaling-stroke; }
#sc .sc-iris .sc-iris-ticks { vector-effect: none; stroke: rgba(var(--gold-rgb), .4); stroke-width: 14; stroke-dasharray: 1.4 18.5; }
#sc .sc-iris-blades { transition: transform 1.6s var(--sc-ease); }
#sc .sc-top:has([data-state="ok"]) .sc-iris-blades { transform: rotate(30deg); }
#sc .sc-top:has(.is-reading) .sc-iris-blades { animation: sc-iris-turn 6s linear infinite; }
@keyframes sc-iris-turn { to { transform: rotate(360deg); } }

/* ── The instrument ── */
#sc .sc-inst { position: relative; width: 100%; max-width: 880px; min-width: 0; margin-top: 32px; overflow: hidden; text-align: left; border-radius: 28px;
  background: linear-gradient(180deg, var(--s2), var(--s1) 55%);
  box-shadow: 0 0 0 1px var(--border), inset 0 1px 0 rgba(255, 255, 255, .06), 0 56px 96px -48px rgba(0, 0, 0, .75), 0 18px 40px -24px rgba(0, 0, 0, .5);
  transition: box-shadow .25s var(--sc-ease); }
#sc .sc-inst.is-drag { box-shadow: 0 0 0 2px var(--gold), inset 0 1px 0 rgba(255, 255, 255, .06), 0 56px 96px -48px rgba(var(--gold-rgb), .5); }
#sc .sc-face { padding: 24px 32px 20px; }
#sc .sc-plate { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 15px; }
#sc .sc-plate::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border2); transition: background .3s; }
#sc .sc-inst[data-state="reading"] .sc-plate::before { background: var(--gold); animation: sc-led 1s ease-in-out infinite; }
#sc .sc-inst[data-state="ok"] .sc-plate::before { background: var(--sc-ok); }
#sc .sc-inst:is([data-state="none"], [data-state="noexif"], [data-state="err"]) .sc-plate::before { background: var(--sc-warn); }
@keyframes sc-led { 50% { opacity: .3; } }
#sc .sc-plate-model { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
#sc .sc-serial { margin-left: auto; white-space: nowrap; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--dim); }

/* The counter window: dark glass over number wheels in a raised bezel, shaded top and bottom like a drum. */
#sc .sc-window { position: relative; container-type: inline-size; display: flex; justify-content: center; margin: 8px; padding: 24px 16px; border-radius: 18px; background: var(--sc-win);
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .06), 0 0 0 8px var(--s3), 0 0 0 9px var(--border2); }
#sc .sc-window::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255, 255, 255, .07), transparent 38%); }
#sc .sc-window::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent 30%, transparent 70%, rgba(0, 0, 0, .6)); }
#sc .sc-counter { display: flex; font-family: var(--sc-figures); font-size: clamp(2.25rem, 15cqi, 8rem); font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--sc-digit); }
#sc .sc-cell { position: relative; width: .7em; height: 1.2em; margin: 0 2px; overflow: hidden; border-radius: 6px;
  background: linear-gradient(#1d1d22, #0e0e11 50%, #1d1d22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
#sc .sc-cell.sc-gap { margin-left: .26em; }
#sc .sc-cell.sc-lead { color: rgba(244, 241, 234, .28); }
#sc .sc-reel { display: flex; flex-direction: column; transform: translateY(calc(var(--n, 0) * -1.2em));
  transition: transform calc(900ms + var(--i, 0) * 110ms) var(--sc-ease); }
#sc .sc-reel > span { display: flex; align-items: center; justify-content: center; height: 1.2em; }
#sc .sc-still .sc-reel { transition: none; }
#sc .is-reading .sc-reel { animation: sc-spin calc(.42s + var(--i, 0) * .05s) linear infinite; filter: blur(.6px); }
@keyframes sc-spin { from { transform: translateY(0); } to { transform: translateY(-12em); } }
#sc .sc-inst:is([data-state="none"], [data-state="noexif"], [data-state="err"]) .sc-counter { color: rgba(244, 241, 234, .4); }

#sc .sc-caption { margin: 20px 0 0; text-align: center; font-size: 15px; color: var(--dim); }
#sc .sc-meter { max-width: 560px; margin: 24px auto 0; }
#sc .sc-meter-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--s3); }
#sc .sc-meter-fill { width: var(--fill, 0%); height: 100%; border-radius: inherit; background: var(--gold); transition: width 1.1s var(--sc-ease) .25s; }
#sc .sc-meter[data-band="over"] .sc-meter-fill { background: var(--sc-warn); }
#sc .sc-meter-label { margin: 12px 0 0; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); }

/* The drop target is the instrument's lower half: a large dashed field with one obvious button. */
#sc .sc-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 16px 16px; padding: 32px 32px 36px; text-align: center; cursor: pointer;
  border-radius: 20px; background: var(--s1); transition: background .2s var(--sc-ease); }
#sc .sc-drop::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; border: 2px dashed rgba(var(--gold-rgb), .5);
  transition: border-color .2s var(--sc-ease); }
#sc .sc-drop:hover, #sc .is-drag .sc-drop { background: var(--gold-bg); }
#sc .sc-drop:hover::before, #sc .is-drag .sc-drop::before { border-style: solid; border-color: var(--gold); }
#sc .sc-drop:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
#sc .sc-drop-icon { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 4px; border-radius: 50%; background: var(--gold-bg);
  box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), .45); }
#sc .sc-drop-icon svg { width: 32px; height: 32px; fill: none; stroke: var(--pk-link); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#sc .sc-inst[data-state="rest"] .sc-drop-icon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); opacity: 0;
  animation: sc-ping 2.8s var(--sc-ease) 1.2s infinite; }
@keyframes sc-ping { 0% { transform: scale(1); opacity: .6; } 70%, 100% { transform: scale(1.7); opacity: 0; } }
#sc .sc-dz-title { font-size: clamp(1.375rem, 2.6vw, 1.75rem); font-weight: 600; letter-spacing: -.015em; line-height: 1.2; color: var(--text); }
#sc .sc-pick { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 32px; border-radius: 14px; background: var(--gold);
  font-size: 16px; font-weight: 600; color: #000; box-shadow: 0 12px 28px -12px rgba(var(--gold-rgb), .8); transition: filter .15s var(--sc-ease), transform .15s var(--sc-ease); }
#sc .sc-drop:hover .sc-pick { filter: brightness(1.08); transform: translateY(-1px); }
#sc .sc-dz-hint { max-width: 52ch; margin-top: 4px; font-size: 14px; line-height: 1.55; color: var(--dim); }

/* Reassurance under the instrument */
#sc .sc-assure { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 32px; }
#sc .sc-brands { max-width: 72ch; margin: 0; font-size: 14px; line-height: 1.6; color: var(--dim); }
#sc .sc-brands strong { font-weight: 600; color: var(--text); }
#sc .sc-private { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--dim); }
#sc .sc-private svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--pk-link); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Results ── */
#sc .sc-out { width: 100%; max-width: 928px; box-sizing: border-box; margin: 0 auto; padding: 0 24px; }
#sc .sc-results-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 16px; }
#sc .sc-card { margin: 0; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--s1); }
#sc .sc-card h2 { margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; color: var(--text); }
/* The heading takes focus only so a screen reader lands on the result; it is not a control. */
#sc .sc-card h2:focus, #sc .sc-card h2:focus-visible { outline: none; }
#sc .sc-kind-err h2 { color: var(--sc-err); }
#sc .sc-reading { margin: 0 0 16px; font-size: 15px; color: var(--dim); }
#sc .sc-reading-num { margin-right: 4px; font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
#sc .sc-reading-none { font-weight: 600; color: var(--sc-warn); }
#sc .sc-sub, #sc .sc-rating { max-width: 62ch; margin: 0 0 12px; font-size: 15px; line-height: 1.6; color: var(--dim); }
#sc .sc-sub strong, #sc .sc-rating strong { font-weight: 600; color: var(--text); }
#sc .sc-band-early strong { color: var(--sc-ok); }
#sc .sc-band-over strong { color: var(--sc-warn); }
#sc .sc-note { max-width: 62ch; margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--dim); }
#sc .sc-card a { color: var(--pk-link); text-decoration: underline; text-decoration-color: rgba(var(--gold-rgb), .45); text-underline-offset: 3px; }
#sc .sc-tip { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--s2); font-size: 13px; line-height: 1.55; color: var(--dim); }
#sc .sc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
#sc .sc-btn { min-height: 44px; padding: 0 16px; border: 1px solid var(--border2); border-radius: 10px; background: transparent; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--text); transition: background .15s var(--sc-ease); }
#sc .sc-btn:hover { background: var(--s2); }
#sc .sc-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#sc .sc-btn-primary { border-color: var(--gold); background: var(--gold); color: #000; }
#sc .sc-btn-primary:hover { background: var(--gold); filter: brightness(1.07); }

#sc .sc-card-details h3 { margin: 0 0 16px; font-size: 15px; font-weight: 600; color: var(--text); }
#sc .sc-dl { display: grid; gap: 12px; margin: 0; }
#sc .sc-dl div { display: grid; gap: 2px; }
#sc .sc-dl dt { font-size: 12px; color: var(--dim); }
#sc .sc-dl dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--text); }

#sc .sc-trace { margin-top: 16px; }
#sc .sc-trace summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 13px; color: var(--dim); }
#sc .sc-trace summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
#sc .sc-trace-body { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--s1); }
#sc .sc-mono { margin: 0 0 8px; font-family: var(--sc-mono); font-size: 12px; line-height: 1.7; color: var(--dim); }
#sc ol.sc-mono { padding-left: 24px; }
#sc pre.sc-mono { overflow-x: auto; margin: 0; padding: 12px; border-radius: 8px; background: var(--s2); white-space: pre; }
#sc .sc-warnln { color: var(--sc-warn); }

#sc .sc-bridge { display: flex; align-items: center; gap: 24px; margin-top: 16px; padding: 24px; border: 1px solid rgba(var(--gold-rgb), .35); border-radius: 16px;
  background: var(--gold-bg); }
#sc .sc-bridge > div { min-width: 0; }
#sc .sc-bridge-title { margin: 0 0 4px; font-size: 17px; font-weight: 600; color: var(--text); }
#sc .sc-bridge p { max-width: 60ch; margin: 0; font-size: 14px; line-height: 1.55; color: var(--dim); }
#sc .sc-bridge p.sc-bridge-title { color: var(--text); }
#sc .sc-bridge .btn-primary { flex: none; margin-left: auto; }

/* ── Tables: ratings, camera support, the multi-file compare ── */
#sc .sc-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
#sc .sc-card .sc-table-wrap { margin-top: 16px; }
#sc .sc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
#sc .sc-table caption { caption-side: bottom; padding: 12px 16px; text-align: left; font-size: 12px; color: var(--dim); }
#sc .sc-table th, #sc .sc-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.55; color: var(--dim); }
#sc .sc-table thead th { background: var(--s1); font-size: 12px; font-weight: 600; color: var(--dim); }
#sc .sc-table tbody th { font-weight: 600; color: var(--text); }
#sc .sc-table tbody tr:last-child > * { border-bottom: 0; }
#sc .sc-table .sc-num { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
#sc .sc-table a { color: var(--pk-link); text-decoration: underline; text-decoration-color: rgba(var(--gold-rgb), .45); text-underline-offset: 3px; }
#sc .sc-support tbody th { width: 24%; }
#sc .sc-ratings-table th, #sc .sc-ratings-table td { padding-top: 8px; padding-bottom: 8px; }
#sc .sc-ratings-table a { display: inline-block; padding: 4px 0; }
#sc .sc-compare th, #sc .sc-compare td { white-space: nowrap; }
#sc .section .sc-table-wrap + p { margin-top: 16px; }

/* ── The long page below the instrument: one centred column ── */
#sc .section { max-width: 880px; padding-top: 56px; }
#sc .section > h2 { text-align: center; font-size: clamp(1.625rem, 3vw, 2rem); letter-spacing: -.02em; }
#sc .section > h3 { text-align: center; }
#sc .section > p { margin-left: auto; margin-right: auto; }
#sc .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 32px; }
#sc .step { flex-direction: column; gap: 16px; }
#sc .step-num { position: relative; width: 40px; height: 40px; margin-top: 0; font-size: 1rem; }
#sc .step:not(:last-child) .step-num::after { content: ""; position: absolute; top: 50%; left: calc(100% + 12px); width: 160px; max-width: 30vw; height: 1px; background: var(--border2); }
#sc .step-body h3 { margin-bottom: 8px; font-size: 1.125rem; }

/* ── Smaller screens ── */
@media (max-width: 860px) {
  #sc .sc-top { padding-top: 40px; }
  #sc .steps { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  #sc .step { flex-direction: row; }
  #sc .step-num { width: 32px; height: 32px; }
  #sc .step:not(:last-child) .step-num::after { display: none; }
  #sc .sc-results-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  #sc .sc-top, #sc .sc-out { padding-left: 16px; padding-right: 16px; }
  #sc .sc-top { padding-top: 32px; }
  #sc .sc-inst { margin-top: 32px; border-radius: 22px; }
  #sc .sc-face { padding: 20px 12px; }
  #sc .sc-plate { margin-bottom: 16px; padding: 0 8px; }
  #sc .sc-window { margin: 6px; padding: 24px 8px;
    box-shadow: inset 0 4px 18px rgba(0, 0, 0, .75), 0 0 0 1px rgba(255, 255, 255, .06), 0 0 0 6px var(--s3), 0 0 0 7px var(--border2); }
  #sc .sc-cell { margin: 0 1px; border-radius: 4px; }
  #sc .sc-drop { gap: 8px; margin: 0 8px 8px; padding: 32px 16px; }
  #sc .sc-drop-icon { width: 64px; height: 64px; }
  #sc .sc-pick { width: 100%; max-width: 320px; }
  #sc .sc-card { padding: 16px; }
  #sc .sc-bridge { flex-direction: column; align-items: flex-start; gap: 16px; padding: 16px; }
  #sc .sc-bridge .btn-primary { margin-left: 0; }
  #sc .sc-support thead { display: none; }
  #sc .sc-support tr { display: block; padding: 12px 16px; border-bottom: 1px solid var(--border); }
  #sc .sc-support tbody tr:last-child { border-bottom: 0; }
  #sc .sc-support th, #sc .sc-support td { display: block; width: auto; padding: 0; border: 0; }
  #sc .sc-support tbody th { width: auto; margin-bottom: 4px; }
  #sc .sc-table th, #sc .sc-table td { padding: 12px; }
  /* Ratings as stacked rows: camera and figure on one line, the source under them. */
  #sc .sc-ratings-table thead { display: none; }
  #sc .sc-ratings-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
  #sc .sc-ratings-table tbody tr:last-child { border-bottom: 0; }
  #sc .sc-ratings-table th, #sc .sc-ratings-table td { padding: 0; border: 0; }
  #sc .sc-ratings-table td:last-child { grid-column: 1 / -1; font-size: 12px; }
}

[data-theme="light"] #sc .sc-inst { box-shadow: 0 0 0 1px var(--border), inset 0 1px 0 rgba(255, 255, 255, .8), 0 48px 80px -44px rgba(60, 45, 0, .35), 0 14px 32px -20px rgba(60, 45, 0, .25); }
[data-theme="light"] #sc .sc-inst.is-drag { box-shadow: 0 0 0 2px var(--gold), 0 48px 80px -44px rgba(var(--gold-rgb), .45); }
[data-theme="light"] #sc .sc-iris { stroke: rgba(var(--gold-rgb), .4); }

@media (prefers-reduced-motion: reduce) {
  #sc .sc-reel { transition: none !important; animation: none !important; filter: none !important; }
  #sc .sc-meter-fill, #sc .sc-inst, #sc .sc-drop, #sc .sc-pick, #sc .sc-iris-blades { transition: none; }
  #sc .sc-iris-blades, #sc .sc-plate::before, #sc .sc-drop-icon::after { animation: none !important; }
}
