/*! @xmemory/ui — Design Tokens v0.1.0 */

/* ============================================================
   FONTS
   Load these in your HTML <head>:
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500&family=Fira+Code:wght@400&display=swap" rel="stylesheet">
   ============================================================ */

:root {
  /* ── Font families ─────────────────────────────────────── */
  --xm-font-sans: "Inter", "Source Serif 4", Georgia, "Times New Roman", serif;
  --xm-font-mono: "Fira Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  /* ── Font weights ──────────────────────────────────────── */
  --xm-weight-thin: 100;
  --xm-weight-extralight: 200;
  --xm-weight-light: 300;
  --xm-weight-regular: 400;
  --xm-weight-medium: 500;
  /* Variable font: use font-variation-settings: "wght" 250 for 250 weight */

  /* ── Font sizes ────────────────────────────────────────── */
  --xm-text-xs: 10px;
  --xm-text-sm: 12px;
  --xm-text-base: 14px;
  --xm-text-md: 16px;
  --xm-text-lg: 18px;
  --xm-text-xl: 20px;
  --xm-text-2xl: 24px;
  --xm-text-3xl: 27px;
  --xm-text-4xl: 36px;
  --xm-text-5xl: 48px;

  /* ── Line heights ──────────────────────────────────────── */
  --xm-leading-none: 1;
  --xm-leading-tight: 1.1;
  --xm-leading-snug: 1.2;
  --xm-leading-normal: 1.3;
  --xm-leading-relaxed: 1.4;
  --xm-leading-loose: 1.5;
  --xm-leading-prose: 1.6;

  /* ── Letter spacing ────────────────────────────────────── */
  --xm-tracking-tight: -0.02em;
  --xm-tracking-normal: 0;
  --xm-tracking-code: -0.01em;

  /* ── Colors — Brand ────────────────────────────────────── */
  --xm-green: #66bf45;
  --xm-blue: #56b5db;
  --xm-orange: #f97316;
  --xm-yellow: #e6cd6a;
  --xm-gradient-start: #cbb92b;
  --xm-gradient-end: #82b732;

  /* ── Colors — Backgrounds ──────────────────────────────── */
  --xm-bg-primary: #121b26;
  --xm-bg-elevated: #0c1520;
  --xm-bg-surface: #182233;
  --xm-bg-inset: #1a2332;
  --xm-bg-overlay: rgba(12, 21, 32, 0.92);
  --xm-bg-deep: #000000;

  /* ── Colors — Background gradient stops ────────────────── */
  --xm-gradient-bg-1: #0a0a0a;
  --xm-gradient-bg-2: #1a1a2e;
  --xm-gradient-bg-3: #16213e;
  --xm-gradient-bg-4: #0f3460;

  /* ── Colors — Text ─────────────────────────────────────── */
  --xm-text-white: #ffffff;
  --xm-text-primary: #b7c3d2;
  --xm-text-secondary: #788ca4;
  --xm-text-muted: rgba(255, 255, 255, 0.45);
  --xm-text-faint: rgba(255, 255, 255, 0.2);

  /* ── Colors — Borders ──────────────────────────────────── */
  --xm-border-hairline: rgba(255, 255, 255, 0.08);
  --xm-border-subtle: rgba(255, 255, 255, 0.1);
  --xm-border-visible: rgba(255, 255, 255, 0.2);
  --xm-border-accent: #66bf45;

  /* ── Colors — Semantic surfaces (tinted backgrounds) ───── */
  --xm-surface-green: rgba(102, 191, 69, 0.2);
  --xm-surface-blue: rgba(86, 181, 219, 0.2);
  --xm-surface-orange: rgba(249, 115, 22, 0.2);
  --xm-surface-input: rgba(20, 39, 63, 0.5);
  --xm-surface-hover: rgba(255, 255, 255, 0.08);

  /* ── Colors — Accent buttons ───────────────────────────── */
  --xm-btn-ghost-bg: #222e50;
  --xm-btn-ghost-shadow: rgba(34, 46, 80, 0.3);
  --xm-link-blue-bg: #243d50;

  /* ── Colors — Syntax highlighting (code) ───────────────── */
  --xm-syntax-keyword: #c792ea;
  --xm-syntax-identifier: #d6deeb;
  --xm-syntax-operator: #89ddff;
  --xm-syntax-function: #82aaff;
  --xm-syntax-argument: #addb67;
  --xm-syntax-string: #ecc48d;
  --xm-syntax-comment: #7f8fa3;
  --xm-syntax-number: #82aaff;
  --xm-syntax-boolean: #89ddff;
  --xm-syntax-null: #f07178;

  /* ── Colors — Data visualization ───────────────────────── */
  --xm-data-green: #66bf45;
  --xm-data-red: rgba(252, 112, 112, 0.5);
  --xm-data-blue: rgba(86, 181, 219, 0.5);
  --xm-data-yellow: rgba(255, 247, 96, 0.5);
  --xm-data-purple: rgba(192, 132, 252, 0.5);
  --xm-data-amber: rgba(245, 158, 11, 0.5);
  --xm-data-teal: rgba(45, 212, 191, 0.5);

  /* ── Spacing ───────────────────────────────────────────── */
  --xm-space-1: 4px;
  --xm-space-2: 6px;
  --xm-space-3: 8px;
  --xm-space-4: 10px;
  --xm-space-5: 12px;
  --xm-space-6: 16px;
  --xm-space-7: 20px;
  --xm-space-8: 24px;
  --xm-space-9: 30px;
  --xm-space-10: 32px;
  --xm-space-11: 40px;
  --xm-space-12: 48px;
  --xm-space-13: 56px;
  --xm-space-14: 64px;
  --xm-space-15: 80px;
  --xm-space-16: 100px;

  /* ── Border radius ─────────────────────────────────────── */
  --xm-radius-xs: 3px;
  --xm-radius-sm: 4px;
  --xm-radius-md: 6px;
  --xm-radius-lg: 8px;
  --xm-radius-xl: 12px;
  --xm-radius-2xl: 20px;
  --xm-radius-full: 50%;

  /* ── Shadows ───────────────────────────────────────────── */
  --xm-shadow-sm: 5px 5px 30px rgba(0, 0, 0, 0.25);
  --xm-shadow-md: 0 24px 80px rgba(0, 0, 0, 0.45);
  --xm-shadow-lg: 0 28px 90px rgba(0, 0, 0, 0.48);
  --xm-shadow-glow-green: 0 0 0 4px rgba(102, 191, 69, 0.3);
  --xm-shadow-glow-ghost: 0 0 0 4px rgba(34, 46, 80, 0.3);
  --xm-shadow-glow-cyan: 0 0 0 4px rgba(0, 212, 255, 0.2);

  /* ── Backdrop blur ─────────────────────────────────────── */
  --xm-blur-sm: 8px;
  --xm-blur-md: 10px;
  --xm-blur-lg: 12px;
  --xm-blur-xl: 16px;

  /* ── Transitions ───────────────────────────────────────── */
  --xm-transition-fast: 0.2s ease;
  --xm-transition-base: 0.3s ease;
  --xm-transition-slow: 0.6s ease;

  /* ── Layout ────────────────────────────────────────────── */
  --xm-max-width: 1200px;
  --xm-nav-height: 80px;

  /* ── Z-index scale ─────────────────────────────────────── */
  --xm-z-base: 0;
  --xm-z-above: 2;
  --xm-z-dropdown: 10;
  --xm-z-sticky: 100;
  --xm-z-nav: 1000;
  --xm-z-banner: 1500;
  --xm-z-overlay: 2200;
  --xm-z-modal: 9999;
  --xm-z-loader: 10050;
}
/*! @xmemory/ui — Base & Reset v0.1.0 */

/* ── Reset ───────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── HTML & Body defaults ────────────────────────────────── */

html,
body {
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--xm-bg-primary);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--xm-nav-height);
  color-scheme: dark;
}

body {
  font-family: var(--xm-font-sans);
  color: var(--xm-text-white);
  line-height: var(--xm-leading-loose);
  font-weight: var(--xm-weight-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Links ───────────────────────────────────────────────── */

a {
  color: inherit;
  text-decoration: none;
}

/* ── Images ──────────────────────────────────────────────── */

img,
svg {
  display: block;
  max-width: 100%;
}

/* ── Focus ───────────────────────────────────────────────── */

:focus-visible {
  outline: 2px solid rgba(102, 191, 69, 0.6);
  outline-offset: 2px;
  border-radius: var(--xm-radius-md);
}

/* ── Selection ───────────────────────────────────────────── */

::selection {
  background: var(--xm-surface-green);
  color: var(--xm-text-white);
}

/* ── Custom scrollbar (when visible) ─────────────────────── */

.xm-scrollbar {
  scrollbar-color: rgba(120, 140, 164, 0.35) transparent;
}

.xm-scrollbar::-webkit-scrollbar {
  width: 8px;
}

.xm-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.xm-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(120, 140, 164, 0.35);
  border-radius: 8px;
}

/* ── Responsive body padding for safe areas ──────────────── */

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  body {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
    min-height: 100dvh;
  }
}
/*! @xmemory/ui — Components v0.1.0 */

/* ================================================================
   NAVIGATION BAR — .xm-nav
   ================================================================
   <header class="xm-nav">
     <div class="xm-nav__inner xm-container">
       <a class="xm-nav__logo-link" href="/"><img class="xm-nav__logo" src="..." alt="xmemory"></a>
       <nav class="xm-nav__links">
         <a class="xm-nav__link" href="#">Link</a>
       </nav>
       <a class="xm-btn xm-btn--outline" href="#">CTA</a>
     </div>
   </header>
   ================================================================ */

.xm-nav {
  height: var(--xm-nav-height);
  background: rgba(18, 27, 38, 0.5);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--xm-z-nav);
  backdrop-filter: blur(var(--xm-blur-lg));
  -webkit-backdrop-filter: blur(var(--xm-blur-lg));
}

.xm-nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
}

.xm-nav__logo {
  width: 177px;
  height: 24px;
  display: block;
}

.xm-nav__logo-link {
  display: block;
  line-height: 0;
}

.xm-nav__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 70px;
  margin-left: auto;
  margin-right: 70px;
}

.xm-nav__link {
  font-size: var(--xm-text-md);
  font-weight: var(--xm-weight-light);
  color: var(--xm-text-white);
  text-decoration: none;
  transition: color var(--xm-transition-fast);
}

.xm-nav__link:hover {
  color: var(--xm-green);
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-nav__links {
    display: none;
  }

  .xm-nav__inner {
    padding: 0 var(--xm-space-6);
    justify-content: space-between;
  }
}


/* ================================================================
   BUTTONS — .xm-btn
   ================================================================
   <a class="xm-btn" href="#">Primary</a>
   <a class="xm-btn xm-btn--outline" href="#">Outline</a>
   <a class="xm-btn xm-btn--ghost" href="#">Ghost</a>
   <button class="xm-btn xm-btn--solid">Solid</button>
   <button class="xm-btn xm-btn--solid xm-btn--loading">Loading</button>
   ================================================================ */

.xm-btn {
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-md);
  font-weight: var(--xm-weight-light);
  color: var(--xm-text-white);
  text-decoration: none;
  height: 40px;
  padding: 0 var(--xm-space-8);
  border-radius: var(--xm-radius-lg);
  background: transparent;
  border: 1px solid var(--xm-green);
  box-shadow: var(--xm-shadow-glow-green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--xm-space-5);
  cursor: pointer;
  transition: background var(--xm-transition-fast), color var(--xm-transition-fast);
  white-space: nowrap;
}

.xm-btn:hover {
  background: rgba(102, 191, 69, 0.1);
}

.xm-btn--outline {
  background: transparent;
}

.xm-btn--ghost {
  height: 48px;
  background: var(--xm-btn-ghost-bg);
  border: none;
  box-shadow: var(--xm-shadow-glow-ghost);
}

.xm-btn--ghost:hover {
  background: #2a3860;
}

.xm-btn--solid {
  background: var(--xm-green);
  color: var(--xm-bg-primary);
  border-color: var(--xm-green);
  font-weight: var(--xm-weight-regular);
}

.xm-btn--solid:hover {
  background: #5aad3d;
}

.xm-btn--solid:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.xm-btn--loading {
  opacity: 0.85;
  pointer-events: none;
}

.xm-btn--loading::after {
  content: "";
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(18, 27, 38, 0.28);
  border-top-color: var(--xm-bg-primary);
  border-radius: var(--xm-radius-full);
  animation: xm-spin 0.8s linear infinite;
}

.xm-btn__icon {
  display: block;
  height: 20px;
  width: 20px;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-btn {
    font-size: var(--xm-text-lg);
  }
}


/* ================================================================
   CARDS — .xm-card
   ================================================================
   <div class="xm-card">Content</div>
   <div class="xm-card xm-card--glass">Glass card</div>
   <div class="xm-card xm-card--accent-top">Accent top border</div>
   ================================================================ */

.xm-card {
  border-radius: var(--xm-radius-lg);
  background: var(--xm-bg-surface);
  border: 0.5px solid var(--xm-border-hairline);
  padding: var(--xm-space-9);
}

.xm-card--glass {
  background: linear-gradient(135deg, rgba(52, 58, 66, 0.1), rgba(0, 0, 0, 0.1));
  backdrop-filter: blur(var(--xm-blur-xl));
  -webkit-backdrop-filter: blur(var(--xm-blur-xl));
  border-color: var(--xm-border-visible);
  box-shadow: var(--xm-shadow-sm);
}

.xm-card--accent-top {
  border-top: 4px solid var(--xm-green);
}

.xm-card--elevated {
  background: var(--xm-bg-elevated);
  border-color: var(--xm-border-subtle);
}


/* ================================================================
   FORM INPUTS — .xm-input, .xm-textarea, .xm-checkbox, .xm-select
   ================================================================
   <label class="xm-label">Name</label>
   <input class="xm-input" type="text" placeholder="Your name">
   <textarea class="xm-textarea" placeholder="Message"></textarea>
   <input class="xm-checkbox" type="checkbox">
   ================================================================ */

.xm-label {
  display: block;
  margin-bottom: var(--xm-space-3);
  font-size: var(--xm-text-md);
  line-height: var(--xm-leading-normal);
  font-weight: var(--xm-weight-regular);
  color: var(--xm-text-white);
}

.xm-input {
  width: 100%;
  height: 48px;
  border-radius: var(--xm-radius-lg);
  border: 1px solid var(--xm-border-hairline);
  background: var(--xm-surface-input);
  color: var(--xm-text-white);
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-md);
  line-height: var(--xm-leading-loose);
  font-weight: var(--xm-weight-light);
  padding: 0 var(--xm-space-6);
  outline: none;
  transition: border-color var(--xm-transition-fast);
}

.xm-input::placeholder {
  color: var(--xm-text-secondary);
}

.xm-input:focus {
  border-color: var(--xm-green);
}

.xm-textarea {
  width: 100%;
  min-height: 72px;
  border-radius: var(--xm-radius-lg);
  border: 1px solid var(--xm-border-hairline);
  background: var(--xm-surface-input);
  color: var(--xm-text-white);
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-md);
  line-height: var(--xm-leading-loose);
  font-weight: var(--xm-weight-light);
  padding: var(--xm-space-5) var(--xm-space-6);
  outline: none;
  resize: vertical;
  transition: border-color var(--xm-transition-fast);
}

.xm-textarea::placeholder {
  color: var(--xm-text-secondary);
}

.xm-textarea:focus {
  border-color: var(--xm-green);
}

.xm-checkbox {
  width: 14px;
  height: 14px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--xm-surface-input);
  border: 1px solid var(--xm-border-hairline);
  border-radius: var(--xm-radius-xs);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}

.xm-checkbox:checked {
  border-color: var(--xm-green);
}

.xm-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 8px;
  border: solid var(--xm-green);
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -62%) rotate(45deg);
}

.xm-select {
  height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 32px 0 10px;
  border: none;
  border-radius: var(--xm-radius-sm);
  background: var(--xm-surface-green);
  color: var(--xm-green);
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-md);
  font-weight: var(--xm-weight-light);
  line-height: var(--xm-leading-none);
  cursor: pointer;
  position: relative;
}

.xm-select::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  position: absolute;
  right: 9px;
  top: calc(50% - 1px);
  transform: translateY(-50%) rotate(45deg);
}

.xm-select--blue {
  background: var(--xm-link-blue-bg);
  color: var(--xm-blue);
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-input {
    height: 56px;
    font-size: var(--xm-text-lg);
    padding: 0 var(--xm-space-7);
  }

  .xm-textarea {
    min-height: 88px;
    padding: 14px var(--xm-space-7);
  }

  .xm-label {
    font-size: var(--xm-text-lg);
  }

  .xm-checkbox {
    width: 16px;
    height: 16px;
  }

  .xm-checkbox:checked::after {
    width: 5px;
    height: 10px;
    border-width: 0 2px 2px 0;
  }
}


/* ================================================================
   BADGES / TAGS — .xm-badge
   ================================================================
   <span class="xm-badge xm-badge--green">Saved</span>
   <span class="xm-badge xm-badge--blue">Retrieved</span>
   <span class="xm-badge xm-badge--orange">Updated</span>
   ================================================================ */

.xm-badge {
  height: 20px;
  display: inline-flex;
  align-items: center;
  gap: var(--xm-space-2);
  padding: 0 var(--xm-space-3);
  border-radius: var(--xm-radius-sm);
  border: none;
  font-family: var(--xm-font-sans);
  font-size: 8px;
  line-height: var(--xm-leading-none);
  cursor: default;
}

.xm-badge--green {
  background: var(--xm-surface-green);
  color: var(--xm-green);
}

.xm-badge--blue {
  background: var(--xm-surface-blue);
  color: var(--xm-blue);
}

.xm-badge--orange {
  background: var(--xm-surface-orange);
  color: var(--xm-orange);
}

.xm-badge__icon {
  width: 12px;
  height: 12px;
  display: block;
}


/* ================================================================
   CODE BLOCK — .xm-code
   ================================================================
   <div class="xm-code">
     <div class="xm-code__line">
       <span class="xm-code__num">1</span>
       <span class="xm-code__content">
         <span class="xm-code--kw">const</span> x = <span class="xm-code--str">"hello"</span>
       </span>
     </div>
   </div>
   ================================================================ */

.xm-code {
  font-family: var(--xm-font-mono);
  font-size: var(--xm-text-sm);
  color: var(--xm-syntax-identifier);
  background: var(--xm-bg-elevated);
  border-radius: var(--xm-radius-lg);
  overflow: hidden;
}

.xm-code__header {
  height: 40px;
  background: var(--xm-bg-elevated);
  border-bottom: 0.5px solid var(--xm-border-hairline);
  display: flex;
  align-items: center;
  padding: 0 var(--xm-space-6);
  justify-content: space-between;
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-xs);
  color: var(--xm-text-secondary);
}

.xm-code__body {
  padding: var(--xm-space-6) var(--xm-space-7) var(--xm-space-7);
}

.xm-code__line {
  display: flex;
  align-items: flex-start;
  line-height: var(--xm-leading-prose);
  white-space: normal;
}

.xm-code__num {
  width: 50px;
  flex: 0 0 50px;
  color: rgba(120, 140, 164, 0.7);
  text-align: center;
}

.xm-code__content {
  flex: 1 1 auto;
  padding-left: var(--xm-space-5);
}

/* Syntax highlight tokens */
.xm-code--kw { color: var(--xm-syntax-keyword); }
.xm-code--id { color: var(--xm-syntax-identifier); }
.xm-code--op { color: var(--xm-syntax-operator); }
.xm-code--fn { color: var(--xm-syntax-function); }
.xm-code--arg { color: var(--xm-syntax-argument); }
.xm-code--str { color: var(--xm-syntax-string); }
.xm-code--comment { color: var(--xm-syntax-comment); }
.xm-code--num { color: var(--xm-syntax-number); }
.xm-code--bool { color: var(--xm-syntax-boolean); }
.xm-code--null { color: var(--xm-syntax-null); }


/* ================================================================
   TAB SWITCH — .xm-tabs
   ================================================================
   <div class="xm-tabs">
     <button class="xm-tabs__btn is-active">Tab 1</button>
     <button class="xm-tabs__btn">Tab 2</button>
   </div>
   ================================================================ */

.xm-tabs {
  position: relative;
  height: 28px;
  border-radius: var(--xm-radius-sm);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  background: var(--xm-bg-primary);
}

.xm-tabs__btn {
  position: relative;
  z-index: 1;
  height: 24px;
  padding: 0 var(--xm-space-6);
  border: none;
  border-radius: var(--xm-radius-xs);
  background: transparent;
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-xs);
  font-weight: var(--xm-weight-medium);
  color: var(--xm-text-secondary);
  cursor: pointer;
  transition: color var(--xm-transition-fast);
}

.xm-tabs__btn.is-active {
  color: var(--xm-text-white);
}

.xm-tabs__btn.is-active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--xm-bg-elevated);
  border-radius: var(--xm-radius-xs);
  z-index: -1;
}


/* ================================================================
   OVERLAY / LIGHTBOX — .xm-overlay
   ================================================================
   <div class="xm-overlay">
     <div class="xm-overlay__backdrop"></div>
     <div class="xm-overlay__dialog">
       <button class="xm-overlay__close">&times;</button>
       ...content...
     </div>
   </div>
   ================================================================ */

.xm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--xm-z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--xm-space-10);
}

.xm-overlay[hidden] {
  display: none !important;
}

.xm-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(var(--xm-blur-md));
  -webkit-backdrop-filter: blur(var(--xm-blur-md));
}

.xm-overlay__dialog {
  position: relative;
  z-index: 1;
  max-width: min(1100px, calc(100vw - 64px));
}

.xm-overlay__close {
  position: absolute;
  top: -44px;
  right: 0;
  border: 0;
  background: transparent;
  color: var(--xm-text-white);
  font: inherit;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-overlay {
    padding: var(--xm-space-6);
  }

  .xm-overlay__close {
    top: -34px;
    font-size: 30px;
  }
}


/* ================================================================
   COOKIE / BANNER — .xm-banner
   ================================================================
   <div class="xm-banner">
     <p class="xm-banner__text">We use cookies.</p>
     <div class="xm-banner__actions">
       <button class="xm-btn xm-btn--solid">Accept</button>
       <button class="xm-btn">Decline</button>
     </div>
   </div>
   ================================================================ */

.xm-banner {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  width: min(960px, calc(100vw - 32px));
  padding: var(--xm-space-6) var(--xm-space-7);
  border: 0.5px solid var(--xm-border-visible);
  background: var(--xm-bg-overlay);
  backdrop-filter: blur(var(--xm-blur-md));
  -webkit-backdrop-filter: blur(var(--xm-blur-md));
  z-index: var(--xm-z-banner);
  display: flex;
  align-items: center;
  gap: var(--xm-space-6);
}

.xm-banner[hidden] {
  display: none !important;
}

.xm-banner__text {
  margin: 0;
  color: var(--xm-text-secondary);
  font-size: var(--xm-text-base);
  line-height: var(--xm-leading-relaxed);
  font-weight: var(--xm-weight-light);
}

.xm-banner__text a {
  color: var(--xm-text-white);
  text-decoration: underline;
}

.xm-banner__actions {
  margin-left: auto;
  display: flex;
  gap: var(--xm-space-4);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .xm-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .xm-banner__actions {
    margin-left: 0;
    width: 100%;
    gap: var(--xm-space-3);
  }

  .xm-banner__actions .xm-btn {
    min-width: 0;
    flex: 1 1 auto;
  }
}


/* ================================================================
   POPOVER / TOOLTIP — .xm-popover
   ================================================================
   <div class="xm-popover">Popover content</div>
   ================================================================ */

.xm-popover {
  position: absolute;
  max-width: 320px;
  padding: var(--xm-space-4) var(--xm-space-5);
  border: 0.5px solid var(--xm-border-visible);
  background: var(--xm-bg-overlay);
  backdrop-filter: blur(var(--xm-blur-md));
  -webkit-backdrop-filter: blur(var(--xm-blur-md));
  border-radius: var(--xm-radius-lg);
  color: var(--xm-text-secondary);
  font-size: 13px;
  line-height: 1.35;
  font-weight: var(--xm-weight-light);
  z-index: var(--xm-z-dropdown);
}

.xm-popover::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -6px;
  width: 10px;
  height: 10px;
  background: var(--xm-bg-overlay);
  border-top: 0.5px solid var(--xm-border-visible);
  border-left: 0.5px solid var(--xm-border-visible);
  transform: rotate(45deg);
}


/* ================================================================
   DROPDOWN MENU — .xm-dropdown
   ================================================================
   <div class="xm-dropdown">
     <button class="xm-dropdown__item">Option 1</button>
     <button class="xm-dropdown__item">Option 2</button>
   </div>
   ================================================================ */

.xm-dropdown {
  position: absolute;
  min-width: 132px;
  background: var(--xm-bg-elevated);
  border: 0.5px solid var(--xm-border-visible);
  border-radius: var(--xm-radius-md);
  padding: var(--xm-space-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: var(--xm-z-dropdown);
}

.xm-dropdown__item {
  border: none;
  border-radius: var(--xm-radius-sm);
  background: transparent;
  color: var(--xm-text-white);
  font-family: var(--xm-font-sans);
  font-size: var(--xm-text-base);
  line-height: var(--xm-leading-snug);
  font-weight: var(--xm-weight-light);
  text-align: left;
  padding: var(--xm-space-2) var(--xm-space-3);
  cursor: pointer;
  white-space: nowrap;
}

.xm-dropdown__item:hover {
  background: var(--xm-surface-hover);
}


/* ================================================================
   SECTION HEADING — .xm-heading
   ================================================================
   <h2 class="xm-heading">Section Title</h2>
   <p class="xm-subheading">Subtitle text</p>
   ================================================================ */

.xm-heading {
  font-size: var(--xm-text-5xl);
  line-height: var(--xm-leading-snug);
  font-weight: var(--xm-weight-regular);
  color: var(--xm-text-white);
  letter-spacing: var(--xm-tracking-tight);
}

.xm-subheading {
  margin-top: var(--xm-space-6);
  font-size: var(--xm-text-lg);
  line-height: var(--xm-leading-loose);
  font-weight: var(--xm-weight-light);
  color: var(--xm-text-secondary);
}

.xm-heading--md {
  font-size: var(--xm-text-3xl);
  line-height: var(--xm-leading-relaxed);
  font-weight: var(--xm-weight-extralight);
}

.xm-heading--sm {
  font-size: var(--xm-text-xl);
  line-height: var(--xm-leading-snug);
  font-weight: var(--xm-weight-medium);
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-heading {
    font-size: 46px;
  }

  .xm-subheading {
    font-size: 19px;
  }
}


/* ================================================================
   GRID CARD LIST — .xm-grid
   ================================================================
   <div class="xm-grid xm-grid--3">
     <div class="xm-grid__item">...</div>
   </div>
   ================================================================ */

.xm-grid {
  display: grid;
  gap: 0;
  width: 100%;
}

.xm-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.xm-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.xm-grid__item {
  padding: var(--xm-space-10);
  border-right: 0.5px solid var(--xm-border-hairline);
  border-bottom: 0.5px solid var(--xm-border-hairline);
  transition: color var(--xm-transition-fast);
}

.xm-grid--3 .xm-grid__item:nth-child(3n) {
  border-right: none;
}

.xm-grid--2 .xm-grid__item:nth-child(2n) {
  border-right: none;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-grid--3,
  .xm-grid--2 {
    grid-template-columns: 1fr;
  }

  .xm-grid__item {
    border-right: none;
    padding: 38px var(--xm-space-6);
  }
}


/* ================================================================
   HORIZONTAL SCROLL ROW — .xm-hscroll
   ================================================================
   <div class="xm-hscroll">
     <div class="xm-hscroll__item xm-card xm-card--accent-top">...</div>
   </div>
   ================================================================ */

.xm-hscroll {
  display: flex;
  gap: var(--xm-space-8);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.xm-hscroll::-webkit-scrollbar {
  display: none;
}

.xm-hscroll__item {
  flex: 0 0 calc((var(--xm-max-width) - 72px) / 4);
  min-height: 260px;
  scroll-snap-align: start;
}

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-hscroll {
    gap: var(--xm-space-6);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .xm-hscroll__item {
    flex: 0 0 min(320px, calc(100vw - 86px));
    scroll-snap-stop: always;
  }
}


/* ================================================================
   BAR CHART — .xm-bar
   ================================================================
   <div class="xm-bar">
     <div class="xm-bar__track">
       <div class="xm-bar__fill" style="--xm-bar-value: 85%; --xm-bar-color: var(--xm-data-green)"></div>
     </div>
   </div>
   ================================================================ */

.xm-bar__track {
  width: 100%;
  height: 8px;
  background: #1c2126;
  border-radius: var(--xm-radius-sm);
  overflow: hidden;
}

.xm-bar__fill {
  width: var(--xm-bar-value, 0%);
  height: 100%;
  background: var(--xm-bar-color, var(--xm-green));
  border-radius: var(--xm-radius-sm);
}

.xm-bar__legend {
  display: flex;
  align-items: center;
  gap: 15px;
}

.xm-bar__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--xm-radius-full);
  margin-right: 5px;
  flex: 0 0 auto;
}


/* ================================================================
   TIMELINE — .xm-timeline
   ================================================================
   <div class="xm-timeline">
     <div class="xm-timeline__line"></div>
     <div class="xm-timeline__item">
       <div class="xm-timeline__dot"></div>
       <div class="xm-timeline__content">...</div>
     </div>
   </div>
   ================================================================ */

.xm-timeline {
  position: relative;
}

.xm-timeline__line {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 0.5px;
  height: 100%;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--xm-green) 0 4px,
    transparent 4px 8px
  );
}

.xm-timeline__dot {
  width: 8px;
  height: 8px;
  border-radius: var(--xm-radius-full);
  background: var(--xm-green);
  box-shadow: var(--xm-shadow-glow-cyan);
  flex: 0 0 auto;
}

.xm-timeline__dot--blue {
  background: var(--xm-blue);
}

.xm-timeline__dot--orange {
  background: var(--xm-orange);
}


/* ================================================================
   FOOTER / COPYRIGHT — .xm-footer
   ================================================================
   <footer class="xm-footer">
     <p class="xm-footer__copy">&copy; 2026 xmemory</p>
     <nav class="xm-footer__links">
       <a href="#">Privacy</a><span>&middot;</span><a href="#">Terms</a>
     </nav>
   </footer>
   ================================================================ */

.xm-footer__copy {
  text-align: center;
  font-size: var(--xm-text-sm);
  line-height: var(--xm-leading-normal);
  font-weight: var(--xm-weight-light);
  color: var(--xm-text-faint);
}

.xm-footer__links {
  margin-top: var(--xm-space-13);
  text-align: center;
  font-size: var(--xm-text-sm);
  line-height: var(--xm-leading-normal);
  font-weight: var(--xm-weight-light);
  color: var(--xm-text-muted);
}

.xm-footer__links a {
  color: inherit;
  text-decoration: none;
}

.xm-footer__links a:hover {
  text-decoration: underline;
}

.xm-footer__links span {
  margin: 0 var(--xm-space-3);
}


/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes xm-spin {
  100% { transform: rotate(360deg); }
}

@keyframes xm-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes xm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes xm-fade-out {
  from { opacity: 1; visibility: visible; }
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

@keyframes xm-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
/*! @xmemory/ui — Utilities v0.1.0 */

/* ── Layout ──────────────────────────────────────────────── */

.xm-container {
  max-width: var(--xm-max-width);
  margin: 0 auto;
}

.xm-flex {
  display: flex;
}

.xm-flex-col {
  display: flex;
  flex-direction: column;
}

.xm-flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.xm-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.xm-items-center {
  align-items: center;
}

.xm-items-start {
  align-items: flex-start;
}

.xm-justify-center {
  justify-content: center;
}

.xm-justify-end {
  justify-content: flex-end;
}

.xm-gap-1 { gap: var(--xm-space-1); }
.xm-gap-2 { gap: var(--xm-space-2); }
.xm-gap-3 { gap: var(--xm-space-3); }
.xm-gap-4 { gap: var(--xm-space-4); }
.xm-gap-5 { gap: var(--xm-space-5); }
.xm-gap-6 { gap: var(--xm-space-6); }
.xm-gap-7 { gap: var(--xm-space-7); }
.xm-gap-8 { gap: var(--xm-space-8); }
.xm-gap-9 { gap: var(--xm-space-9); }
.xm-gap-10 { gap: var(--xm-space-10); }

.xm-w-full { width: 100%; }
.xm-h-full { height: 100%; }

/* ── Spacing ─────────────────────────────────────────────── */

.xm-mt-0 { margin-top: 0; }
.xm-mt-2 { margin-top: var(--xm-space-2); }
.xm-mt-4 { margin-top: var(--xm-space-4); }
.xm-mt-6 { margin-top: var(--xm-space-6); }
.xm-mt-8 { margin-top: var(--xm-space-8); }
.xm-mt-10 { margin-top: var(--xm-space-10); }
.xm-mt-12 { margin-top: var(--xm-space-12); }
.xm-mt-14 { margin-top: var(--xm-space-14); }
.xm-mt-15 { margin-top: var(--xm-space-15); }

.xm-mb-0 { margin-bottom: 0; }
.xm-mb-6 { margin-bottom: var(--xm-space-6); }
.xm-mb-8 { margin-bottom: var(--xm-space-8); }
.xm-mb-10 { margin-bottom: var(--xm-space-10); }

.xm-p-0 { padding: 0; }
.xm-p-6 { padding: var(--xm-space-6); }
.xm-p-8 { padding: var(--xm-space-8); }
.xm-p-10 { padding: var(--xm-space-10); }

.xm-px-6 { padding-left: var(--xm-space-6); padding-right: var(--xm-space-6); }
.xm-px-8 { padding-left: var(--xm-space-8); padding-right: var(--xm-space-8); }

.xm-py-6 { padding-top: var(--xm-space-6); padding-bottom: var(--xm-space-6); }
.xm-py-8 { padding-top: var(--xm-space-8); padding-bottom: var(--xm-space-8); }

/* ── Typography ──────────────────────────────────────────── */

.xm-font-sans { font-family: var(--xm-font-sans); }
.xm-font-mono { font-family: var(--xm-font-mono); }

.xm-text-xs { font-size: var(--xm-text-xs); }
.xm-text-sm { font-size: var(--xm-text-sm); }
.xm-text-base { font-size: var(--xm-text-base); }
.xm-text-md { font-size: var(--xm-text-md); }
.xm-text-lg { font-size: var(--xm-text-lg); }
.xm-text-xl { font-size: var(--xm-text-xl); }
.xm-text-2xl { font-size: var(--xm-text-2xl); }
.xm-text-3xl { font-size: var(--xm-text-3xl); }
.xm-text-4xl { font-size: var(--xm-text-4xl); }
.xm-text-5xl { font-size: var(--xm-text-5xl); }

.xm-font-thin { font-weight: var(--xm-weight-thin); }
.xm-font-extralight { font-weight: var(--xm-weight-extralight); }
.xm-font-light { font-weight: var(--xm-weight-light); }
.xm-font-regular { font-weight: var(--xm-weight-regular); }
.xm-font-medium { font-weight: var(--xm-weight-medium); }

.xm-leading-tight { line-height: var(--xm-leading-tight); }
.xm-leading-snug { line-height: var(--xm-leading-snug); }
.xm-leading-normal { line-height: var(--xm-leading-normal); }
.xm-leading-relaxed { line-height: var(--xm-leading-relaxed); }
.xm-leading-loose { line-height: var(--xm-leading-loose); }

.xm-tracking-tight { letter-spacing: var(--xm-tracking-tight); }

.xm-text-left { text-align: left; }
.xm-text-center { text-align: center; }
.xm-text-right { text-align: right; }

.xm-nowrap { white-space: nowrap; }
.xm-break-words { overflow-wrap: anywhere; }

/* ── Colors ──────────────────────────────────────────────── */

.xm-color-white { color: var(--xm-text-white); }
.xm-color-primary { color: var(--xm-text-primary); }
.xm-color-secondary { color: var(--xm-text-secondary); }
.xm-color-muted { color: var(--xm-text-muted); }
.xm-color-green { color: var(--xm-green); }
.xm-color-blue { color: var(--xm-blue); }
.xm-color-orange { color: var(--xm-orange); }
.xm-color-yellow { color: var(--xm-yellow); }

.xm-bg-primary { background-color: var(--xm-bg-primary); }
.xm-bg-elevated { background-color: var(--xm-bg-elevated); }
.xm-bg-surface { background-color: var(--xm-bg-surface); }
.xm-bg-deep { background-color: var(--xm-bg-deep); }

/* ── Borders ─────────────────────────────────────────────── */

.xm-border { border: 0.5px solid var(--xm-border-hairline); }
.xm-border-subtle { border: 0.5px solid var(--xm-border-subtle); }
.xm-border-visible { border: 0.5px solid var(--xm-border-visible); }
.xm-border-accent { border: 1px solid var(--xm-border-accent); }

.xm-border-b { border-bottom: 0.5px solid var(--xm-border-hairline); }
.xm-border-l { border-left: 0.5px solid var(--xm-border-hairline); }
.xm-border-r { border-right: 0.5px solid var(--xm-border-hairline); }
.xm-border-t { border-top: 0.5px solid var(--xm-border-hairline); }

.xm-rounded-sm { border-radius: var(--xm-radius-sm); }
.xm-rounded-md { border-radius: var(--xm-radius-md); }
.xm-rounded-lg { border-radius: var(--xm-radius-lg); }
.xm-rounded-xl { border-radius: var(--xm-radius-xl); }
.xm-rounded-2xl { border-radius: var(--xm-radius-2xl); }
.xm-rounded-full { border-radius: var(--xm-radius-full); }

/* ── Effects ─────────────────────────────────────────────── */

.xm-glass {
  background: linear-gradient(135deg, rgba(52, 58, 66, 0.1), rgba(0, 0, 0, 0.1));
  backdrop-filter: blur(var(--xm-blur-xl));
  -webkit-backdrop-filter: blur(var(--xm-blur-xl));
  border: 0.5px solid var(--xm-border-visible);
}

.xm-gradient-text {
  background: linear-gradient(135deg, var(--xm-gradient-start) 0%, var(--xm-gradient-end) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.xm-gradient-bg {
  background: linear-gradient(
    155deg,
    var(--xm-gradient-bg-1) 0%,
    var(--xm-gradient-bg-2) 20%,
    var(--xm-gradient-bg-3) 40%,
    var(--xm-gradient-bg-4) 74%
  );
}

.xm-gradient-accent {
  background: linear-gradient(165deg, #f97316 0%, #fbbf24 30%, #a3e635 80%);
}

.xm-shadow-sm { box-shadow: var(--xm-shadow-sm); }
.xm-shadow-md { box-shadow: var(--xm-shadow-md); }
.xm-shadow-lg { box-shadow: var(--xm-shadow-lg); }
.xm-shadow-glow-green { box-shadow: var(--xm-shadow-glow-green); }

/* ── Visibility & state ──────────────────────────────────── */

.xm-hidden { display: none !important; }
.xm-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.xm-pointer-events-none { pointer-events: none; }
.xm-cursor-pointer { cursor: pointer; }

/* ── State classes (for JS toggling) ─────────────────────── */

.is-active {}
.is-open {}
.is-loading {}
.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.is-fading {
  animation: xm-fade-out 0.8s ease forwards;
}
.is-dimmed {
  opacity: 0.4;
}

/* ── Transitions ─────────────────────────────────────────── */

.xm-transition-fast { transition: all var(--xm-transition-fast); }
.xm-transition-base { transition: all var(--xm-transition-base); }
.xm-transition-slow { transition: all var(--xm-transition-slow); }

/* ── Mobile utilities ────────────────────────────────────── */

@media (max-width: 820px), (hover: none) and (pointer: coarse) {
  .xm-hide-mobile { display: none !important; }
}

@media (min-width: 821px) {
  .xm-hide-desktop { display: none !important; }
}