/* Hopzup design tokens — "Hop" direction (design_handoff_hopzup/tokens).
   The --hz-* tokens are the design's own names and values. The older names
   further down (--surface, --ink, --brand …) are aliases onto them, so every
   existing component follows the new palette, light and dark, until it is
   rebuilt. Nothing else in the stylesheets should hard-code a colour.

   Fonts are self-hosted subsets from @fontsource (SIL OFL 1.1): Outfit for
   Latin, Noto Sans for Cyrillic (Outfit has none), Noto Sans Arabic and
   IBM Plex Mono for codes and labels. */

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/outfit-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/outfit-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/ibm-plex-mono-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-cyrillic-500-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: 'Noto Sans Arabic';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/noto-sans-arabic-arabic-wght-normal.woff2) format('woff2');
  unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC,U+102E0-102FB,U+10E60-10E7E,U+10EC2-10EC4,U+10EFC-10EFF,U+1EE00-1EE03,U+1EE05-1EE1F,U+1EE21-1EE22,U+1EE24,U+1EE27,U+1EE29-1EE32,U+1EE34-1EE37,U+1EE39,U+1EE3B,U+1EE42,U+1EE47,U+1EE49,U+1EE4B,U+1EE4D-1EE4F,U+1EE51-1EE52,U+1EE54,U+1EE57,U+1EE59,U+1EE5B,U+1EE5D,U+1EE5F,U+1EE61-1EE62,U+1EE64,U+1EE67-1EE6A,U+1EE6C-1EE72,U+1EE74-1EE77,U+1EE79-1EE7C,U+1EE7E,U+1EE80-1EE89,U+1EE8B-1EE9B,U+1EEA1-1EEA3,U+1EEA5-1EEA9,U+1EEAB-1EEBB,U+1EEF0-1EEF1;
}
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/noto-sans-cyrillic-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url(/fonts/noto-sans-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}

:root {
  color-scheme: light;

  /* color */
  --hz-mist: #F2F7F6;
  --hz-cloud: #FFFFFF;
  --hz-pool: #E9F3F0;
  --hz-reed: #DCE9E5;
  --hz-switch-track: #E1ECE9;
  --hz-ink: #17211F;
  --hz-ink-hover: #2A3835;
  --hz-on-ink: #FFFFFF;
  --hz-slate: #5A6966;
  --hz-slate-2: #3F4B49;
  --hz-hint: #8A9A96;
  --hz-dashed: #B9CDC8;
  --hz-coral: #E46F55;
  --hz-coral-hover: #D8634A;
  --hz-coral-soft: #F7C9BD;
  --hz-clay: #A9482F; /* v1.1 Q-018: passes 4.5:1 on blush */
  --hz-fern: #46A88C;
  --hz-blush: #FDEBE6;
  --hz-blush-stripe: #F7D9D0;
  --hz-seat-free: #F2E2DC;
  --hz-error-text: #7A3626;
  --hz-team-text: var(--hz-clay);
  --hz-success-bg: #E3F2EC;
  --hz-success-text: #1F5A48;
  --hz-scrim: rgba(23, 33, 31, .25);
  --hz-android-pill: #FDD9CF;
  --hz-stripe-a: #E9F3F0;
  --hz-stripe-b: #DCE9E5;

  /* type */
  --hz-font: 'Outfit', 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --hz-font-ar: 'Noto Sans Arabic', 'Outfit', system-ui, sans-serif;
  --hz-font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --hz-display: 600 50px/1.05 var(--hz-font);
  --hz-title: 600 28px/1.15 var(--hz-font);
  --hz-heading: 600 19px/1.3 var(--hz-font);
  --hz-body: 400 16px/1.5 var(--hz-font);
  --hz-small: 400 13px/1.4 var(--hz-font);
  --hz-tracking-display: -0.02em;

  /* radius */
  --hz-r-sm: 12px;
  --hz-r-md: 20px;
  --hz-r-tile: 24px;
  --hz-r-card: 28px;
  --hz-r-panel: 32px;
  --hz-r-stage: 36px;
  --hz-r-pill: 999px;

  /* space (4pt grid) */
  --hz-s-1: 4px; --hz-s-2: 8px; --hz-s-3: 12px; --hz-s-4: 16px; --hz-s-5: 20px; --hz-s-6: 24px;
  --hz-s-7: 28px; --hz-s-8: 32px; --hz-s-10: 40px; --hz-s-14: 56px;

  /* depth */
  --hz-shadow-raised: 0 20px 40px -24px rgba(20, 50, 45, .4);
  --hz-shadow-lifted: 0 30px 60px -20px rgba(20, 50, 45, .45);
  --hz-shadow-nav: 0 6px 20px -10px rgba(20, 50, 45, .25);
  --hz-ring-selected: 0 0 0 4px var(--hz-cloud), 0 0 0 7px var(--hz-coral);

  /* motion (docs/03-motion.md) */
  --hz-ease-out: cubic-bezier(.2, .8, .2, 1);
  --hz-ease-hop: cubic-bezier(.3, .7, .3, 1);
  --hz-ease-std: cubic-bezier(.4, 0, .2, 1);
  --hz-d-press: 120ms; --hz-d-menu: 200ms; --hz-d-enter: 320ms; --hz-d-hop: 640ms;

  /* sizes */
  --hz-hit: 44px; --hz-hit-touch: 48px;
  --hz-bubble-lg: 104px; --hz-bubble: 72px; --hz-bubble-sm: 56px;
}

/* Dark appearance: an explicit choice, or "Same as device" on a dark system.
   ASSUMED (DESIGN_QUESTIONS Q-013): system-dark uses the same values. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --hz-mist: #0F1715; --hz-cloud: #18221F; --hz-pool: #1F2B28; --hz-reed: #2A3834; --hz-switch-track: #22302C;
    --hz-ink: #EAF2EF; --hz-ink-hover: #D5E1DD; --hz-on-ink: #0F1715;
    --hz-slate: #9AABA6; --hz-slate-2: #C2D0CC; --hz-hint: #6E7F7A; --hz-dashed: #3D4E49;
    --hz-coral: #EE7A60; --hz-coral-hover: #F38B73; --hz-clay: #F29A84; --hz-fern: #5BC2A3;
    --hz-blush: #3A2420; --hz-blush-stripe: #4A2D27; --hz-seat-free: #3A2C28;
    --hz-error-text: #F7C4B7; --hz-team-text: #F4B3A3; --hz-android-pill: #4A2A22;
    --hz-success-bg: #16352C; --hz-success-text: #8FDCC2; --hz-scrim: rgba(0, 0, 0, .45);
    --hz-stripe-a: #26332F; --hz-stripe-b: #2C3A36;
    --hz-shadow-raised: inset 0 0 0 1px rgba(255,255,255,.04), 0 20px 40px -24px rgba(0,0,0,.7);
    --hz-shadow-lifted: inset 0 0 0 1px rgba(255,255,255,.04), 0 30px 60px -20px rgba(0,0,0,.7);
    --hz-shadow-nav: inset 0 0 0 1px rgba(255,255,255,.04), 0 6px 20px -10px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --hz-mist: #0F1715; --hz-cloud: #18221F; --hz-pool: #1F2B28; --hz-reed: #2A3834; --hz-switch-track: #22302C;
  --hz-ink: #EAF2EF; --hz-ink-hover: #D5E1DD; --hz-on-ink: #0F1715;
  --hz-slate: #9AABA6; --hz-slate-2: #C2D0CC; --hz-hint: #6E7F7A; --hz-dashed: #3D4E49;
  --hz-coral: #EE7A60; --hz-coral-hover: #F38B73; --hz-clay: #F29A84; --hz-fern: #5BC2A3;
  --hz-blush: #3A2420; --hz-blush-stripe: #4A2D27; --hz-seat-free: #3A2C28;
  --hz-error-text: #F7C4B7; --hz-team-text: #F4B3A3; --hz-android-pill: #4A2A22;
  --hz-success-bg: #16352C; --hz-success-text: #8FDCC2; --hz-scrim: rgba(0, 0, 0, .45);
  --hz-stripe-a: #26332F; --hz-stripe-b: #2C3A36;
  --hz-shadow-raised: inset 0 0 0 1px rgba(255,255,255,.04), 0 20px 40px -24px rgba(0,0,0,.7);
  --hz-shadow-lifted: inset 0 0 0 1px rgba(255,255,255,.04), 0 30px 60px -20px rgba(0,0,0,.7);
  --hz-shadow-nav: inset 0 0 0 1px rgba(255,255,255,.04), 0 6px 20px -10px rgba(0,0,0,.6);
}

/* Arabic uses Noto Sans Arabic; codes, digits and names keep their own spans. */
:root[lang="ar"] { --hz-font: var(--hz-font-ar); }

/* Reduced motion: the system setting or the in-app "Reduce motion" switch
   (data-motion="reduce" on <html>). Movement becomes a short crossfade. */
@media (prefers-reduced-motion: reduce) {
  :root { --hz-d-enter: 120ms; --hz-d-hop: 120ms; --hz-d-menu: 120ms; }
}
:root[data-motion="reduce"] { --hz-d-enter: 120ms; --hz-d-hop: 120ms; --hz-d-menu: 120ms; }

/* ---- Aliases used by the existing stylesheets ---- */
:root {
  /* Typography */
  --font: var(--hz-font);
  --font-mono: var(--hz-font-mono);
  --fs-meta: 0.8125rem;   /* 13 — metadata, never smaller */
  --fs-sm: 0.875rem;      /* 14 — secondary text, labels */
  --fs-base: 1rem;        /* 16 — body */
  --fs-md: 1rem;          /* 16 — inputs, emphasised body */
  --fs-lg: 1.1875rem;     /* 19 — heading */
  --fs-xl: 1.375rem;      /* 22 — section titles */
  --fs-2xl: 1.75rem;      /* 28 — title */
  --fs-3xl: 2.25rem;      /* 36 — pairing code */
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh: 1.5;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --tracking-tight: -0.02em;

  /* Surfaces */
  --canvas-base: var(--hz-mist);
  --surface: var(--hz-cloud);
  --surface-sunken: var(--hz-pool);
  --surface-hover: var(--hz-pool);
  --surface-press: var(--hz-reed);
  --line: var(--hz-reed);
  --line-strong: var(--hz-dashed);
  --scrim: var(--hz-scrim);

  /* Text */
  --ink: var(--hz-ink);
  --ink-2: var(--hz-slate-2);
  --ink-3: var(--hz-slate);
  --ink-disabled: var(--hz-hint);

  /* "Brand" is the main action that isn't sending: ink (light on dark).
     Coral is reserved for sending; see --send. */
  --brand: var(--hz-ink);
  --brand-hover: var(--hz-ink-hover);
  --brand-press: var(--hz-slate-2);
  --brand-tint: var(--hz-pool);
  --brand-tint-strong: var(--hz-reed);
  --on-brand: var(--hz-on-ink);
  --send: var(--hz-coral);
  --send-hover: var(--hz-coral-hover);
  --on-send: #FFFFFF;

  /* Workspaces. Boomerang works in fern, Team in clay on blush. */
  --boomerang: var(--hz-ink);
  --boomerang-tint: var(--hz-success-bg);
  --on-boomerang: var(--hz-on-ink);
  --boomerang-hover: var(--hz-ink-hover);
  --boomerang-press: var(--hz-slate-2);
  --team: var(--hz-clay);
  --team-tint: var(--hz-blush);
  --on-team: var(--hz-on-ink);
  --team-hover: var(--hz-error-text);
  --team-press: var(--hz-error-text);

  /* Semantic */
  --ok: var(--hz-success-text);
  --ok-tint: var(--hz-success-bg);
  --warn: #855600;
  --warn-tint: #FAF0D9;
  --danger: var(--hz-clay);
  --danger-tint: var(--hz-blush);
  --danger-hover: var(--hz-error-text);

  /* Focus */
  --focus: var(--hz-coral);
  --focus-halo: color-mix(in srgb, var(--hz-coral) 30%, transparent);

  /* Space (4 px grid) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s8: 32px;
  --s10: 40px;
  --s12: 48px;
  --s16: 64px;
  --gutter: clamp(16px, 3.6vw, 32px);
  --page-max: 1360px;
  --read-max: 46rem;

  /* Shape */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;
  --border: 1px;
  --control: 44px;
  --control-sm: 36px;
  --control-lg: 52px;
  --icon: 20px;
  --icon-sm: 16px;
  --header: 64px;

  /* Elevation */
  --shadow-raise: var(--hz-shadow-nav);
  --shadow-pop: var(--hz-shadow-raised);
  --shadow-dialog: var(--hz-shadow-lifted);

  /* Motion */
  --ease: var(--hz-ease-out);
  --t-fast: var(--hz-d-press);
  --t-med: var(--hz-d-menu);
  --t-slow: var(--hz-d-enter);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
:root[data-theme="dark"] { --warn: #E6AD45; --warn-tint: rgb(230 173 69 / 0.13); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --warn: #E6AD45; --warn-tint: rgb(230 173 69 / 0.13); }
}

/* The open workspace (set on <html> by the shell). Accents follow the
   workspace, but the page ground is the design's one mist on every page
   (02-screens: "Page: background mist"); the owner chose that on 29 Oct. */
/* Desktop UI scale (02-screens, owner decision): from 1000 px wide the whole
   app renders at 75 %, like the browser at 75 % zoom. CSS zoom (not
   transform) keeps hit-testing and fixed panels right. Inside the zoomed page
   a vh is 0.75 of the screen, so every vh length is multiplied by --vz. */
:root { --vz: 1; }
@media (min-width: 1000px) {
  html { zoom: 0.75; }
  :root { --vz: calc(1 / 0.75); }
  /* Public pages (legal, help, pricing, report abuse, 404) are for reading:
     at 75 % their body text fell to about 10 px. They render at 90 %. */
  html:has(body.site) { zoom: 0.9; --vz: calc(1 / 0.9); }
}

:root {
  --mode: var(--brand);
  --mode-tint: var(--brand-tint);
  --on-mode: var(--on-brand);
  --mode-hover: var(--brand-hover);
  --mode-press: var(--brand-press);
  --mode-wash: transparent;
  --canvas: var(--hz-mist);
}
:root[data-section="boomerang"] {
  --mode: var(--boomerang);
  --mode-tint: var(--boomerang-tint);
  --on-mode: var(--on-boomerang);
  --mode-hover: var(--boomerang-hover);
  --mode-press: var(--boomerang-press);
}
:root[data-section="team"] {
  --mode: var(--team);
  --mode-tint: var(--team-tint);
  --on-mode: var(--on-team);
  --mode-hover: var(--team-hover);
  --mode-press: var(--team-press);
}

@media (pointer: coarse) {
  :root {
    --control: 48px;
    --control-sm: 40px;
    --control-lg: 52px;
  }
}
