/* ============================================================
   /apps/exif/ — Photo Exif Metadata Editor
   Darkroom and contact sheet: film strips on a lightbox, a frame
   enlarged under an inspector, monospace readouts. Colours come
   from the app's theme: slate #565E74, periwinkle #DAE2FD and the
   brick red it uses for "Clear", lifted here into a safelight.
   ============================================================ */

/* ---------- Tokens -------------------------------------------- */

:root {
  color-scheme: dark;

  /* site chrome tokens: the darkroom */
  --bg: #13151c;
  --bg-raised: #1a1d27;
  --bg-inset: #0f1117;
  --bg-hover: #232736;
  --line: #2a2f3e;
  --line-strong: #3d445a;
  --fg: #e6e9f4;
  --fg-muted: #a6adc2;
  --fg-faint: #7e869c;
  --accent: #b6c3f7;
  --accent-strong: #dae2fd;
  --accent-ink: #161a2a;
  --accent-soft: rgba(182, 195, 247, 0.12);
  --danger: #ef7a6f;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 0 16px 40px -16px rgba(0, 0, 0, 0.7);

  /* page tokens */
  --x-safe: #ef7a6f;
  --x-safe-ink: #1d0c0a;
  --x-safe-soft: rgba(239, 122, 111, 0.13);
  --x-safe-bar: #e5584b;
  --x-film: #09090c;
  --x-film-fg: #e2e5f0;
  --x-film-muted: #a9b0c6;
  --x-edge: #d9b273;
  --x-hole: #7d86a4;
  --x-grease: #ff6253;
  --x-map-sea: #1d2436;
  --x-map-land: #2a3043;
  --x-map-grid: rgba(182, 195, 247, 0.09);
  --x-map-beach: #cdb68b;
  --x-map-bridge: #8b94b4;
  --x-lift: 0 34px 70px -34px rgba(0, 0, 0, 0.85);

  --x-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --x-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --x-measure: 1180px;
  --app-measure: var(--x-measure);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    /* site chrome tokens: proof paper under a cool light */
    --bg: #f4f6f9;
    --bg-raised: #ffffff;
    --bg-inset: #e9eef3;
    --bg-hover: #e1e8ee;
    --line: #d6dde4;
    --line-strong: #a9b4b9;
    --fg: #232c31;
    --fg-muted: #535e64;
    --fg-faint: #69747a;
    --accent: #4a5268;
    --accent-strong: #363d52;
    --accent-ink: #f7f7ff;
    --accent-soft: rgba(86, 94, 116, 0.1);
    --danger: #9f403d;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(30, 36, 60, 0.22);

    --x-safe: #9f403d;
    --x-safe-ink: #fff7f6;
    --x-safe-soft: rgba(159, 64, 61, 0.09);
    --x-safe-bar: #b9433d;
    --x-hole: #f4f6f9;
    --x-map-sea: #dae2fd;
    --x-map-land: #f6f8fa;
    --x-map-grid: rgba(74, 82, 104, 0.1);
    --x-map-beach: #b89a62;
    --x-map-bridge: #6a7390;
    --x-lift: 0 34px 60px -34px rgba(30, 36, 60, 0.45);
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-raised: #ffffff;
  --bg-inset: #e9eef3;
  --bg-hover: #e1e8ee;
  --line: #d6dde4;
  --line-strong: #a9b4b9;
  --fg: #232c31;
  --fg-muted: #535e64;
  --fg-faint: #69747a;
  --accent: #4a5268;
  --accent-strong: #363d52;
  --accent-ink: #f7f7ff;
  --accent-soft: rgba(86, 94, 116, 0.1);
  --danger: #9f403d;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 16px 40px -16px rgba(30, 36, 60, 0.22);

  --x-safe: #9f403d;
  --x-safe-ink: #fff7f6;
  --x-safe-soft: rgba(159, 64, 61, 0.09);
  --x-safe-bar: #b9433d;
  --x-hole: #f4f6f9;
  --x-map-sea: #dae2fd;
  --x-map-land: #f6f8fa;
  --x-map-grid: rgba(74, 82, 104, 0.1);
  --x-map-beach: #b89a62;
  --x-map-bridge: #6a7390;
  --x-lift: 0 34px 60px -34px rgba(30, 36, 60, 0.45);
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

/* ---------- Base ---------------------------------------------- */

.app-exif main,
.app-exif .app-foot {
  font-family: var(--x-serif);
  font-optical-sizing: auto;
}

.app-exif main {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-x: clip;
}

:where(.app-exif main) :is(h1, h2, h3) {
  font-family: var(--x-serif);
  font-weight: 560;
  letter-spacing: -0.018em;
  color: var(--fg);
}

:where(.app-exif main) p {
  margin: 0 0 1em;
}

:where(.app-exif main) code {
  font-family: var(--x-mono);
  font-size: 0.86em;
}

.x-wrap {
  max-width: var(--x-measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sec-head {
  max-width: 41rem;
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.sec-head h2 {
  font-size: clamp(1.95rem, 1.25rem + 2.3vw, 3.05rem);
  line-height: 1.06;
  margin-bottom: 0.45em;
}

.sec-head p {
  color: var(--fg-muted);
  max-width: 36rem;
}

.x-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
  text-underline-offset: 0.2em;
}

.x-link:hover {
  text-decoration-color: currentColor;
}

/* ---------- Film: sprockets and edge print ------------------------
   A strip is a black film base with a row of perforations along the
   top and bottom edge. The holes are a mask over a fill, so the
   "light" behind them follows the theme. */

.strip,
.ix-photo {
  --hole-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='12'%3E%3Crect x='5' y='0' width='16' height='12' rx='2.6'/%3E%3C/svg%3E");
  position: relative;
  background: var(--x-film);
  color: var(--x-film-fg);
}

.strip::before,
.strip::after,
.ix-photo::before,
.ix-photo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  background: var(--x-hole);
  -webkit-mask: var(--hole-mask) repeat-x 0 0 / 26px 12px;
  mask: var(--hole-mask) repeat-x 0 0 / 26px 12px;
  pointer-events: none;
}

.strip::before,
.ix-photo::before {
  top: 9px;
}

.strip::after,
.ix-photo::after {
  bottom: 9px;
}

/* ---------- Hero ---------------------------------------------- */

.hero {
  position: relative;
  padding-top: clamp(2rem, 4.5vw, 3.25rem);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--x-measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}

.hero-copy {
  padding-bottom: clamp(1.5rem, 3vw, 2rem);
}

.x-path {
  font-family: var(--x-mono);
  font-size: 0.8rem;
  margin-bottom: 1.3rem;
}

.x-path a {
  color: var(--accent);
}

.hero-icon {
  display: block;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  margin-bottom: 1.1rem;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
}

.hero h1 {
  font-size: clamp(2.7rem, 1.35rem + 4.3vw, 4.9rem);
  line-height: 0.98;
  font-weight: 540;
  letter-spacing: -0.03em;
  max-width: 10.5ch;
  margin: 0 0 1.2rem;
}

.lede {
  font-size: clamp(1.12rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.5;
  max-width: 30rem;
  color: var(--fg-muted);
  margin-bottom: 1.6rem;
}

.hero-note {
  margin-top: 1rem;
  font-family: var(--x-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
}

.app-exif .store-badge {
  --badge-focus: var(--accent);
}

.hero-phone {
  --device-w: clamp(250px, 23vw, 304px);
  --device-frame: #101116;
  --device-edge: rgba(218, 226, 253, 0.16);
  --device-shadow: 0 50px 90px -40px rgba(0, 0, 0, 0.7), 0 22px 40px -22px rgba(0, 0, 0, 0.5);
  justify-self: center;
  margin-bottom: -168px;
}

/* the contact strip under the hero */
.strip-hero {
  z-index: 1;
  overflow: hidden;
  padding: 32px 0 46px;
}

.strip-run {
  --fw: clamp(150px, 15vw, 226px);
  display: flex;
  justify-content: center;
  gap: 14px;
}

.cs-frame {
  position: relative;
  display: block;
  flex: none;
  width: var(--fw);
  aspect-ratio: 3 / 2;
  color: inherit;
  text-decoration: none;
}

.cs-pic {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1d2140;
}

.cs-pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--crop, 50% 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--crop, 50% 50%);
  filter: brightness(var(--exp, 1));
}

.cs-frame i {
  position: absolute;
  left: 2px;
  top: calc(100% + 5px);
  font: 500 10px/1 var(--x-mono);
  font-style: normal;
  letter-spacing: 0.08em;
  color: var(--x-edge);
}

.cs-frame i::after {
  content: "\25B8" attr(data-a);
  margin-left: calc(var(--fw) * 0.55);
  opacity: 0.75;
}

.cs-frame.is-select {
  z-index: 1;
}

.cs-frame.is-select i {
  color: var(--x-grease);
}

.grease {
  position: absolute;
  inset: -10px -11px;
  width: calc(100% + 22px);
  height: calc(100% + 20px);
  overflow: visible;
  fill: none;
  stroke: var(--x-grease);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.grease path {
  vector-effect: non-scaling-stroke;
}

.cs-frame.is-select:hover .grease,
.cs-frame.is-select:focus-visible .grease {
  stroke-width: 6;
}

.cs-frame.is-select:focus-visible {
  outline: 2px solid var(--x-film-fg);
  outline-offset: 14px;
  border-radius: 2px;
}

/* load: the frames develop out of a white flash, then the select is marked */
@media (prefers-reduced-motion: no-preference) {
  html.js .cs-pic img {
    animation: x-develop 1.5s var(--ease) both;
  }

  html.js .cs-frame:nth-child(1) .cs-pic img { animation-delay: 0.05s; }
  html.js .cs-frame:nth-child(2) .cs-pic img { animation-delay: 0.13s; }
  html.js .cs-frame:nth-child(3) .cs-pic img { animation-delay: 0.21s; }
  html.js .cs-frame:nth-child(4) .cs-pic img { animation-delay: 0.29s; }
  html.js .cs-frame:nth-child(5) .cs-pic img { animation-delay: 0.37s; }
  html.js .cs-frame:nth-child(6) .cs-pic img { animation-delay: 0.45s; }
  html.js .cs-frame:nth-child(7) .cs-pic img { animation-delay: 0.53s; }
  html.js .cs-frame:nth-child(8) .cs-pic img { animation-delay: 0.61s; }
  html.js .cs-frame:nth-child(9) .cs-pic img { animation-delay: 0.69s; }

  html.js .grease path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: x-draw 0.85s cubic-bezier(0.5, 0, 0.3, 1) 1.45s forwards;
  }
}

@keyframes x-develop {
  from {
    filter: brightness(2.4) contrast(0.35) saturate(0);
  }
}

@keyframes x-draw {
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Inspector ----------------------------------------- */

.inspect {
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  scroll-margin-top: var(--nav-h);
}

.sim-note {
  font-family: var(--x-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--fg-muted);
  padding-left: 0.9rem;
  border-left: 2px solid var(--x-safe);
}

.ix {
  display: grid;
  grid-template-columns: minmax(0, 4.6fr) minmax(0, 7.4fr);
  gap: clamp(1.5rem, 3.4vw, 3rem);
  align-items: start;
}

.ix-left {
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  display: grid;
  gap: 1.1rem;
}

/* the enlarged frame */
.ix-photo {
  margin: 0;
  padding: 30px 16px 50px;
  border-radius: 3px;
  box-shadow: var(--x-lift);
}

.film-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: #1d2140;
}

.film-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
}

.film-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #ff2d1a;
  mix-blend-mode: multiply;
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}

.ix.is-safelight .film-frame::after {
  opacity: 0.62;
}

.edge {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 26px;
  display: flex;
  gap: 1.25rem;
  font: 500 10px/1 var(--x-mono);
  letter-spacing: 0.08em;
  color: var(--x-edge);
  white-space: nowrap;
  overflow: hidden;
}

.edge span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* map card */
.ix-map {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.ix-map svg {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.6s ease, opacity 0.6s ease;
}

.m-sea { fill: var(--x-map-sea); }
.m-land { fill: var(--x-map-land); }
.m-grid path { stroke: var(--x-map-grid); stroke-width: 1; fill: none; }
.m-beach { fill: none; stroke: var(--x-map-beach); stroke-width: 2.5; stroke-linecap: round; }
.m-bridge { fill: none; stroke: var(--x-map-bridge); stroke-width: 2; stroke-dasharray: 5 4; }
.m-pin path { fill: var(--x-safe); }
.m-pin .m-dot { fill: var(--bg-raised); }
.m-pin .m-pulse { fill: none; stroke: var(--x-safe); stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; }

.m-pin > * {
  transition: opacity 0.35s ease, transform 0.45s var(--ease);
}

@media (prefers-reduced-motion: no-preference) {
  .ix.is-seen .m-pulse {
    animation: x-pulse 1.6s ease-out 0.3s 3;
  }
}

@keyframes x-pulse {
  0% { opacity: 0.85; transform: scale(0.6); }
  100% { opacity: 0; transform: scale(2.6); }
}

.ix-map.is-wiped svg {
  filter: grayscale(1);
  opacity: 0.5;
}

.ix-map.is-wiped .m-pin > * {
  opacity: 0;
  transform: translateY(-14px);
}

.ix-map-label {
  margin: 0;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.3rem;
}

.ix-map-coord {
  font-family: var(--x-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--fg);
}

.ix-map.is-wiped .ix-map-coord {
  color: var(--fg-muted);
}

.ix-map-label small {
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--fg-muted);
}

/* the readout panel */
.ix-panel {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.05rem, 2.3vw, 1.6rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.ix-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(130% 70% at 50% 0%, var(--x-safe-soft), transparent 75%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.ix.is-safelight .ix-panel::before {
  opacity: 1;
}

.ix-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 1rem;
  align-items: baseline;
  padding-bottom: 1rem;
}

.ix-head p {
  margin: 0;
}

.ix-file {
  font-family: var(--x-mono);
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.ix-count {
  font-family: var(--x-mono);
  font-size: 0.82rem;
  color: var(--fg-muted);
  white-space: nowrap;
}

.ix-count b {
  display: inline-block;
  min-width: 2ch;
  text-align: right;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}

.ix-count b.tick {
  color: var(--x-safe);
}

.ix-spec {
  grid-column: 1 / -1;
  font-family: var(--x-mono);
  font-size: 0.76rem;
  color: var(--fg-muted);
}

.ix-spec {
  display: flex;
  flex-wrap: wrap;
  column-gap: 0.9rem;
}

/* buttons */
.ix-actions {
  display: none;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

html.js .ix-actions {
  display: flex;
}

.xb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--fg);
  font: 500 0.84rem/1 var(--x-mono);
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s, opacity 0.18s;
}

.xb:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.xb:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.xb-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.xb-primary:not(:disabled):hover {
  background: var(--accent-strong);
}

.xb-danger {
  color: var(--x-safe);
  border-color: color-mix(in srgb, var(--x-safe) 55%, transparent);
}

.xb-danger:not(:disabled):hover {
  background: var(--x-safe-soft);
  border-color: var(--x-safe);
}

.xb-danger-solid {
  background: var(--x-safe);
  color: var(--x-safe-ink);
}

.xb-danger-solid:hover {
  background: color-mix(in srgb, var(--x-safe) 86%, var(--fg));
}

.xb-ghost {
  border-color: var(--line-strong);
}

.xb-ghost:not(:disabled):hover {
  background: var(--bg-hover);
}

.xb-count {
  min-width: 1.5rem;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent-ink) 16%, transparent);
  font-size: 0.74rem;
  text-align: center;
}

/* inline confirm, mirroring the app's dialogs */
.ix-dialog,
.ix-receipt {
  position: relative;
  margin: 0 0 1rem;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
}

.ix-dialog[hidden],
.ix-receipt[hidden] {
  display: none;
}

.ix-dialog.is-danger {
  border-color: color-mix(in srgb, var(--x-safe) 60%, transparent);
}

.ix-dialog-title,
.ix-receipt .r-title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.35rem;
}

.ix-dialog-body {
  font-size: 0.97rem;
  color: var(--fg-muted);
}

.ix-dialog-body p {
  margin: 0 0 0.6rem;
}

.ix-dialog-body small {
  display: block;
  font-family: var(--x-mono);
  font-size: 0.74rem;
  color: var(--fg-muted);
}

.ix-changes {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.25rem 1rem;
  margin: 0 0 0.4rem;
  font-family: var(--x-mono);
  font-size: 0.82rem;
}

.ix-changes dt {
  color: var(--fg-muted);
}

.ix-changes dd {
  margin: 0;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.ix-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.ix-receipt {
  border-style: dashed;
}

.ix-receipt.is-clean {
  border-color: color-mix(in srgb, var(--x-safe) 55%, transparent);
}

.ix-receipt:focus {
  outline: none;
}

.ix-receipt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ix-receipt ul {
  list-style: none;
  margin: 0.4rem 0 0.6rem;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.ix-receipt li {
  display: grid;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  font-size: 0.92rem;
  line-height: 1.4;
}

.ix-receipt li::before {
  content: "\2713";
  font-family: var(--x-mono);
  color: var(--x-safe);
}

.ix-receipt.is-saved li::before {
  color: var(--accent);
}

.ix-receipt li b {
  font-weight: 600;
}

.ix-receipt li span {
  color: var(--fg-muted);
}

.ix-receipt .r-note {
  margin: 0;
  font-family: var(--x-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--fg-muted);
}

@media (prefers-reduced-motion: no-preference) {
  .ix-dialog:not([hidden]),
  .ix-receipt:not([hidden]) {
    animation: x-drop 0.28s var(--ease) both;
  }
}

@keyframes x-drop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.ix-status {
  display: none;
  min-height: 1.4em;
  margin: 0 0 0.75rem;
  font-family: var(--x-mono);
  font-size: 0.78rem;
  color: var(--fg-muted);
}

html.js .ix-status {
  display: block;
}

/* groups and rows */
.ix-group {
  display: grid;
  grid-template-columns: 5.6rem minmax(0, 1fr);
  column-gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}

.ix-group > :not(.ix-g) {
  grid-column: 2;
}

.app-exif main .ix-g {
  grid-column: 1;
  grid-row: 1 / span 12;
  margin: 0;
  padding-top: 0.35rem;
  font-size: 1.02rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--fg-muted);
}

.ix-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 8.75rem) minmax(0, 1fr);
  grid-template-areas:
    "label val"
    "tag val";
  column-gap: 1rem;
  align-items: center;
  padding: 0.3rem 0;
}

.ix-label {
  grid-area: label;
  align-self: end;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--fg);
}

.app-exif main .ix-tag {
  grid-area: tag;
  align-self: start;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--x-mono);
  font-size: 0.66rem;
  line-height: 1.4;
  color: var(--fg-faint);
  overflow-wrap: anywhere;
  transition: color 0.2s;
}

.ix-val {
  grid-area: val;
  position: relative;
  min-width: 0;
  font-family: var(--x-mono);
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.ix-val small {
  display: block;
  font-size: 0.72rem;
  color: var(--fg-muted);
}

/* the redaction bar */
.ix-val::after {
  content: "";
  position: absolute;
  left: -0.2rem;
  right: -0.2rem;
  top: 50%;
  height: max(1.25em, 18px);
  background: var(--x-safe-bar);
  border-radius: 2px;
  transform: translateY(-50%) scaleX(0);
  transform-origin: left center;
  transition: transform 0.22s cubic-bezier(0.6, 0, 0.3, 1);
  pointer-events: none;
}

.ix-row.is-striking .ix-val::after {
  transform: translateY(-50%) scaleX(1);
}

.ix-row.is-gone .ix-val::after {
  transform-origin: right center;
}

.app-exif main .ix-row.is-gone .ix-tag {
  color: var(--fg-faint);
  text-decoration: line-through;
  text-decoration-color: var(--x-safe);
  text-decoration-thickness: 1.5px;
}

.ix-row.is-gone .ix-val {
  color: var(--fg-faint);
}

.ix-row.is-gone .ix-label {
  color: var(--fg-muted);
}

.ix-gone {
  display: none;
}

.ix-row.is-gone .ix-gone {
  display: block;
  padding: 0.4rem 0.15rem;
}

.ix-row.is-gone .ix-val-pair .ix-in {
  display: none;
}

/* edited marker + the "written" flash */
.ix-row::before {
  content: "";
  position: absolute;
  left: -0.75rem;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0;
  transform: scaleY(0.3);
  transition: opacity 0.2s, transform 0.25s var(--ease);
}

.ix-row.is-changed::before {
  opacity: 1;
  transform: none;
}

.app-exif main .ix-row.is-changed .ix-tag {
  color: var(--accent);
}

@media (prefers-reduced-motion: no-preference) {
  .ix-row.is-written .ix-val {
    animation: x-written 1.1s ease-out;
  }

  .ix-row.is-restored .ix-val {
    animation: x-restore 0.9s ease-out both;
  }
}

@keyframes x-written {
  0% { background: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); }
  100% { background: transparent; box-shadow: 0 0 0 4px transparent; }
}

@keyframes x-restore {
  from { opacity: 0; filter: blur(3px); }
}

/* exposure cells */
.ix-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.3rem 0;
}

.ix-cells + .ix-cells {
  padding-top: 0;
}

.ix-cells-sm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ix-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  padding: 0.6rem 0.65rem 0.65rem;
  border-radius: 9px;
  background: var(--bg-inset);
}

.ix-cell::before {
  display: none;
}

.ix-cell .ix-label {
  order: 1;
  align-self: auto;
  font-size: 0.8rem;
  color: var(--fg-muted);
}

.ix-cell .ix-val {
  order: 2;
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.25;
  margin: 0.15rem 0 0.2rem;
}

.ix-cells-sm .ix-val {
  font-size: 0.86rem;
  line-height: 1.35;
}

.app-exif main .ix-cell .ix-tag {
  order: 3;
  font-size: 0.6rem;
  overflow-wrap: normal;
  color: var(--fg-muted);
}

/* inputs */
.ix-in {
  display: block;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0.4rem 0.15rem;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed var(--line-strong);
  border-radius: 0;
  font: 400 0.88rem/1.3 var(--x-mono);
  color: var(--fg);
  transition: border-color 0.18s, background-color 0.18s;
}

.ix-in::placeholder {
  color: var(--fg-faint);
  opacity: 1;
}

.ix-in:hover:not(:disabled) {
  border-bottom-color: var(--fg-muted);
}

.ix-in:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: 4px;
  border-bottom-color: transparent;
  background: var(--accent-soft);
}

.ix-in:disabled {
  border-bottom-style: solid;
  border-bottom-color: var(--line);
  cursor: not-allowed;
}

.ix-val-pair {
  display: flex;
  gap: 0.75rem;
}

.ix-val-pair .ix-in {
  flex: 1 1 9rem;
  min-width: 0;
}

.ix-val-pair .ix-in-time {
  flex: 0 1 7rem;
}

/* keywords */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.15rem 0 0.35rem;
}

.chips:empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 32px;
  padding: 0.1rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  line-height: 1.2;
  background: var(--bg);
}

html.js .chip {
  padding-right: 0.15rem;
}

.chip-x {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-muted);
  font: 500 1rem/1 var(--x-mono);
  cursor: pointer;
}

.chip-x::before {
  content: "";
  position: absolute;
  inset: -8px;
}

.chip-x:hover {
  background: var(--bg-hover);
  color: var(--fg);
}

.chip-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.kw-add {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.kw-btn {
  display: none;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--fg);
  font: 500 1.15rem/1 var(--x-mono);
  cursor: pointer;
}

html.js .kw-btn {
  display: inline-grid;
  place-items: center;
}

.kw-btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.kw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kw-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Proof sheet --------------------------------------- */

.sheet {
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(3rem, 7vw, 5.5rem);
}

.strip-sheet + .strip-sheet {
  margin-top: 14px;
}

.sheet-scroll {
  padding: 40px 0 34px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.sheet-scroll::-webkit-scrollbar {
  display: none;
}

.sheet-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.sheet-run {
  list-style: none;
  display: flex;
  gap: clamp(1.75rem, 5vw, 4.5rem);
  width: max-content;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sheet-frame {
  flex: none;
  width: clamp(208px, 21vw, 262px);
  scroll-snap-align: center;
}

.sheet-frame .app-device {
  --device-w: 100%;
  --device-bezel: 9px;
  --device-radius: 40px;
  --device-frame: #17181e;
  --device-edge: rgba(255, 255, 255, 0.1);
  --device-shadow: none;
}

.sheet-frame p {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr);
  margin: 1.05rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--x-film-fg);
}

.sheet-frame p i {
  font: 500 0.78rem/1.9 var(--x-mono);
  font-style: normal;
  color: var(--x-edge);
}

/* ---------- Datasheet ----------------------------------------- */

.data {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(3.5rem, 8vw, 6rem);
}

.datasheet {
  margin: 0;
  border-top: 2px solid var(--fg);
  max-width: 62rem;
}

.datasheet > div {
  display: grid;
  grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr);
  gap: 0.4rem 2rem;
  padding: 1.05rem 0 1.15rem;
  border-bottom: 1px solid var(--line);
}

.datasheet dt {
  font-size: 1.22rem;
  font-style: italic;
  line-height: 1.35;
  color: var(--fg);
}

.datasheet dd {
  margin: 0;
  max-width: 40rem;
  color: var(--fg-muted);
}

.app-exif main .datasheet code {
  padding: 0.05em 0.35em;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--fg);
}

/* ---------- Privacy note -------------------------------------- */

.trust {
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  background: var(--bg-inset);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.trust-inner {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 1rem clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.trust h2 {
  font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem);
  line-height: 1.08;
  margin: 0;
  max-width: 12ch;
}

.trust-copy {
  max-width: 36rem;
  font-size: 1.08rem;
}

.trust-copy p:last-child {
  margin-bottom: 0;
}

/* ---------- Closing CTA --------------------------------------- */

.cta {
  padding: clamp(4.5rem, 10vw, 8rem) 0 clamp(4rem, 9vw, 7rem);
}

.cta-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
  gap: 2.5rem clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.cta-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cta-side {
  justify-self: end;
  width: min(100%, 440px);
}

.cta-frame {
  transform: rotate(-1.6deg);
}

.cta-frame figcaption.edge span:last-child {
  color: var(--x-film-fg);
}

.cta-cap {
  margin: 1rem 0 0;
  font-size: 0.92rem;
  color: var(--fg-muted);
  transform: rotate(-1.6deg);
}

.cta-icon {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  margin-bottom: 1.4rem;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
}

.cta h2 {
  font-size: clamp(2.2rem, 1.3rem + 3.4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.028em;
  max-width: 14ch;
  margin: 0 0 1.8rem;
}

/* ---------- Footer -------------------------------------------- */

.app-exif .app-foot a {
  color: var(--fg);
}

/* ---------- Responsive ---------------------------------------- */

@media (max-width: 980px) {
  .ix {
    grid-template-columns: minmax(0, 1fr);
  }

  .ix-left {
    position: static;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    align-items: start;
  }

  .ix-map {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .hero-copy {
    padding-bottom: 1.5rem;
  }

  .hero-phone {
    --device-w: min(70vw, 270px);
    margin-bottom: -18px;
  }

  .ix-left {
    grid-template-columns: minmax(0, 1fr);
  }

  .ix-map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .trust-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .cta-side {
    justify-self: start;
  }
}

@media (max-width: 600px) {
  .ix-panel {
    padding: 1rem 0.95rem;
    border-radius: 12px;
  }

  .ix-group {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.75rem 0 0.6rem;
  }

  .ix-group > :not(.ix-g),
  .app-exif main .ix-g {
    grid-column: 1;
  }

  .app-exif main .ix-g {
    grid-row: auto;
    padding: 0 0 0.25rem;
    font-size: 0.98rem;
  }

  .ix-row {
    grid-template-columns: minmax(0, auto) minmax(0, 1fr);
    grid-template-areas:
      "label tag"
      "val val";
    column-gap: 0.6rem;
    align-items: baseline;
    padding: 0.4rem 0;
  }

  .app-exif main .ix-row:not(.ix-cell) .ix-tag {
    justify-self: end;
    text-align: right;
    align-self: baseline;
  }

  .ix-row::before {
    left: -0.55rem;
  }

  .ix-cells {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ix-in {
    font-size: 16px;
  }

  .ix-actions .xb {
    flex: 1 1 auto;
  }

  .ix-map {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .ix-map-label {
    padding: 0.7rem 0.85rem;
  }

  .datasheet > div {
    grid-template-columns: minmax(0, 1fr);
  }

  .ix-spec {
    column-gap: 0.6rem;
  }

  .ix-file {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .ix-spec {
    grid-column: 1;
    grid-row: 2;
  }

  .ix-count {
    grid-column: 2;
    grid-row: 2;
  }
}

/* ---------- Reduced motion ------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .cs-pic img,
  .grease path,
  .m-pulse,
  .ix-row .ix-val,
  .ix-dialog,
  .ix-receipt {
    animation: none !important;
  }

  .ix-val::after {
    display: none;
  }

  .film-frame::after,
  .ix-panel::before,
  .ix-map svg,
  .m-pin > * {
    transition: none;
  }
}
