/* ==========================================================================
   quickImages — Design tokens
   Two named themes sharing one brand hue (coral / sunset coral):
     - Default (no class needed)  : "Coral Dusk"  — a dark, warm charcoal-brown
                                    backdrop with a vivid sunset-coral accent.
     - body.theme-light           : "Coral Bloom" — warm cream-white with a
                                    deeper burnt-coral ink for text/links.

   Every color used anywhere in this project MUST be one of the tokens below.
   Never hard-code a hex value inside a component rule — see
   docs/UNIVERSAL_DESIGN_PLAYBOOK.md §3.

   Two-tier accent (same convention as every sibling site): --accent is the
   fill/border/icon coral, always paired with --accent-contrast-text on top.
   --accent-ink is what text/links use sitting directly on the page
   background — a brighter coral in "Coral Dusk" (≈7.4:1 on the dark page),
   a deep burnt-coral in "Coral Bloom" (≈5.5:1 on the warm white).
   ========================================================================== */

:root {
  /* Layered backgrounds */
  --bg-page: #1f1512;
  --bg-surface: #271a16;
  --bg-elevated: #33231d;
  --bg-overlay: rgba(15, 9, 7, 0.74);

  /* Brand accent (coral / sunset coral) */
  --accent: #ff6f52;
  --accent-hover: #ff8567;
  --accent-ink: #ff9a7e;
  --accent-ink-hover: #ffb09a;
  --accent-dim: rgba(255, 111, 82, 0.14);
  --accent-contrast-text: #2a1410;

  /* Semantic status */
  --success: #57c77c;
  --success-dim: rgba(87, 199, 124, 0.14);
  --warning: #ffa53e;
  --warning-dim: rgba(255, 165, 62, 0.14);
  --danger: #ff6a5e;
  --danger-dim: rgba(255, 106, 94, 0.14);
  --info: #59b8e8;
  --info-dim: rgba(89, 184, 232, 0.14);

  /* Extended palette — one identity per tool category (7 categories) */
  --tool-amber: #ffb84a;   /* Compress & Convert */
  --tool-blue: #59a6e8;    /* Resize & Transform */
  --tool-purple: #a78bfa;  /* Color & Filters */
  --tool-rose: #f472a0;    /* Creative Tools */
  --tool-green: #6fcf7a;   /* Batch Tools */
  --tool-teal: #3fc9c0;    /* Metadata & Privacy */
  --tool-gold: #e6c34a;    /* Advanced */

  /* Text */
  --text-1: #f5ece7;
  --text-2: #b8a89f;
  --text-3: #7d6b62;

  /* Borders / shadows */
  --border: #4a332b;
  --border-subtle: #33231d;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

  /* Per-component */
  --navbar-bg: #241914;
  --card-bg: var(--bg-surface);
  --modal-bg: var(--bg-elevated);
  --modal-hdr-bg: var(--bg-surface);
  --input-bg: #170f0d;
  --input-border: var(--border);
  --toolbar-btn-bg: #2b1e19;
  --scrollbar-thumb: #4a332b;
  --scrollbar-track: transparent;

  /* Canvas stage — the neutral backdrop the before/after preview canvases
     sit on, and the checkerboard used behind transparent-background images */
  --stage-bg: #150f0d;
  --checker-a: #2b1e19;
  --checker-b: #33231d;

  color-scheme: dark;
}

body.theme-light {
  /* Layered backgrounds */
  --bg-page: #fff8f5;
  --bg-surface: #fdeee7;
  --bg-elevated: #ffffff;
  --bg-overlay: rgba(60, 20, 10, 0.35);

  /* Brand accent */
  --accent: #e6543d;
  --accent-hover: #f26449;
  --accent-ink: #b83d1e;
  --accent-ink-hover: #d1481f;
  --accent-dim: rgba(230, 84, 61, 0.1);
  --accent-contrast-text: #ffffff;

  /* Semantic status */
  --success: #1f7a45;
  --success-dim: rgba(31, 122, 69, 0.12);
  --warning: #93630a;
  --warning-dim: rgba(147, 99, 10, 0.12);
  --danger: #a23327;
  --danger-dim: rgba(162, 51, 39, 0.12);
  --info: #1c6ea4;
  --info-dim: rgba(28, 110, 164, 0.12);

  /* Extended palette */
  --tool-amber: #b8790a;
  --tool-blue: #1c6ea4;
  --tool-purple: #7c5cd6;
  --tool-rose: #c23d72;
  --tool-green: #2e8b3d;
  --tool-teal: #128077;
  --tool-gold: #a9821f;

  /* Text */
  --text-1: #2a1a14;
  --text-2: #5c4a41;
  --text-3: #8a746a;

  /* Borders / shadows */
  --border: #e8d5cb;
  --border-subtle: #f2e2d8;
  --shadow-sm: 0 2px 8px rgba(60, 30, 20, 0.08);
  --shadow-md: 0 8px 24px rgba(60, 30, 20, 0.1);
  --shadow-lg: 0 24px 60px rgba(60, 30, 20, 0.16);

  /* Per-component. --card-bg/--modal-bg/--modal-hdr-bg/--input-border must be
     redeclared here even though :root defines them as var(--bg-surface) etc.
     — a custom property's var() reference is substituted once, using the
     inheritance context AT ITS OWN DECLARING ELEMENT, and that resolved
     value (not a live reference) is what descendants inherit. Since only
     :root declares these aliases, they'd otherwise stay frozen at :root's
     dark values even under body.theme-light, no matter what --bg-surface
     etc. are overridden to below (found via a real light-theme screenshot
     showing the tool-card/dropzone area still dark). */
  --navbar-bg: #fffaf8;
  --card-bg: var(--bg-surface);
  --modal-bg: var(--bg-elevated);
  --modal-hdr-bg: var(--bg-surface);
  --input-bg: #ffffff;
  --input-border: var(--border);
  --toolbar-btn-bg: #ffffff;
  --scrollbar-thumb: #e8d5cb;

  /* Canvas stage */
  --stage-bg: #f2e2d8;
  --checker-a: #ffffff;
  --checker-b: #f0e0d5;

  color-scheme: light;
}

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

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-1);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-dim);
  color: var(--text-1);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
}

a {
  color: var(--accent-ink);
}

.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.visually-hidden-skip {
  position: absolute;
  left: -9999px;
  top: auto;
}

.visually-hidden-skip:focus {
  left: 12px;
  top: 12px;
  z-index: 2000;
  background: var(--accent);
  color: var(--accent-contrast-text);
  padding: 10px 16px;
  border-radius: 8px;
}
