/* ============================================================
   Premium Portfolio — Vanilla CSS
   Palette: Dark + Indigo — #0B0F14 / #151B23 / #F8FAFC / #94A3B8 / #6366F1 / #818CF8 / #273244
   Fonts: Vazirmatn (Persian) + Inter (Latin) + JetBrains Mono (dates / tags / numbers)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Vazirmatn:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --primary: #6366f1;
  --secondary: #818cf8;
  --accent: #818cf8;
  --success: #22c55e;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;

  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
  --gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(129, 140, 248, 0.08));
  --gradient-text: linear-gradient(135deg, #6366f1, #818cf8);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 10px 25px -5px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 30px -10px rgba(99, 102, 241, 0.25), 0 20px 50px -20px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.25);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  --t-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);

  /* Bilingual font system — Latin + digits render in Inter,
     Persian glyphs automatically fall back to Vazirmatn */
  --font-fa: "Vazirmatn", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-latin: "Inter", var(--font-fa);
  --font-mono: "JetBrains Mono", var(--font-fa), ui-monospace, "SF Mono", Consolas, "Segoe UI Mono", monospace;
}

[data-theme="dark"] {
  --bg: #0b0f14;
  --surface: #151b23;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #273244;
  --gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(129, 140, 248, 0.12));
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.6), 0 0 40px rgba(99, 102, 241, 0.2);
}

/* Dark theme: small text/labels/links use the lighter indigo (#818CF8)
   for legibility on dark surfaces (#6366F1 stays for fills & accents) */
[data-theme="dark"] .eyebrow,
[data-theme="dark"] .tl-date,
[data-theme="dark"] .lang-switch,
[data-theme="dark"] .proj-link,
[data-theme="dark"] .cert-link,
[data-theme="dark"] .proj-tag,
[data-theme="dark"] .chip:hover,
[data-theme="dark"] .logo-card:hover {
  color: #818cf8;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-latin);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t-base), color var(--t-base);
  overflow-x: hidden;
}

/* ============================================================
   Bilingual typography (FA / EN)
   Persian is a connected script — any letter-spacing visibly
   breaks the letter joins, so Persian-carrying elements are
   reset to 0 tracking in RTL. English display type gets tight
   tracking in LTR for a premium, editorial feel.
   ============================================================ */

/* RTL: Persian text always tracks at 0 */
[dir="rtl"] .hero-title,
[dir="rtl"] .section-title,
[dir="rtl"] .eyebrow,
[dir="rtl"] .tl-date,
[dir="rtl"] .proj-tag,
[dir="rtl"] .bento-card h3,
[dir="rtl"] .contact-info h3 {
  letter-spacing: 0;
}

/* LTR: tighter tracking on English display type */
[dir="ltr"] .hero-role {
  letter-spacing: -0.01em;
}
[dir="ltr"] .tl-card h4,
[dir="ltr"] .proj-body h4 {
  letter-spacing: -0.02em;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 120px 0;
  position: relative;
}

@media (max-width: 768px) {
  section {
    padding: 80px 0;
  }
}

.section-head {
  text-align: center;
  margin-bottom: 64px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--gradient-soft);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--primary);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-primary);
}

.section-title {
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 900;
  line-height: 1.12;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
  margin: 0 auto;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: grid;
  place-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hide {
  opacity: 0;
  visibility: hidden;
}
.loader-ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Background decor ---------- */
.bg-orb {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
  animation: float 18s ease-in-out infinite;
}
.bg-orb.one {
  top: -200px;
  left: -200px;
  background: radial-gradient(circle, #6366f1, transparent 70%);
}
.bg-orb.two {
  bottom: -200px;
  right: -200px;
  background: radial-gradient(circle, #818cf8, transparent 70%);
  animation-delay: -9s;
}
[data-theme="dark"] .bg-orb {
  opacity: 0.2;
}
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(40px, -40px) scale(1.1);
  }
}

/* ---------- Navigation ---------- */
.nav {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1100px;
  background: color-mix(in oklab, var(--surface) 75%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 12px 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: box-shadow var(--t-base), top var(--t-base);
}
[dir="rtl"] .nav {
  padding: 10px 24px 10px 12px;
}
.nav.scrolled {
  box-shadow: var(--shadow-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  box-shadow: var(--shadow-glow);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--t-fast);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}
.nav-links a.active::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  border-radius: var(--radius-full);
  z-index: -1;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover {
  background: var(--gradient-soft);
  color: var(--text);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.lang-switch {
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-soft);
  color: var(--primary);
  transition: transform var(--t-fast);
}
.lang-switch:hover {
  transform: scale(1.05);
}

.nav-toggle {
  display: none;
}
@media (max-width: 880px) {
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open {
    display: flex;
    animation: fadeSlide 0.3s ease both;
  }
  .nav-links a {
    padding: 12px 16px;
  }
  .nav-toggle {
    display: grid;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 180px 0 100px;
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.4;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.hero-title {
  font-size: clamp(32px, 5.5vw, 68px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.hero-title .line {
  display: block;
  overflow: visible;
}
.hero-role {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--muted);
  margin: 0 0 24px;
  font-weight: 600;
}
.hero-bio {
  font-size: 17px;
  color: var(--muted);
  max-width: 540px;
  margin: 0 0 36px;
}
@media (max-width: 900px) {
  .hero-bio {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
@media (max-width: 900px) {
  .hero-cta {
    justify-content: center;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.5);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(99, 102, 241, 0.65);
}
.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-socials {
  display: flex;
  gap: 10px;
}
@media (max-width: 900px) {
  .hero-socials {
    justify-content: center;
  }
}
.social-link {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: all var(--t-fast);
}
.social-link svg {
  width: 18px;
  height: 18px;
}
.social-link:hover {
  color: #fff;
  background: var(--gradient-primary);
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: var(--shadow-glow);
}

/* Hero portrait */
.hero-portrait {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1;
  margin: 0 auto;
}
.portrait-frame {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: var(--gradient-primary);
  padding: 3px;
  animation: floatY 6s ease-in-out infinite;
  box-shadow: var(--shadow-lg);
}
.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: var(--radius-xl);
  background: var(--gradient-soft);
  z-index: -1;
  filter: blur(40px);
}
.portrait-inner {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-xl) - 3px);
  background: linear-gradient(180deg, #eef2ff 0%, #e0e7ff 100%);
  display: grid;
  place-items: center;
  font-size: 160px;
  font-weight: 800;
  color: var(--primary);
  overflow: hidden;
  letter-spacing: -0.05em;
}
.portrait-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.portrait-chip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: floatY 5s ease-in-out infinite;
}
.portrait-chip.one {
  top: 10%;
  left: -10%;
}
.portrait-chip.two {
  bottom: 12%;
  right: -8%;
  animation-delay: -2.5s;
}
[dir="rtl"] .portrait-chip.one {
  left: auto;
  right: -10%;
}
[dir="rtl"] .portrait-chip.two {
  right: auto;
  left: -8%;
}
.chip-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
}
.chip-icon.purple {
  background: var(--gradient-primary);
}
.chip-icon.amber {
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
}
.chip-icon svg {
  width: 16px;
  height: 16px;
}
.chip-meta small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

@keyframes floatY {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

/* Hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 80px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
@media (max-width: 700px) {
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stat {
  text-align: center;
}
.stat-num {
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.stat-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-top: 6px;
}

/* ---------- About — Bento ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: minmax(170px, auto);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
}
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  min-height: 170px;
  transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
}
.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
}
.bento-card.b1 {
  grid-column: span 4;
  grid-row: span 2;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
}
.bento-card.b2 {
  grid-column: span 2;
}
.bento-card.b3 {
  grid-column: span 2;
}
.bento-card.b4 {
  grid-column: span 3;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  border: none;
  color: #0f172a;
}
.bento-card.b5 {
  grid-column: span 3;
}
@media (max-width: 900px) {
  .bento-card.b1,
  .bento-card.b2,
  .bento-card.b3,
  .bento-card.b4,
  .bento-card.b5 {
    grid-column: span 2;
    grid-row: auto;
  }
}
.bento-card h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.bento-card p {
  margin: 0;
  color: inherit;
  opacity: 0.92;
  overflow-wrap: anywhere;
}
.bento-card.b1 h3 {
  font-size: 28px;
}
.bento-card .big-num {
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -0.03em;
}
.bento-card.b2 .big-num,
.bento-card.b3 .big-num,
.bento-card.b5 .big-num {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bento-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.bento-icon svg {
  width: 22px;
  height: 22px;
}

/* ---------- Experience Timeline ---------- */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 0;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  inset-inline-start: 24px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  opacity: 0.4;
}
@media (min-width: 800px) {
  .timeline::before {
    inset-inline-start: auto; /* clear the mobile inset-inline-start */
    left: 50%; /* physical left: identical centering in LTR and RTL */
    transform: translateX(-50%);
  }
}
.tl-item {
  position: relative;
  margin-bottom: 32px;
  padding-inline-start: 64px;
}
@media (min-width: 800px) {
  .tl-item {
    width: 50%;
    padding-inline-start: 48px;
  }
  /* nth-of-type: .tl-dot divs are direct siblings now and must be ignored */
  .tl-item:nth-of-type(even) {
    margin-inline-start: 50%;
  }
  .tl-item:nth-of-type(odd) {
    padding-inline-start: 0;
    padding-inline-end: 48px;
    text-align: end;
  }
}
.tl-dot {
  position: absolute;
  top: 0; /* set to its entry's top + 22px by positionTimelineDots() */
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 6px var(--border);
  inset-inline-start: 17px;
  transition: top 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 800px) {
  .tl-dot {
    inset-inline-start: auto;
    left: 50%; /* physical left: identical centering in LTR and RTL */
    transform: translateX(-50%);
  }
}
.tl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--t-base);
}
.tl-card:hover {
  border-color: color-mix(in oklab, var(--primary) 30%, var(--border));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tl-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  background: var(--gradient-soft);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}
.tl-card h4 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}
.tl-org {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 12px;
}
.tl-card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--t-base);
}
.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--primary) 25%, var(--border));
}
.skill-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gradient-soft);
  display: grid;
  place-items: center;
  color: var(--primary);
}
.skill-icon svg {
  width: 22px;
  height: 22px;
}
.skill-card h4 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: all var(--t-fast);
}
.chip:hover {
  background: var(--gradient-soft);
  border-color: transparent;
  color: var(--primary);
  transform: translateY(-1px);
}

/* ---------- Bug Bounty ---------- */
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.logo-card {
  aspect-ratio: 2/1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--muted);
  transition: all var(--t-base);
  position: relative;
  overflow: hidden;
}
.logo-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gradient-soft);
  opacity: 0;
  transition: opacity var(--t-base);
}
.logo-card:hover {
  color: var(--primary);
  border-color: transparent;
  transform: translateY(-3px) scale(1.02);
  box-shadow: var(--shadow-lg);
}
.logo-card:hover::before {
  opacity: 1;
}
.logo-card span {
  position: relative;
  z-index: 1;
}

/* ---------- Projects ---------- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--t-base);
}
.proj-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--primary) 25%, var(--border));
}
.proj-thumb {
  aspect-ratio: 16/9;
  background: var(--gradient-primary);
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
}
.proj-thumb.alt-1 {
  background: linear-gradient(135deg, #6366f1, #818cf8);
}
.proj-thumb.alt-2 {
  background: linear-gradient(135deg, #818cf8, #a5b4fc);
}
.proj-thumb.alt-3 {
  background: linear-gradient(135deg, #a5b4fc, #6366f1);
}
.proj-thumb.alt-4 {
  background: linear-gradient(135deg, #6366f1, #a5b4fc);
}
.proj-thumb svg {
  width: 64px;
  height: 64px;
  opacity: 0.85;
}
.proj-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 60%);
}
.proj-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.proj-body h4 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
}
.proj-desc {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
  flex: 1;
}
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.proj-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--gradient-soft);
  color: var(--primary);
}
.proj-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.proj-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  transition: gap var(--t-fast);
}
.proj-link:hover {
  gap: 10px;
}
.proj-link svg {
  width: 14px;
  height: 14px;
}

/* ---------- Certifications ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.cert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: all var(--t-base);
}
.cert-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in oklab, var(--accent) 30%, var(--border));
}
.cert-badge {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.6);
}
.cert-badge svg {
  width: 28px;
  height: 28px;
}
.cert-card h4 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}
.cert-issuer {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  margin: 0 0 10px;
}
.cert-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ---------- Soft Skills ---------- */
.soft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.soft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  transition: all var(--t-base);
}
.soft-card:hover {
  transform: translateY(-4px);
  border-color: transparent;
  background: var(--gradient-soft);
}
.soft-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--gradient-primary);
  display: grid;
  place-items: center;
  color: #fff;
  margin: 0 auto 16px;
}
.soft-icon svg {
  width: 26px;
  height: 26px;
}
.soft-card h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.soft-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Contact ---------- */
.contact-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.contact-wrap::before {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: var(--gradient-primary);
  filter: blur(80px);
  opacity: 0.15;
  border-radius: 50%;
}
@media (max-width: 800px) {
  .contact-wrap {
    grid-template-columns: 1fr;
    padding: 36px 24px;
    gap: 32px;
  }
}
.contact-info h3 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.contact-info p {
  color: var(--muted);
  margin: 0 0 28px;
}
.contact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.contact-list li {
  display: flex;
  align-items: center;
  gap: 14px;
}
.contact-list .icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gradient-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.contact-list svg {
  width: 18px;
  height: 18px;
}
.contact-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.contact-list strong {
  font-weight: 600;
  font-size: 14.5px;
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  color: var(--text);
  transition: border var(--t-fast), box-shadow var(--t-fast);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 48px 0 32px;
  background: var(--surface);
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
}
.footer-socials {
  display: flex;
  gap: 8px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.footer-bottom .heart {
  color: var(--accent);
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--t-base);
}
[dir="ltr"] .to-top {
  right: 24px;
}
[dir="rtl"] .to-top {
  left: 24px;
}
.to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  transform: translateY(-4px);
}
.to-top svg {
  width: 20px;
  height: 20px;
}

/* ---------- Reveal Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* RTL flips for arrow icons */
[dir="rtl"] .flip-x {
  transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}