:root {
  --color-primary: #dc2626;
  --color-primary-hover: #b91c1c;
  --color-secondary: #1f2937;
  --color-secondary-hover: #111827;
  --color-accent: #fbbf24;
  --color-accent-hover: #f59e0b;
  --color-text: #111827;
  --color-text-muted: #4b5563;
  --color-surface: #f3f4f6;
  --color-background: #ffffff;
  --color-border: #d1d5db;
  --font-heading: Outfit, system-ui, sans-serif;
  --font-body: Inter, system-ui, sans-serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
}

:root {
  --color-primary: #e8401f;
  --color-primary-hover: #ff5a36;
  --color-secondary: #ffd9c7;
  --color-secondary-hover: #ffc4a8;
  --color-accent: #ffd9c7;
  --color-accent-hover: #ffc4a8;
  --color-text: #ece8e2;
  --color-text-muted: #9a8e86;
  --color-surface: #161110;
  --color-background: #0a0708;
  --color-border: #2a2220;
  --color-paper: #fbf8f4;
  --color-bone: #ece8e2;
  --color-sand: #eae3dd;
  --color-peach: #ffd9c7;
  --color-ember: #e8401f;
  --color-ink: #161110;
  --color-stone: #7a6e68;
  --color-warm-black: #0a0708;
  --rule: rgba(236, 232, 226, 0.14);
  --rule-strong: rgba(236, 232, 226, 0.34);
  --font-heading: "Inter Tight", Inter, Helvetica, Arial, sans-serif;
  --font-body: Inter, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.375rem;
  --font-size-2xl: 1.75rem;
  --font-size-3xl: 2.25rem;
  --font-size-4xl: 3rem;
  --font-size-5xl: 4rem;
  --gutter: clamp(20px, 4.6vw, 76px);
  --section-y: clamp(84px, 11vw, 190px);
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-quart: cubic-bezier(0.76, 0, 0.24, 1);
}

/* Stay Media — Ember (dark cinematic)
 * Warm-black canvas, ember accent, bone type, mono micro-labels.
 * Scroll-driven motion is the signature — see widget scripts.
 */

/* import blocked */500;600;700;800&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap");

html { scroll-blocked: smooth; }

/* ============================================================
   MODE LAYER — dark (default) and light.
   Widgets must never hardcode these. Anything that cannot be
   expressed with the colour tokens (glows, grain blend, scrims,
   ghost numerals, dark video frames) gets its own token here so
   one mode switch flips the whole site.
   ============================================================ */
:root {
  /* ember atmospherics */
  --glow-1: rgba(232, 64, 31, 0.5);
  --glow-2: rgba(232, 64, 31, 0.14);
  --glow-soft: rgba(232, 64, 31, 0.22);
  --glow-faint: rgba(232, 64, 31, 0.08);

  /* oversized ghost numerals / outlined wordmarks */
  --ghost: rgba(236, 232, 226, 0.09);
  --ghost-faint: rgba(236, 232, 226, 0.035);
  --ghost-stroke: rgba(236, 232, 226, 0.13);

  /* translucent panels + scrims */
  --scrim: rgba(10, 7, 8, 0.4);
  --panel: rgba(22, 17, 16, 0.6);
  --header-bg: rgba(10, 7, 8, 0.72);
  --menu-bg: rgba(10, 7, 8, 0.96);
  --stack-shadow: rgba(0, 0, 0, 0.9);

  /* film grain + cursor spotlight */
  --grain-blend: overlay;
  --grain-op: 0.26;
  --spot-blend: screen;

  /* Mode-toggle icon state. Widget CSS is validated to start every selector
     with the widget ID, so it cannot use an `html[data-mode]` ancestor
     selector — the icons read these instead. */
  --sun-o: 1;
  --sun-t: rotate(0deg) scale(1);
  --moon-o: 0;
  --moon-t: rotate(-70deg) scale(0.5);

  /* Video frames stay dark in BOTH modes — footage reads on black. Anything
     drawn INSIDE a frame must use these, never --color-text / --rule, or it
     turns ink-on-black and disappears the moment light mode is on. */
  --frame-bg: #0e0a09;
  --on-frame: #ece8e2;
  --on-frame-dim: rgba(236, 232, 226, 0.5);
  --on-frame-rule: rgba(236, 232, 226, 0.34);
  --on-frame-ghost: rgba(236, 232, 226, 0.09);
  --on-frame-scrim: rgba(10, 7, 8, 0.4);
}

html[data-mode="light"] {
  /* Ember is darkened for light mode: #e8401f on paper is only 3.6:1,
     which fails AA for the mono micro-labels. #d1361a is 4.66:1. */
  --color-primary: #d1361a;
  --color-primary-hover: #b52c13;
  --color-secondary: #ffd9c7;
  --color-secondary-hover: #ffc4a8;
  --color-accent: #ffd9c7;
  --color-accent-hover: #ffc4a8;
  --color-text: #161110;
  --color-text-muted: #7a6e68;
  --color-surface: #ffffff;
  --color-background: #fbf8f4;
  --color-border: #e4dbd3;

  --rule: rgba(22, 17, 16, 0.14);
  --rule-strong: rgba(22, 17, 16, 0.32);

  --glow-1: rgba(232, 64, 31, 0.16);
  --glow-2: rgba(232, 64, 31, 0.04);
  --glow-soft: rgba(232, 64, 31, 0.1);
  --glow-faint: rgba(232, 64, 31, 0.04);

  --ghost: rgba(22, 17, 16, 0.08);
  --ghost-faint: rgba(22, 17, 16, 0.035);
  --ghost-stroke: rgba(22, 17, 16, 0.16);

  --scrim: rgba(251, 248, 244, 0.45);
  --panel: rgba(255, 255, 255, 0.72);
  --header-bg: rgba(251, 248, 244, 0.78);
  --menu-bg: rgba(251, 248, 244, 0.97);
  --stack-shadow: rgba(22, 17, 16, 0.16);

  --grain-blend: multiply;
  --grain-op: 0.12;
  /* screen over paper is invisible; multiply reads as a warm shadow */
  --spot-blend: multiply;

  --sun-o: 0;
  --sun-t: rotate(70deg) scale(0.5);
  --moon-o: 1;
  --moon-t: rotate(0deg) scale(1);

  --frame-bg: #161110;
}


/* NOTE: the theme-CSS sanitiser only keeps rules whose selectors are scoped to
   this theme (.wpc-theme-stayy_media, body.stayy-paper, :root,
   html[data-mode=...]). Anything else is dropped silently — and a dropped rule
   can take the following rule with it. The page background for  is set
   from the stayy_theme_mode snippet instead, for that reason. */

/* ============================================================
   Home v2 (page 43) — orange accent variant.
   Scoped to that one page by body class, so the live Home keeps its
   original ember. Set on  rather than :root: custom properties
   inherit, so everything inside the page picks these up instead.
   ============================================================ */
body.page-id-43 {
  --color-primary: #ff7a1a;
  --color-primary-hover: #ff9040;
  --glow-1: rgba(255, 122, 26, 0.5);
  --glow-2: rgba(255, 122, 26, 0.14);
  --glow-soft: rgba(255, 122, 26, 0.22);
  --glow-faint: rgba(255, 122, 26, 0.08);
}

/* #ff7a1a is only 2.4:1 on paper — light mode needs a deeper orange.
   #a85200 is 5.12:1, which passes AA for the mono micro-labels. */
html[data-mode="light"] body.page-id-43 {
  --color-primary: #a85200;
  --color-primary-hover: #8f4500;
  --glow-1: rgba(255, 122, 26, 0.16);
  --glow-2: rgba(255, 122, 26, 0.04);
  --glow-soft: rgba(255, 122, 26, 0.1);
  --glow-faint: rgba(255, 122, 26, 0.04);
}

/* Anchor targets must clear the fixed header */
.wpc-theme-stayy_media section[id],
#work, #services, #process, #about, #contact {
  scroll-margin-top: clamp(64px, 9vh, 96px);
}

body.stayy-paper,
.wpc-theme-stayy_media {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* NOTE: never set overflow-x here — it creates a scroll container and
     silently breaks every `position: sticky` pin on the page. Sections
     clip their own overflow instead. */
}

.wpc-theme-stayy_media  * { margin-block: 0; }

/* The Gutenberg block wrapper ships with overflow-x:hidden, which creates a
   scroll container and silently disables every `position: sticky` pin inside
   it. Our sections clip their own overflow, so release the wrapper. */
.wpc-gutenberg-block[class*="wpc-widget-stayy_"],
.ewb-gutenberg-block[class*="ewb-widget-stayy_"] {
  overflow: visible !important;
}

.wpc-theme-stayy_media ::selection {
  background: var(--color-primary);
  color: var(--color-background);
}

.wpc-theme-stayy_media h1,
.wpc-theme-stayy_media h2,
.wpc-theme-stayy_media h3,
.wpc-theme-stayy_media h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.035em;
  font-weight: 600;
}

.wpc-theme-stayy_media .stayy-label {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.86vw, 11.5px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.wpc-theme-stayy_media :focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}
