/* ============================================================
   ACADEX (آکادکس) Design System - styles/site.css
   Light-first, single accent #2563ea, RTL native, zero build step
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* brand */
  --ink: #0b0e1d;
  --accent: #2563ea;
  --accent-strong: #1d4ed8;
  --accent-soft: rgba(37, 99, 234, 0.08);
  --accent-soft-2: rgba(37, 99, 234, 0.14);

  /* semantic */
  --ok: #059669;
  --ok-soft: rgba(5, 150, 105, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(180, 83, 9, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);

  /* surfaces */
  --bg: #fbfbfd;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f4f8;

  /* text */
  --text: #131828;
  --text-2: #4b5568;
  --text-3: #77809a;

  /* lines */
  --line: #e5e8f0;
  --line-strong: #d3d8e6;

  /* shape & layout */
  --radius: 20px;
  --radius-sm: 12px;
  --nav-h: 68px;

  /* elevation */
  --shadow-sm: 0 1px 2px rgba(11, 14, 29, 0.05), 0 1px 4px rgba(11, 14, 29, 0.04);
  --shadow-md: 0 4px 12px rgba(11, 14, 29, 0.06), 0 12px 32px rgba(11, 14, 29, 0.07);
  --shadow-lg: 0 8px 20px rgba(11, 14, 29, 0.08), 0 24px 60px rgba(11, 14, 29, 0.12);

  /* charts */
  --chart-grid: #e5e8f0;
  --chart-tick: #77809a;
  --chart-bg: #ffffff;
  --chart-tip-bg: #131828;
  --chart-tip-fg: #ffffff;

  /* motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #0a0e1e;
  --bg-raised: #101527;
  --bg-sunken: #0c1122;
  --text: #eef1fa;
  --text-2: #9aa5c4;
  --text-3: #67719a;
  --line: #1f2740;
  --line-strong: #2c3654;
  --accent-soft: rgba(96, 145, 250, 0.12);
  --accent-soft-2: rgba(96, 145, 250, 0.2);
  --ok-soft: rgba(52, 211, 153, 0.12);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --danger-soft: rgba(248, 113, 113, 0.12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.45), 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 20px rgba(0, 0, 0, 0.5), 0 24px 60px rgba(0, 0, 0, 0.55);
  --chart-grid: #1f2740;
  --chart-tick: #9aa5c4;
  --chart-bg: #101527;
  --chart-tip-bg: #eef1fa;
  --chart-tip-fg: #0a0e1e;
  --ink: #eef1fa;
  color-scheme: dark;
}

/* ---------- Reset & base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "IRANYekanX", Tahoma, sans-serif;
  line-height: 1.8;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.6em;
  line-height: 1.35;
  font-weight: 800;
  color: var(--text);
}

p {
  margin: 0 0 1em;
}

ul,
ol {
  margin: 0 0 1em;
  padding-inline-start: 1.4em;
}

button {
  font-family: inherit;
  cursor: pointer;
}

::selection {
  background: var(--accent-soft-2);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Utilities ---------- */
.wrap {
  width: min(1140px, 100% - 40px);
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  inset-inline-start: 16px;
  top: -48px;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s var(--ease);
}

.skip-link:focus-visible {
  top: 0;
  color: #fff;
}

.text-center {
  text-align: center;
}

.text-muted {
  color: var(--text-2);
}

.text-soft {
  color: var(--text-3);
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 40px; }
.mt-5 { margin-top: 64px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 40px; }

/* ---------- Sections ---------- */
.section {
  padding: 96px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 48px;
}

.section-head.center {
  margin-inline: auto;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  letter-spacing: -0.01em;
}

.section-head p {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.6;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease),
    color 0.2s var(--ease), transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
  text-align: center;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 234, 0.35);
}

.btn-ghost {
  background: var(--bg-raised);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.02rem;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 0.85rem;
}

/* ---------- Cards & feature grid ---------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.card-hover {
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.feature-grid .span-2 {
  grid-column: span 2;
}

.feature-tile {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease), opacity 0.3s var(--ease);
}

.feature-tile[hidden] {
  display: none;
}

.feature-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.feature-tile h3 {
  font-size: 1.05rem;
  margin: 14px 0 6px;
}

.feature-tile p {
  color: var(--text-2);
  font-size: 0.92rem;
  margin: 0;
}

.feature-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.feature-ico svg {
  width: 22px;
  height: 22px;
}

.tile-tint-accent {
  background: linear-gradient(135deg, var(--accent-soft), rgba(37, 99, 234, 0.02));
  border-color: var(--accent-soft-2);
}

.tile-tint-sunken {
  background: var(--bg-sunken);
}

/* ---------- Filter pills ---------- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.filter-pill {
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Depth-Perspective Phone Mockup Carousel (SolaceUI Design) ---------- */
.phone-carousel {
  position: relative;
  width: 100%;
  max-width: 1020px;
  margin: 10px auto 0;
  padding: 30px 0 40px;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.carousel-stage {
  position: relative;
  width: 100%;
  height: 700px;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: pan-y pinch-zoom;
  outline: none;
}

/* Ambient Backlight Glow behind Active Phone (Zero clipping, perfectly unclipped) */
.carousel-stage::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, 90vw);
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at center,
    rgba(37, 99, 235, 0.55) 0%,
    rgba(59, 130, 246, 0.35) 35%,
    rgba(37, 99, 235, 0.12) 60%,
    transparent 78%
  );
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] .carousel-stage::before {
  background: radial-gradient(
    ellipse at center,
    rgba(59, 130, 246, 0.65) 0%,
    rgba(37, 99, 235, 0.38) 35%,
    rgba(37, 99, 235, 0.14) 60%,
    transparent 80%
  );
  filter: blur(52px);
}

.carousel-stage:focus-visible {
  box-shadow: 0 0 0 2px var(--accent);
}

.carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-slide {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 275px;
  max-width: 80vw;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center center;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease, filter 0.5s ease;
  will-change: transform, opacity;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%) scale(0.72);
}

.carousel-slide .phone-mockup-wrapper {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
}

.carousel-slide .phone {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 275px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.7));
  transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}

.carousel-slide .phone img {
  border-radius: 0;
  display: block;
  width: 100%;
  height: auto;
}

/* Active Slide */
.carousel-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 20;
  transform: translate(-50%, -50%) scale(1);
}

.carousel-slide.is-active .phone {
  filter: drop-shadow(0 25px 40px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 25px rgba(37, 99, 235, 0.45));
}

.carousel-slide.is-active:hover .phone {
  transform: translateY(-4px) scale(1.02);
}

/* Previous Slide (Left Preview) */
.carousel-slide.is-prev {
  opacity: 0.38;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  transform: translate(calc(-50% - 240px), -50%) scale(0.86);
  filter: blur(0.5px);
}

.carousel-slide.is-prev:hover {
  opacity: 0.75;
  transform: translate(calc(-50% - 240px), -50%) scale(0.89);
}

/* Next Slide (Right Preview) */
.carousel-slide.is-next {
  opacity: 0.38;
  pointer-events: auto;
  cursor: pointer;
  z-index: 10;
  transform: translate(calc(-50% + 240px), -50%) scale(0.86);
  filter: blur(0.5px);
}

.carousel-slide.is-next:hover {
  opacity: 0.75;
  transform: translate(calc(-50% + 240px), -50%) scale(0.89);
}

/* Dynamic Active Caption */
.carousel-caption-box {
  text-align: center;
  margin-top: 18px;
  min-height: 64px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.carousel-caption-box.is-fading {
  opacity: 0;
  transform: translateY(6px);
}

.carousel-caption-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .carousel-caption-title {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.carousel-caption-desc {
  font-size: 0.95rem;
  color: var(--text-2);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: none;
}

[data-theme="dark"] .carousel-caption-desc {
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Carousel Control Buttons */
.carousel-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.carousel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(17, 20, 34, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.carousel-btn:hover {
  background: rgba(30, 36, 62, 0.95);
  border-color: rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-btn svg {
  width: 20px;
  height: 20px;
}

.carousel-btn.play-pause-btn svg {
  width: 17px;
  height: 17px;
}

/* Indicators */
.carousel-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(11, 14, 29, 0.18);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .indicator-dot {
  background: rgba(255, 255, 255, 0.2);
}

.indicator-dot:hover {
  background: rgba(11, 14, 29, 0.4);
}

[data-theme="dark"] .indicator-dot:hover {
  background: rgba(255, 255, 255, 0.45);
}

.indicator-dot.active {
  width: 26px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 102, 255, 0.5);
}

@media (max-width: 900px) {
  .carousel-stage {
    height: 620px;
  }
  .carousel-stage::before {
    width: 310px;
    height: 530px;
    filter: blur(35px);
  }
  .carousel-slide {
    width: 245px;
  }
  .carousel-slide.is-prev {
    transform: translate(calc(-50% - 190px), -50%) scale(0.85);
  }
  .carousel-slide.is-next {
    transform: translate(calc(-50% + 190px), -50%) scale(0.85);
  }
}

@media (max-width: 640px) {
  .carousel-stage {
    height: 530px;
  }
  .carousel-stage::before {
    width: 250px;
    height: 440px;
    filter: blur(28px);
  }
  .carousel-slide {
    width: 205px;
  }
  .carousel-slide.is-prev {
    transform: translate(calc(-50% - 120px), -50%) scale(0.82);
    opacity: 0.25;
  }
  .carousel-slide.is-next {
    transform: translate(calc(-50% + 120px), -50%) scale(0.82);
    opacity: 0.25;
  }
  .carousel-caption-title {
    font-size: 1.15rem;
  }
  .carousel-caption-desc {
    font-size: 0.88rem;
    padding: 0 10px;
  }
  .carousel-btn {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide {
    transition: opacity 0.2s ease !important;
  }
  .carousel-slide:hover .phone {
    transform: none !important;
  }
}

/* ---------- Screenshot strip & phone frames ---------- */
.shot-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  align-items: start;
}

.shot {
  text-align: center;
}

.shot figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 500;
}

.phone {
  display: inline-block;
  border-radius: 28px;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.phone:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.phone img {
  border-radius: 21px;
  width: 100%;
  height: auto;
}

.phone.small {
  max-width: 220px;
  margin-inline: auto;
}

.phone.wide {
  max-width: 420px;
  margin-inline: auto;
}

.shot-duo {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* ---------- Chart boxes ---------- */
.chart-box {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.chart-box canvas {
  width: 100% !important;
}

/* ---------- Accordion ---------- */
.accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.accordion-item + .accordion-item {
  border-top: 1px solid var(--line);
}

.accordion-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  transition: color 0.2s var(--ease);
}

.accordion-item summary::-webkit-details-marker {
  display: none;
}

.accordion-item summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-inline-end: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform 0.2s var(--ease);
  flex: none;
  margin-inline-start: auto;
}

.accordion-item[open] summary::after {
  transform: rotate(225deg);
}

.accordion-item summary:hover {
  color: var(--accent);
}

.accordion-item .accordion-body {
  padding: 0 24px 20px;
  color: var(--text-2);
  font-size: 0.95rem;
}

.accordion-item .accordion-body > :last-child {
  margin-bottom: 0;
}

/* ---------- Steps ---------- */
.steps {
  display: grid;
  gap: 20px;
  counter-reset: step;
}

.step {
  position: relative;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px 24px 28px;
  box-shadow: var(--shadow-sm);
}

.step-num {
  counter-increment: step;
}

.step-num::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-inline-end: 12px;
  vertical-align: middle;
}

.step h3 {
  display: inline;
  font-size: 1.1rem;
  vertical-align: middle;
}

.step > p,
.step > ul {
  margin-top: 10px;
}

/* ---------- Callouts ---------- */
.callout {
  display: flex;
  gap: 12px;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  font-size: 0.93rem;
  color: var(--text-2);
  margin: 20px 0;
}

.callout svg {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 4px;
  color: var(--text-3);
}

.callout-info {
  background: var(--accent-soft);
  border-color: var(--accent-soft-2);
}

.callout-info svg {
  color: var(--accent);
}

.callout-warn {
  background: var(--warn-soft);
  border-color: rgba(180, 83, 9, 0.25);
}

.callout-warn svg {
  color: var(--warn);
}

.callout-danger {
  background: var(--danger-soft);
  border-color: rgba(220, 38, 38, 0.3);
}

.callout-danger svg {
  color: var(--danger);
}

.callout > div {
  flex: 1;
}

.callout strong {
  color: var(--text);
}

/* ---------- Hero (Fullscreen with Photographic Backdrop) ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 32px) 0 88px;
  overflow: hidden;
  box-sizing: border-box;
}

/* Background Photo Container */
.hero-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 26% center;
  display: block;
}

/* Subtle Overlays: Light Theme (Base) */
.hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(to left, rgba(251, 251, 253, 0.95) 0%, rgba(251, 251, 253, 0.85) 46%, rgba(251, 251, 253, 0.35) 75%, rgba(251, 251, 253, 0.12) 100%),
    linear-gradient(to bottom, rgba(251, 251, 253, 0.65) 0%, transparent 20%, transparent 72%, var(--bg) 100%),
    radial-gradient(ellipse at 80% 50%, rgba(37, 99, 235, 0.08), transparent 60%);
  pointer-events: none;
}

/* Subtle Overlays: Dark Theme */
[data-theme="dark"] .hero-overlay {
  background:
    linear-gradient(to left, rgba(10, 14, 30, 0.94) 0%, rgba(10, 14, 30, 0.82) 46%, rgba(10, 14, 30, 0.38) 75%, rgba(10, 14, 30, 0.18) 100%),
    linear-gradient(to bottom, rgba(10, 14, 30, 0.72) 0%, transparent 20%, transparent 72%, var(--bg) 100%),
    radial-gradient(ellipse at 80% 50%, rgba(37, 99, 235, 0.16), transparent 60%);
}

.hero-container {
  position: relative;
  z-index: 2;
  padding-inline: clamp(16px, 3.5vw, 36px);
  box-sizing: border-box;
}

/* Text kept strictly on the right (current position in RTL) with comfortable breathing room */
.hero-copy {
  max-width: 590px;
  margin-inline-start: 0;
  margin-inline-end: auto;
}

.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-weight: 900;
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin-bottom: 22px;
  animation: rise 0.6s var(--ease) both;
  word-break: break-word;
}

[data-theme="dark"] .hero h1 {
  text-shadow: 0 3px 20px rgba(0, 0, 0, 0.5);
}

.hero h1 .hl {
  color: var(--accent);
}

.hero .lede {
  font-size: 1.15rem;
  color: var(--text-2);
  max-width: 36rem;
  margin-bottom: 28px;
  line-height: 1.85;
  animation: rise 0.6s var(--ease) 0.08s both;
}

[data-theme="dark"] .hero .lede {
  color: #c0c9e2;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 34px;
  animation: rise 0.6s var(--ease) 0.16s both;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .chip {
  background: rgba(16, 21, 39, 0.75);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.chip svg {
  width: 15px;
  height: 15px;
  color: var(--ok);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  animation: rise 0.6s var(--ease) 0.2s both;
}

.hero-cta .btn-ghost {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .hero-cta .btn-ghost {
  background: rgba(16, 21, 39, 0.75);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

[data-theme="dark"] .hero-cta .btn-ghost:hover {
  background: rgba(37, 99, 235, 0.18);
  border-color: var(--accent);
  color: #ffffff;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Stats band ---------- */
.stats-band {
  border-block: 1px solid var(--line);
  background: var(--bg-raised);
  padding: 36px 0;
}

.stats-band .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.stat {
  text-align: center;
}

.stat b {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--accent);
}

.stat span {
  color: var(--text-2);
  font-size: 0.9rem;
}

/* ---------- Split rows ---------- */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.split-row + .split-row {
  margin-top: 80px;
}

/* ---------- Persona ---------- */
.persona-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}

.persona-item {
  display: block;
  width: 100%;
  text-align: start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin-bottom: 12px;
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.persona-item h4 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.persona-item p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-2);
}

.persona-item:hover {
  border-color: var(--accent);
}

.persona-item.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

#personaDesc {
  font-size: 0.98rem;
  color: var(--accent);
  font-weight: 600;
  font-style: italic;
  text-align: center;
  margin: 18px 0 0;
}

/* ---------- FAQ ---------- */
.faq .accordion-item summary {
  font-size: 1rem;
}

/* ---------- Blog ---------- */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--text);
}

.post-tag {
  display: inline-flex;
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 14px;
}

.post-card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

.post-card p {
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.post-more {
  margin-top: auto;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
}

/* ---------- Help hub ---------- */
.help-hub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.guide-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
    border-color 0.25s var(--ease);
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
  color: var(--text);
}

.guide-card .feature-ico {
  flex: none;
}

.guide-card h3 {
  font-size: 1.02rem;
  margin: 0 0 6px;
}

.guide-card p {
  color: var(--text-2);
  font-size: 0.88rem;
  margin: 0;
}

/* ---------- Guide layout (article pages) ---------- */
.guide-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.guide-toc {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 0.88rem;
}

.guide-toc b {
  display: block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: var(--text-3);
}

.guide-toc nav {
  display: grid;
  gap: 4px;
}

.guide-toc nav a {
  color: var(--text-2);
  padding: 5px 10px;
  border-radius: 8px;
  border-inline-start: 2px solid transparent;
  transition: all 0.15s var(--ease);
}

.guide-toc nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.guide-toc nav a.active {
  color: var(--accent);
  border-inline-start-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.guide-article {
  min-width: 0;
}

.guide-article h2 {
  font-size: 1.45rem;
  margin-top: 2.2em;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.guide-article h3 {
  font-size: 1.12rem;
  margin-top: 1.8em;
}

.guide-article p,
.guide-article li {
  color: var(--text-2);
  font-size: 1rem;
}

.guide-article img {
  border-radius: var(--radius-sm);
}

.guide-shot {
  margin: 36px 0;
  text-align: center;
}

.guide-shot .phone {
  max-width: 300px;
}

.guide-shot figcaption {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--text-3);
}

/* ---------- Breadcrumbs & page hero ---------- */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-3);
  margin-bottom: 18px;
}

.crumbs a {
  color: var(--text-3);
}

.crumbs a:hover {
  color: var(--accent);
}

.crumbs .sep {
  color: var(--line-strong);
}

.crumbs [aria-current="page"] {
  color: var(--text-2);
  font-weight: 600;
}

.page-hero {
  padding: calc(var(--nav-h) + 48px) 0 48px;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}

.page-hero h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  margin-bottom: 12px;
}

.page-hero .lede {
  font-size: 1.06rem;
  color: var(--text-2);
  max-width: 44rem;
  margin: 0;
}

/* ---------- To top ---------- */
.to-top {
  position: fixed;
  inset-inline-end: 20px;
  bottom: calc(72px + 20px);
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.25s var(--ease);
}

.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(251, 251, 253, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

[data-theme="dark"] .site-header {
  background: rgba(10, 14, 30, 0.65);
}

.site-header.scrolled {
  background: var(--bg);
  border-bottom-color: var(--line);
}

.header-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  direction: ltr !important;
  unicode-bidi: isolate;
  gap: 0;
  font-weight: 900;
  font-size: 1.22rem;
  color: var(--text);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.brand span {
  color: var(--text);
}

.brand b {
  color: var(--accent);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: 8px;
}

.main-nav a {
  color: var(--text-2);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.main-nav a:hover {
  color: var(--text);
  background: var(--bg-sunken);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 19px;
  height: 19px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

.burger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text);
  align-items: center;
  justify-content: center;
}

.burger svg {
  width: 20px;
  height: 20px;
}

/* ---------- Mobile nav ---------- */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--bg);
  display: none;
  flex-direction: column;
  padding: 24px;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.mobile-nav nav {
  display: grid;
  gap: 6px;
}

.mobile-nav nav a {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.mobile-nav nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.mobile-nav .btn {
  margin-top: 24px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #b7bdd4;
  margin-top: 96px;
}

[data-theme="dark"] .site-footer {
  background: #070a16;
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding: 64px 0 48px;
}

.site-footer .brand {
  color: #fff;
  margin-bottom: 14px;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.site-footer .brand span {
  color: #ffffff;
}

.site-footer .brand b {
  color: #60a5fa;
}

.site-footer .footer-note {
  font-size: 0.9rem;
  max-width: 26rem;
  margin-bottom: 20px;
}

.site-footer .store-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.site-footer .store-badges a {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease), filter 0.2s var(--ease);
}

.site-footer .store-badges a:hover {
  transform: translateY(-2px);
  opacity: 0.92;
  filter: drop-shadow(0 4px 12px rgba(37, 99, 235, 0.3));
}

.site-footer .store-badges img {
  width: 141px;
  height: 42px;
  border-radius: 8px;
  display: block;
  object-fit: contain;
  background: #000;
}

.site-footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.site-footer ul a {
  color: #b7bdd4;
  font-size: 0.9rem;
}

.site-footer ul a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  font-size: 0.84rem;
  color: #7f88a8;
}

.footer-bottom a {
  color: #b7bdd4;
}

/* ---------- Mobile bottom bar ---------- */
.mobile-bar {
  display: none;
}

body.has-mobile-bar {
  padding-bottom: 72px;
}

body.has-mobile-bar .to-top {
  bottom: 84px;
}

/* ---------- Search overlay (desktop dialog, mobile bottom sheet) ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: none;
}

.search-overlay.open {
  display: block;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 14, 29, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.search-overlay.open .search-backdrop {
  opacity: 1;
}

.search-sheet {
  position: absolute;
  inset-inline: 0;
  top: 12vh;
  margin-inline: auto;
  width: min(620px, calc(100% - 32px));
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.search-overlay.open .search-sheet {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.search-sheet-handle {
  display: none;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--line);
}

.search-ico {
  display: flex;
  color: var(--text-3);
}

.search-ico svg {
  width: 20px;
  height: 20px;
}

.search-input-row input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 0;
}

.search-input-row input::-webkit-search-cancel-button,
.search-input-row input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.search-input-row input::placeholder {
  color: var(--text-3);
}

.search-close {
  width: 34px;
  height: 34px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--bg-sunken);
  color: var(--text-2);
  transition: color 0.15s var(--ease);
}

.search-close:hover {
  color: var(--text);
}

.search-close svg {
  width: 17px;
  height: 17px;
}

.search-results {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding: 10px;
}

.search-hint {
  color: var(--text-3);
  font-size: 0.9rem;
  text-align: center;
  padding: 22px 12px;
  margin: 0;
}

.search-hit {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: background-color 0.12s var(--ease);
}

.search-hit:hover,
.search-hit.active {
  background: var(--accent-soft);
}

.search-hit-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 2px;
}

.search-hit-sec {
  display: block;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--accent);
  margin-bottom: 3px;
}

.search-hit-x {
  display: block;
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.7;
}

.search-count {
  text-align: center;
  color: var(--text-3);
  font-size: 0.8rem;
  padding: 10px 0 4px;
}

.search-empty {
  text-align: center;
  padding: 26px 16px;
}

.search-empty p {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.search-empty .search-empty-sub {
  font-weight: 400;
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.search-footer {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 0.78rem;
}

.search-footer kbd {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 7px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text-2);
}

body.search-open {
  overflow: hidden;
}

/* ---------- Floating feedback FAB ---------- */
.feedback-fab {
  position: fixed;
  inset-inline-start: 20px;
  bottom: 20px;
  z-index: 92;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #0f172a;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

[data-theme="dark"] .feedback-fab {
  background: #141c33;
  color: #ffffff !important;
  border-color: rgba(96, 145, 250, 0.35);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65), 0 0 15px rgba(37, 99, 235, 0.2);
}

.feedback-fab:hover {
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

[data-theme="dark"] .feedback-fab:hover {
  background: #1a2444;
  border-color: #60a5fa;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.75), 0 0 20px rgba(37, 99, 235, 0.35);
}

.feedback-fab svg {
  width: 18px;
  height: 18px;
  color: #60a5fa;
}

/* ---------- Footer feedback strip ---------- */
.footer-feedback-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 36px;
}

.footer-feedback-strip .ffb-text b {
  display: block;
  color: #fff;
  font-size: 1.02rem;
  margin-bottom: 4px;
}

.footer-feedback-strip .ffb-text span {
  color: #9aa5c4;
  font-size: 0.9rem;
}

.footer-feedback-strip .ffb-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
}

.footer-feedback-strip .ffb-btn:hover {
  background: #3b76f0;
  color: #fff;
}

.footer-feedback-strip .ffb-btn svg {
  width: 18px;
  height: 18px;
}

/* ---------- Header search button ---------- */
.header-search-btn {
  display: none;
}

.mobile-search-btn {
  display: none;
}

@media (max-width: 820px) {
  .mobile-search-btn {
    display: inline-flex;
  }
}

/* ---------- Help hub search launcher ---------- */
.hub-search-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin-top: 22px;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 13px 20px;
  color: var(--text-3);
  font-family: inherit;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.hub-search-launcher:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.hub-search-launcher svg {
  width: 19px;
  height: 19px;
  color: var(--accent);
  flex: none;
}

.hub-search-launcher span {
  flex: 1;
  text-align: start;
}

.hub-search-launcher kbd {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 8px;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-3);
}

/* ---------- CTA panel ---------- */
.cta-panel {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: var(--radius);
  color: #fff;
  text-align: center;
  padding: 64px 32px;
  box-shadow: 0 24px 60px rgba(37, 99, 234, 0.35);
}

.cta-panel h2 {
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin-bottom: 10px;
}

.cta-panel p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 28px;
}

.cta-panel .btn {
  background: #fff;
  color: var(--accent);
}

.cta-panel .btn:hover {
  background: var(--bg-sunken);
  color: var(--accent-strong);
}

.cta-panel .btn.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.cta-panel .btn.btn-ghost:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ---------- Data table (simulator) ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 11px 16px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.data-table thead th {
  background: var(--bg-sunken);
  font-size: 0.84rem;
  color: var(--text-2);
  font-weight: 700;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: var(--accent-soft);
}

.data-table td.num {
  font-variant-numeric: tabular-nums;
}

.data-table .hl-col {
  color: var(--accent);
  font-weight: 700;
}

.data-table .final-col {
  color: var(--ok);
  font-weight: 800;
}

/* ---------- Simulator ---------- */
.sim-params {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.param-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.84rem;
  color: var(--text-2);
  font-weight: 600;
}

.param-chip svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

/* Rich Animated Flow Diagram */
.flow-diagram-container {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 28px 0 36px;
  position: relative;
  overflow: hidden;
}

.flow-interactive-canvas {
  position: relative;
  min-height: 480px;
  width: 100%;
  overflow-x: auto;
  user-select: none;
}

.flow-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flow-path {
  stroke-dasharray: 12;
  animation: flowDash 3s linear infinite;
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke 0.2s, stroke-width 0.2s;
}

@keyframes flowDash {
  to {
    stroke-dashoffset: -240;
  }
}

.flow-grid-layout {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 460px;
  gap: 24px;
  padding: 16px 12px;
}

.flow-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  text-align: center;
  position: relative;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
  cursor: default;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.flow-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(37, 99, 234, 0.15);
}

.flow-card .icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-sunken);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 1.25rem;
}

.flow-card .flow-title {
  font-weight: 800;
  color: var(--text);
  font-size: 0.95rem;
}

.flow-card .flow-sub {
  font-size: 0.76rem;
  color: var(--text-3);
  margin-top: 2px;
}

.flow-card .flow-badge {
  position: absolute;
  top: -10px;
  inset-inline-end: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(37, 99, 234, 0.3);
}

.flow-card.flow-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 234, 0.35);
}

.flow-card.flow-accent .flow-title,
.flow-card.flow-accent .flow-sub {
  color: #fff;
}

.flow-card.flow-accent .flow-sub {
  opacity: 0.85;
}

/* Mobile flow steps */
.flow-mobile-steps {
  display: none;
  position: relative;
  padding-inline-start: 24px;
}

.flow-mobile-steps::before {
  content: "";
  position: absolute;
  inset-inline-start: 11px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--line-strong), var(--accent));
}

.flow-m-step {
  position: relative;
  margin-bottom: 20px;
}

.flow-m-bullet {
  position: absolute;
  inset-inline-start: -24px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--accent);
}

.flow-m-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

@media (max-width: 820px) {
  .flow-interactive-canvas {
    display: none;
  }
  .flow-mobile-steps {
    display: block;
  }
}

/* Legacy fallback .sim-flow */
.sim-flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  position: relative;
  margin-bottom: 32px;
}

.sim-flow .flow-node {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-2);
}

.sim-flow .flow-node b {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 4px;
}

.curve-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.curve-btn {
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--text-2);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s var(--ease);
}

.curve-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.curve-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.sim-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.sim-stats .stat-box {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.sim-stats .stat-box span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
  margin-bottom: 4px;
}

.sim-stats .stat-box b {
  font-size: 1.3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.sim-stats .diff-pos {
  color: var(--ok);
}

.sim-stats .diff-neg {
  color: var(--danger);
}

/* ---------- Article pages ---------- */
.article-body {
  max-width: 46rem;
  margin-inline: auto;
}

.article-body h2 {
  font-size: 1.4rem;
  margin-top: 2.2em;
}

.article-body h3 {
  font-size: 1.12rem;
  margin-top: 1.8em;
}

.article-body p,
.article-body li {
  color: var(--text-2);
  font-size: 1.02rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  color: var(--text-3);
  font-size: 0.86rem;
  margin-bottom: 28px;
}

.article-meta .post-tag {
  margin-bottom: 0;
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) {
  transition-delay: 0.06s;
}

.reveal:nth-child(3) {
  transition-delay: 0.12s;
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .shot-strip {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 32px;
  }

  .hero-grid,
  .split-row,
  .persona-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .split-row.media-first .split-media {
    order: 2;
  }

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

  .site-footer .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-toc {
    position: static;
  }
}

@media (max-width: 820px) {
  .main-nav {
    display: none;
  }

  .header-actions .btn {
    display: none;
  }

  .burger {
    display: flex;
  }

  .section {
    padding: 64px 0;
  }

  .hero {
    min-height: 90vh;
    padding: calc(var(--nav-h) + 48px) 0 64px;
  }

  .hero-bg-img {
    object-position: 24% center;
  }

  .sim-flow {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: 100svh;
    padding: calc(var(--nav-h) + 24px) 0 64px;
  }

  .hero-bg-img {
    object-position: 22% center;
  }

  .hero-overlay {
    background:
      linear-gradient(to bottom, rgba(251, 251, 253, 0.95) 0%, rgba(251, 251, 253, 0.88) 55%, var(--bg) 100%);
  }

  [data-theme="dark"] .hero-overlay {
    background:
      linear-gradient(to bottom, rgba(10, 14, 30, 0.95) 0%, rgba(10, 14, 30, 0.88) 55%, var(--bg) 100%);
  }

  .feature-grid,
  .post-grid,
  .help-hub {
    grid-template-columns: 1fr;
  }

  .feature-grid .span-2 {
    grid-column: auto;
  }

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

  .stats-band .wrap {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 28px;
  }

  .site-footer .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .data-table {
    display: none;
  }

  .hero-cta .btn {
    flex: 1;
  }
}

/* ---------- Mobile bar ---------- */
@media (max-width: 820px) {
  .mobile-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 95;
    height: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: var(--bg-raised);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-3);
    transition: transform 0.15s var(--ease), color 0.2s var(--ease);
  }

  .mobile-bar a:active {
    transform: scale(0.93);
  }

  .mobile-bar a svg {
    width: 21px;
    height: 21px;
  }

  .mobile-bar a.active {
    color: var(--accent);
  }

  .mobile-bar a.bar-cta {
    color: var(--accent);
  }

  /* Search sheet becomes an app-style bottom sheet on mobile */
  .search-sheet {
    top: auto;
    bottom: 0;
    inset-inline: 0;
    width: 100%;
    max-width: none;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
  }

  .search-overlay.open .search-sheet {
    transform: translateY(0);
  }

  .search-sheet-handle {
    display: block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: var(--line-strong);
    margin: 10px auto 2px;
  }

  .search-results {
    max-height: 58vh;
  }

  .feedback-fab {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 14px);
    inset-inline-start: 14px;
    padding: 10px 15px;
    font-size: 0.82rem;
  }

  .footer-feedback-strip {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 821px) {
  .header-search-btn {
    display: flex;
  }

  .search-footer {
    display: flex;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .mobile-bar,
  .to-top,
  .hero-visual,
  .guide-toc {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
