/* ---------- Design tokens ---------- */
:root {
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* dark (default): the darkroom */
  --bg: #1E1C23;
  --surface: #27242E;
  --surface-2: #302C38;
  --line: #3E3948;
  --text: #EEEAF3;
  --muted: #A69FB3;
  --accent: #F2B544;      /* safelight amber */
  --accent-ink: #241A04;
  --accent-text: #F6C870;
  --danger: #F2836F;
  --ok: #8BD19A;
  --glass: linear-gradient(160deg, rgb(255 255 255 / .055), rgb(255 255 255 / .018));
  --glass-line: rgb(255 255 255 / .09);
  --glass-shadow: 0 1px 0 rgb(255 255 255 / .05) inset, 0 40px 90px -40px rgb(0 0 0 / .8);
  --glow: rgb(242 181 68 / .13);
  --dash: rgb(255 255 255 / .2);
  --well: rgb(0 0 0 / .14);
  --well-hi: rgb(242 181 68 / .05);
  --chip: #36313F;
  --sheen: #FFF4D9;
  --checker-a: #3A3543;
  --checker-b: #2E2A36;
  --shadow: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 18px 40px -24px rgb(0 0 0 / 0.7);

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: dark;
}

[data-theme="light"] {
  /* light: the light table in daylight */
  --bg: #ECEEF2;
  --surface: #FFFFFF;
  --surface-2: #F5F6F8;
  --line: #D3D7DF;
  --text: #1E1C23;
  --muted: #5B5767;
  --accent: #F2B544;
  --accent-ink: #241A04;
  --accent-text: #8A5A00;
  --danger: #B3402C;
  --ok: #2E7D45;
  --glass: linear-gradient(160deg, rgb(255 255 255 / .9), rgb(255 255 255 / .65));
  --glass-line: rgb(30 28 35 / .08);
  --glass-shadow: 0 30px 70px -36px rgb(30 28 35 / .35);
  --glow: rgb(242 181 68 / .28);
  --dash: rgb(30 28 35 / .22);
  --well: #F5F6F8;
  --well-hi: #FFF8EA;
  --chip: #E8E9EE;
  --sheen: #E8B04A;
  --checker-a: #E4E6EB;
  --checker-b: #F7F8FA;
  --shadow: 0 18px 40px -26px rgb(30 28 35 / 0.45);
  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;

  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
a:not(.btn, .top-btn):hover { color: var(--accent-text); } /* buttons that are links keep their own colours */
h1, h2, h3 { margin: 0; line-height: 1.1; }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px var(--gutter);
  max-width: 1180px; margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-weight: 800; font-size: 1.45rem; letter-spacing: -0.03em; }
/* a camera viewfinder framing a lens: amber barrel, dark glass, focus ring and a glint */
.brand-mark { width: 52px; height: 52px; flex: none; overflow: visible; }
.bm-vf { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; }
.bm-body { fill: var(--accent); }
.bm-glass { fill: var(--accent-ink); }
.bm-ring { fill: none; stroke: var(--accent); stroke-width: .9; opacity: .55; }
.bm-glint { fill: #FFF4D9; }
.brand-mark path, .brand-mark circle { transform-box: fill-box; transform-origin: center; }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px 7px 10px; cursor: pointer; font-size: .9rem; white-space: nowrap; flex: none;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease, opacity .15s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #FFC75E; }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--text); }
.btn-quiet:hover:not(:disabled) { border-color: var(--muted); }
.btn-outline { background: transparent; border-color: color-mix(in srgb, var(--text) 40%, transparent); color: var(--text); }
.btn-outline svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.dropzone:hover .btn-outline { border-color: var(--text); }

/* ---------- Footer ---------- */
.footer {
  max-width: 1180px; margin: 0 auto; padding: 40px var(--gutter) 120px;
  color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 8px 32px; justify-content: space-between;
}

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