/* Sloan's app design system: raw tokens (plain CSS variables, framework-agnostic).
   tokens.css (Tailwind v4) and tailwind.preset.js (Tailwind v3) both read these.
   Default theme: Sloan's navy + yellow. Load theme-green.css after this file to swap.
   Per-contractor tint later: set --sl-primary / --sl-primary-hover on <body> (see DESIGN-SYSTEM.md).
   v2 adds the IDENTITY LAYER (paper, edges, tape, stamps, tilt-for-brand-only, illustration sizes). Recipes in identity.css. */

@font-face {
  font-family: "Montserrat";
  src: url("fonts/Montserrat-ExtraBold-latin.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap; /* on bad signal the system font shows first; Montserrat swaps in when it lands */
}

:root {
  /* ---- colour: brand (the only part a theme file changes) ---- */
  --sl-primary: #0D1D3D;          /* navy. main buttons, top bar, selected answers */
  --sl-primary-hover: #182E5C;
  --sl-primary-ink: #FFFFFF;      /* text/icons on primary. 16.7:1 */
  --sl-primary-soft: #E7EAF1;     /* pressed / selected wash on light surfaces */
  --sl-accent: #FFC700;           /* yellow. ONLY on primary surfaces + focus ring. never text on white */
  --sl-accent-ink: #0D1D3D;       /* text on accent. 10.7:1 */
  --sl-surface-page: #F8F5ED;     /* paper. the page background */
  --sl-surface-card: #FFFFFF;
  --sl-surface-sunken: #EFEBE1;   /* wells: note box, photo empty tile */
  --sl-line: #E1DED6;             /* dividers (decorative) */

  /* ---- colour: functional (same in every theme) ---- */
  --sl-ink: #1B1F1D;              /* body text. 15.3:1 on paper, 16.7:1 on white (AAA) */
  --sl-muted: #4F5753;            /* secondary text. 7.4:1 white / 6.8:1 paper (darkened from #5d6661 for sun) */
  --sl-line-strong: #7A817D;      /* borders on controls: options, inputs. 4:1 on white (UI needs 3:1) */
  --sl-yes: #1F7A4A;              /* ✔ / sure / approved. 5.3:1 */
  --sl-yes-soft: #E6F2EA;
  --sl-no: #B23A2E;               /* ✖ / delete / error. 5.9:1 */
  --sl-no-soft: #F8E8E5;
  --sl-caution: #8A5300;          /* unsure / waiting. 6.3:1 white */
  --sl-caution-soft: #FBF0DA;
  --sl-white: #FFFFFF;

  /* ---- type ---- */
  --sl-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sl-font-heading: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* to drop Montserrat: set --sl-font-heading: var(--sl-font-body); and --sl-heading-weight: 750 */
  --sl-heading-weight: 800;

  /* comfortable density (contractor, phone) is the default */
  --sl-text-small: 16px;   --sl-leading-small: 1.4;
  --sl-text-body: 18px;    --sl-leading-body: 1.5;
  --sl-text-lead: 20px;    --sl-leading-lead: 1.4;
  --sl-text-title: 28px;   --sl-leading-title: 1.15;
  --sl-text-display: 34px; --sl-leading-display: 1.1;
  --sl-text-button: 19px;

  /* ---- sizes & spacing ---- */
  --sl-tap: 56px;          /* every tappable thing */
  --sl-tap-primary: 64px;  /* the sticky main button */
  --sl-tap-gap: 12px;      /* min space between targets (gloves) */
  --sl-pad-screen: 20px;   /* screen side padding */
  --sl-pad-card: 20px;
  --sl-stack: 16px;        /* default vertical rhythm */

  /* ---- shape ---- */
  --sl-radius-control: 12px;
  --sl-radius-card: 14px;
  --sl-radius-photo: 12px;
  --sl-border: 2px;        /* controls get real borders, not shadows */

  /* ---- shadow (minimal: borders do the work) ---- */
  --sl-shadow-card: 0 1px 2px rgba(13, 29, 61, 0.06);
  --sl-shadow-raised: 0 -1px 0 var(--sl-line), 0 -6px 20px rgba(13, 29, 61, 0.08); /* sticky bars */
  --sl-focus: 0 0 0 3px var(--sl-surface-card), 0 0 0 6px var(--sl-primary);

  /* ---- layers ---- */
  --sl-z-base: 0; --sl-z-raised: 10; --sl-z-sticky: 20; --sl-z-bar: 30; --sl-z-overlay: 40; --sl-z-toast: 50;

  /* ---- motion: calm ---- */
  --sl-dur-fast: 120ms; --sl-dur-base: 200ms; --sl-dur-slow: 320ms;
  --sl-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* compact density (review room, desktop). Same names, smaller values. */
.density-compact {
  --sl-text-small: 12.5px; --sl-leading-small: 1.4;
  --sl-text-body: 14px;    --sl-leading-body: 1.45;
  --sl-text-lead: 15px;    --sl-leading-lead: 1.4;
  --sl-text-title: 18px;   --sl-leading-title: 1.25;
  --sl-text-display: 22px; --sl-leading-display: 1.2;
  --sl-text-button: 14px;
  --sl-tap: 36px; --sl-tap-primary: 40px; --sl-tap-gap: 8px;
  --sl-pad-screen: 24px; --sl-pad-card: 14px; --sl-stack: 10px;
  --sl-radius-control: 8px; --sl-radius-card: 12px; --sl-radius-photo: 8px;
  --sl-border: 1px;
}

@media (prefers-reduced-motion: reduce) {
  :root, .density-compact { --sl-dur-fast: 0.01ms; --sl-dur-base: 0.01ms; --sl-dur-slow: 0.01ms; }
}


/* =====================================================================
   IDENTITY LAYER (v2). The paper-cutout brand, carried into the app.
   Two zones: BRAND MOMENTS (loud: mascot, props, textures, tilt <= 4deg)
   and WORK SURFACES (calm: flat, straight, only the small identity details).
   Homepage (marketing) sits above both and may go louder (tilt <= 6deg).
   ===================================================================== */
:root {
  /* paper surfaces */
  --sl-paper-page: url("/brand/assets/textures/cream_paper_tile_512.jpg");   /* work-surface page, very faint grain */
  --sl-paper-navy: url("/brand/assets/textures/navy_paper_tile_512.jpg");    /* brand-moment backdrop */
  --sl-paper-navy-marks: url("/brand/assets/textures/navy_paper_with_marks_tile_1024.jpg"); /* homepage + covers only */
  --sl-paper-yellow: url("assets/textures/yellow_paper_tile_512.jpg");
  --sl-paper-white: url("assets/textures/white_paper_tile_512.jpg");
  --sl-paper-tile-size: 512px;

  /* cut-paper edge (mask tiles, seamless, repeat-x) */
  --sl-edge-down: url("assets/identity/edge_torn_down.svg");  /* under the top bar */
  --sl-edge-up: url("assets/identity/edge_torn_up.svg");      /* on top of the sticky button bar */
  --sl-edge-height: 10px;
  --sl-edge-tile: 240px;

  /* tape + marker */
  --sl-tape: #FFC700;              /* tape pieces, marker underline */
  --sl-tape-opacity: 0.88;
  --sl-tape-cream: #F2E9D0;        /* quiet tape on photos in brand moments */
  --sl-marker: url("assets/identity/marker_underline.svg");
  --sl-marker-height: 0.42em;      /* how much of the word the marker covers, from the baseline up */

  /* ink stamp (status). Square, inked, never a pill. Text colour = border colour. */
  --sl-stamp-live: var(--sl-primary);      /* LIVE, DRAFT */
  --sl-stamp-approved: var(--sl-yes);      /* APPROVED, POSTED */
  --sl-stamp-waiting: var(--sl-caution);   /* WAITING, CHECK THIS */
  --sl-stamp-off: var(--sl-no);            /* OFF, FAILED */
  --sl-stamp-border: 2.5px;
  --sl-stamp-radius: 3px;
  --sl-stamp-text: 15px;                   /* min 15px, Montserrat 800, +0.06em tracking */
  --sl-stamp-pad: 4px 10px;

  /* paper card (photo frame on work surfaces). Straight, never tilted. */
  --sl-frame-border: 6px;                  /* white paper border around a photo */
  --sl-frame-radius: 4px;
  --sl-frame-shadow: 0 2px 0 rgba(13, 29, 61, 0.14), 0 6px 14px rgba(13, 29, 61, 0.10);

  /* cut-out objects (mascot, props) */
  --sl-cutout-shadow: drop-shadow(3px 5px 0 rgba(13, 29, 61, 0.22));
  --sl-cutout-border: 6px;                 /* the PNGs already carry their white cut border */

  /* tilt: BRAND ONLY. Controls, text, photos on job screens: always 0. */
  --sl-tilt-none: 0deg;
  --sl-tilt-brand-sm: 2deg;
  --sl-tilt-brand: 4deg;                   /* max inside the app */
  --sl-tilt-home: 6deg;                    /* max on the marketing homepage */

  /* illustration sizes (height of the mascot / prop box) */
  --sl-illo-hero: 240px;      /* onboarding, success, waiting mascot */
  --sl-illo-state: 160px;     /* empty, error, no-signal */
  --sl-illo-header: 96px;     /* weekly task card header, review goal header */
  --sl-illo-inline: 64px;     /* a prop beside a line of text in a brand moment */
  --sl-illo-cover: 320px;     /* monthly results cover collage */

  /* stop-motion motion (brand moments only) */
  --sl-fps: 8;                             /* 125ms per frame */
  --sl-frame: 125ms;
  --sl-pop: 375ms steps(3, end);           /* pop-in: 3 frames */
  --sl-wiggle: 500ms steps(1, end);        /* idle wiggle frame swap */

  /* icon style */
  --sl-icon-stroke: 2.6px;                 /* on a 24px grid, round caps, slightly hand-drawn */
  --sl-icon-size: 26px;
}

.density-compact {
  --sl-stamp-text: 11.5px; --sl-stamp-pad: 2px 6px; --sl-stamp-border: 1.5px;
  --sl-frame-border: 3px; --sl-edge-height: 6px; --sl-icon-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --sl-pop: 0.01ms steps(1, end); --sl-wiggle: 0.01ms steps(1, end); }
}

/* base rules the system relies on */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--sl-font-body); color: var(--sl-ink); background: var(--sl-surface-page) var(--sl-paper-page); background-size: var(--sl-paper-tile-size); }
h1, h2, h3, h4 { font-family: var(--sl-font-heading); font-weight: var(--sl-heading-weight); text-wrap: balance; letter-spacing: -0.01em; }
p, li, dd { text-wrap: pretty; }
em, i, cite, var, address, dfn { font-style: normal; }   /* no italics, ever */
:focus-visible { outline: none; box-shadow: var(--sl-focus); }
