/* Sloan's app: IDENTITY RECIPES (v2). Plain CSS, works with Tailwind v3 or v4.
   Load after sloans-vars.css. Keep this file next to the assets/ folder (url() paths are relative).

   THE RULE: flavour lives in two zones.
   - .sl-brand  = BRAND MOMENT (onboarding, waits, empties, success, no-signal, errors, covers).
                  Mascot, props, paper textures, cut edges, tilt up to 4deg, stop-motion pop.
   - everything else = WORK SURFACE. Flat and straight. Identity only through: torn edge on the
                  top bar and sticky bar, paper page, paper-card photo frames, marker underline on
                  the key word, ink stamps for status, hand-cut arrow for the next step, rough icons.
   Never tilt a control, a line of text people must read, or a photo on a job screen. */

/* ---------- 1. cut-paper edges ---------- */
.sl-topbar { position: relative; background: var(--sl-primary); color: var(--sl-primary-ink); }
.sl-topbar::after {                       /* torn bottom edge hanging under the navy bar */
  content: ""; position: absolute; left: 0; right: 0; top: 100%;
  height: var(--sl-edge-height); background: var(--sl-primary);
  -webkit-mask: var(--sl-edge-down) repeat-x 0 0 / var(--sl-edge-tile) 100%;
          mask: var(--sl-edge-down) repeat-x 0 0 / var(--sl-edge-tile) 100%;
  pointer-events: none;
}
.sl-stickybar { position: relative; background: var(--sl-surface-card); }
.sl-stickybar::before {                   /* torn top edge on the white sticky button bar */
  content: ""; position: absolute; left: 0; right: 0; bottom: 100%;
  height: var(--sl-edge-height); background: var(--sl-surface-card);
  -webkit-mask: var(--sl-edge-up) repeat-x 0 0 / var(--sl-edge-tile) 100%;
          mask: var(--sl-edge-up) repeat-x 0 0 / var(--sl-edge-tile) 100%;
  filter: drop-shadow(0 -2px 1px rgba(13, 29, 61, 0.08));
  pointer-events: none;
}
/* any brand panel can use the same edge: add .sl-edge-bottom to a coloured block */
.sl-edge-bottom { position: relative; }
.sl-edge-bottom::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: var(--sl-edge-height);
  background: inherit; -webkit-mask: var(--sl-edge-down) repeat-x 0 0 / var(--sl-edge-tile) 100%; mask: var(--sl-edge-down) repeat-x 0 0 / var(--sl-edge-tile) 100%; }

/* ---------- 2. paper page ---------- */
.sl-page { background: var(--sl-surface-page) var(--sl-paper-page); background-size: var(--sl-paper-tile-size); }

/* ---------- 3. paper-card photo frame (work surfaces: straight) ---------- */
.sl-paper-card { background: #fff; padding: var(--sl-frame-border); border-radius: var(--sl-frame-radius); box-shadow: var(--sl-frame-shadow); }
.sl-paper-card > img { display: block; width: 100%; border-radius: 2px; object-fit: cover; }

/* ---------- 4. marker underline: the ONE key word of a big heading ---------- */
.sl-mark {
  background: var(--sl-marker) no-repeat 0 100% / 100% var(--sl-marker-height);
  padding: 0 0.06em; margin: 0 -0.06em; color: inherit;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
/* only on display/title headings on paper or white. Never on navy (use yellow text there), never in body copy. */

/* ---------- 5. ink stamp (status). Square ink box, never a pill, never filled ---------- */
.sl-stamp {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--sl-font-heading); font-weight: 800; font-size: var(--sl-stamp-text);
  letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.1;
  padding: var(--sl-stamp-pad); border: var(--sl-stamp-border) solid currentColor;
  border-radius: var(--sl-stamp-radius); outline: 1px solid currentColor; outline-offset: 2px;
  color: var(--sl-stamp-live); background: transparent; white-space: nowrap;
}
.sl-stamp--live { color: var(--sl-stamp-live); }
.sl-stamp--approved { color: var(--sl-stamp-approved); }
.sl-stamp--waiting { color: var(--sl-stamp-waiting); }
.sl-stamp--off { color: var(--sl-stamp-off); }
/* Status always reads as words: the stamp IS the words ("LIVE", "APPROVED", "WAITING", "CHECK THIS").
   Next to it, plain sentence text can add detail ("Live on your site since Tue").
   The big inked stamp (assets/identity/stamp_*_big.svg) is for brand moments only and may tilt. */

/* ---------- 6. hand-cut arrow (the next step) ---------- */
.sl-arrow { display: inline-block; width: 56px; height: auto; filter: none; }
/* decorative: aria-hidden="true", never the tap target itself; points AT the real button */

/* ---------- 7. icons: assets/icons/*.svg use currentColor, 2.6 stroke on 24 grid ---------- */
.sl-icon { width: var(--sl-icon-size); height: var(--sl-icon-size); flex: none; }

/* ---------- 8. BRAND MOMENT container ---------- */
.sl-brand { position: relative; overflow: hidden; text-align: center; }
.sl-brand--navy { background: var(--sl-primary) var(--sl-paper-navy); background-size: var(--sl-paper-tile-size); color: var(--sl-primary-ink); }
.sl-brand--paper { background: var(--sl-surface-page) var(--sl-paper-page); background-size: var(--sl-paper-tile-size); }
.sl-brand--navy h1, .sl-brand--navy h2 { color: var(--sl-primary-ink); }
.sl-brand--navy .sl-key { color: var(--sl-accent); }            /* key word in yellow on navy */
.sl-cutout { display: block; margin-inline: auto; filter: var(--sl-cutout-shadow); }
.sl-illo-hero { height: var(--sl-illo-hero); width: auto; }
.sl-illo-state { height: var(--sl-illo-state); width: auto; }
.sl-illo-header { height: var(--sl-illo-header); width: auto; }
.sl-illo-inline { height: var(--sl-illo-inline); width: auto; }
.sl-tilt-l { rotate: calc(var(--sl-tilt-brand) * -1); }   /* .sl-brand children only */
.sl-tilt-r { rotate: var(--sl-tilt-brand); }
.sl-tilt-sm-l { rotate: calc(var(--sl-tilt-brand-sm) * -1); }
.sl-tilt-sm-r { rotate: var(--sl-tilt-brand-sm); }
/* tape on a brand-moment photo or prop */
.sl-taped { position: relative; }
.sl-taped::before { content: ""; position: absolute; top: -10px; left: 50%; width: 84px; height: 22px; translate: -50% 0; rotate: -3deg;
  background: url("assets/identity/tape_cream.svg") center / 100% 100% no-repeat; z-index: 1; }
.sl-taped--yellow::before { background-image: url("assets/identity/tape_yellow.svg"); }
/* the headline strip (cut yellow paper behind a heading word) */
.sl-strip { display: inline-block; background: url("assets/strips/strip_yellow_blank.svg") center / 100% 100% no-repeat; color: var(--sl-accent-ink); padding: 0.2em 0.6em 0.28em; }

/* the rule, enforced: nothing tappable or readable tilts, even inside a brand moment */
.sl-brand button, .sl-brand a, .sl-brand input, .sl-brand p, .sl-brand h1, .sl-brand h2, .sl-brand h3, .sl-brand li { rotate: 0deg; }

/* ---------- 9. stop-motion motion (brand moments only) ---------- */
@keyframes sl-pop {           /* 3 frames at 8fps: small, overshoot, settle */
  0%   { scale: 0.6; opacity: 0; }
  33%  { scale: 1.08; opacity: 1; }
  66%  { scale: 0.97; }
  100% { scale: 1; opacity: 1; }
}
@keyframes sl-wiggle {        /* held-frame swap: the cut-out "breathes" like paper on a table */
  0%, 49% { rotate: calc(var(--sl-tilt-brand-sm) * -1); }
  50%, 100% { rotate: var(--sl-tilt-brand-sm); }
}
.sl-pop { animation: sl-pop var(--sl-pop) both; }
.sl-pop-2 { animation: sl-pop var(--sl-pop) 125ms both; }
.sl-pop-3 { animation: sl-pop var(--sl-pop) 250ms both; }
.sl-wiggle { animation: sl-wiggle 1s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) {
  .sl-pop, .sl-pop-2, .sl-pop-3, .sl-wiggle { animation: none; opacity: 1; scale: 1; }
  .sl-wiggle { rotate: 0deg; }   /* static frame, still tilted per its class if any */
}
