:root {
  --bg: #131315;
  --bg-deep: #040b14;
  --surface-lowest: #0e0e10;
  --surface-low: #1b1b1d;
  --surface: #1f1f21;
  --surface-high: #2a2a2c;
  --surface-highest: #343536;
  --text: #e4e2e4;
  --text-muted: #c5c6cd;
  --outline: #44474d;
  --outline-strong: rgba(255, 255, 255, 0.16);
  --primary: #b9c7e4;
  --primary-deep: #0a192f;
  --amber: #ffdf9e;
  --amber-strong: #fabd00;
  --green: #00c853;
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-deep: 0 28px 64px rgba(0, 0, 0, 0.45);
  --shadow-amber: 0 0 0 1px rgba(250, 189, 0, 0.08), 0 14px 36px rgba(250, 189, 0, 0.16);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --section-gap: clamp(4rem, 7vw, 6rem);
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body {
  background:
    radial-gradient(circle at top right, rgba(185, 199, 228, 0.11), transparent 28%),
    radial-gradient(circle at 18% 12%, rgba(250, 189, 0, 0.09), transparent 24%),
    linear-gradient(180deg, #040b14 0%, #131315 22%, #131315 100%);
  color: var(--text);
  font-family: 'Vazirmatn', sans-serif;
}
body {
  overflow-x: hidden;
  position: relative;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 92%);
  opacity: 0.22;
}

header.glass {
  background: rgba(14, 14, 16, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.gradient-mesh {
  background-image:
    radial-gradient(circle at 88% 12%, rgba(250, 189, 0, 0.18), transparent 0 24%),
    radial-gradient(circle at 12% 18%, rgba(185, 199, 228, 0.16), transparent 0 26%),
    radial-gradient(circle at 52% 78%, rgba(0, 200, 83, 0.12), transparent 0 22%);
}

.glass,
.glass-strong,
.layer-card,
.modal-card,
#faqList,
.chat-window,
.lead-form-overlay {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-deep);
}

.glass::before,
.glass-strong::before,
.layer-card::before,
.modal-card::before,
#faqList::before,
.chat-window::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 223, 158, 0.08), transparent 28%, transparent 72%, rgba(185, 199, 228, 0.06));
}

.glass { background-color: var(--glass); }
.glass-strong,
.modal-card,
.chat-window { background-color: rgba(27, 27, 29, 0.84); }

.text-gradient-gold {
  background: linear-gradient(135deg, #ffdf9e 0%, #fabd00 55%, #ffdf9e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-emerald {
  background: linear-gradient(135deg, #62ff96 0%, #00e475 50%, #00c853 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-primary,
.btn-secondary {
  border-radius: var(--radius-lg);
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #ffdf9e 0%, #fabd00 100%);
  color: #261a00;
  border: 1px solid rgba(255, 223, 158, 0.32);
  box-shadow: var(--shadow-amber);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(250, 189, 0, 0.18), 0 18px 40px rgba(250, 189, 0, 0.22);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 223, 158, 0.22);
}

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

section {
  position: relative;
}
section.py-20,
section.sm\:py-32,
section[class*='py-20'] {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

section:nth-of-type(odd):not(:first-of-type)::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - 2rem));
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

section:first-of-type .inline-flex.glass {
  border-radius: 999px;
  padding: 0.6rem 1rem;
  border-color: rgba(0, 200, 83, 0.3);
  box-shadow: none;
}

section:first-of-type h1 {
  font-size: clamp(2.5rem, 5.8vw, 4.75rem);
  line-height: 1.2;
  letter-spacing: 0;
}

section:first-of-type p.text-base,
section:first-of-type p.sm\:text-xl {
  color: var(--text-muted);
  max-width: 46rem;
}

section:first-of-type .grid.grid-cols-3 > div {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 1.25rem 0.75rem;
  min-height: 124px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#values .glass,
#features .glass,
#use-cases .glass,
#architecture .glass-strong,
#faqList,
footer .btn-primary {
  border-radius: var(--radius-lg) !important;
}

#values .glass,
#features .glass,
#use-cases .glass,
#architecture .layer-card,
#faqList,
footer > div > div,
.modal-card {
  box-shadow: none;
}

#values .glass,
#features .glass,
#use-cases .glass,
#architecture .layer-card,
#faqList {
  background: linear-gradient(180deg, rgba(31, 31, 33, 0.92), rgba(27, 27, 29, 0.82));
}

#values .glass:hover,
#features .glass:hover,
#use-cases .glass:hover,
#architecture .layer-card:hover,
#faqList .faq-item:hover {
  border-color: rgba(255, 223, 158, 0.2);
}

.layer-card {
  overflow: hidden;
}
.layer-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 223, 158, 0.14), transparent 28%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.layer-card:hover::after { opacity: 1; }

#architecture .layer-card {
  border-right: 3px solid rgba(255, 223, 158, 0.22);
}

#features .glass,
#use-cases .glass {
  padding: 1.5rem;
}

#features h3,
#use-cases h3,
#values h3,
#architecture h3 {
  color: var(--text);
}

.text-gray-300 { color: var(--text-muted) !important; }
.text-gray-400,
.text-gray-500,
.text-gray-600 { color: rgba(197, 198, 205, 0.78) !important; }
.text-brand-bg { color: var(--bg-deep) !important; }
.bg-brand-bg { background-color: var(--bg-deep) !important; }

.arrow-down { color: rgba(255, 223, 158, 0.42); }

.faq-item { border-bottom: 1px solid rgba(255,255,255,0.07); }
.faq-item:last-child { border-bottom: none; }
.faq-question { cursor: pointer; transition: color 0.2s ease, background-color 0.2s ease; border-radius: var(--radius-lg); }
.faq-question:hover { color: var(--amber); background: rgba(255,255,255,0.03); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease, padding 0.35s ease; color: var(--text-muted) !important; }
.faq-item.open .faq-answer { max-height: 400px; padding-top: 12px; padding-bottom: 4px; }
.faq-icon { transition: transform 0.3s ease; }
.faq-item.open .faq-icon { transform: rotate(180deg); }

.chat-fab {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 60;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #ffdf9e, #fabd00);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 1px solid rgba(255, 223, 158, 0.28);
  box-shadow: var(--shadow-amber);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-fab:hover { transform: scale(1.04); box-shadow: 0 18px 40px rgba(250, 189, 0, 0.28); }
.chat-fab-ring {
  position: absolute;
  inset: -8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffdf9e, #fabd00);
  opacity: 0.22;
  z-index: -1;
  animation: pulseRing 2.4s ease-in-out infinite;
}
@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.22; }
  50% { transform: scale(1.16); opacity: 0; }
}

.chat-window {
  position: fixed;
  bottom: 100px;
  left: 24px;
  z-index: 70;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 140px);
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.chat-window.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: all; }

.messages-area::-webkit-scrollbar { width: 5px; }
.messages-area::-webkit-scrollbar-track { background: transparent; }
.messages-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--amber-strong);
  display: inline-block;
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-7px); opacity: 1; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 11, 20, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card { animation: modalIn 0.3s ease forwards; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

input,
textarea,
#chatInput {
  background: rgba(14, 14, 16, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text) !important;
  box-shadow: none !important;
}
input:focus,
textarea:focus,
#chatInput:focus {
  border-color: rgba(250, 189, 0, 0.8) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(250, 189, 0, 0.1) !important;
}
input::placeholder,
textarea::placeholder { color: rgba(197, 198, 205, 0.38); }

.flex { display: flex; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }
.max-w-chat { max-width: 88%; }
.rounded-tr-sm { border-top-right-radius: 0.125rem; }
.rounded-tl-sm { border-top-left-radius: 0.125rem; }
.text-gray-100 { --tw-text-opacity: 1; color: rgb(243 244 246 / var(--tw-text-opacity, 1)); }
.flex-grow { flex-grow: 1; }
.bg-amber-500 { --tw-bg-opacity: 1; background-color: rgb(250 189 0 / var(--tw-bg-opacity, 1)); }
.font-medium { font-weight: 500; }

.lead-form-overlay {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(27, 27, 29, 0.96);
}

#messagesArea > div:first-child .border-emerald-500\/40,
.border-emerald-500\/40 {
  border-color: rgba(0, 200, 83, 0.45) !important;
}

footer {
  background: linear-gradient(180deg, rgba(4, 11, 20, 0.18), rgba(4, 11, 20, 0.42));
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

#detailContent h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--amber);
}
#detailContent ul, #detailContent ol {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}
#detailContent li {
  margin-bottom: 0.5rem;
  line-height: 1.8;
}
#detailContent p {
  margin-bottom: 1rem;
}

.blog-media-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.blog-media-frame iframe,
.blog-media-frame img {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 640px) {
  :root { --section-gap: 3.5rem; }

  .chat-window {
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    border: none;
  }
  .chat-window.open { transform: none; }

  section:first-of-type .grid.grid-cols-3 {
    gap: 0.75rem;
  }
  section:first-of-type .grid.grid-cols-3 > div {
    min-height: 110px;
    padding: 1rem 0.5rem;
  }
}

/* ===== Blog page polish ===== */
#blogListing #blogGrid {
  align-items: stretch;
}

#blogListing .glass {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(31, 31, 33, 0.94), rgba(20, 20, 22, 0.88));
  border-color: rgba(255, 255, 255, 0.1);
}

#blogListing .glass:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 223, 158, 0.24);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.blog-card-media {
  position: relative;
  overflow: hidden;
  background: rgba(14, 14, 16, 0.9);
}

.blog-card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(4, 11, 20, 0.3) 100%);
  pointer-events: none;
}

.blog-card-media img {
  transition: transform 0.45s ease;
}

#blogListing .glass:hover .blog-card-media img {
  transform: scale(1.04);
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#blogDetail article {
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(31, 31, 33, 0.96), rgba(20, 20, 22, 0.92));
}

/* Article title — overrides the hero `section:first-of-type h1` rule on the
   server-rendered article page, where the article is the first section. */
#blogDetail #detailTitle {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.3;
  letter-spacing: 0;
}

#detailCategory,
#detailTags span,
#blogListing .bg-amber-500\/10 {
  background: rgba(250, 189, 0, 0.1) !important;
  border-color: rgba(250, 189, 0, 0.26) !important;
  color: var(--amber) !important;
}

#detailContent {
  color: var(--text-muted) !important;
}

#detailContent h1,
#detailContent h2,
#detailContent h3,
#detailContent h4 {
  color: var(--text);
}

#detailContent a {
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 223, 158, 0.25);
}

#detailContent a:hover {
  border-bottom-color: rgba(255, 223, 158, 0.55);
}

#detailContent blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-right: 3px solid rgba(0, 200, 83, 0.55);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-radius: 6px;
}

#detailContent table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow: hidden;
  border-radius: 8px;
}

#detailContent th,
#detailContent td {
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.8rem 0.9rem;
  text-align: right;
}

#detailContent th {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

#blogDetail .glass.rounded-2xl {
  border-radius: 8px !important;
  background: linear-gradient(180deg, rgba(4, 11, 20, 0.36), rgba(4, 11, 20, 0.18));
}

@media (max-width: 640px) {
  #blogListing .glass,
  #blogDetail article {
    border-radius: 8px !important;
  }
}

/* ===== Structural executive classes ===== */
.executive-shell {
  background:
    radial-gradient(circle at 86% 10%, rgba(250, 189, 0, 0.08), transparent 0 20%),
    radial-gradient(circle at 10% 18%, rgba(185, 199, 228, 0.08), transparent 0 22%),
    linear-gradient(180deg, #040b14 0%, #131315 20%, #131315 100%);
}

.executive-hero {
  padding-bottom: clamp(5rem, 10vw, 7rem);
}

.executive-section {
  isolation: isolate;
}

.executive-card,
.executive-panel {
  border-radius: 8px !important;
}

.executive-card {
  background: linear-gradient(180deg, rgba(31, 31, 33, 0.94), rgba(27, 27, 29, 0.84));
}

.executive-card-compact {
  min-height: 100%;
}

.executive-panel {
  background: linear-gradient(180deg, rgba(31, 31, 33, 0.96), rgba(20, 20, 22, 0.9));
}

.executive-cta {
  border-color: rgba(255, 223, 158, 0.16) !important;
}

.executive-footer {
  position: relative;
}

/* ===== Persistent header ===== */
header.glass {
  position: fixed !important;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  background: rgba(14, 14, 16, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

header.glass > div {
  min-height: 76px;
}

#mobileMenu {
  background: rgba(14, 14, 16, 0.96);
}

body.executive-shell {
  min-height: 100vh;
}

@media (max-width: 640px) {
  header.glass > div {
    min-height: 68px;
  }
}
