/* ============================================
   Astryx — Rebuilt in Figma
   Design tokens pulled from Figma file
   hvJRZdp9wXRD1LACPYCkpL — Token System section
   ============================================ */

:root {
  /* Color — Text */
  --text-primary: #1d1c11;
  --text-secondary: #605f52;
  --text-disabled: #adac9e;
  --text-accent: #225bff;

  /* Color — Background */
  --bg-surface: #ffffff;
  --bg-body: #fdfbe4;
  --bg-muted: #f3f2e2;

  /* Color — Border */
  --border-default: #e5e3d4;
  --border-emphasized: #c7c4b2;

  /* Color — Icon */
  --icon-primary: #1d1c11;
  --icon-secondary: #605f52;
  --icon-disabled: #adac9e;

  /* Color — Accent */
  --accent-default: #225bff;
  --accent-muted: #225bff33;
  --accent-on-accent: #ffffff;

  /* Color — Interactive / Overlay */
  --overlay-default: #1d1c1180;
  --overlay-hover: #1d1c110d;
  --overlay-pressed: #1d1c111a;

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Outfit', sans-serif;
  --font-code: 'JetBrains Mono', monospace;

  --size-sm: 12px;
  --line-height-sm: 20px;
  --size-base: 14px;
  --line-height-base: 20px;
  --size-lg: 17px;
  --line-height-lg: 24px;
  --size-3xl: 29px;
  --line-height-3xl: 36px;
  --size-4xl: 35px;
  --line-height-4xl: 44px;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Spacing scale */
  --space-0: 0px;
  --space-0-5: 2px;
  --space-1: 4px;
  --space-1-5: 6px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;

  /* Radius scale */
  --radius-none: 0px;
  --radius-inner: 6px;
  --radius-element: 8px;
  --radius-container: 12px;
  --radius-page: 24px;
  --radius-chat: 28px;
  --radius-full: 9999px;

  /* Elevation scale */
  --shadow-color: #1d1c111a;
  --shadow-very-low: 0px 1px 2px 0px var(--shadow-color);
  --shadow-low: 0px 1px 3px 0px var(--shadow-color);
  --shadow-medium: 0px 4px 6px -1px var(--shadow-color);
  --shadow-high: 0px 8px 10px -2px var(--shadow-color);
  --shadow-very-high: 0px 16px 24px -4px var(--shadow-color);
  --shadow-overlay: 0px 20px 25px -5px var(--shadow-color);

  /* Color — Inverted surface */
  --bg-inverted: #1d1c11;
  --text-inverted-number: #e5e3d4;
  --text-inverted-label: #605f52;

  /* Layout */
  --page-max-width: 1440px;
  --page-padding-desktop: 128px;
  --page-padding-mobile: 20px;
}

/* ── Reset ── */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg-surface);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
}

ul, ol {
  list-style: none;
}

/* ── Layout helpers ── */
.container {
  max-width: var(--page-max-width);
  margin: 0 auto;
  padding-left: var(--page-padding-desktop);
  padding-right: var(--page-padding-desktop);
}

@media (max-width: 1023px) {
  .container {
    padding-left: var(--page-padding-mobile);
    padding-right: var(--page-padding-mobile);
  }
}

/* ── Nav ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease, backdrop-filter 0.3s ease;
}
.nav.is-scrolled {
  border-bottom-color: var(--border-default);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.nav-inner {
  max-width: var(--page-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) var(--page-padding-desktop);
}
.nav-logo { display: flex; align-items: center; flex-shrink: 0; }
.nav-logo-mobile { display: none; }
.nav-logo img { height: 24px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 32px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-element);
  font-size: 13px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.nav-btn:active { transform: scale(0.98); }
.nav-btn-ghost {
  color: var(--text-primary);
}
.nav-btn-ghost:hover { background: var(--overlay-hover); }
.nav-btn-primary {
  background: var(--accent-default);
  color: var(--accent-on-accent);
}
.nav-btn-primary:hover { filter: brightness(1.08); }
.nav-btn-primary svg { flex-shrink: 0; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-element);
}
.nav-toggle:hover { background: var(--overlay-hover); }
.nav-toggle-bar {
  width: 16px;
  height: 1.5px;
  background: var(--icon-primary);
  border-radius: var(--radius-full);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-3.25px) rotate(-45deg); }

.nav-mobile-menu {
  display: none;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  border-top: 1px solid transparent;
}
.nav-mobile-menu.is-open {
  max-height: 200px;
  border-top-color: var(--border-default);
}
.nav-mobile-link {
  padding: var(--space-4) var(--page-padding-mobile);
  font-size: 14px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-default);
}
.nav-mobile-link:last-child { border-bottom: none; }

@media (max-width: 767px) {
  .nav-inner { padding: var(--space-4) var(--page-padding-mobile); }
  .nav-logo-desktop { display: none; }
  .nav-logo-mobile { display: block; height: 16.5px; }
  .nav-toggle { display: flex; }
  .nav-mobile-menu { display: flex; }
  .nav-links { gap: var(--space-3); }
  .nav-btn-ghost { display: none; }
}

/* ── Buttons (shared) ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 48px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-element);
  font-size: 16px;
  font-weight: var(--weight-medium);
  white-space: nowrap;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: var(--overlay-hover);
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--overlay-pressed); }
.btn-primary {
  background: var(--accent-default);
  color: var(--accent-on-accent);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary svg { flex-shrink: 0; }

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 120px 0 96px;
}
.hero-shapes {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-shapes-mobile {
  display: none;
}
.hero-shape-wrap {
  position: absolute;
  display: block;
  animation-name: hero-shape-float;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@media (prefers-reduced-motion: reduce) {
  .hero-shape-wrap {
    animation: none;
  }
}
@keyframes hero-shape-float {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(8px, -12px) rotate(3deg); }
  50%  { transform: translate(-6px, 5px) rotate(-3deg); }
  75%  { transform: translate(-10px, -6px) rotate(2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.hero-shape {
  display: block;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 40px;
}
.hero-copy {
  flex: 1 1 0;
  min-width: 0;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: var(--space-9);
}
.hero-copy-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  align-self: flex-start;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  background: var(--overlay-hover);
  font-family: var(--font-code);
  font-size: var(--size-sm);
  line-height: var(--line-height-sm);
  color: var(--text-primary);
}
.hero-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 68px;
  line-height: 71.4px;
  letter-spacing: -1.36px;
  color: var(--text-primary);
}
.hero-subtitle {
  font-family: var(--font-heading);
  font-weight: var(--weight-normal);
  font-size: 20px;
  line-height: 28px;
  color: var(--text-secondary);
  max-width: 640px;
}
.hero-actions {
  display: flex;
  gap: var(--space-4);
}
.hero-btn-secondary { order: 1; }
.hero-btn-primary { order: 2; width: 160px; }

/* Composited mockup */
.hero-mockup {
  position: relative;
  flex-shrink: 0;
}
.hero-mockup-desktop { width: 576px; height: 480px; }
.hero-mockup-mobile { display: none; }

.hero-card {
  position: absolute;
  background: var(--bg-surface);
  border-radius: var(--radius-container);
  box-shadow: 0 1.7px 1.7px 0 rgba(0,0,0,0.08), 0 6.8px 20.4px 0 rgba(0,0,0,0.12);
}
.hero-product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.hero-product-photo { width: 100%; aspect-ratio: 1 / 1; }
.hero-product-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-product-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3);
  gap: var(--space-3);
}
.hero-progress { display: flex; flex-direction: column; gap: var(--space-1); }
.hero-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--size-base);
  line-height: var(--line-height-base);
}
.hero-progress-label { color: var(--text-primary); font-weight: var(--weight-medium); }
.hero-progress-value { color: var(--text-secondary); }
.hero-progress-track {
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  overflow: hidden;
}
.hero-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--accent-default);
}
.hero-avatar-row { display: flex; align-items: center; gap: var(--space-2); }
.hero-avatar {
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-emphasized);
  object-fit: cover;
}
.hero-avatar-name { font-size: 10px; color: var(--text-secondary); }

.hero-mini-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
}
.hero-mini-row { display: flex; align-items: center; gap: var(--space-2); }
.hero-mini-thumb {
  width: 41px; height: 41px;
  border-radius: var(--radius-container);
  object-fit: cover;
  flex-shrink: 0;
}
.hero-mini-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hero-mini-title { font-size: var(--size-base); font-weight: var(--weight-semibold); color: var(--text-primary); white-space: nowrap; }
.hero-mini-sub { font-size: 10px; color: var(--text-secondary); white-space: nowrap; }
.hero-mini-btn {
  border: 1px solid var(--accent-default);
  border-radius: var(--radius-element);
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  font-weight: var(--weight-medium);
  color: var(--text-accent);
  background: transparent;
}

.hero-chat {
  border-radius: var(--radius-page);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  box-shadow: 0 0.85px 0.425px rgba(0,0,0,0.06), 0 1.7px 3.4px rgba(0,0,0,0.08);
}
.hero-chat-input { font-size: var(--size-sm); color: var(--text-secondary); }
.hero-chat-actions { display: flex; align-items: center; justify-content: space-between; }
.hero-chat-btn {
  width: 27px; height: 27px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-chat-btn-add { background: var(--overlay-hover); color: var(--icon-primary); }
.hero-chat-btn-send { background: var(--text-primary); color: var(--accent-on-accent); }

.hero-float-badge {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: var(--size-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}
.hero-badge-tokens { background: #9eb7ff; color: #00134d; }
.hero-badge-components { background: #f2daff; color: #52237b; }
.hero-badge-modes { background: var(--overlay-hover); color: var(--text-primary); }

@media (max-width: 1023px) {
  .hero-shapes:not(.hero-shapes-mobile) { display: none; }
  .hero-shapes-mobile { display: block; }
  .hero-mockup-desktop { display: none; }
  .hero-inner { flex-direction: column; align-items: flex-start; }
  .hero { padding: var(--space-12) 0; }
  .hero-copy { max-width: 100%; gap: var(--space-8); }
  .hero-title { font-size: var(--size-4xl); line-height: var(--line-height-4xl); letter-spacing: 0; }
  .hero-subtitle { font-size: var(--size-base); line-height: var(--line-height-base); max-width: 100%; }
  .hero-actions { flex-direction: column; width: 100%; gap: var(--space-3); }
  .hero-btn-primary, .hero-btn-secondary { width: 100%; }
  .hero-btn-primary { order: 1; }
  .hero-btn-secondary { order: 2; }
  .hero-mockup-mobile { display: block; width: 100%; max-width: 336px; height: 284px; margin-top: var(--space-2); }
  .hero-mini-title { overflow: hidden; text-overflow: ellipsis; }
}

/* ── Shared section header ── */
.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-10);
}
.section-eyebrow {
  font-family: var(--font-body);
  font-weight: var(--weight-bold);
  font-size: var(--size-sm);
  line-height: var(--line-height-sm);
  color: var(--text-accent);
}
.section-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-semibold);
  font-size: var(--size-4xl);
  line-height: var(--line-height-4xl);
  color: var(--text-primary);
}
.section-desc {
  font-family: var(--font-body);
  font-size: var(--size-lg, 17px);
  line-height: var(--line-height-lg, 24px);
  color: var(--text-secondary);
  max-width: 800px;
}

/* ── The Approach ── */
.approach { padding: 80px 0; }
.approach-grid {
  display: flex;
  gap: var(--space-5);
  align-items: stretch;
}
.approach-carousel { display: none; }
.approach-card {
  flex: 1 1 0;
  min-width: 0;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-container);
}
.approach-card-title { font-weight: var(--weight-bold); font-size: var(--size-base); line-height: var(--line-height-base); }
.approach-card-body { font-size: var(--size-base); line-height: var(--line-height-base); }
.approach-card-white {
  background: var(--bg-surface);
  border: 1px solid var(--border-emphasized);
  color: var(--text-primary);
}
.approach-card-muted { background: var(--bg-muted); color: var(--text-primary); }
.approach-card-gray { background: #f0edd4; color: #4a4732; }
.approach-card-orange { background: #ffdcb6; color: #622e00; }

@media (max-width: 1023px) {
  .approach { padding: var(--space-12) 0; }
  .section-title { font-size: var(--size-3xl); line-height: var(--line-height-3xl); }
  .section-desc { font-size: var(--size-base); line-height: var(--line-height-base); }
  .approach-grid { display: none; }
  .approach-carousel {
    display: flex;
    gap: var(--space-5);
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-2);
    scrollbar-width: none;
  }
  .approach-carousel::-webkit-scrollbar { display: none; }
  .approach-carousel .approach-card {
    flex: 0 0 auto;
    width: 260px;
    scroll-snap-align: start;
  }
}

/* ── Themes ── */
.themes { padding: 80px 0; }
.themes-demo {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
}
.themes-panel {
  flex: 0 0 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-emphasized);
  border-radius: var(--radius-container);
  padding: var(--space-5);
}
.themes-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
}
.themes-panel-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--size-lg);
  color: var(--text-primary);
}
.themes-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: var(--icon-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}
.themes-toggle:hover { background: var(--overlay-hover); }
.themes-toggle[aria-pressed="true"] { background: var(--overlay-pressed); color: var(--icon-primary); }
.themes-toggle-icon {
  position: absolute;
  top: 9px;
  left: 9px;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.themes-toggle-icon-sun { opacity: 1; transform: rotate(0deg) scale(1); }
.themes-toggle-icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
.themes-toggle[aria-pressed="true"] .themes-toggle-icon-sun { opacity: 0; transform: rotate(90deg) scale(0.5); }
.themes-toggle[aria-pressed="true"] .themes-toggle-icon-moon { opacity: 1; transform: rotate(0deg) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .themes-toggle-icon { transition: opacity 0.15s ease; }
}
.themes-panel-divider {
  height: 1px;
  background: var(--border-default);
  margin-bottom: var(--space-4);
}
.themes-list { display: flex; flex-direction: column; gap: var(--space-3); }
.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  height: 88px;
  padding: var(--space-4);
  border-radius: var(--td-radius-container, var(--radius-container));
  border: 1px solid var(--td-border-default, var(--border-default));
  background: var(--td-background-card, var(--bg-surface));
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s ease, background-color 0.15s ease, border-radius 0.15s ease;
}
.theme-card-icon { position: relative; z-index: 1; color: var(--td-text-primary, var(--icon-primary)); transition: color 0.15s ease; }
.theme-card-label {
  position: relative;
  z-index: 1;
  font-family: var(--td-font-family-heading, var(--font-heading));
  font-weight: var(--td-font-weight-semibold, var(--weight-semibold));
  font-size: var(--size-base);
  color: var(--td-text-primary, var(--text-primary));
  transition: color 0.15s ease;
}
.theme-card-thumb {
  position: absolute;
  right: 0;
  top: 0;
  transform: translateY(-50%);
  transform: translatex(20%);
  width: 42%;
  height: 130%;
  object-fit: scale-down;
}
.theme-card.is-selected { border-color: var(--accent-default); border-width: 2px; }

.themes-preview {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--td-background-body, var(--bg-body));
  border-radius: var(--td-radius-page, var(--radius-page));
  font-family: var(--td-font-family-body, var(--font-body));
  transition: background-color 0.2s ease, border-radius 0.2s ease;
}
.themes-products { display: flex; gap: var(--space-5); }
.theme-product-card {
  flex: 1 1 0;
  min-width: 0;
  background: var(--td-background-card, var(--bg-surface));
  border: 1px solid var(--td-border-emphasized, var(--border-emphasized));
  border-radius: var(--td-radius-container, var(--radius-container));
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease, border-radius 0.2s ease;
}
.theme-product-photo { width: 100%; aspect-ratio: 1 / 1; }
.theme-product-photo img { width: 100%; height: 100%; object-fit: cover; }
.theme-product-body { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4); text-align: center; }
.theme-product-title {
  font-family: var(--td-font-family-heading, var(--font-heading));
  font-weight: var(--td-font-weight-semibold, var(--weight-semibold));
  font-size: var(--td-font-size-lg, var(--size-lg));
  color: var(--td-text-primary, var(--text-primary));
  transition: color 0.2s ease;
}
.theme-product-desc {
  font-size: var(--td-font-size-sm, var(--size-sm));
  color: var(--td-text-secondary, var(--text-secondary));
  transition: color 0.2s ease;
}
.theme-product-actions { display: flex; gap: var(--space-2); align-items: center; justify-content: center; width: 100%; }
.theme-qty {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 32px;
  border: 1px solid var(--td-border-emphasized, var(--border-emphasized));
  border-radius: var(--td-radius-element, var(--radius-element));
  font-size: var(--td-font-size-base, var(--size-base));
  color: var(--td-text-primary, var(--text-primary));
  transition: border-color 0.2s ease, border-radius 0.2s ease, color 0.2s ease;
}
.theme-add-btn {
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--td-radius-element, var(--radius-element));
  background: var(--td-overlay-hover, var(--overlay-hover));
  font-size: 13px;
  font-weight: var(--td-font-weight-medium, var(--weight-medium));
  color: var(--td-text-primary, var(--text-primary));
  transition: background-color 0.2s ease, border-radius 0.2s ease, color 0.2s ease;
}
.theme-add-btn:hover { background: var(--td-overlay-pressed, var(--overlay-pressed)); }

.theme-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 var(--space-2);
  border-radius: var(--td-radius-full, var(--radius-full));
  font-size: 11px;
  font-weight: var(--td-font-weight-medium, var(--weight-medium));
  transition: background-color 0.2s ease, color 0.2s ease, border-radius 0.2s ease;
}
.theme-badge-blue { background: var(--td-background-blue, #dbe6ff); color: var(--td-badge-text-blue, #1a3a99); }
.theme-badge-green { background: var(--td-background-green, #1f6d3e); color: var(--td-badge-text-green, #ffffff); }
.theme-badge-yellow { background: var(--td-background-yellow, #f6d675); color: var(--td-badge-text-yellow, #4a3a05); }
.theme-badge-navy { background: #1d1c11; color: #ffffff; }
.theme-badge-teal { background: var(--td-background-teal, #bdece0); color: var(--td-badge-text-teal, #0d4d3f); }
.theme-badge-orange { background: var(--td-background-orange, #ffdcb6); color: var(--td-badge-text-orange, #622e00); }

.theme-table {
  background: var(--td-background-surface, var(--bg-surface));
  border: 1px solid var(--td-border-default, var(--border-default));
  border-radius: var(--td-radius-container, var(--radius-container));
  overflow: hidden;
  transition: background-color 0.2s ease, border-color 0.2s ease, border-radius 0.2s ease;
}
.theme-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6);
  border-bottom: 1px solid var(--td-border-default, var(--border-default));
  transition: border-color 0.2s ease;
}
.theme-table-title {
  font-family: var(--td-font-family-heading, var(--font-heading));
  font-weight: var(--td-font-weight-semibold, var(--weight-semibold));
  font-size: var(--td-font-size-lg, var(--size-lg));
  color: var(--td-text-primary, var(--text-primary));
  transition: color 0.2s ease;
}
.theme-add-item-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 32px;
  padding: 0 var(--space-3);
  border-radius: var(--td-radius-element, var(--radius-element));
  background: var(--td-accent-default, var(--accent-default));
  color: var(--td-accent-on-accent, var(--accent-on-accent));
  font-size: 13px;
  font-weight: var(--td-font-weight-medium, var(--weight-medium));
  transition: background-color 0.2s ease, color 0.2s ease, border-radius 0.2s ease;
}
.theme-add-item-btn:hover { filter: brightness(1.08); }
.theme-table-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--td-border-default, var(--border-default));
  transition: border-color 0.2s ease;
}
.theme-search, .theme-filters {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--td-text-secondary, var(--text-secondary));
  font-size: var(--td-font-size-sm, var(--size-sm));
  transition: color 0.2s ease;
}
.theme-search {
  flex: 1 1 0;
  min-width: 0;
  max-width: 256px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--td-border-default, var(--border-default));
  border-radius: var(--td-radius-element, var(--radius-element));
  transition: border-color 0.2s ease, border-radius 0.2s ease;
}
.theme-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) var(--space-6) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--td-warning-warning-muted, #e8dfc4);
  color: var(--td-warning-default, #5c4a1f);
  border-radius: var(--td-radius-container, var(--radius-container));
  font-size: var(--td-font-size-base, var(--size-base));
  font-weight: var(--td-font-weight-medium, var(--weight-medium));
  transition: background-color 0.2s ease, color 0.2s ease, border-radius 0.2s ease;
}
.theme-inventory { width: 100%; border-collapse: collapse; margin-top: var(--space-4); }
.theme-inventory th {
  padding: var(--space-1) var(--space-2) var(--space-2) var(--space-6);
  text-align: left;
  font-size: 11px;
  font-weight: var(--td-font-weight-semibold, var(--weight-semibold));
  color: var(--td-text-secondary, var(--text-secondary));
  border-bottom: 1px solid var(--td-border-default, var(--border-default));
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-inventory td {
  padding: var(--space-3) var(--space-2) var(--space-3) var(--space-6);
  font-size: var(--td-font-size-base, var(--size-base));
  color: var(--td-text-primary, var(--text-primary));
  border-bottom: 1px solid var(--td-border-default, var(--border-default));
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.theme-inventory tr:last-child td { border-bottom: none; }
.theme-inventory-item { display: flex; align-items: center; white-space: normal; }
.theme-checkbox {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-right: var(--space-3);
  flex-shrink: 0;
  border: 1px solid var(--td-border-emphasized, var(--border-emphasized));
  border-radius: var(--td-radius-inner, var(--radius-inner));
  color: var(--td-accent-on-accent, var(--accent-on-accent));
  transition: background-color 0.2s ease, border-color 0.2s ease, border-radius 0.2s ease;
}
.theme-checkbox.is-checked {
  background: var(--td-accent-default, var(--accent-default));
  border-color: var(--td-accent-default, var(--accent-default));
}
.theme-inventory-sub {
  display: block;
  font-size: var(--td-font-size-sm, var(--size-sm));
  color: var(--td-text-secondary, var(--text-secondary));
  transition: color 0.2s ease;
}
.theme-inventory td:nth-child(2),
.theme-inventory td:nth-child(3) { color: var(--td-text-secondary, var(--text-secondary)); }

@media (max-width: 1023px) {
  .themes { padding: var(--space-12) 0; }
  .themes-demo { flex-direction: column; }
  .themes-panel { flex: 1 1 auto; width: 100%; }
  .themes-preview { display: none; }
}

/* ── Component Showcase ── */
.showcase { padding: 80px 0; }
.showcase-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}
.showcase-grid .component-card:nth-child(5) { grid-column: 1; }
.showcase-grid .component-card:nth-child(6) { grid-column: 2 / 4; }
.showcase-grid .component-card:nth-child(7) { grid-column: 4; }
.component-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-container);
  box-shadow: var(--shadow-low);
  overflow: hidden;
}
.component-card-preview {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-8);
  background: var(--bg-body);
}
.component-card-text {
  padding: var(--space-4) var(--space-3);
}
.component-card-text p {
  font-size: var(--size-sm);
  line-height: var(--line-height-sm);
  color: var(--text-secondary);
}
.showcase-demo-btn { height: 36px; width: auto; padding: 0 var(--space-3); font-size: var(--size-base); }

.showcase-field { display: flex; flex-direction: column; gap: var(--space-1); width: 176px; }
.showcase-field-label { font-size: var(--size-base); font-weight: var(--weight-semibold); color: var(--text-primary); }
.showcase-input {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-element);
  background: var(--bg-surface);
  color: var(--icon-secondary);
  font-size: var(--size-base);
}
.showcase-input { color: var(--text-primary); }
.showcase-input svg { color: var(--icon-secondary); flex-shrink: 0; }

.showcase-avatar-stack { display: flex; }
.showcase-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-muted);
  border: 2px solid var(--bg-surface);
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-secondary);
  margin-left: -8px;
}
.showcase-avatar:first-child { margin-left: 0; }
.showcase-avatar-more { background: var(--overlay-hover); }

.showcase-radio { display: flex; flex-direction: column; gap: var(--space-2); width: 192px; }
.showcase-radio-label { font-size: var(--size-sm); font-weight: var(--weight-medium); color: var(--text-secondary); }
.showcase-radio-item { display: flex; align-items: center; gap: var(--space-2); }
.showcase-radio-dot {
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-emphasized);
  background: var(--bg-surface);
  flex-shrink: 0;
  position: relative;
}
.showcase-radio-dot.is-checked { border-color: var(--accent-default); }
.showcase-radio-dot.is-checked::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: var(--radius-full);
  background: var(--accent-default);
}
.showcase-radio-text { flex: 1 1 0; min-width: 0; font-size: var(--size-base); font-weight: var(--weight-medium); color: var(--text-primary); }
.showcase-radio-price { font-size: var(--size-base); color: var(--text-secondary); }

.component-card-fixed { flex: 0 0 auto; }
.showcase-switch {
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  padding: 2px;
  border-radius: var(--radius-full);
  background: var(--border-emphasized);
  justify-content: flex-start;
}
.showcase-switch.is-on { background: var(--bg-muted); justify-content: flex-end; }
.showcase-switch-thumb {
  width: 20px; height: 20px;
  border-radius: var(--radius-full);
  background: var(--text-primary);
}

.showcase-collapsible {
  width: 100%;
  max-width: 320px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-container);
  padding: var(--space-4);
}
.showcase-collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-primary);
  font-size: var(--size-lg);
}
.showcase-collapsible-head svg { color: var(--icon-secondary); }
.showcase-collapsible-body {
  margin-top: var(--space-2);
  font-size: var(--size-base);
  line-height: var(--line-height-base);
  color: var(--text-secondary);
}

.showcase-chat {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-chat);
  box-shadow: var(--shadow-low);
  padding: var(--space-2);
}
.showcase-chat-placeholder { padding: var(--space-1) var(--space-2); font-size: var(--size-sm); color: var(--text-secondary); }
.showcase-chat-footer { display: flex; align-items: center; gap: var(--space-1); }
.showcase-chat-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  height: 28px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--text-primary);
}
.showcase-chat-pill:hover { background: var(--overlay-hover); }
.showcase-chat-icon, .showcase-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  color: var(--icon-primary);
  margin-left: auto;
}
.showcase-chat-send { background: var(--text-primary); color: var(--accent-on-accent); margin-left: 0; }
.showcase-chat-icon:hover { background: var(--overlay-hover); }

@media (max-width: 1023px) {
  .showcase { padding: var(--space-12) 0; }
  .showcase-grid { grid-template-columns: 1fr; }
  .showcase-grid .component-card:nth-child(5),
  .showcase-grid .component-card:nth-child(6),
  .showcase-grid .component-card:nth-child(7) { grid-column: 1; }
  .component-card-preview { padding: 0 var(--space-4); }
}

/* ── Token System ── */
.tokens { padding: 80px 0; }
.token-group-title { font-size: var(--size-base); font-weight: var(--weight-semibold); color: var(--text-secondary); padding-bottom: var(--space-2); border-bottom: 1px solid var(--border-default); margin-bottom: var(--space-4); }
.token-colors {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-6);
  padding-bottom: var(--space-10);
  margin-bottom: var(--space-10);
}
.token-group { display: flex; flex-direction: column; }
.token-swatch-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.token-swatch { width: 28px; height: 28px; border-radius: var(--radius-inner); flex-shrink: 0; }
.token-swatch-bordered { border: 1px solid var(--border-default); }
.token-swatch-labels { display: flex; flex-direction: column; min-width: 0; }
.token-label { font-size: var(--size-base); font-weight: var(--weight-medium); color: var(--text-primary); white-space: nowrap; }
.token-hex { font-family: var(--font-code); font-size: var(--size-sm); color: var(--text-secondary); }

.token-scales { display: flex; gap: 128px; align-items: flex-start; }
.token-spacing { flex: 0 0 256px; min-width: 0; }
.spacing-row { display: flex; align-items: center; gap: var(--space-4); height: 20px; margin-bottom: var(--space-2); }
.spacing-bar { display: block; height: 14px; min-width: 2px; border-radius: var(--radius-full); background: var(--accent-default); }
.spacing-value { font-size: var(--size-base); color: var(--text-primary); }

.token-shapes-elevation { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 64px; }
.shape-row { display: flex; flex-wrap: wrap; gap: var(--space-5); }
.shape-item { display: flex; flex: 1 1 0; min-width: 0; flex-direction: column; align-items: center; gap: var(--space-2); }
.shape-swatch { width: 80px; height: 80px; background: var(--bg-body); border: 1px solid var(--border-default); }
.shape-label { font-family: var(--font-code); font-size: var(--size-sm); color: var(--text-secondary); text-align: center; }

@media (max-width: 1023px) {
  .tokens { padding: var(--space-12) 0; }
  .token-colors { grid-template-columns: 1fr; gap: var(--space-8); }
  .token-scales { flex-direction: column; gap: var(--space-9); }
  .token-spacing { flex: 1 1 auto; width: 100%; }
  .token-shapes-elevation { gap: var(--space-9); }
  .shape-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
  .shape-item { width: auto; }
}

/* ── Stats ── */
.stats {
  background: var(--bg-inverted);
  padding: 64px 270px;
}
.stats-inner {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}
.stat {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat-number {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: 42px;
  line-height: 52px;
  color: var(--text-inverted-number);
}
.stat-label {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: var(--line-height-base);
  color: var(--text-inverted-label);
}

@media (max-width: 767px) {
  .stats { padding: var(--space-12) var(--page-padding-mobile); }
  .stats-inner { gap: var(--space-6); }
  .stat { gap: var(--space-1); }
  .stat-number { font-size: var(--size-3xl); line-height: var(--line-height-3xl); }
  .stat-label { font-size: var(--size-sm); line-height: var(--line-height-sm); }
}

/* ── Final CTA ── */
.cta { padding: 100px 0; }
.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-6);
  text-align: center;
}
.cta-content { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.cta-title {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  font-size: var(--size-4xl);
  line-height: var(--line-height-4xl);
  color: var(--text-primary);
}
.cta-subtitle {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 24px;
  color: var(--text-secondary);
}
.cta-btn { width: 160px; }

@media (max-width: 767px) {
  .cta { padding: var(--space-12) 0; }
  .cta-break { display: none; }
  .cta-subtitle { font-size: var(--size-base); line-height: var(--line-height-base); }
  .cta-btn { width: 100%; }
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border-default);
  padding: var(--space-10) 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.footer-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.footer-logo { height: 24px; width: auto; }
.footer-credit { font-size: var(--size-base); color: var(--text-secondary); }
.footer-credit-name { color: var(--text-accent); }
.footer-legal {
  max-width: 720px;
  font-size: var(--size-sm);
  line-height: var(--line-height-sm);
  color: var(--text-secondary);
}
.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--space-6);
  flex-shrink: 0;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  font-size: var(--size-base);
  color: var(--text-primary);
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--text-accent); }

.footer-socials {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.footer-social-link {
  display: flex;
  width: 24px;
  height: 24px;
  opacity: 1;
  transition: opacity 0.15s ease;
}
.footer-social-link:hover { opacity: 0.7; }
.footer-social-icon { width: 24px; height: 24px; }

@media (max-width: 767px) {
  .footer-inner { flex-direction: column; align-items: flex-start; gap: var(--space-6); }
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-stagger="1"] { transition-delay: 0.05s; }
.reveal[data-stagger="2"] { transition-delay: 0.2s; }
.reveal[data-stagger="3"] { transition-delay: 0.35s; }
