/* =============================================================
   STORYAT v2.0 — COMPONENTS LAYER
   ----------------------------------------------------------------
   New spatial / aurora components introduced in v2.0:
     - .hero-header           : large floating header (75-110px)
     - .aurora-text           : gradient-clipped text
     - .spatial-card          : deep-glass surface with bloom
     - .btn-aurora            : primary CTA with gradient fill + shimmer
     - .floating-tabbar       : new mobile tab bar with morph indicator
     - .stage-glow            : breathing orb behind story canvas
     - .stage-reflection      : floor-mirror reflection of canvas
     - .empty-state-hero      : redesigned empty state
     - .command-palette       : Cmd+K palette overlay
     - .aurora-focus-ring     : utility for gradient focus rings

   Load order: AFTER glass.css and BEFORE app.css overrides.
   ============================================================= */


/* ============================================================
   AURORA TEXT — gradient-clipped headings
   ============================================================ */

.aurora-text {
  background: var(--brand-aurora);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: aurora-text-shimmer 6s ease-in-out infinite;
}

/* High-contrast / forced-colors fallback */
@media (forced-colors: active) {
  .aurora-text {
    background: none;
    color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
}


/* ============================================================
   HERO HEADER — 75–110px floating header (replaces flat 44px strip)
   ============================================================ */

.hero-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 16px;
  padding: 14px 24px 12px;
  background-color: color-mix(in srgb, var(--bg-app) 60%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  backdrop-filter: saturate(180%) blur(28px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge-highlight);
  transition: padding var(--duration-base) var(--ease-out);
}

/* Compact state when user scrolls (set by JS via body[data-hero="compact"]) */
body[data-hero="compact"] .hero-header {
  padding: 8px 24px;
}
body[data-hero="compact"] .hero-eyebrow,
body[data-hero="compact"] .hero-subtitle {
  display: none;
}

.hero-brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  height: 40px;
  color: var(--fg-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.hero-brand-logo {
  display: block;
  height: 26px;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.4));
}
[data-theme="dark"] .hero-brand-logo-light { display: none; }
[data-theme="light"] .hero-brand-logo-dark { display: none; }

.hero-eyebrow {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  padding-inline-start: 4px;
}

.hero-subtitle {
  grid-row: 2;
  grid-column: 1 / -1;
  font-size: var(--text-body);
  color: var(--fg-secondary);
  letter-spacing: -0.005em;
  animation: hero-text-fade-in 400ms var(--ease-out);
}

.hero-actions {
  grid-row: 1;
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background-color: var(--glass-thin-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin));
  backdrop-filter: blur(var(--glass-blur-thin));
  color: var(--fg-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.hero-action-btn:hover {
  background-color: color-mix(in srgb, var(--glass-thin-bg) 80%, var(--glass-press-tint));
  color: var(--fg-primary);
  border-color: var(--glass-border-strong);
}
.hero-action-btn:active { transform: scale(0.94); }
.hero-action-btn .fa-solid,
.hero-action-btn .fa-regular { font-size: 13px; }

.hero-search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background-color: var(--glass-thin-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur-thin));
  backdrop-filter: blur(var(--glass-blur-thin));
  color: var(--fg-tertiary);
  font-size: var(--text-small);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}
.hero-search-trigger:hover {
  background-color: color-mix(in srgb, var(--glass-thin-bg) 80%, var(--glass-press-tint));
  color: var(--fg-primary);
  border-color: var(--glass-border-strong);
}
.hero-search-trigger .kbd {
  font-size: var(--text-caption);
  font-family: var(--font-mono);
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--glass-press-tint);
  color: var(--fg-tertiary);
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .hero-header {
    padding: 10px 14px 10px;
  }
  .hero-brand-logo { height: 22px; }
  .hero-subtitle { font-size: var(--text-small); }
  .hero-search-trigger .hero-search-label,
  .hero-search-trigger .kbd { display: none; }
  .hero-search-trigger { width: 34px; padding: 0; justify-content: center; }
}


/* ============================================================
   SPATIAL CARD — the new universal card surface
   ============================================================ */

.spatial-card {
  position: relative;
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.06) 0%,
      rgba(255, 255, 255, 0) 50%),
    var(--glass-regular-bg);
  -webkit-backdrop-filter: saturate(var(--glass-saturate)) blur(28px);
  backdrop-filter: saturate(var(--glass-saturate)) blur(28px);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 1px 0 rgba(0, 0, 0, 0.3),
    0 12px 32px -8px rgba(0, 0, 0, 0.45),
    0 4px 12px -2px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 18%, transparent);
  transition:
    transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 320ms var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}
[data-theme="light"] .spatial-card {
  background:
    linear-gradient(135deg,
      rgba(255, 255, 255, 0.65) 0%,
      rgba(255, 255, 255, 0.40) 50%),
    var(--glass-regular-bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 32px -8px rgba(31, 14, 64, 0.10),
    0 4px 12px -2px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 10%, transparent);
}

.spatial-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 1px 0 rgba(0, 0, 0, 0.3),
    0 18px 40px -8px rgba(0, 0, 0, 0.55),
    0 6px 16px -2px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 28%, transparent);
}

/* Pill header inside a spatial card */
.spatial-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.spatial-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: var(--brand-aurora-soft);
  color: var(--aurora-violet);
  flex-shrink: 0;
}
.spatial-card-title {
  flex: 1;
  font-size: var(--text-title);
  font-weight: 600;
  color: var(--fg-primary);
  letter-spacing: var(--tracking-section);
}


/* ============================================================
   AURORA BUTTON — primary CTA with gradient + shimmer sweep
   ============================================================ */

.btn-aurora {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 14px;
  background: var(--brand-aurora);
  background-size: 200% 200%;
  color: var(--brand-text-on);
  font-family: inherit;
  font-size: var(--text-body-lg);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10),
    var(--brand-aurora-glow);
  animation: aurora-shift 8s ease-in-out infinite;
  transition: transform var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out);
}
.btn-aurora:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10),
    0 12px 32px -6px rgba(124, 58, 237, 0.55),
    0 4px 12px -2px rgba(0, 212, 255, 0.30);
}
.btn-aurora:active {
  transform: translateY(0) scale(0.98);
}
.btn-aurora:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  animation-play-state: paused;
}

/* Shimmer sweep on hover */
.btn-aurora::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 70%);
  transform: translateX(-120%) skewX(-12deg);
  pointer-events: none;
}
.btn-aurora:hover::before {
  animation: shimmer-sweep 700ms ease-out;
}

.btn-aurora > * { position: relative; z-index: 1; }


/* ============================================================
   STAGE GLOW — breathing aurora orb behind story canvas
   ============================================================ */

.stage-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    var(--mood-accent, var(--aurora-violet)) 0%,
    transparent 65%);
  opacity: 0.55;
  filter: blur(80px);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
  animation: stage-pulse 6s ease-in-out infinite;
  will-change: transform, opacity;
  transition: background 600ms var(--ease-out);
}
[data-theme="light"] .stage-glow {
  opacity: 0.35;
}

/* Story canvas reveal animation when project loads */
body[data-has-project="true"] .story-canvas {
  animation: stage-reveal 540ms var(--ease-out-soft) both;
}


/* ============================================================
   EMPTY STATE — animated story-card cluster
   ============================================================ */

.empty-state-v2 {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
  z-index: 1;
}

.empty-story-cluster {
  position: relative;
  width: 140px;
  height: 100px;
  margin-bottom: 12px;
}

.empty-story-card {
  position: absolute;
  width: 56px;
  height: 80px;
  border-radius: 10px;
  background: var(--brand-aurora-soft);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-edge-highlight), 0 8px 20px -6px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  will-change: transform;
}

.empty-story-card--a {
  left: 8px; top: 14px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.30), rgba(124, 58, 237, 0.06));
  animation: empty-float-a 6s ease-in-out infinite;
}
.empty-story-card--b {
  left: 42px; top: 0;
  z-index: 2;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.30), rgba(0, 212, 255, 0.06));
  animation: empty-float-b 7s ease-in-out infinite;
}
.empty-story-card--c {
  left: 78px; top: 14px;
  background: linear-gradient(135deg, rgba(255, 110, 92, 0.30), rgba(255, 110, 92, 0.06));
  animation: empty-float-c 8s ease-in-out infinite;
}

.empty-state-title {
  font-size: var(--text-section);
  font-weight: 700;
  letter-spacing: var(--tracking-section);
  color: var(--fg-primary);
  margin: 0;
}
.empty-state-sub {
  font-size: var(--text-small);
  color: var(--fg-tertiary);
  margin: 0;
  max-width: 220px;
}


/* ============================================================
   COMMAND PALETTE — Cmd+K overlay
   ============================================================ */

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
}
.command-palette[hidden] { display: none; }

.command-palette-backdrop {
  position: absolute;
  inset: 0;
  background-color: var(--glass-overlay-bg);
  -webkit-backdrop-filter: saturate(var(--glass-saturate-strong)) blur(var(--glass-blur-overlay));
  backdrop-filter: saturate(var(--glass-saturate-strong)) blur(var(--glass-blur-overlay));
  animation: palette-backdrop-fade-in 240ms var(--ease-out);
  cursor: pointer;
}

.command-palette-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 580px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0) 50%),
    var(--glass-thick-bg);
  -webkit-backdrop-filter: saturate(var(--glass-saturate-strong)) blur(var(--glass-blur-thick));
  backdrop-filter: saturate(var(--glass-saturate-strong)) blur(var(--glass-blur-thick));
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--glass-edge-highlight), var(--glass-shadow-modal);
  animation: palette-open 280ms var(--ease-spring);
}

.command-palette-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border);
}
.command-palette-input-wrap .icon-search {
  color: var(--fg-tertiary);
  flex-shrink: 0;
}
.command-palette-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--fg-primary);
  font-size: var(--text-body-lg);
  font-family: inherit;
  letter-spacing: -0.005em;
}
.command-palette-input::placeholder { color: var(--fg-tertiary); }
.command-palette-input::-webkit-search-cancel-button { display: none; }

.command-palette-results {
  max-height: 56vh;
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
}
.command-palette-results:empty::before {
  content: attr(data-empty-text);
  display: block;
  padding: 28px;
  text-align: center;
  color: var(--fg-tertiary);
  font-size: var(--text-small);
}

.command-palette-group-label {
  font-size: var(--text-caption);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-tertiary);
  padding: 10px 12px 6px;
}

.command-palette-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  text-align: start;
  color: var(--fg-primary);
  font-size: var(--text-body);
  font-family: inherit;
  cursor: pointer;
  transition: background-color 120ms var(--ease-out);
}
.command-palette-item:hover,
.command-palette-item.is-active {
  background-color: var(--glass-press-tint);
}
.command-palette-item-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-aurora-soft);
  color: var(--aurora-violet);
  flex-shrink: 0;
  font-size: 12px;
}
.command-palette-item-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.command-palette-item-meta {
  font-size: var(--text-micro);
  color: var(--fg-tertiary);
  letter-spacing: 0;
}
.command-palette-item-kbd {
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--glass-press-tint);
  color: var(--fg-tertiary);
}

.command-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--glass-border);
  font-size: var(--text-caption);
  color: var(--fg-tertiary);
}
.command-palette-footer .kbd-hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.command-palette-footer .kbd {
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--glass-press-tint);
  color: var(--fg-secondary);
}


/* ============================================================
   MOOD ACCENT — utilities to apply --mood-accent
   ============================================================ */

body[data-mood="youtube"]  { --mood-accent: var(--mood-youtube);  --mood-accent-glow: rgba(255, 51, 68, 0.35); }
body[data-mood="twitter"]  { --mood-accent: var(--mood-twitter);  --mood-accent-glow: rgba(29, 161, 242, 0.35); }
body[data-mood="quote"]    { --mood-accent: var(--mood-quote);    --mood-accent-glow: rgba(168, 85, 247, 0.35); }
body[data-mood="brand"]    { --mood-accent: var(--mood-brand);    --mood-accent-glow: rgba(16, 185, 129, 0.35); }
/* v2.0 — new platform moods */
body[data-mood="tiktok"]   { --mood-accent: var(--mood-tiktok);   --mood-accent-glow: rgba(255, 0, 80, 0.35); }
body[data-mood="linkedin"] { --mood-accent: var(--mood-linkedin); --mood-accent-glow: rgba(10, 102, 194, 0.35); }
body[data-mood="reddit"]   { --mood-accent: var(--mood-reddit);   --mood-accent-glow: rgba(255, 69, 0, 0.35); }


/* ============================================================
   AURORA FOCUS RING — utility class
   ============================================================ */

.aurora-focus-ring:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px var(--bg-app),
    0 0 0 4px var(--aurora-violet);
}


/* ============================================================
   ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-transparency: reduce) {
  .hero-header,
  .spatial-card,
  .hero-action-btn,
  .hero-search-trigger,
  .command-palette-panel,
  .command-palette-backdrop {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .hero-header { background: var(--bg-panel); }
  .spatial-card,
  .command-palette-panel { background: var(--bg-elevated); }
  .command-palette-backdrop { background: rgba(0, 0, 0, 0.72); }
  .stage-glow,
  .empty-story-card { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn-aurora { animation: none; }
  .spatial-card,
  .spatial-card:hover { transform: none; }
  .stage-glow { animation: none; }
  .empty-story-card { animation: none; }
  .aurora-text { animation: none; }
}


/* =============================================================
   v2.0 — LARGE-SCREEN POLISH
   Scales padding + type so the layout feels intentional at 1280px+
   ============================================================= */

/* Desktop ≥ 1280px */
@media (min-width: 1280px) {
  .hero-header {
    padding: 18px 32px 14px;
  }
  .hero-brand-logo {
    height: 30px;
  }
  .hero-subtitle {
    font-size: var(--text-body-lg);
  }

  .spatial-card {
    padding: 22px;
    border-radius: 20px;
  }
  .spatial-card-head {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .settings-section {
    padding: 32px 22px calc(48px + env(safe-area-inset-bottom, 0px));
    gap: 52px;
  }
}

/* Large desktop ≥ 1600px */
@media (min-width: 1600px) {
  .hero-header {
    padding: 22px 40px 16px;
  }
  .hero-brand-logo {
    height: 32px;
  }

  .spatial-card {
    padding: 26px;
    border-radius: 22px;
  }

  .settings-section {
    padding: 40px 26px calc(56px + env(safe-area-inset-bottom, 0px));
    gap: 60px;
  }
  .settings-section::before {
    font-size: 34px;
    margin-bottom: 28px;
  }
}


/* =============================================================
   v2.0 — APPLE VISION-STYLE CARD INTERACTION
   3D tilt + parallax + cursor-tracked shine.
   JS sets --tilt-x / --tilt-y / --shine-x / --shine-y per pointermove.
   ============================================================= */

.vision-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --shine-x: 50%;
  --shine-y: 50%;
  transform-style: preserve-3d;
  perspective: 1200px;
  position: relative;
  overflow: hidden;
  transition:
    transform 480ms var(--ease-spring),
    box-shadow 480ms var(--ease-out);
  will-change: transform;
}

.vision-card:hover {
  transform:
    perspective(1200px)
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    translateZ(8px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 1px 0 rgba(0, 0, 0, 0.30),
    0 22px 50px -8px rgba(0, 0, 0, 0.55),
    0 8px 22px -2px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 35%, transparent);
}
[data-theme="light"] .vision-card:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.50),
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 22px 50px -8px rgba(31, 14, 64, 0.16),
    0 8px 22px -2px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 22%, transparent);
}

/* Cursor-tracked shine sweep */
.vision-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle 240px at var(--shine-x) var(--shine-y),
    rgba(255, 255, 255, 0.10),
    transparent 60%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity 320ms var(--ease-out);
  z-index: 1;
}
[data-theme="light"] .vision-card::before {
  background: radial-gradient(
    circle 240px at var(--shine-x) var(--shine-y),
    rgba(255, 255, 255, 0.55),
    transparent 60%
  );
}
.vision-card:hover::before { opacity: 1; }

/* Content sits above the shine */
.vision-card > * { position: relative; z-index: 2; }

/* Parallax — inner blocks lift forward more than the card */
.vision-card:hover .settings-card-head { transform: translateZ(14px); }
.vision-card:hover .settings-card-desc { transform: translateZ(8px); }
.vision-card:hover .settings-card-links { transform: translateZ(4px); }
.vision-card .settings-card-head,
.vision-card .settings-card-desc,
.vision-card .settings-card-links {
  transition: transform 480ms var(--ease-spring);
}

/* Accessibility — disable on reduced motion + touch */
@media (prefers-reduced-motion: reduce) {
  .vision-card,
  .vision-card:hover,
  .vision-card:hover .settings-card-head,
  .vision-card:hover .settings-card-desc,
  .vision-card:hover .settings-card-links {
    transform: none !important;
  }
  .vision-card::before { display: none; }
}
@media (hover: none) {
  /* Touch devices: keep a gentle lift but skip the 3D tilt */
  .vision-card:hover { transform: translateY(-2px); }
  .vision-card::before { display: none; }
  .vision-card:hover .settings-card-head,
  .vision-card:hover .settings-card-desc,
  .vision-card:hover .settings-card-links {
    transform: none;
  }
}


/* =============================================================
   v2.0 — Verified badge next to social handles in Settings
   ============================================================= */

.settings-link-verified {
  margin-inline-start: 6px;
  font-size: 11px;
  color: var(--aurora-cyan);
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.45));
  vertical-align: 1px;
  transition: transform var(--duration-base) var(--ease-spring),
              filter var(--duration-base) var(--ease-out);
}
.settings-link-row:hover .settings-link-verified {
  transform: scale(1.15);
  filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.65));
}

@media (forced-colors: active) {
  .settings-link-verified {
    color: LinkText;
    filter: none;
  }
}


/* =============================================================
   MOBILE TAB BAR — Aurora Pill v2 (replaces old mobile rules)
   Floating thick-glass pill with a sliding aurora indicator,
   filled icons on active state, and a top-edge depth seam.
   ============================================================= */

.mobile-tab-bar {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
  height: 64px;
  display: grid;
  grid-template-columns: repeat(var(--tab-count, 5), 1fr);
  background-color: var(--glass-thick-bg);
  -webkit-backdrop-filter: saturate(var(--glass-saturate-strong)) blur(44px);
  backdrop-filter: saturate(var(--glass-saturate-strong)) blur(44px);
  border: 1px solid var(--glass-border-strong);
  border-radius: 26px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 20px 40px -10px rgba(0, 0, 0, 0.45),
    0 6px 16px -4px rgba(0, 0, 0, 0.25),
    0 8px 32px -8px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 28%, transparent);
  z-index: 60;
  transition:
    transform 320ms var(--ease-out),
    opacity 320ms var(--ease-out),
    box-shadow 600ms var(--ease-out);
  will-change: transform, opacity;
}
[data-theme="light"] .mobile-tab-bar {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 20px 40px -10px rgba(31, 14, 64, 0.12),
    0 6px 16px -4px rgba(31, 14, 64, 0.06),
    0 8px 32px -8px color-mix(in srgb, var(--mood-accent, var(--aurora-violet)) 15%, transparent);
}

/* Top edge aurora seam — visionOS depth cue */
.mobile-tab-bar::before {
  content: "";
  position: absolute;
  inset: 1px 22px auto 22px;
  height: 2px;
  background: var(--brand-aurora);
  opacity: 0.32;
  border-radius: 2px;
  pointer-events: none;
}

/* Sliding aurora indicator under the active tab */
.m-tab-indicator {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: calc(100% / var(--tab-count, 5));
  pointer-events: none;
  transform: translateX(calc(var(--active-index, 0) * 100%));
  transition: transform 380ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}
.m-tab-indicator::after {
  content: "";
  width: 78%;
  height: 100%;
  border-radius: 16px;
  background:
    linear-gradient(135deg,
      rgba(124, 58, 237, 0.20) 0%,
      rgba(0, 212, 255, 0.16) 50%,
      rgba(255, 110, 92, 0.14) 100%);
  border: 1px solid color-mix(in srgb, var(--aurora-violet) 30%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 4px 14px -2px color-mix(in srgb, var(--aurora-violet) 30%, transparent);
}

/* Individual tab cells */
.m-tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  background: transparent;
  border: 0;
  color: var(--fg-tertiary);
  font-family: inherit;
  font-size: var(--text-caption);
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 180ms var(--ease-out), transform 120ms var(--ease-out);
}
.m-tab:active { transform: scale(0.95); }

.m-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-size: 19px;
  line-height: 1;
  transition: color 180ms var(--ease-out), transform 220ms var(--ease-spring);
}
.m-tab-icon i { line-height: 1; }
.m-tab-icon svg { width: 22px; height: 22px; }

.m-tab-label {
  line-height: 1.15;
  font-weight: 500;
  white-space: nowrap;
  transition: color 180ms var(--ease-out);
}

/* ACTIVE TAB — aurora icon + bold label */
.m-tab.is-active {
  color: var(--aurora-violet);
}
.m-tab.is-active .m-tab-icon {
  color: var(--aurora-violet);
  transform: scale(1.08) translateY(-1px);
  filter: drop-shadow(0 2px 6px rgba(124, 58, 237, 0.45));
}
.m-tab.is-active .m-tab-label {
  font-weight: 600;
  background: var(--brand-aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Settings tab divider — visually separates it from creative-flow tabs */
.m-tab[data-tab="settings"]::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--glass-border);
  pointer-events: none;
}

/* Minimize-on-scroll: hide the indicator too so we don't leave a floating dot */
body[data-tabbar="minimized"] .mobile-tab-bar {
  transform: translateY(calc(8px + env(safe-area-inset-bottom, 0px))) scale(0.93);
  opacity: 0.78;
}
body[data-tabbar="minimized"] .m-tab-indicator {
  opacity: 0;
}

/* Hide on desktop */
@media (min-width: 641px) {
  .mobile-tab-bar { display: none !important; }
}

/* RTL: indicator already mirrors because we use inset-inline + translateX
   on a logical-flow grid. No extra rules needed for visual order. */


/* ============================================================
   TAB BAR — Accessibility fallbacks
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  .mobile-tab-bar,
  .m-tab-indicator,
  .m-tab,
  .m-tab-icon {
    transition: none !important;
  }
  .m-tab.is-active .m-tab-icon {
    transform: none;
    filter: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .mobile-tab-bar {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-color: var(--bg-panel) !important;
    border-color: var(--border-default) !important;
  }
  .mobile-tab-bar::before { display: none; }
  .m-tab-indicator::after {
    background: var(--brand-primary);
    opacity: 0.22;
    border-color: var(--brand-primary);
  }
  .m-tab.is-active .m-tab-label {
    background: none;
    -webkit-text-fill-color: var(--brand-primary);
    color: var(--brand-primary);
  }
}

@media (forced-colors: active) {
  .mobile-tab-bar {
    border: 1px solid CanvasText !important;
    background: Canvas !important;
  }
  .m-tab.is-active .m-tab-label {
    background: none !important;
    -webkit-text-fill-color: LinkText !important;
    color: LinkText !important;
  }
}
