/* SS Visualist — "Light table" design tokens and shared components */
:root {
  /* Sonia's palette (24 Oct 2026): warm light beige + deep emerald. Emerald replaces black everywhere. */
  --paper: #EFE6D6;      /* warm light beige: page */
  --sheet: #F7F1E6;      /* raised paper: cards, fields */
  --ink: #0E4A3B;        /* deep emerald: headings, text, buttons */
  --graphite: #566A5E;   /* secondary text */
  --hair: #D6C8AE;       /* rules, borders */
  --pencil: #B0392A;     /* grease pencil: selection only */
  --ok: #1A6E46;
  --warn: #8A5A0E;
  --focus: #2457C5;
  --scrim: rgba(9, 46, 37, .55);
  --radius-s: 8px;
  --radius-m: 14px;
  --font: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --step--1: 0.8125rem;  /* 13 */
  --step-0: 1rem;        /* 16 */
  --step-1: 1.1875rem;   /* 19 */
  --step-2: 1.5rem;      /* 24 */
  --step-3: 2.25rem;     /* 36 */
  --step-4: clamp(2.6rem, 6.4vw, 5.5rem);
  color-scheme: light;
}
/* Dark: the same emerald becomes the page, beige becomes the text. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0E4A3B; --sheet: #155545; --ink: #EFE6D6; --graphite: #B9C6B6; --hair: #2F6656;
    --pencil: #F6A48E; --ok: #A6DDB9; --warn: #EBC373; --focus: #9DB8F5; --scrim: rgba(4, 24, 19, .7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0E4A3B; --sheet: #155545; --ink: #EFE6D6; --graphite: #B9C6B6; --hair: #2F6656;
  --pencil: #F6A48E; --ok: #A6DDB9; --warn: #EBC373; --focus: #9DB8F5; --scrim: rgba(4, 24, 19, .7); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--pencil) 25%, transparent); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--graphite); }

/* Logo */
.logo { font-weight: 800; letter-spacing: -0.02em; font-size: var(--step-1); text-decoration: none; white-space: nowrap; }
.logo span { font-weight: 400; color: var(--graphite); }

/* Buttons */
.btn {
  appearance: none; border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 var(--step-0)/1 var(--font); padding: 14px 22px; border-radius: 999px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
}
.btn:hover { background: color-mix(in srgb, var(--ink) 86%, var(--paper)); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--hair); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.small { min-height: 36px; padding: 8px 14px; font-size: var(--step--1); }
.linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Fields */
label.field { display: grid; gap: 6px; font-weight: 500; }
label.field small { font-weight: 400; color: var(--graphite); }
input[type="text"], input[type="email"] {
  font: 400 var(--step-0)/1.3 var(--font); color: var(--ink); background: var(--sheet);
  border: 1px solid var(--hair); border-radius: var(--radius-s); padding: 13px 14px; width: 100%; min-height: 48px;
}
input[type="text"]:focus, input[type="email"]:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }

/* Frames: photos on the light table, with crop marks */
.frame { position: relative; margin: 0; }
.frame .shot { position: relative; background: color-mix(in srgb, var(--hair) 55%, var(--paper)); }
.frame .shot img { width: 100%; height: 100%; object-fit: cover; }
.frame .shot > button, .frame .shot > .developing, .frame .shot > .failed { overflow: hidden; }
.frame .crop::before, .frame .crop::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--ink); pointer-events: none;
}
.frame .crop { position: absolute; inset: 0; pointer-events: none; }
.frame .crop::before { top: -7px; left: -7px; border-right: 0; border-bottom: 0; }
.frame .crop::after { bottom: -7px; right: -7px; border-left: 0; border-top: 0; }
.frame figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: var(--step--1); color: var(--graphite); margin-top: 9px; font-variant-numeric: tabular-nums; }

/* Grease-pencil circle around a chosen frame */
.pencil-ring { position: absolute; inset: -20px -14px -30px; pointer-events: none; overflow: visible; }
.pencil-ring path { fill: none; stroke: var(--pencil); stroke-width: 1.6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.pencil-note { position: absolute; color: var(--pencil); font-weight: 500; font-style: italic; transform: rotate(-4deg); white-space: nowrap; }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); border-radius: 999px; padding: 5px 11px; font-size: var(--step--1); background: var(--sheet); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 15%, transparent); flex: none; }

/* Status marks */
.mark-ok { color: var(--ok); }
.mark-warn { color: var(--warn); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
