/* ---------- Hero (centred) ---------- */
.hero {
  position: relative;
  max-width: 1180px; margin: 0 auto;
  padding: clamp(20px, 5vw, 56px) var(--gutter) clamp(24px, 4vw, 40px);
  text-align: center;
}
/* the safelight: a soft amber glow behind the headline */
.hero::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: -120px;
  width: min(980px, 100%); height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  pointer-events: none;
}
/* one line on every screen: in Outfit 700 the headline is ~10.1x as wide as its font size */
h1 {
  font-size: clamp(1.5rem, calc((100vw - 40px) / 10.7), 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  white-space: nowrap;
  animation: h1-in 2.2s .25s cubic-bezier(.25, .6, .25, 1) both; /* slow enough to be seen */
}
@keyframes h1-in {
  from { opacity: 0; filter: blur(8px); letter-spacing: .02em; }
  to { opacity: 1; filter: blur(0); letter-spacing: -0.03em; }
}
/* the accent words: a beam of light passes over them once on load, and again on hover */
.h1-glow {
  margin-inline-start: .26em;
  color: var(--accent-text);
  background: linear-gradient(100deg, var(--accent-text) 0 42%, var(--sheen) 50%, var(--accent-text) 58% 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: sheen 2.6s 1.7s cubic-bezier(.45, 0, .35, 1) both; /* the beam starts as the headline settles */
}
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (hover: hover) {
  h1:hover .h1-glow { animation: sheen-again 1.1s cubic-bezier(.4, 0, .2, 1); }
}
@keyframes sheen-again { from { background-position: 100% 0; } to { background-position: 0 0; } }

.lede { margin: 14px auto 0; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.12rem); max-width: 58ch; font-weight: 400; }
.promise {
  list-style: none; padding: 0; margin: 18px auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px;
  font-size: .92rem; font-weight: 500; color: var(--text);
}
.promise li { display: inline-flex; align-items: center; gap: 7px; }
.promise svg {
  width: 18px; height: 18px; padding: 2px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  fill: none; stroke: var(--accent-text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 14; stroke-dashoffset: 0; transition: stroke-dashoffset .5s ease;
}
/* hovering a promise redraws its tick */
@media (hover: hover) {
  .promise li:hover svg { animation: tick-draw .5s ease; }
}
@keyframes tick-draw { from { stroke-dashoffset: 14; } to { stroke-dashoffset: 0; } }

/* ---------- Studio: one glass panel, drop zone + settings ---------- */
.studio {
  max-width: 1180px;
  margin-inline: max(var(--gutter), calc((100% - 1180px) / 2));
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: clamp(16px, 2vw, 24px);
  padding: clamp(14px, 2vw, 24px);
  border-radius: 26px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.studio-main { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 18px; min-width: 0; }

/* ---------- The tray: drop zone first, then it holds the photos ----------
   On wide screens it is exactly as tall as the settings panel next to it ("contain: size" stops a big batch
   from stretching the page); the photo grid scrolls inside it. */
.tray {
  position: relative; display: grid; grid-template-rows: minmax(0, 1fr);
  min-height: 420px; contain: size;
  border-radius: 18px; border: 1.5px dashed var(--dash); background: var(--well);
  transition: border-color .2s ease, background-color .2s ease;
}
.tray:has(.dropzone:hover), .tray.drag { border-color: var(--accent); background: var(--well-hi); }
.tray.filled { border-style: solid; border-color: var(--line); }
.tray.filled.drag { border-color: var(--accent); }
.dropzone {
  display: grid; place-items: center; text-align: center; padding: 40px 24px;
  border-radius: inherit; cursor: pointer;
}
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.dz-inner { display: grid; justify-items: center; gap: 8px; }
.dz-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 10px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 6%, transparent);
  transition: transform .25s cubic-bezier(.3, .7, .3, 1), box-shadow .3s ease;
}
.dropzone:hover .dz-icon, .tray.drag .dz-icon { transform: translateY(-3px); }
.dz-icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent-text); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.dz-title { font-size: clamp(1.2rem, 2vw, 1.45rem); font-weight: 650; letter-spacing: -0.01em; }
.dz-sub { font-size: .92rem; color: var(--muted); margin-bottom: 14px; }
.dz-tip { margin-top: 16px; font-size: .8rem; color: var(--muted); max-width: 36ch; opacity: .85; }
/* registration crop marks, a nod to the darkroom (only while the tray is empty) */
.crop { position: absolute; width: 16px; height: 16px; border-color: var(--muted); border-style: solid; border-width: 0; opacity: .55; pointer-events: none; }
.crop-tl { top: 14px; left: 14px; border-top-width: 1.5px; border-left-width: 1.5px; }
.crop-tr { top: 14px; right: 14px; border-top-width: 1.5px; border-right-width: 1.5px; }
.crop-bl { bottom: 14px; left: 14px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.crop-br { bottom: 14px; right: 14px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.tray.filled .crop { display: none; }

.tray-full { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; padding: 12px 12px 10px; }
.tray-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 0 2px 12px; border-bottom: 1px solid var(--line);
}
.tray-title { font-size: .95rem; }
.tray-title strong { font-weight: 650; }
.tray-title span { color: var(--muted); font-size: .85rem; margin-inline-start: 4px; }
.tray-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; gap: 6px; }
.btn-sm svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.grid {
  list-style: none; margin: 0; padding: 12px 2px 4px; overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-content: start;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.tray-tip { font-size: .78rem; color: var(--muted); padding: 8px 2px 0; }
/* while dragging files over a full tray */
.tray-drop-hint {
  position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px);
  font-weight: 600; color: var(--accent-text); opacity: 0; transition: opacity .2s ease;
}
.tray.filled.drag .tray-drop-hint { opacity: 1; }

/* run bar: an exposure meter. A thin track fills with light, the scale below lights up like a camera's
   light meter, and the leading edge glows while photos are being processed. */
.meter { --p: 0; display: grid; grid-template-columns: 1fr auto; column-gap: 14px; align-items: center; }
.meter-scale { grid-column: 1; }
.meter-track {
  position: relative; height: 4px; border-radius: 999px; background: var(--chip); overflow: visible;
}
.meter-fill {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 100%); border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), var(--accent));
  transition: width .6s cubic-bezier(.3, .7, .3, 1);
}
/* the glowing leading edge */
.meter-fill::after {
  content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; border-radius: 50%;
  transform: translateY(-50%) scale(0); background: #FFE3A6;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 18px 4px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .3s ease;
}
.meter.running .meter-fill::after { transform: translateY(-50%) scale(1); animation: edge-pulse 1.4s ease-in-out infinite; }
@keyframes edge-pulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 26px 6px color-mix(in srgb, var(--accent) 55%, transparent); } }
/* a soft light travelling along the filled part */
.meter.running .meter-fill {
  background:
    linear-gradient(90deg, transparent 0 30%, rgb(255 255 255 / .55) 50%, transparent 70% 100%) 0 0 / 40% 100% no-repeat,
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), var(--accent));
  animation: travel 1.6s linear infinite;
}
@keyframes travel { from { background-position: -60% 0, 0 0; } to { background-position: 160% 0, 0 0; } }
.meter.complete .meter-fill { background: var(--accent); }
.meter-scale { display: flex; justify-content: space-between; height: 9px; margin-top: 7px; }
.meter-scale i { width: 1.5px; border-radius: 1px; height: 4px; background: var(--line); transition: background-color .4s ease, height .4s ease; }
.meter-scale i.major { height: 8px; }
.meter-scale i.lit { background: var(--accent); }
.meter-count {
  grid-row: 1; grid-column: 2; min-width: 44px; text-align: right; font-size: .78rem; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums; line-height: 1;
}
.meter.running .meter-count, .meter.complete .meter-count { color: var(--accent-text); }
.run-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.run-status { color: var(--muted); font-size: .93rem; min-height: 1.5em; flex: 1 1 220px; }
.run-status strong { color: var(--text); font-weight: 650; }
.btn-run { min-width: 190px; min-height: 48px; font-size: 1rem; }
.btn-run svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Settings panel ---------- */
.panel {
  margin: 0; padding: 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; gap: 4px; align-content: start; min-width: 0;
}
.panel-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.panel-head h2 { font-size: 1.05rem; font-weight: 720; }
.panel-head p { color: var(--muted); font-size: .8rem; }
.panel-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--chip); }
.panel-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; }

.group { border: 0; margin: 0; padding: 14px 0 12px; border-top: 1px solid var(--line); min-width: 0; }
.group legend:not(.sr-only) {
  float: left; width: 100%; padding: 0; margin-bottom: 10px;
  font-size: .8rem; font-weight: 650; color: var(--muted); letter-spacing: .02em;
}
.group legend + * { clear: both; }

/* checkbox tiles */
.toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile-wide { grid-column: 1 / -1; }
.tile {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; user-select: none; font-size: .93rem; font-weight: 550;
  transition: border-color .15s ease, background-color .15s ease;
}
.tile:hover { border-color: var(--muted); }
.tile input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tile .box {
  flex: none; width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--muted);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.tile .box::after {
  content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s cubic-bezier(.3, .7, .3, 1);
}
.tile:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.tile input:checked + .box { background: var(--accent); border-color: var(--accent); }
.tile input:checked + .box::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.tile:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control: a track with a rounded "pill" for the chosen option (no hard inner corners) */
.seg {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; margin-top: 10px; padding: 3px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2);
}
.seg label { position: relative; cursor: pointer; min-width: 0; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span {
  display: grid; place-items: center; min-height: 36px; padding: 0 8px; text-align: center; border-radius: 9px;
  font-size: .88rem; font-weight: 600; color: var(--muted);
  transition: background-color .2s ease, color .2s ease, box-shadow .25s ease;
}
.seg label:hover span { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
.seg input:checked + span {
  background: color-mix(in srgb, var(--accent) 17%, var(--surface));
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 4px 14px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-sm span { min-height: 34px; padding: 0 12px; }

/* Auto edit switch: the four fixes and strength only show while it's on */
.group-auto .auto-options { margin-top: 10px; }
.group-auto:not(.on) .auto-options { display: none; }

/* crop and size: two compact dropdown rows */
.field-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 10px; }
.field-row .seg { margin-top: 0; }
.seg-fill span { min-height: 36px; }
.field-row + .field-row { margin-top: 8px; }
.field-label { font-size: .86rem; font-weight: 500; color: var(--muted); }

.select { position: relative; min-width: 0; }
.select::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; pointer-events: none;
  border: 1.8px solid var(--muted); border-top: 0; border-left: 0; transform: translateY(-70%) rotate(45deg);
}
.select select {
  width: 100%; min-height: 42px; padding: 0 36px 0 12px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); appearance: none; -webkit-appearance: none; font-size: .9rem;
}
.select select:hover { border-color: var(--muted); }
.select option, .select optgroup { background: var(--surface); color: var(--text); }
.custom-size { display: flex; gap: 8px; margin-top: 8px; padding-inline-start: 62px; }
.custom-size input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2); font-size: .95rem;
}
.custom-size .seg { margin-top: 0; flex: none; }
.hint { margin-top: 10px; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.hint strong { color: var(--text); font-weight: 650; }

/* background removal */
.group-bg { padding-bottom: 2px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; min-height: 40px; font-weight: 650; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px;
  background: var(--chip); border: 1px solid var(--line); transition: background-color .18s, border-color .18s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); transition: transform .18s cubic-bezier(.3, .7, .3, 1), background-color .18s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 3px; }
.group-bg:not(.on) .bg-options { display: none; }
/* ---------- Bigger preview while the mouse rests on a photo ---------- */
.peek {
  position: fixed; z-index: 35; pointer-events: none; left: 0; top: 0;
  border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--chip) 0 25%, var(--surface-2) 0 50%) 0 0 / 16px 16px;
  box-shadow: 0 26px 60px -20px rgb(0 0 0 / .7);
  opacity: 0; transform: scale(.96); transition: opacity .16s ease, transform .2s cubic-bezier(.2, .8, .2, 1);
}
.peek.on { opacity: 1; transform: none; }
.peek img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (hover: none) { .peek { display: none; } }
@media (prefers-reduced-motion: reduce) { .peek { transition: none; } }

/* ---------- Photo cards (compact, inside the tray) ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 5px; display: grid; gap: 5px; min-width: 0;
}
.frame {
  position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background-color: var(--checker-b);
  background-image: conic-gradient(var(--checker-a) 25%, transparent 0 50%, var(--checker-a) 0 75%, transparent 0);
  background-size: 12px 12px;
  cursor: pointer; touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.thumb { width: 100%; height: 100%; object-fit: contain; transition: opacity .25s ease; }
.thumb:not([src]) { opacity: 0; }
.card.busy .thumb { opacity: .55; }
.state {
  position: absolute; left: 5px; bottom: 5px; max-width: calc(100% - 10px);
  font-size: .68rem; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 7px; border-radius: 999px; background: rgb(20 18 24 / .78); color: #F3F0F7; backdrop-filter: blur(6px);
}
.state:empty { display: none; }
.card.done .state { background: color-mix(in srgb, var(--ok) 85%, black); color: #0F2414; }
.card.error .state { background: var(--danger); color: #2A0D07; }
.card.comparing .state { background: var(--accent); color: var(--accent-ink); }
.card.busy .frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .18) 50%, transparent 70%);
  background-size: 250% 100%; animation: sweep 1.3s linear infinite;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
/* small round buttons on the photo: download (when ready) and remove */
.card-actions { position: absolute; top: 5px; right: 5px; display: flex; gap: 4px; }
.icon-btn {
  display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 8px; cursor: pointer;
  background: rgb(20 18 24 / .72); color: #F3F0F7; backdrop-filter: blur(6px);
  transition: opacity .2s ease, background-color .2s ease, transform .15s ease;
}
.icon-btn:disabled { display: none; }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.dl { background: var(--accent); color: var(--accent-ink); }
.icon-btn:hover { transform: scale(1.08); }
.icon-btn.rm:hover { background: var(--danger); color: #2A0D07; }
@media (hover: hover) {
  .card .rm { opacity: 0; }
  .card:hover .rm, .card:focus-within .rm { opacity: 1; }
}
.card-meta { display: grid; gap: 0; padding: 0 3px 2px; min-width: 0; }
.name { font-size: .76rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail { font-size: .7rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.error .detail { color: var(--danger); }


/* ---------- How it works (centred) ---------- */
.how { max-width: 1180px; margin: 0 auto; padding: 88px var(--gutter) 0; text-align: center; }
.how h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 780; letter-spacing: -0.02em; }
.steps {
  margin: 28px 0 0; padding: 0; list-style: none; counter-reset: s;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; text-align: left;
}
.steps li {
  counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 10px; color: var(--muted);
  padding: 20px; border-radius: 16px; border: 1px solid var(--glass-line); background: var(--glass);
}
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--chip); color: var(--accent-text); font-weight: 800; font-size: .95rem;
}
.steps strong { color: var(--text); font-weight: 650; display: block; }
.uses { list-style: none; padding: 0; margin: 28px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 920px; }
.uses li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: .88rem; font-weight: 550;
}
.uses li::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%23241A04' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.uses li.more { border-style: dashed; color: var(--muted); padding-inline: 14px; }
.uses li.more::before { display: none; }

/* ---------- Support ---------- */
.support { max-width: 1180px; margin: 0 auto; padding: 80px var(--gutter) 0; text-align: center; }
.support-card {
  max-width: 760px; margin: 0 auto; padding: 36px clamp(20px, 4vw, 52px) 26px;
  border-radius: 22px; border: 1px solid var(--glass-line); background: var(--glass); box-shadow: var(--glass-shadow);
}
.support-heart {
  display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 14px; border-radius: 50%;
  background: color-mix(in srgb, #F0627A 16%, transparent);
}
.support-heart svg { width: 22px; height: 22px; fill: #F0627A; }
.support h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); font-weight: 700; letter-spacing: -0.02em; }
.support-card > p { color: var(--muted); max-width: 56ch; margin: 14px auto 0; }
.support-card .btn { margin-top: 22px; min-height: 46px; padding: 0 22px; }
.support-card .btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.support-meta { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 0; font-size: .78rem; color: var(--muted); }
.support-meta li { padding: 0 12px; }
.support-meta li + li { border-inline-start: 1px solid var(--line); }
.support-meta li:first-child { font-weight: 650; color: var(--text); }
@keyframes beat { 30% { transform: scale(1.22); } 60% { transform: scale(.95); } }

/* ---------- Header controls ---------- */
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text);
  font-size: .88rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}
.top-btn svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.support-link svg { fill: #F0627A; stroke: none; }
/* Language menu */
.topbar { position: relative; z-index: 30; } /* the open menu sits above the page and the email box */
.lang { position: relative; }
.lang-btn { font-family: inherit; }
.lang-btn .lang-chev { width: 14px; height: 14px; margin-inline-start: -2px; opacity: .7; transition: transform .25s ease; }
.lang-btn[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: var(--surface); }
.lang-btn[aria-expanded="true"] .lang-chev { transform: rotate(180deg); }
.lang-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 40;
  min-width: 190px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 22px 48px -18px rgb(0 0 0 / .55), 0 0 0 1px rgb(255 255 255 / .02) inset;
  transform-origin: top right;
  animation: lang-in .18s cubic-bezier(.2, .8, .2, 1);
}
[dir="rtl"] .lang-menu { transform-origin: top left; }
.lang-menu[hidden] { display: none; }
@keyframes lang-in { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.lang-menu li {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 9px 12px; border-radius: 10px; font-size: .92rem; font-weight: 500;
  color: var(--text); cursor: pointer; outline: none;
}
.lang-menu li:hover, .lang-menu li:focus-visible { background: var(--surface-2); }
.lang-menu li:focus-visible { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent); }
.lang-menu li svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.lang-menu li[aria-selected="true"] { color: var(--accent-text); font-weight: 700; }
.lang-menu li[aria-selected="true"] svg { visibility: visible; }
@media (prefers-reduced-motion: reduce) { .lang-menu { animation: none; } .lang-btn .lang-chev { transition: none; } }
/* base.css gives the theme button its own look; align it with the other header buttons */
.top-actions .theme-toggle { height: 38px; padding: 0 13px 0 11px; font-size: .88rem; }

/* translated pages wait a moment so English doesn't flash first */
.i18n-wait body { opacity: 0; }
body { transition: opacity .2s ease, background-color .25s ease, color .25s ease; }

/* ---------- Newsletter corner box ---------- */
.newsletter {
  position: fixed; right: 20px; bottom: 20px; z-index: 20; width: min(330px, calc(100vw - 40px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 18px 14px; box-shadow: var(--shadow), 0 24px 60px -20px rgb(0 0 0 / .5);
}
.newsletter h2 { font-size: 1.02rem; font-weight: 740; padding-right: 28px; }
.newsletter > p { color: var(--muted); font-size: .88rem; margin-top: 4px; }
.nl-row { display: flex; gap: 8px; margin-top: 12px; }
.nl-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); font-size: .95rem;
}
.nl-row input::placeholder { color: var(--muted); opacity: .8; }
.nl-row input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nl-row .btn { padding: 0 16px; }
.nl-msg { font-size: .85rem; min-height: 1.3em; margin-top: 8px; color: var(--muted); }
.nl-msg.good { color: var(--ok); }
.nl-msg.bad { color: var(--danger); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.nl-close {
  position: absolute; top: 10px; right: 10px; z-index: 3; width: 32px; height: 32px; border-radius: 50%;
  background: transparent; border: 0; cursor: pointer; color: var(--muted); display: grid; place-items: center;
}
.nl-close:hover { color: var(--text); background: var(--surface-2); }
.nl-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nl-reopen {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-weight: 600; font-size: .9rem; cursor: pointer; box-shadow: var(--shadow);
}
.nl-reopen:hover { border-color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .newsletter { position: static; width: auto; max-width: 560px; margin: 48px auto 0; margin-inline: max(var(--gutter), calc((100% - 560px) / 2)); box-shadow: none; }
  .nl-close, .nl-reopen { display: none !important; }
  .footer { padding-bottom: 40px; }
}
@media (max-width: 880px) {
  .studio { grid-template-columns: 1fr; }
  /* one column: the tray sizes to its content, and a long batch scrolls inside it */
  .tray { contain: none; min-height: 260px; }
  .tray.filled .grid { max-height: 62vh; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .top-btn .theme-label, .support-link span, .contact-link span { display: none; }
  .top-btn { padding: 0 10px; }
  .top-actions .theme-toggle { padding: 0 10px; }
}
@media (max-width: 520px) {
  .studio { border-radius: 20px; padding: 10px; margin-inline: 12px; }
  .panel { padding: 14px; }
  .dropzone { padding: 32px 16px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .tray-actions { width: 100%; }
  .tray-actions .btn-primary { flex: 1 1 100%; }
  .run-row .btn { width: 100%; }
  .custom-size { padding-inline-start: 0; }
  .how { padding-top: 56px; }
  .brand-name { font-size: 1.15rem; }
  .brand-mark { width: 40px; height: 40px; }
  .brand { gap: 9px; }
}

/* Support heart: a steady, soft heartbeat that loops all the time (two beats, then a short rest) */
.support-link svg { transform-origin: 50% 55%; animation: heartbeat 1.8s ease-in-out infinite; }
@keyframes heartbeat {
  0%, 45%, 100% { transform: scale(1); }
  10% { transform: scale(1.26); }
  20% { transform: scale(1.02); }
  30% { transform: scale(1.18); }
}
/* this small heartbeat stays on even when the device asks for less motion */
@media (prefers-reduced-motion: reduce) {
  .support-link svg { animation: heartbeat 1.8s ease-in-out infinite !important; }
}

/* =====================================================================
   Hover details. Pointer devices only; turned off by "reduce motion".
   One idea throughout: light. Surfaces catch a soft light where the
   pointer is, controls glow a little, text gets a quick sheen.
   ===================================================================== */
.studio, .steps li, .card, .uses li, .support-card { position: relative; }
@media (hover: hover) {
  /* a thin rim of light on the border, centred on the pointer */
  /* the light glides after the pointer instead of jumping (the two positions are animatable, see @property) */
  .spot { transition: --mx .35s cubic-bezier(.2, .7, .2, 1), --my .35s cubic-bezier(.2, .7, .2, 1); }
  .spot::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    /* eased fall-off (several stops) so the rim fades out smoothly instead of ending in a visible edge */
    background: radial-gradient(380px circle at var(--mx) var(--my),
      color-mix(in srgb, var(--accent) 48%, transparent) 0%,
      color-mix(in srgb, var(--accent) 30%, transparent) 22%,
      color-mix(in srgb, var(--accent) 14%, transparent) 45%,
      color-mix(in srgb, var(--accent) 5%, transparent) 68%,
      transparent 88%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    opacity: 0; transition: opacity .6s ease;
  }
  .spot:hover::after { opacity: 1; }
  /* and a faint pool of light on the surface itself */
  .studio:hover { background: radial-gradient(520px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 6%, transparent), transparent 70%), var(--glass); }
  .steps li:hover { background: radial-gradient(320px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--glass); }
  .card:hover { background: radial-gradient(260px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 7%, transparent), transparent 70%), var(--surface); }

  /* controls lift slightly and catch light */
  .tile, .seg span, .select select, .icon-btn, .uses li, .card, .steps li, .support-card {
    transition: border-color .2s ease, background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .25s ease, opacity .2s ease,
      --mx .35s cubic-bezier(.2, .7, .2, 1), --my .35s cubic-bezier(.2, .7, .2, 1);
  }
  .tile:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--accent) 60%, transparent); }
  .card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -20px rgb(0 0 0 / .6); }
  .support-card:hover { background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--glass); }
  .top-btn:hover { border-color: var(--muted); background: color-mix(in srgb, var(--text) 5%, transparent); }
  .support-link:hover svg { animation-duration: 1s; }
  .card .thumb { transition: opacity .25s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
  .card:hover .thumb { transform: scale(1.035); }
  .uses li:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 8%, transparent); }
  .steps li:hover { transform: translateY(-2px); }

  /* buttons: the primary one glows like a lit safelight */
  .btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent), 0 10px 30px -10px color-mix(in srgb, var(--accent) 80%, transparent);
  }
  .btn-run:hover:not(:disabled) svg { animation: twinkle .6s ease; }
  .btn-outline:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
  .btn-quiet:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 5%, transparent); }
  .dropzone:hover .dz-icon { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 9%, transparent), 0 0 34px -4px color-mix(in srgb, var(--accent) 55%, transparent); }

  /* section titles: a line as wide as the title draws in from the left while you're in that section,
     and slides away to the right when you leave */
  .how h2, .support h2 { position: relative; display: inline-block; }
  .how h2::after, .support h2::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, transparent), var(--accent) 30% 70%, color-mix(in srgb, var(--accent) 35%, transparent));
    transform: scaleX(0); transform-origin: right center;
    transition: transform .6s cubic-bezier(.65, 0, .35, 1);
  }
  .how:hover h2::after, .support:hover h2::after { transform: scaleX(1); transform-origin: left center; }
  [dir="rtl"] .how h2::after, [dir="rtl"] .support h2::after { transform-origin: left center; }
  [dir="rtl"] .how:hover h2::after, [dir="rtl"] .support:hover h2::after { transform-origin: right center; }

  /* links: the underline grows from the left */
  .footer a, .how-note a { text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .3s ease, color .2s; }
  .footer a:hover, .how-note a:hover { background-size: 100% 1px; }

  /* the logo focuses: the viewfinder corners close in, the lens racks focus and the glint flashes */
  .bm-vf path { transition: transform .45s cubic-bezier(.3, .8, .3, 1); }
  .brand:hover .bm-tl, .brand:focus-visible .bm-tl { transform: translate(2px, 2px); }
  .brand:hover .bm-tr, .brand:focus-visible .bm-tr { transform: translate(-2px, 2px); }
  .brand:hover .bm-br, .brand:focus-visible .bm-br { transform: translate(-2px, -2px); }
  .brand:hover .bm-bl, .brand:focus-visible .bm-bl { transform: translate(2px, -2px); }
  .brand:hover .bm-glass, .brand:focus-visible .bm-glass { animation: bm-glass .6s cubic-bezier(.5, 0, .2, 1) .1s; }
  .brand:hover .bm-ring, .brand:focus-visible .bm-ring { animation: bm-ring .6s cubic-bezier(.5, 0, .2, 1) .1s; }
  .brand:hover .bm-glint, .brand:focus-visible .bm-glint { animation: bm-glint .6s ease-out .1s; }
  @keyframes bm-glass { 40% { transform: scale(1.22); } }
  @keyframes bm-ring  { 40% { transform: scale(.55); opacity: 1; } }
  @keyframes bm-glint { 40% { transform: translate(-1px, -1px) scale(1.5); filter: drop-shadow(0 0 2px #FFF4D9); } }

  /* theme switch: the sun turns, the moon tilts */
  .theme-toggle svg { transition: transform .5s cubic-bezier(.3, .7, .3, 1); }
  .theme-toggle:hover .icon-sun { transform: rotate(60deg); }
  .theme-toggle:hover .icon-moon { transform: rotate(-18deg); }
}
@keyframes twinkle { 40% { transform: scale(1.25) rotate(15deg); } }

/* pointer position for the hover light; registered so it can glide smoothly */
@property --mx { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }
@property --my { syntax: "<length-percentage>"; inherits: false; initial-value: 50%; }

/* Chinese and Japanese don't put a space between the two parts of the headline */
:lang(zh) .h1-glow, :lang(ja) .h1-glow { margin-inline-start: 0; }

/* ---------- Email box entrance (computers, where it floats in the corner) ----------
   A moment after the page opens, the box rises from the corner with a slight tilt that settles, its text
   fades in line by line, and a soft amber light runs once around its border. */
@property --nl-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@media (min-width: 1101px) {
  .newsletter.nl-pre { opacity: 0; transform: translateY(70px) rotate(-4deg) scale(.92); pointer-events: none; }
  /* (entrance animations for .nl-show are set further down, with the shine) */
  .newsletter.nl-show > h2, .newsletter.nl-show > p, .newsletter.nl-show > form { animation: nl-line .55s ease-out both; }
  .newsletter.nl-show > h2 { animation-delay: .3s; }
  .newsletter.nl-show > p { animation-delay: .42s; }
  .newsletter.nl-show > form { animation-delay: .54s; }
  /* a soft glass shine sweeps across the card once, while its border warms to amber and cools again */
  .newsletter::after {
    content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--accent) 22%, transparent) 45%,
      rgb(255 255 255 / .16) 50%, color-mix(in srgb, var(--accent) 22%, transparent) 55%, transparent 70%) 0 0 / 260% 100% no-repeat;
    background-position: 130% 0; opacity: 0;
  }
  .newsletter.nl-show::after { animation: nl-shine 1.5s .6s cubic-bezier(.45, 0, .25, 1) both; }
  .newsletter.nl-show { animation: nl-rise 1s cubic-bezier(.2, 1.25, .35, 1) both, nl-warm 2.2s .5s ease-in-out both; }
}
@keyframes nl-rise {
  0% { opacity: 0; transform: translateY(70px) rotate(-4deg) scale(.92); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
@keyframes nl-line { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nl-sweep {
  0% { --nl-a: 0deg; opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { --nl-a: 360deg; opacity: 0; }
}

/* small checkbox row (Auto-center), lined up with the dropdowns above it */
.check-row {
  display: flex; align-items: center; gap: 9px; margin: 0; padding-inline-start: 82px;
  font-size: .86rem; color: var(--text); cursor: pointer; user-select: none; position: relative;
}
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-row .box {
  flex: none; width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--muted);
  display: grid; place-items: center; transition: background-color .15s, border-color .15s;
}
.check-row .box::after {
  content: ""; width: 8px; height: 4.5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s cubic-bezier(.3, .7, .3, 1);
}
.check-row:hover .box { border-color: var(--text); }
.check-row input:checked + .box { background: var(--accent); border-color: var(--accent); }
.check-row input:checked + .box::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check-row input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 520px) { .check-row { padding-inline-start: 0; } }
/* the four options sit together as one short list */
.checks { display: grid; gap: 7px; margin-top: 12px; }

/* ---------- Compact layout: the whole work area fits on a laptop/desktop screen at first view ---------- */
.hero { padding-top: clamp(14px, 3vw, 30px); padding-bottom: clamp(16px, 2.4vw, 26px); }
.lede { margin-top: 10px; }
.promise { margin-top: 14px; }
.panel { padding: 16px; gap: 2px; }
.panel-head { padding-bottom: 6px; }
.panel-icon { width: 34px; height: 34px; }
.group { padding: 11px 0 9px; }
.group legend:not(.sr-only) { margin-bottom: 8px; }
.switch { min-height: 36px; }
.tile { min-height: 38px; }
.toggles { gap: 7px; }
.seg span { min-height: 32px; }
.group-auto .auto-options { margin-top: 8px; }
.seg { margin-top: 8px; }
.field-row .seg { margin-top: 0; }
.select select { min-height: 38px; }
.field-row + .field-row { margin-top: 7px; }
.custom-size { padding-inline-start: 82px; }
/* the four options: two short columns, no indent */
.checks { grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 11px; }
.checks .check-row { padding-inline-start: 0; }
.run-row { margin-top: 12px; }
.studio-main { gap: 14px; }
.topbar { padding-top: 12px; padding-bottom: 10px; }
.hero { padding-top: clamp(10px, 2vw, 18px); padding-bottom: clamp(14px, 2vw, 20px); }
.switch { min-height: 34px; }
.tile { min-height: 36px; }
.seg span { min-height: 30px; }
.select select { min-height: 36px; }

/* email box as a small pill while it would cover the work area (see fitNewsletter in app.js) */
.newsletter.nl-mini { width: auto; padding: 11px 18px; cursor: pointer; }
.newsletter.nl-mini > :not(h2) { display: none; }
.newsletter.nl-mini h2 { margin: 0; padding-right: 0; font-size: .92rem; }
.newsletter.nl-mini:hover { border-color: var(--muted); }
.newsletter.nl-away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .25s ease, visibility 0s .25s; }

/* ---------- Selecting photos ---------- */
.card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent), 0 10px 26px -14px color-mix(in srgb, var(--accent) 80%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}
.card.selected .frame::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.card.selected .name { color: var(--accent-text); }
/* the round check in the top-left corner of each photo */
.sel {
  position: absolute; top: 6px; left: 6px; z-index: 2; width: 24px; height: 24px; padding: 0;
  display: grid; place-items: center; border-radius: 50%; cursor: pointer;
  border: 2px solid rgb(255 255 255 / .9); background: rgb(20 18 24 / .45); color: transparent;
  box-shadow: 0 1px 4px rgb(0 0 0 / .4); backdrop-filter: blur(4px);
  transition: opacity .15s ease, background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.sel svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sel:hover { transform: scale(1.08); }
.sel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sel[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sel:disabled { cursor: default; }
/* on computers the circles appear on hover, and stay on every photo once something is selected */
@media (hover: hover) {
  .sel { opacity: 0; }
  .card:hover .sel, .sel:focus-visible, .grid.selecting .sel, .sel[aria-checked="true"] { opacity: 1; }
}
#selectAllBtn svg { width: 16px; height: 16px; }
#selectAllBtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); }
@media (prefers-reduced-motion: reduce) { .card, .sel { transition: none; } }

/* ---------- "Bulk" in the headline: on hover the word turns into many fine amber dots (a batch of small pieces) ---------- */
.bulk {
  display: inline-block; cursor: default; transition: color .35s ease;
  background: radial-gradient(circle, var(--accent) 56%, transparent 61%) 0 0 / .068em .068em;
  -webkit-background-clip: text; background-clip: text;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .bulk:hover, .bulk.fan { color: transparent; animation: bulk-dots 1s cubic-bezier(.3, .6, .3, 1) forwards; }
}
@keyframes bulk-dots {
  0%   { background-size: .045em .045em; }
  45%  { background-size: .09em .09em; }
  100% { background-size: .068em .068em; }
}

/* ---------- Options list: hover previews the tick, ticking pops it in ---------- */
.check-row > span:last-child { transition: transform .25s cubic-bezier(.2, .8, .2, 1), color .2s ease; }
.check-row .box { transition: background-color .15s, border-color .15s, box-shadow .25s ease, transform .25s cubic-bezier(.2, .8, .2, 1); }
@media (hover: hover) {
  .check-row:hover .box { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
  .check-row:hover > span:last-child { color: var(--accent-text); transform: translateX(3px); }
  [dir="rtl"] .check-row:hover > span:last-child { transform: translateX(-3px); }
  /* a faint tick shows what a click will do */
  .check-row:hover input:not(:checked) + .box::after {
    border-color: var(--accent); opacity: .55; transform: translateY(-1px) rotate(-45deg) scale(.85);
  }
  .check-row:hover input:not(:checked) + .box { animation: box-pop .35s cubic-bezier(.2, .8, .2, 1); }
}
.check-row input:checked + .box::after { animation: tick-pop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes box-pop { 40% { transform: scale(1.14); } }
@keyframes tick-pop { 0% { transform: translateY(-1px) rotate(-45deg) scale(.2); } 100% { transform: translateY(-1px) rotate(-45deg) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .check-row .box, .check-row > span:last-child { transition: none; animation: none; }
  .check-row input:checked + .box::after { animation: none; }
}

/* ---------- Contact pop-up ---------- */
.foot-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.support-contact { margin-top: 14px; font-size: .88rem; color: var(--muted); }
.support-contact a { color: var(--accent-text); font-weight: 600; text-decoration: none; }
.support-contact a:hover { text-decoration: underline; text-underline-offset: 3px; }

.contact-dlg {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / .75);
}
.contact-dlg[open] { animation: ct-in .28s cubic-bezier(.2, .8, .2, 1); }
.contact-dlg::backdrop { background: rgb(10 9 12 / .62); backdrop-filter: blur(4px); }
@keyframes ct-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.ct-x { top: 14px; right: 14px; }
.ct-form, .ct-done { padding: 26px 26px 22px; display: grid; gap: 14px; }
.ct-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.ct-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ct-icon.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); }
.ct-icon.ok svg { stroke: var(--ok); stroke-width: 2.4; }
.contact-dlg h2 { margin: 0; font-size: 1.35rem; font-weight: 740; letter-spacing: -0.02em; padding-right: 30px; }
.ct-lead, .ct-done p { margin: -6px 0 2px; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-field { display: grid; gap: 6px; font-size: .84rem; font-weight: 600; color: var(--muted); min-width: 0; }
.ct-label-row { display: flex; justify-content: space-between; gap: 8px; }
.ct-count { font-weight: 500; opacity: .75; font-variant-numeric: tabular-nums; }
.ct-field input, .ct-field textarea, .ct-field select {
  width: 100%; min-height: 42px; padding: 10px 12px; border-radius: 10px; font: inherit; font-size: .92rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ct-field select { padding-right: 36px; }
.ct-field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.ct-field input::placeholder, .ct-field textarea::placeholder { color: var(--muted); opacity: .7; }
.ct-field :is(input, textarea, select):hover { border-color: var(--muted); }
.ct-field :is(input, textarea, select):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ct-field [aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.ct-msg { margin: -4px 0 0; font-size: .86rem; color: var(--muted); }
.ct-msg:empty { display: none; }
.ct-msg.bad { color: var(--danger); }
.ct-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ct-note { margin: 0; font-size: .8rem; color: var(--muted); }
.ct-note a { color: var(--accent-text); }
#ctSend svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ct-done { justify-items: start; }
@media (max-width: 520px) { .ct-row { grid-template-columns: 1fr; } .ct-form, .ct-done { padding: 22px 18px 18px; } }
@media (prefers-reduced-motion: reduce) { .contact-dlg[open] { animation: none; } }

/* ---------- Header buttons: two pairs, each pair shares one look ----------
   left pair  = actions (Contact, Support)   right pair = preferences (Language, Light/Dark)
   (style "a": solid action pills, quiet preference buttons after a thin divider) */
.top-actions { gap: 14px; }
.top-group { display: flex; align-items: center; gap: 8px; }
.contact-link { font-family: inherit; }

/* A: solid action pills, quiet preference buttons after a thin divider */
[data-style="a"] .top-main .top-btn { background: var(--surface-2); border-color: transparent; font-weight: 600; }
[data-style="a"] .top-prefs { gap: 2px; }
[data-style="a"] .top-prefs::before { content: ""; width: 1px; height: 20px; background: var(--line); margin-inline-end: 8px; }
[data-style="a"] .top-prefs .top-btn { background: transparent; border-color: transparent; color: var(--muted); height: 36px; font-size: .86rem; }
@media (hover: hover) {
  [data-style="a"] .top-main .top-btn:hover { background: color-mix(in srgb, var(--text) 12%, var(--surface-2)); border-color: transparent; }
  [data-style="a"] .top-prefs .top-btn:hover { color: var(--text); border-color: transparent; background: color-mix(in srgb, var(--text) 6%, transparent); }
}


/* phones: every header button shows just its icon, so the two pairs fit next to the logo */
@media (max-width: 560px) {
  .top-actions { gap: 8px; }
  .top-group { gap: 6px; }
  .top-prefs #langName, .top-prefs .lang-chev { display: none; }
  .top-prefs .top-btn { width: 38px; padding: 0; justify-content: center; }
  [data-style="a"] .top-prefs::before { margin-inline-end: 2px; }
}

/* ---------- The three promises arrive one after another, left to right, as the headline settles ---------- */
@media (prefers-reduced-motion: no-preference) {
  .promise li { animation: promise-in .8s cubic-bezier(.2, .8, .2, 1) both; }
  .promise li:nth-child(1) { animation-delay: 1.1s; }
  .promise li:nth-child(2) { animation-delay: 1.35s; }
  .promise li:nth-child(3) { animation-delay: 1.6s; }
  /* each tick draws itself just after its words land */
  .promise li svg { animation: tick-draw .5s ease both; }
  .promise li:nth-child(1) svg { animation-delay: 1.5s; }
  .promise li:nth-child(2) svg { animation-delay: 1.75s; }
  .promise li:nth-child(3) svg { animation-delay: 2s; }
  @media (hover: hover) { .promise li:hover svg { animation: tick-draw .5s ease; } }
}
@keyframes promise-in {
  from { opacity: 0; transform: translateX(-28px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
[dir="rtl"] .promise li { animation-name: promise-in-rtl; }
@keyframes promise-in-rtl {
  from { opacity: 0; transform: translateX(28px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- Main box: the same soft amber light runs once around its border when the page opens ---------- */
.studio-ring { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .studio-ring {
    display: block; position: absolute; inset: -1px; z-index: 3; border-radius: inherit; padding: 1.5px; pointer-events: none;
    background: conic-gradient(from var(--nl-a), transparent 0 62%, color-mix(in srgb, var(--accent) 90%, white) 80%, transparent 96%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    animation: nl-sweep 2.4s 4.4s ease-in-out both; /* the promises finish at about 2.4 s; this starts 2 s later */
  }
}
@keyframes nl-shine {
  0% { background-position: 130% 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { background-position: -30% 0; opacity: 0; }
}
@keyframes nl-warm {
  0%, 100% { border-color: var(--line); }
  40% { border-color: color-mix(in srgb, var(--accent) 75%, var(--line)); box-shadow: var(--shadow), 0 24px 60px -20px rgb(0 0 0 / .5), 0 0 26px -4px color-mix(in srgb, var(--accent) 45%, transparent); }
}
/* a gentle reminder now and then: the same shine and warm border, without the rise (see app.js) */
@media (min-width: 1101px) and (prefers-reduced-motion: no-preference) {
  .newsletter.nl-show.nl-ping { animation: nl-warm-again 2.2s ease-in-out both; }
  .newsletter.nl-show.nl-ping::after { animation: nl-shine-again 1.5s .1s cubic-bezier(.45, 0, .25, 1) both; }
}
/* same keyframes under new names: a browser only restarts an animation when its name changes */
@keyframes nl-shine-again {
  0% { background-position: 130% 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { background-position: -30% 0; opacity: 0; }
}
@keyframes nl-warm-again {
  0%, 100% { border-color: var(--line); }
  40% { border-color: color-mix(in srgb, var(--accent) 75%, var(--line)); box-shadow: var(--shadow), 0 24px 60px -20px rgb(0 0 0 / .5), 0 0 26px -4px color-mix(in srgb, var(--accent) 45%, transparent); }
}
.support-pay { margin-top: 10px; font-size: .78rem; color: var(--muted); }

/* ---------- The four output options as tiles (same family as the Auto edit tiles) ---------- */
.checks.opts { grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.tile.opt { min-height: 36px; padding: 0 10px 0 11px; gap: 9px; font-size: .86rem; font-weight: 550; }
.tile.opt .opt-text { flex: 1; min-width: 0; line-height: 1.2; }
.opt-ic { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.tile.opt:has(input:checked) .opt-ic { stroke: var(--accent-text); }
@media (hover: hover) { .tile.opt:hover .opt-ic { stroke: var(--text); transform: scale(1.12); } .tile.opt:has(input:checked):hover .opt-ic { stroke: var(--accent-text); } }
/* a little more room elsewhere so the whole work area still fits on a 1080p screen */
.group { padding: 10px 0 8px; }
.field-row + .field-row { margin-top: 6px; }
