@font-face {
  font-family: Twemoji;
  src: url('../public/font/Twemoji.Mozilla.v15.1.0.woff2') format('woff2');
  font-display: swap;
}

:root {
  --tc-link: hsl(213deg 100% 45%);

  /* user mxid colors */
  --mx-uc-1: hsl(208, 100%, 45%);
  --mx-uc-2: hsl(302, 100%, 30%);
  --mx-uc-3: hsl(163, 100%, 30%);
  --mx-uc-4: hsl(343, 100%, 45%);
  --mx-uc-5: hsl(24, 100%, 45%);
  --mx-uc-6: hsl(181, 100%, 30%);
  --mx-uc-7: hsl(242, 100%, 45%);
  --mx-uc-8: hsl(94, 100%, 35%);

  /* Horseshoe void seam — see `src/app/styles/horseshoe.ts`. The :root
     default is the light-theme value; `.dark-theme` overrides below. */
  --vojo-horseshoe-void: #d6d6e3;

  /* Peer (not-own) bubble bg for the CHANNEL layout (groups / channels /
     thread drawer). The 1-1 Stream layout's incoming bubble does NOT use this
     — it binds directly to `color.Surface.Container` (the composer surface).
     Light: slight off-white step from #ffffff. Dark override below. */
  --vojo-peer-bubble-bg: #f5f5fa;
  /* Stream timeline rail (vertical line through dots) + day-divider
     horizontal segments. Light: hairline cool-grey; dark overrides
     below. */
  --vojo-timeline-rail: #e8e8f2;

  /* DM 1-1 «VS Code chat» redesign tokens (see
     docs/plans/dm_stream_vscode_redesign.md). Light-theme defaults here;
     dark overrides in `.dark-theme`.
       * stream-name-own  — own author label colour AND own rail dots (strong
                            neutral «white»: black light / white dark). Used by
                            StreamName and by useDotColor's own resting dot.
       * stream-name-peer — peer author label colour (brand purple — the Dawn
                            lavender accent).
       * dot-neutral — gray rail dot for PEER (incoming) dots. (Own dots use
                       stream-name-own; green = my-read-awaiting-reply, gold =
                       mention, red = my-failed are folds tokens in useDotColor.)
     NB: the incoming-bubble fill is NOT a var — `StreamBubble` binds it to
     `color.Surface.Container` so it always matches the composer card. */
  --vojo-stream-name-own: #000000;
  --vojo-stream-name-peer: #5b6aff;
  --vojo-dot-neutral: #9aa0aa;

  --font-emoji: 'Twemoji_DISABLED';
  --font-secondary: 'InterVariable', var(--font-emoji), sans-serif;
  /* Single shared mono stack for technical metadata (mxid, aliases,
     timestamps, device ids, version, shortcodes, command sigs). JetBrains
     Mono Variable is imported globally in index.tsx; this var lets every
     surface point at one stack instead of repeating it. */
  --font-mono: 'JetBrains Mono Variable', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    monospace;
}

.dark-theme {
  --tc-link: hsl(213deg 100% 80%);

  --mx-uc-1: hsl(208, 100%, 75%);
  --mx-uc-2: hsl(301, 100%, 80%);
  --mx-uc-3: hsl(163, 100%, 70%);
  --mx-uc-4: hsl(343, 100%, 75%);
  --mx-uc-5: hsl(24, 100%, 70%);
  --mx-uc-6: hsl(181, 100%, 60%);
  --mx-uc-7: hsl(243, 100%, 80%);
  --mx-uc-8: hsl(94, 100%, 80%);

  --vojo-horseshoe-void: #000000;

  --vojo-peer-bubble-bg: #000000;
  /* Subtle gray hairline so the thin rail reads against the #0d0e11
     chat surface (was pure #000000, which vanished into the bg). */
  --vojo-timeline-rail: #2a2e38;

  /* DM 1-1 «VS Code chat» redesign — dark palette. (Incoming-bubble fill
     binds to color.Surface.Container in StreamBubble, not a var here.)
     Own nick + own dots = white; peer nick = #9580ff Dawn brand lavender;
     peer dots = gray (dot-neutral). */
  --vojo-stream-name-own: #ffffff;
  --vojo-stream-name-peer: #9580ff;
  --vojo-dot-neutral: #6b7280;

  --font-secondary: 'InterVariable', var(--font-emoji), sans-serif;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  /* Cold-start fallback before `app/styles/global.css.ts` parses + the
     ThemeManager mounts and binds `--vojo-safe-area-bg` to the active
     palette's Background.Container token. The literal `#0d0e11` matches
     dark; the @media block below mirrors it for light so a light-theme
     user doesn't see a dark flash in the safe-area zone. */
  background-color: var(--vojo-safe-area-bg, #0d0e11);
  font-family: var(--font-secondary);
  font-size: 16px;
  font-weight: 400;

  /*Why font-variant-ligatures => https://github.com/rsms/inter/issues/222 */
  font-variant-ligatures: no-contextual;
}

@media (prefers-color-scheme: light) {
  body {
    background-color: var(--vojo-safe-area-bg, #f2f2f7);
  }
}
#root {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  /* Top & bottom insets are intentionally zero: each screen extends
     its own bg through the system-bar zones (status bar at top, gesture
     pill at bottom). Top-anchored UI pads itself down by `--vojo-safe-top`
     (see `app/styles/global.css.ts`) — covered: PageHeader, PageNavHeader
     (chat / chat-list headers via recipe), AuthLayout root. Side insets
     stay so app chrome clears display cutouts on devices with one. */
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--tc-link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

[data-mx-spoiler][aria-pressed='true'] a {
  color: transparent;
  pointer-events: none;
}

b {
  font-weight: 500;
}
label {
  margin: 0;
  padding: 0;
}
button,
textarea {
  margin: 0;
  padding: 0;
  background-color: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  border: none;
}
button {
  max-width: 100%;
  text-transform: none;
  text-align: inherit;
  overflow: visible;
  -webkit-appearance: button;
}
textarea,
input,
input[type],
input[type='text'],
input[type='username'],
input[type='password'],
input[type='email'],
input[type='checkbox'] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

textarea {
  color: inherit;
  word-spacing: inherit;
}

audio:not([controls]) {
  display: none !important;
}

/*
 * Orbit-sweep border for the incoming-call horseshoe.
 *
 * Animating a conic-gradient angle requires the property to be registered
 * via @property — otherwise CSS treats custom properties as untyped
 * strings and the animation snaps instead of interpolating. Defined here
 * (rather than in vanilla-extract) because @property has no first-class
 * binding in @vanilla-extract/css. The keyframe is paired with it so
 * both halves stay in one place.
 */
@property --vojo-orbit-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@keyframes vojo-orbit-sweep {
  to {
    --vojo-orbit-angle: 360deg;
  }
}
