/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Color */
  --bg: #0B1020;
  --surface: #151A2E;
  --card: #1B2140;
  --accent: #30E7F2;
  --accent-2: #7C7CFF;
  --success: #28D17C;
  --danger: #FF6363;
  --text-primary: #FFFFFF;
  --text-secondary: #BFC8D8;
  --text-muted: #7C86A3;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Type */
  --font-en: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-fa: 'Vazirmatn', 'Inter', sans-serif;

  /* 8pt spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;
  --sp-9: 128px;

  /* Radius / shadow */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 999px;
  --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 20px 40px -20px rgba(0,0,0,.6);
  --shadow-lift: 0 30px 60px -25px rgba(48, 231, 242, .25);

  /* Motion */
  --ease: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: .18s;
  --dur-med: .4s;
  --dur-slow: .8s;

  --container: 1180px;
}

@media (prefers-color-scheme: light) {
  :root { color-scheme: dark; }
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-en);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Persian text auto-font */
:lang(fa) { font-family: var(--font-fa); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; color: var(--text-secondary); line-height: 1.65; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

::selection { background: var(--accent); color: var(--bg); }

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

.skip-link {
  position: absolute;
  top: -60px;
  left: var(--sp-3);
  background: var(--accent);
  color: var(--bg);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  z-index: 999;
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-3); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

/* ============================================================
   AMBIENT BACKGROUND
   ============================================================ */
canvas#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(650px 420px at 12% -5%, rgba(48,231,242,.14), transparent 60%),
    radial-gradient(600px 500px at 100% 10%, rgba(124,124,255,.12), transparent 60%),
    radial-gradient(700px 500px at 50% 100%, rgba(48,231,242,.08), transparent 60%);
}

.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(48,231,242,.06), transparent 70%);
  transform: translate(-50%, -50%);
  left: -999px; top: -999px;
  transition: opacity var(--dur-med) var(--ease);
  will-change: left, top;
}
@media (hover: none) { .cursor-glow { display: none; } }

.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 200;
  transition: width .08s linear;
}

main, .footer, .nav { position: relative; z-index: 2; }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  background: rgba(11, 16, 32, .55);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease), background var(--dur-med) var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(11, 16, 32, .8); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
}
.nav-brand .dot { color: var(--accent); }
.brand-mark { height: 30px; width: auto; display: block; }
.brand-mark-sm { height: 24px; }

.nav-links {
  display: flex;
  gap: var(--sp-5);
}
.nav-links a {
  font-size: .92rem;
  color: var(--text-secondary);
  position: relative;
  padding: var(--sp-1) 0;
  transition: color var(--dur-fast) var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width var(--dur-med) var(--ease);
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: var(--sp-3); }

/* ============================================================
   MOBILE NAV TOGGLE + PANEL
   ============================================================ */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.03);
}
.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 1.6px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--dur-med) var(--ease), opacity var(--dur-fast) var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(6.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--sp-5);
  padding: 0 var(--sp-4) var(--sp-5);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  border-top: 1px solid transparent;
  transition: max-height var(--dur-med) var(--ease), opacity var(--dur-med) var(--ease), padding var(--dur-med) var(--ease);
}
.mobile-nav.is-open {
  max-height: 70vh;
  opacity: 1;
  overflow-y: auto;
  border-top-color: var(--border);
  padding-top: var(--sp-4);
}
.mobile-nav-links { display: flex; flex-direction: column; gap: var(--sp-1); }
.mobile-nav-links a {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: var(--sp-3) var(--sp-2);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.mobile-nav-links a:hover,
.mobile-nav-links a:focus-visible { color: var(--text-primary); background: rgba(255,255,255,.04); }
.mobile-nav-cta { align-self: flex-start; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; }
}

/* lock page scroll while the mobile panel is open */
body.nav-open { overflow: hidden; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border-radius: var(--radius-full);
  font-weight: 600;
  padding: 13px 24px;
  font-size: .95rem;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn svg { transition: transform var(--dur-fast) var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #22c6d4);
  color: #05171a;
  box-shadow: 0 12px 30px -12px rgba(48,231,242,.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(48,231,242,.7); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-ghost:hover { background: rgba(255,255,255,.07); transform: translateY(-2px); }

.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-lg { padding: 16px 30px; font-size: 1rem; }

.nav-cta { }
@media (max-width: 640px) { .nav-cta { padding: 9px 16px; font-size: .85rem; } }

/* magnetic wrapper handled in JS via transform */
.magnetic { will-change: transform; }

/* ripple */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  transform: scale(0);
  animation: rippleAnim .6s var(--ease);
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(2.6); opacity: 0; }
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal[data-delay="1"] { --d: 1; }
.reveal[data-delay="2"] { --d: 2; }
.reveal.in-view { opacity: 1; transform: translateY(0); filter: blur(0); }

/* ============================================================
   ELEMENTS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.03);
  font-size: .82rem;
  color: var(--text-secondary);
}
.pulse-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(40,209,124,.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(40,209,124,.55); }
  70% { box-shadow: 0 0 0 8px rgba(40,209,124,0); }
  100% { box-shadow: 0 0 0 0 rgba(40,209,124,0); }
}

.text-gradient {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.section { padding: var(--sp-9) 0; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,.015) 12%, rgba(255,255,255,.015) 88%, transparent); }

.section-head { max-width: 640px; margin-bottom: var(--sp-7); }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: var(--sp-3); }
.section-sub { font-size: 1.05rem; }

.grid { display: grid; gap: var(--sp-4); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding: 160px 0 120px;
  min-height: 92vh;
  display: flex;
  align-items: center;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: var(--sp-7);
}

.badge-available { margin-bottom: var(--sp-5); }

.hero-title {
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  line-height: 1.08;
  margin-bottom: var(--sp-4);
}

.hero-sub {
  font-size: 1.15rem;
  max-width: 560px;
  margin-bottom: var(--sp-6);
}
.hero-sub strong { color: var(--text-primary); font-weight: 600; }

.hero-actions {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  flex-wrap: wrap;
}

.hero-social {
  display: flex;
  gap: var(--sp-3);
}
.social-chip {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.03);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.social-chip:hover { transform: translateY(-3px); border-color: var(--accent); background: rgba(48,231,242,.08); }
.social-chip svg, .social-chip i { width: 18px; height: 18px; }

.hero-visual { display: flex; justify-content: center; }
.orbit-frame {
  position: relative;
  width: 340px;
  height: 340px;
}
.avatar-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  animation: spin 40s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.avatar-glass {
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.01));
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-card), 0 0 80px -20px rgba(48,231,242,.35);
  animation: floatY 6s var(--ease) infinite;
}
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  background: rgba(21,26,46,.85);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
  animation: floatY 7s var(--ease) infinite;
}
.float-card svg { color: var(--accent); }
.float-card-1 { top: 8%; left: -10%; animation-delay: .3s; }
.float-card-2 { bottom: 14%; right: -14%; animation-delay: 1.1s; }
.float-card-3 { bottom: -4%; left: 6%; animation-delay: 2s; }

.hero-scroll-cue {
  position: absolute;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text-muted);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.scroll-line { width: 1px; height: 36px; background: var(--border-strong); position: relative; overflow: hidden; }
.scroll-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); position: absolute; left: -1.5px; animation: scrollDot 2s ease-in-out infinite; }
@keyframes scrollDot { 0% { top: -10%; } 100% { top: 100%; } }

@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { order: -1; margin-bottom: var(--sp-4); }
  .orbit-frame { width: 260px; height: 260px; }
  .hero { padding: 128px 0 90px; }
}

/* ============================================================
   QUICK ACTION CARDS
   ============================================================ */
.quick-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .quick-grid { grid-template-columns: 1fr; } }

.q-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  width: 100%;
}
.q-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(160px 120px at 20% 0%, color-mix(in srgb, var(--c) 18%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-med) var(--ease);
}
.q-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--c) 55%, var(--border-strong));
  box-shadow: var(--shadow-card);
}
.q-card:hover::before { opacity: 1; }

.q-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
  margin-bottom: var(--sp-2);
}
.q-icon svg, .q-icon i { width: 20px; height: 20px; }

.q-title { font-weight: 700; font-size: 1.02rem; }
.q-desc { font-size: .85rem; color: var(--text-secondary); }
.q-arrow {
  position: absolute;
  top: var(--sp-4); right: var(--sp-4);
  color: var(--text-muted);
  transition: transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.q-card:hover .q-arrow { transform: translate(3px, -3px); color: var(--text-primary); }
.copy-arrow i { width: 14px; height: 14px; }

.q-card.is-placeholder { opacity: .45; cursor: default; pointer-events: none; }

/* copy feedback state */
.q-card.is-copied .q-desc { color: var(--success); }

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .services-grid { grid-template-columns: 1fr; } }

.s-card {
  padding: var(--sp-5);
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.s-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-card); }
.s-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  background: rgba(48,231,242,.08);
  color: var(--accent);
  margin-bottom: var(--sp-4);
}
.s-card h3 { font-size: 1.15rem; margin-bottom: var(--sp-2); }
.s-card p { font-size: .92rem; margin-bottom: var(--sp-4); min-height: 66px; }
.s-link { font-size: .88rem; font-weight: 600; color: var(--accent); display: inline-flex; gap: 6px; }
.s-link span { transition: transform var(--dur-fast) var(--ease); }
.s-link:hover span { transform: translateX(3px); }

/* ============================================================
   PROJECTS
   ============================================================ */
.projects-list { display: flex; flex-direction: column; gap: var(--sp-5); }
.p-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.p-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow-lift); }
.p-media {
  position: relative;
  background:
    radial-gradient(120% 120% at 20% 0%, rgba(48,231,242,.18), transparent 60%),
    linear-gradient(150deg, var(--card), var(--bg));
  display: flex; align-items: center; justify-content: center;
  min-height: 180px;
}
.p-media-glyph { color: var(--accent); opacity: .9; }
.p-body { padding: var(--sp-5); }
.p-badges { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.tag {
  font-size: .74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.p-body h3 { font-size: 1.35rem; margin-bottom: var(--sp-2); }
.p-body p { margin-bottom: var(--sp-4); max-width: 620px; }
.p-actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

@media (max-width: 760px) {
  .p-card { grid-template-columns: 1fr; }
  .p-media { min-height: 140px; }
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-8);
  align-items: start;
}
.about-lead { font-size: 1.05rem; margin-bottom: var(--sp-4); }
.about-mission { display: flex; gap: var(--sp-5); margin-top: var(--sp-5); }
.mission-item h4 { font-size: .9rem; color: var(--accent); margin-bottom: 6px; }
.mission-item p { font-size: .92rem; }

.timeline { display: flex; flex-direction: column; gap: var(--sp-5); position: relative; padding-left: var(--sp-5); }
.timeline::before {
  content: "";
  position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px;
  background: var(--border-strong);
}
.tl-item { position: relative; }
.tl-dot {
  position: absolute; left: calc(-1 * var(--sp-5) + 0px);
  top: 5px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(48,231,242,.15);
}
.tl-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.tl-content h4 { font-size: 1.05rem; margin: 4px 0 6px; }
.tl-content p { font-size: .9rem; }

.skills-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-6); }
.skill-pill {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  font-size: .82rem;
  color: var(--text-secondary);
  background: rgba(255,255,255,.02);
}

@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-mission { flex-direction: column; gap: var(--sp-4); }
}

/* ============================================================
   TECH STACK
   ============================================================ */
.stack-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.stack-chip {
  padding: 12px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  font-size: .9rem;
  color: var(--text-secondary);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.stack-chip:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text-primary); }

/* ============================================================
   SOCIAL GRID
   ============================================================ */
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}
@media (max-width: 780px) { .social-grid { grid-template-columns: repeat(2, 1fr); } }
.soc-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-5) var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: .88rem;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.soc-card i { color: var(--c); width: 24px; height: 24px; }
.soc-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, var(--border-strong)); }
.soc-card.is-placeholder { opacity: .4; pointer-events: none; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-7);
  padding: var(--sp-7);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface), var(--card));
  border: 1px solid var(--border);
  align-items: center;
}
.contact-copy h2 { font-size: clamp(1.8rem, 3.2vw, 2.4rem); margin: var(--sp-2) 0 var(--sp-3); }
.contact-copy > p { max-width: 480px; margin-bottom: var(--sp-5); }

.contact-list { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.contact-list li { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.c-label { width: 90px; flex-shrink: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.c-value { font-weight: 600; font-size: .98rem; display: inline-flex; align-items: center; gap: 8px; }
.c-value.c-muted { color: var(--text-secondary); font-weight: 500; }
.copyable { border-bottom: 1px dashed var(--border-strong); padding-bottom: 2px; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.copyable:hover { color: var(--accent); border-color: var(--accent); }
.copy-ic { width: 14px; height: 14px; opacity: .6; }

.contact-cta-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

.contact-qr { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); }
.qr-frame {
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.qr-caption { font-size: .8rem; color: var(--text-muted); text-align: center; }

@media (max-width: 860px) {
  .contact-card { padding: var(--sp-5); text-align: left; }
}

/* ============================================================
   QUICK CONNECT — QR GRID
   ============================================================ */
.qr-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .qr-grid { grid-template-columns: 1fr; } }

.qr-card { padding: var(--sp-5); text-align: center; align-items: center; gap: var(--sp-4); }
.qr-card-head { display: flex; align-items: center; gap: var(--sp-3); text-align: left; width: 100%; }
.qr-card-title { font-size: 1.05rem; margin: 0 0 2px; }
.qr-card-desc { font-size: .85rem; color: var(--text-muted); margin: 0; }
.qr-card .qr-frame { padding: var(--sp-3); }
.qr-card .qr-frame img { display: block; width: 140px; height: 140px; border-radius: 4px; }
.qr-card-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; width: 100%; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: var(--sp-5) 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.footer-brand { font-weight: 800; }
.footer-brand .dot { color: var(--accent); }
.footer-copy { font-size: .85rem; }
.footer-right { display: flex; align-items: center; gap: var(--sp-4); }
.footer-version { font-size: .78rem; color: var(--text-muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: var(--radius-full); }
.back-to-top {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.back-to-top:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--accent); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--sp-5);
  transform: translate(-50%, 20px);
  background: var(--card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-full);
  font-size: .88rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
  z-index: 300;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   ICONS (inline via mask, single sprite-less approach)
   ============================================================ */
i[data-icon] { display: inline-block; width: 20px; height: 20px; line-height: 0; }
i[data-icon] svg { display: block; width: 100%; height: 100%; }

/* ============================================================
   LANGUAGE SWITCH BUTTON
   ============================================================ */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,.03);
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.lang-switch:hover { border-color: var(--accent); color: var(--text-primary); }
.lang-switch .lang-div { opacity: .4; }
.lang-switch .lang-opt { opacity: .5; transition: opacity var(--dur-fast) var(--ease); }
.lang-switch .lang-opt.is-active { opacity: 1; color: var(--accent); }
.lang-switch-mobile { width: 100%; justify-content: center; margin-top: var(--sp-3); }

/* ============================================================
   RTL SUPPORT
   Default reading direction is RTL (Persian); these rules
   correct components that don't auto-mirror via logical
   properties, and mirror LTR back when English is active.
   ============================================================ */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .hero-sub strong,
[dir="rtl"] .about-lead strong { font-weight: 700; }

/* Directional glyphs: mirror plain-text arrows that aren't part of the
   translated string itself (q-card arrows are static in the markup). */
[dir="rtl"] .q-arrow,
[dir="rtl"] .copy-arrow { transform: scaleX(-1); }

/* Numbers, URLs, emails, tech/brand names stay LTR even inside RTL flow */
[dir="rtl"] .c-value,
[dir="rtl"] .stack-chip,
[dir="rtl"] .tag,
[dir="rtl"] .qr-card-actions .btn,
[dir="rtl"] .footer-version {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] .contact-list .c-value { justify-content: flex-start; }

/* Nav / layout mirroring: flex and grid follow `direction` automatically;
   only fixed left/right offsets need explicit overrides. */
[dir="rtl"] .skip-link { right: var(--sp-3); left: auto; }
[dir="ltr"] .skip-link { left: var(--sp-3); right: auto; }

[dir="rtl"] .progress-bar { right: 0; left: auto; transform-origin: right; }
[dir="ltr"] .progress-bar { left: 0; right: auto; transform-origin: left; }

[dir="rtl"] .back-to-top svg { transform: none; }

/* Quote/label punctuation spacing reads better tightened in Persian */
[dir="rtl"] .c-label { letter-spacing: 0; }

@media (max-width: 640px) {
  .lang-switch { padding: 6px 10px; font-size: .72rem; }
}
