/* ============================================================
   SBS Studio — Design System & Global Styles
   Light glassmorphism · Vazirmatn (fa) + Space Grotesk (latin)
   ============================================================ */

/* ============ TOKENS ============ */
:root {
  /* Surfaces */
  --bg: #f4f9ff;
  --bg-alt: #eaf3fd;
  --white: #ffffff;

  /* Ink */
  --ink: #1a2b3c;
  --ink-soft: #52677c;
  --ink-faint: #6e8399;

  /* Brand blues */
  --blue: #4a9fe5;          /* decorative only — fails AA as text */
  --blue-light: #a8d4f7;
  --blue-pale: #dbeeff;
  --blue-deep: #2b7cc9;
  --accent-text: #1668ac;   /* accessible text accent — ≥4.5:1 */
  --btn-grad: linear-gradient(135deg, #3a8bd0 0%, #1f66ad 100%);

  /* Glass */
  --glass: rgba(255, 255, 255, 0.65);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.85);

  /* Elevation */
  --shadow-sm: 0 2px 8px rgba(26, 43, 60, 0.06);
  --shadow-md: 0 8px 32px rgba(26, 43, 60, 0.08);
  --shadow-lg: 0 16px 48px rgba(26, 43, 60, 0.12);
  --shadow-xl: 0 24px 64px rgba(26, 43, 60, 0.16);

  /* Radii */
  --radius: 24px;
  --radius-sm: 16px;
  --radius-xs: 10px;

  /* Motion */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 180ms;
  --dur-base: 250ms;
}

/* ============ RESET / BASE ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: var(--bg);
  font-family: "Vazirmatn", "Space Grotesk", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

button {
  font-family: inherit;
}

main {
  flex: 1;
}

/* ============ UTILITIES ============ */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -48px;
  right: 50%;
  transform: translateX(50%);
  z-index: 200;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--white);
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-fast);
}
.skip-link:focus-visible {
  top: 0;
}

/* ============ HEADER — Liquid Glass ============ */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  position: sticky;
  top: 12px;
  z-index: 100;
  margin: 12px 24px 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 8px 32px rgba(26, 43, 60, 0.10),
    0 2px 8px rgba(26, 43, 60, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.25);
}

.logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.logo-dot { color: var(--blue); }

.header-nav {
  display: flex;
  gap: 8px;
}
.header-nav a {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 100px;
  transition: color var(--dur-base), background var(--dur-base), box-shadow var(--dur-base);
}
.header-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 2px 8px rgba(26, 43, 60, 0.06);
}
.header-nav a[aria-current="page"] {
  color: var(--accent-text);
  font-weight: 600;
  background: var(--blue-pale);
}

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

.header-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  background: var(--btn-grad);
  border-radius: 100px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
  box-shadow:
    0 4px 14px rgba(74, 159, 229, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.header-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 24px rgba(74, 159, 229, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* --- Hamburger --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 42px;
  height: 42px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.menu-toggle-line {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--dur-base), opacity var(--dur-base);
}
.menu-toggle.is-open .menu-toggle-line:first-child {
  transform: translateY(4px) rotate(-45deg);
}
.menu-toggle.is-open .menu-toggle-line:last-child {
  transform: translateY(-4px) rotate(45deg);
}

/* --- Mobile menu drawer --- */
.mobile-menu {
  position: fixed;
  inset: 84px 12px auto;
  z-index: 99;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xl);
  padding: 12px;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-nav {
  display: flex;
  flex-direction: column;
}
.mobile-menu-nav a {
  display: block;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: background var(--dur-fast);
}
.mobile-menu-nav a:hover,
.mobile-menu-nav a[aria-current="page"] {
  background: var(--blue-pale);
  color: var(--accent-text);
}
.mobile-menu-nav .mobile-menu-cta {
  margin-top: 6px;
  background: var(--btn-grad);
  color: var(--white);
  text-align: center;
  box-shadow: 0 4px 14px rgba(74, 159, 229, 0.35);
}
.mobile-menu-contact {
  display: block;
  text-align: center;
  padding: 12px 18px 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
}

/* ============ HERO ============ */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  padding: 100px 56px 120px;
  align-items: center;
  min-height: calc(100vh - 80px);
  position: relative;
  overflow: clip;
}

/* Design-canvas backdrop: soft glows + dot grid, no photo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(640px 420px at 82% 18%, rgba(74, 159, 229, 0.20), transparent 70%),
    radial-gradient(520px 400px at 8% 85%, rgba(255, 184, 113, 0.14), transparent 70%),
    linear-gradient(
      165deg,
      rgba(74, 159, 229, 0.10) 0%,
      rgba(168, 212, 247, 0.08) 45%,
      rgba(234, 243, 253, 0.35) 100%
    );
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, rgba(43, 124, 201, 0.16) 1.2px, transparent 1.4px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 78%);
}

/* Floating artboard outlines + multiplayer cursor,
   anchored to the corners of the profile card */
.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-left,
.hero-right,
.hero-scroll-hint {
  position: relative;
  z-index: 1;
}

.decor-frame {
  position: absolute;
  display: block;
  border: 1.5px solid rgba(74, 159, 229, 0.25);
  border-radius: 18px;
}
.decor-frame--a {
  width: 160px;
  height: 118px;
  bottom: -48px;
  right: -56px;
  animation: decor-float 9s ease-in-out infinite alternate;
}
.decor-frame--a::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(74, 159, 229, 0.45);
  border-radius: 4px;
  background: var(--bg);
}
.decor-frame--b {
  width: 104px;
  height: 104px;
  bottom: -40px;
  left: -52px;
  border-style: dashed;
  animation: decor-float 11s ease-in-out infinite alternate-reverse;
}

.decor-cursor {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  filter: drop-shadow(0 4px 10px rgba(26, 43, 60, 0.18));
  animation: decor-float 8s ease-in-out infinite alternate;
}
.decor-cursor--a {
  top: -86px;
  right: 118px;
}
.decor-cursor-tag {
  padding: 3px 10px;
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  border-radius: 100px 100px 100px 4px;
  margin-right: -6px;
}

@keyframes decor-float {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-10px, 14px, 0); }
}

.hero-greeting {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-text);
  margin-bottom: 12px;
}

.hero-title {
  font-weight: 800;
  font-size: clamp(44px, 6vw, 84px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.hero-title-line {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}
.hero-title-line span {
  display: inline-block;
}

.hero-intro {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: 40px;
  text-align: justify;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 32px;
  font-size: 15px;
  font-weight: 700;
  color: var(--white);
  background: var(--btn-grad);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
  box-shadow: 0 8px 24px rgba(74, 159, 229, 0.35);
}
.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(74, 159, 229, 0.45);
}
.hero-cta svg { transition: transform var(--dur-base); }
.hero-cta:hover svg { transform: translateX(-4px); }

.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  right: 50%;
  transform: translateX(50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  animation: scroll-bounce 2s ease-in-out infinite;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateX(50%) translateY(0); }
  50% { transform: translateX(50%) translateY(8px); }
}

/* ============ HERO VISUAL — PROFILE CARD ============ */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-visual {
  position: relative;
  width: min(500px, 100%);
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  pointer-events: none;
  z-index: 0;
}
.hero-orb-a {
  width: 300px;
  height: 300px;
  top: -50px;
  right: -60px;
  background: radial-gradient(circle at 30% 30%, rgba(74, 159, 229, 0.55), rgba(74, 159, 229, 0) 70%);
  animation: orb-drift 11s ease-in-out infinite alternate;
}
.hero-orb-b {
  width: 260px;
  height: 260px;
  bottom: -40px;
  left: -50px;
  background: radial-gradient(circle at 60% 60%, rgba(255, 184, 113, 0.4), rgba(255, 184, 113, 0) 70%);
  animation: orb-drift 13s ease-in-out infinite alternate-reverse;
}

@keyframes orb-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-18px, 22px, 0) scale(1.12); }
}

.hero-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  box-shadow:
    0 32px 80px rgba(26, 43, 60, 0.16),
    0 8px 24px rgba(26, 43, 60, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Window chrome bar */
.hero-card-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 14px 20px;
  background: rgba(234, 243, 253, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}
.bar-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.bar-dot--r { background: #ff8f8f; }
.bar-dot--y { background: #ffd47f; }
.bar-dot--g { background: #97e2a5; }
.bar-title {
  margin-inline-start: auto;
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  direction: ltr;
}

.hero-card-body {
  padding: 32px 32px 30px;
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
}

.hero-id {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.hero-avatar {
  width: 128px;
  height: 128px;
  border-radius: 30px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #1a7f4b;
  background: rgba(151, 226, 165, 0.35);
  border: 1px solid rgba(151, 226, 165, 0.7);
  border-radius: 100px;
  white-space: nowrap;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fae66;
  position: relative;
  flex-shrink: 0;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(47, 174, 102, 0.45);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0%   { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.8); opacity: 0; }
}

.hero-id-name {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--ink);
}
.hero-id-role {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--ink-soft);
}

.hero-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0;
  margin: 0 0 20px;
  border-top: 1px solid rgba(74, 159, 229, 0.14);
  border-bottom: 1px solid rgba(74, 159, 229, 0.14);
}
.hero-chips li {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  background: var(--blue-pale);
  color: var(--accent-text);
  border-radius: 100px;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hero-stat-num {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  color: var(--accent-text);
}
.hero-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
}
.hero-stat-divider {
  width: 1px;
  height: 36px;
  background: rgba(74, 159, 229, 0.25);
}

/* ============ SECTION SHARED ============ */
.section-header {
  margin-bottom: 56px;
}
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  margin-bottom: 16px;
  padding: 6px 14px;
  background: var(--blue-pale);
  border-radius: 100px;
}
.section-title {
  font-weight: 800;
  font-size: clamp(34px, 4.5vw, 56px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-desc {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 520px;
  margin: 16px auto 0;
  line-height: 1.8;
}

/* ============ CAROUSEL COMPONENT ============ */
.carousel-stage {
  position: relative;
  width: 100%;
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
  touch-action: pan-y;
}

.carousel-track {
  position: absolute;
  width: 200px;
  height: 300px;
  transform-style: preserve-3d;
}

.carousel-track .card {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  cursor: pointer;
  text-decoration: none;
  display: block;
  background-color: #cfe6fa;
  background-image:
    radial-gradient(ellipse 90% 70% at 30% 20%, rgba(255, 255, 255, 0.55) 0%, transparent 60%),
    linear-gradient(160deg, var(--blue-light) 0%, var(--blue-deep) 100%);
  background-size: cover;
  background-position: center;
  transform-origin: 50% 750px;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s, scale 0.5s;
  filter: brightness(0.62) saturate(0.85);
  scale: 0.8;
  box-shadow: 0 16px 48px rgba(26, 43, 60, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.carousel-track .card.active {
  filter: brightness(1) saturate(1);
  scale: 1.1;
  z-index: 10;
  box-shadow:
    0 24px 64px rgba(26, 43, 60, 0.22),
    0 8px 20px rgba(74, 159, 229, 0.15);
}
.carousel-track .card:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

/* Card label overlay: title + CTA on every card */
.card-overlay {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 14px 16px;
  background: linear-gradient(180deg, rgba(13, 30, 46, 0) 0%, rgba(13, 30, 46, 0.82) 70%);
  border-radius: 0 0 23px 23px;
}
.card-title {
  color: var(--white);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cta {
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  padding: 5px 12px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border-radius: 100px;
  white-space: nowrap;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.card:hover .card-cta,
.card:focus-visible .card-cta,
.card.active .card-cta {
  background: rgba(74, 159, 229, 0.85);
  border-color: transparent;
}

.carousel-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}
#carousel-counter {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  direction: ltr;
}
.carousel-dots {
  display: flex;
  gap: 8px;
}
.carousel-dot {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--blue-light);
  border-radius: 50%;
  background: var(--white);
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  color: var(--accent-text);
  cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.carousel-dot:hover {
  background: var(--blue-pale);
}
.carousel-dot.is-active {
  background: var(--accent-text);
  border-color: var(--accent-text);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(74, 159, 229, 0.35);
}

.carousel-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 36px;
}

.carousel-nav button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1.5px solid var(--blue-light);
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--accent-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), background var(--dur-base), color var(--dur-base);
  box-shadow: var(--shadow-sm);
}
.carousel-nav button:hover {
  transform: scale(1.08);
  background: var(--accent-text);
  color: var(--white);
  border-color: var(--accent-text);
  box-shadow: 0 8px 24px rgba(74, 159, 229, 0.35);
}

.card-info {
  text-align: center;
  margin-top: 28px;
  min-height: 76px;
}
.card-info-title {
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
}
.card-info-desc {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.8;
}
.card-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 24px;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  background: var(--btn-grad);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base);
  box-shadow: 0 4px 14px rgba(74, 159, 229, 0.3);
}
.card-info-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 159, 229, 0.4);
}
.card-info-btn svg { transition: transform var(--dur-base); }
.card-info-btn:hover svg { transform: translateX(-4px); }

/* ============ SECTION CTA ============ */
.section-cta {
  display: flex;
  justify-content: center;
  margin-top: 56px;
}
.section-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 30px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), background var(--dur-base), color var(--dur-base), border-color var(--dur-base);
  box-shadow: var(--shadow-sm);
}
.section-cta-btn:hover {
  transform: translateY(-3px);
  background: var(--accent-text);
  color: var(--white);
  border-color: var(--accent-text);
  box-shadow: 0 10px 28px rgba(74, 159, 229, 0.35);
}
.section-cta-btn svg { transition: transform var(--dur-base); }
.section-cta-btn:hover svg { transform: translateX(-4px); }

/* ============ PROJECTS SECTION (HOME) ============ */
.projects {
  padding: 110px 56px;
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}

.projects-bg {
  position: absolute;
  left: -5%;
  right: -5%;
  top: -15%;
  height: 130%;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  background-color: var(--bg-alt);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(74, 159, 229, 0.10) 0%, transparent 70%),
    linear-gradient(
      165deg,
      rgba(74, 159, 229, 0.22) 0%,
      rgba(168, 212, 247, 0.14) 40%,
      rgba(219, 238, 255, 0.18) 70%,
      rgba(234, 243, 253, 0.30) 100%
    );
  background-repeat: no-repeat;
}
.projects-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--bg) 0%, transparent 14%),
    linear-gradient(0deg, var(--bg) 0%, transparent 14%);
  pointer-events: none;
  z-index: 1;
}

.projects > *:not(.projects-bg) {
  position: relative;
  z-index: 1;
}

/* Pull the "همه پروژه‌ها" CTA up, tighter against the carousel */
.projects .section-cta {
  margin-top: 32px;
}

/* ============ CASE STUDIES SECTION (HOME) ============ */
.case-studies {
  padding: 110px 56px;
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}
.case-studies::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 380px at 12% 8%, rgba(74, 159, 229, 0.12), transparent 70%),
    radial-gradient(560px 380px at 92% 92%, rgba(168, 212, 247, 0.16), transparent 70%);
}
.case-studies > * {
  position: relative;
  z-index: 1;
}

.case-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: 56px;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
}

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base);
}
.case-card:hover {
  transform: translateY(-8px);
  border-color: var(--blue-light);
  box-shadow: var(--shadow-xl);
}

.case-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-light) 100%);
}
.case-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.case-card:hover .case-media img { transform: scale(1.06); }
.case-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(13, 30, 46, 0) 55%, rgba(13, 30, 46, 0.26) 100%);
}
.case-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--blue-deep);
}

.case-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  padding: 28px 32px 32px;
}
.case-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  padding: 5px 12px;
  background: var(--blue-pale);
  border-radius: 100px;
}
.case-title {
  font-weight: 800;
  font-size: 21px;
  line-height: 1.55;
  letter-spacing: -0.01em;
}
.case-title a {
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur-base);
}
.case-title a:hover { color: var(--accent-text); }
.case-intro {
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-soft);
}
.case-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: auto;
  padding-top: 6px;
}
.case-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
}
.case-link svg { transition: transform var(--dur-base); }
.case-link:hover svg { transform: translateX(-4px); }

.case-file-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  background: var(--white);
  border: 1.5px solid var(--blue-light);
  border-radius: 100px;
  text-decoration: none;
  transition: background var(--dur-base), color var(--dur-base), border-color var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.case-file-link:hover {
  background: var(--accent-text);
  color: var(--white);
  border-color: var(--accent-text);
  transform: translateY(-2px);
}

/* Lead case study gets a wide editorial treatment */
.case-card--featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.case-card--featured .case-media {
  flex: 1 1 56%;
  aspect-ratio: auto;
  min-height: 380px;
}
.case-card--featured .case-body {
  flex: 1 1 44%;
  justify-content: center;
  padding: 48px 52px;
}
.case-card--featured .case-title {
  font-size: clamp(24px, 3vw, 34px);
}
.case-card--featured .case-intro {
  font-size: 16px;
  max-width: 46ch;
}
.case-card--featured .case-actions {
  margin-top: 12px;
}
.case-card--featured .case-link {
  font-size: 15px;
}

/* ============ BLOG TIMELINE ============ */
.blog {
  padding: 110px 56px;
}
.blog-page {
  max-width: 1024px;
  margin: 0 auto;
}
.blog-page .section-header {
  text-align: center;
}

.blog-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  right: 27px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--blue-pale) 100%);
  border-radius: 2px;
}

.blog-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 28px;
  align-items: start;
  padding: 36px 0;
  position: relative;
}
.blog-item + .blog-item {
  border-top: 1px solid rgba(74, 159, 229, 0.12);
}

.blog-num {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-weight: 700;
  font-size: 17px;
  color: var(--accent-text);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: 50%;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.blog-content time {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  display: block;
  margin-bottom: 8px;
}
.blog-content h2,
.blog-content h3 {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  line-height: 1.4;
  transition: color var(--dur-fast);
}
.blog-item:hover .blog-content h2,
.blog-item:hover .blog-content h3 {
  color: var(--accent-text);
}
.blog-featured .blog-content h2,
.blog-featured .blog-content h3 {
  font-size: 26px;
}
.blog-content p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
  margin-bottom: 14px;
  max-width: 520px;
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.blog-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  background: var(--blue-pale);
  color: var(--accent-text);
  border-radius: 100px;
}

.blog-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-inline-start: auto;
}
.blog-link::after {
  content: "←";
  margin-inline-start: 6px;
  transition: transform var(--dur-base);
}
.blog-link:hover::after {
  transform: translateX(-4px);
}

.blog-visual {
  width: 140px;
  aspect-ratio: 7 / 5;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  opacity: 0.92;
  background-color: var(--blue-pale);
  transition: transform 0.35s var(--ease-spring), opacity 0.35s, box-shadow 0.35s;
}
.blog-visual--image {
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-md);
}
.blog-item:hover .blog-visual {
  transform: translateY(-4px);
  opacity: 1;
}
.bv-1 { background-image: linear-gradient(135deg, var(--blue-pale) 0%, var(--blue-light) 100%); }
.bv-2 { background-image: linear-gradient(135deg, #e8f5e9 0%, #a5d6a7 100%); }
.bv-3 { background-image: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%); }
.bv-4 { background-image: linear-gradient(135deg, #f3e5f5 0%, #ce93d8 100%); }

/* ============ BLOG DETAIL ============ */
.blog-detail {
  padding: 64px 56px 90px;
  max-width: 820px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 32px;
}
.breadcrumb a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] {
  color: var(--ink-faint);
}

.blog-detail-header {
  margin-bottom: 40px;
}
.blog-detail-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  margin-bottom: 16px;
}
.meta-dot { color: var(--blue-light); }
.blog-detail-header h1 {
  font-weight: 800;
  font-size: clamp(30px, 4vw, 50px);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 20px;
}
.article-intro {
  font-size: 18px;
  line-height: 1.9;
  color: var(--ink-soft);
  max-width: 640px;
}

.blog-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(74, 159, 229, 0.14);
}
.blog-detail-meta .meta-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-pale), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--accent-text);
}
.blog-detail-meta .meta-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.blog-detail-meta .meta-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.blog-detail-meta .meta-role {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ============ RICH TEXT (CKEditor content) ============ */
.rich-text {
  font-size: 16px;
  line-height: 2;
  color: #2d3f52;
  word-wrap: break-word;
}
.rich-text p { margin-bottom: 20px; }
.rich-text p:last-child { margin-bottom: 0; }
.rich-text h2 {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin: 44px 0 18px;
  line-height: 1.35;
  color: var(--ink);
}
.rich-text h3 {
  font-weight: 700;
  font-size: 20px;
  margin: 34px 0 12px;
  line-height: 1.4;
  color: var(--ink);
}
.rich-text ul,
.rich-text ol {
  margin: 0 0 20px;
  padding-inline-start: 24px;
}
.rich-text li { margin-bottom: 10px; }
.rich-text a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rich-text img {
  border-radius: var(--radius-sm);
  margin: 24px 0;
}
.rich-text blockquote {
  margin: 32px 0;
  padding: 22px 26px;
  border-inline-start: 3px solid var(--blue);
  background: var(--blue-pale);
  border-radius: var(--radius-xs);
  font-size: 16px;
  color: var(--ink);
}
.rich-text table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
}
.rich-text th,
.rich-text td {
  border: 1px solid var(--blue-light);
  padding: 10px 14px;
  text-align: start;
}
.rich-text th { background: var(--blue-pale); }
.rich-text code {
  background: var(--blue-pale);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.9em;
  direction: ltr;
  unicode-bidi: embed;
}
.rich-text pre {
  background: var(--ink);
  color: #dbeeff;
  padding: 20px;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  direction: ltr;
  margin-bottom: 20px;
}

/* ============ CONTACT ============ */
.contact {
  padding: 110px 56px;
  background: var(--bg-alt);
  text-align: center;
}

.contact-header {
  max-width: 620px;
  margin-inline: auto;
}

.contact-lead {
  font-size: 15px;
  line-height: 2;
  color: var(--ink-soft);
  margin-top: 18px;
  text-align: center;
  text-wrap: balance;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 34px 24px 30px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base), border-color var(--dur-base), background var(--dur-base);
}
.contact-card:hover {
  transform: translateY(-6px);
  background: var(--white);
  border-color: var(--blue-light);
  box-shadow: var(--shadow-lg);
}

.contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--blue-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-text);
  flex-shrink: 0;
  margin-bottom: 12px;
  transition: background var(--dur-base), color var(--dur-base), transform var(--dur-base) var(--ease-spring);
}
.contact-card:hover .contact-icon {
  background: var(--accent-text);
  color: var(--white);
  transform: translateY(-2px) scale(1.05);
}

.contact-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.contact-value {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
  direction: ltr;
  unicode-bidi: isolate;
  line-height: 1.6;
}
.contact-value--url {
  font-size: 13.5px;
  color: var(--accent-text);
}

/* ============ FOOTER ============ */
.site-footer {
  padding: 32px 56px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid rgba(74, 159, 229, 0.1);
}

/* ============ EMPTY STATE ============ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  padding: 56px 24px;
  max-width: 440px;
  margin: 0 auto;
  color: var(--ink-soft);
  background: var(--glass);
  border: 1.5px dashed var(--blue-light);
  border-radius: var(--radius);
}
.empty-state svg { color: var(--blue); }

/* ============ ERROR PAGE ============ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 68vh;
  text-align: center;
  padding: 64px 24px;
}
.error-code {
  font-family: "Space Grotesk", "Vazirmatn", sans-serif;
  font-size: clamp(88px, 16vw, 150px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(160deg, var(--blue) 20%, var(--blue-deep) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.error-page h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  margin: 12px 0;
}
.error-desc {
  color: var(--ink-soft);
  max-width: 440px;
  margin-bottom: 32px;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.error-cta {
  padding: 14px 30px;
  font-size: 14px;
}

/* ============ FOCUS ============ */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============ INITIAL STATES (JS-driven reveals) ============ */
.js-loaded .hero-title-line span { transform: translateY(110%); }
.js-loaded .hero-greeting,
.js-loaded .hero-intro,
.js-loaded .hero-cta { opacity: 0; }
.js-loaded .hero-visual { opacity: 0; transform: translateY(24px) scale(0.96); }
.js-loaded [data-reveal] { opacity: 0; }
.js-loaded .carousel-track .card { opacity: 0; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 56px;
    padding: 60px 32px 88px;
    min-height: auto;
    text-align: center;
  }
  .hero-right { order: -1; }
  .hero-visual { width: min(440px, 100%); }
  .hero-avatar { width: 108px; height: 108px; }
  .hero-intro { margin-inline: auto; }
  .site-header { padding: 12px 20px; margin: 10px 16px 0; border-radius: 18px; }
  .projects, .blog, .contact { padding: 80px 32px; }
  .case-studies { padding: 80px 32px; }
  .case-grid { grid-template-columns: 1fr; gap: 24px; }
  .case-card--featured { flex-direction: column; }
  .case-card--featured .case-media { aspect-ratio: 16 / 10; min-height: 0; }
  .case-card--featured .case-body { padding: 32px; }
  .carousel-stage { height: 360px; }
  .carousel-track { width: 170px; height: 255px; }
  .blog-item { grid-template-columns: 56px 1fr; }
  .blog-visual { display: none; }
  .blog-detail { padding: 56px 32px 72px; }
  .site-footer { padding: 28px 32px; }
}

@media (max-width: 640px) {
  .header-nav, .header-btn { display: none; }
  .menu-toggle { display: flex; }
  .mobile-menu { inset: 78px 12px auto; }

  .hero { padding: 40px 20px 64px; }
  .hero-visual { width: min(360px, 100%); }
  .hero-orb-a { width: 220px; height: 220px; top: -30px; right: -30px; }
  .hero-orb-b { width: 190px; height: 190px; bottom: -24px; left: -26px; }
  .hero-card-body { padding: 22px 20px; }
  .hero-avatar { width: 92px; height: 92px; border-radius: 22px; }
  .hero-decor { display: none; }

  .projects, .blog, .contact { padding: 60px 20px; }
  .case-studies { padding: 60px 20px; }
  .case-header { margin-bottom: 40px; }
  .case-body { padding: 24px 22px 26px; }
  .case-title { font-size: 19px; }
  .case-card--featured .case-body { padding: 26px 22px 28px; }
  .case-card--featured .case-title { font-size: 23px; }
  .site-header { padding: 10px 16px; margin: 8px 12px 0; border-radius: 16px; top: 8px; }

  .carousel-stage { height: 320px; }
  .carousel-track { width: 165px; height: 245px; }
  .carousel-nav { gap: 12px; margin-top: 24px; }
  .carousel-nav button { width: 40px; height: 40px; flex-shrink: 0; }
  .carousel-nav button svg { width: 16px; height: 16px; }
  .carousel-status { min-width: 0; }
  .carousel-dots { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .carousel-dot { width: 24px; height: 24px; font-size: 11px; }
  .projects .section-cta { margin-top: 24px; }

  .blog-item { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .blog-num { width: 40px; height: 40px; font-size: 14px; }
  .timeline-line { display: none; }
  .blog-detail { padding: 40px 20px 56px; }
  .rich-text h2 { font-size: 22px; }

  .contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .contact-card { padding: 28px 18px 24px; }

  .site-footer { flex-direction: column; text-align: center; padding: 24px 20px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
