/* =========================================================
   Afshin Tavakkoli — Product & UX Designer Portfolio
   Design system: "Live Canvas"
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg:        #0B0C13;
  --bg-elev:   #13141E;
  --panel:     rgba(255,255,255,0.035);
  --panel-solid: #15161F;
  --ink:       #F3F2EF;
  --ink-soft:  #9C9DAA;
  --ink-faint: #5D5E6B;
  --line:      rgba(255,255,255,0.09);
  --line-strong: rgba(255,255,255,0.18);

  --accent:      #8B6BFF;  /* electric violet */
  --accent-ink:  #C6B8FF;
  --accent-2:    #FF8A63;  /* warm coral */
  --metric:      #5EEAD4;  /* mint */

  --f-display: 'Space Grotesk', sans-serif;
  --f-body:    'Inter', sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  --container: 1180px;
  --gap: 22px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }
p:last-child { margin-bottom: 0; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
}
@media (max-width: 640px) { .container { padding: 0 20px; } }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ================= AMBIENT LAYERS ================= */

.canvas-dots {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 40%, transparent 100%);
}

.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--mx, 50%) var(--my, 20%),
              rgba(139,107,255,0.16), transparent 65%);
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb { position: absolute; border-radius: 50%; filter: blur(90px); z-index: 0; pointer-events: none; opacity: 0.28; }
.orb-1 { width: 460px; height: 460px; background: var(--accent); top: -120px; left: -80px; animation: drift1 26s ease-in-out infinite alternate; }
.orb-2 { width: 380px; height: 380px; background: var(--accent-2); top: 60px; right: -100px; animation: drift2 22s ease-in-out infinite alternate; }
.orb-3 { width: 320px; height: 320px; background: var(--metric); bottom: -140px; left: 30%; opacity: 0.16; animation: drift1 30s ease-in-out infinite alternate; }

@keyframes drift1 { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,30px) scale(1.08); } }
@keyframes drift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-30px,40px) scale(0.95); } }

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

.spec-label {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: 0.02em;
  color: var(--ink-soft);
}
.spec-label::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.spec-label.warm::before { background: var(--accent-2); }
.spec-label.metric::before { background: var(--metric); }

/* ---- marquee-select reveal ---- */
.marquee { opacity: 0; transform: translateY(14px); position: relative; }
.marquee.is-visible { animation: marqueeIn 0.6s cubic-bezier(0.16,1,0.3,1) forwards; }
.marquee::after {
  content: ""; position: absolute; inset: -10px;
  border: 1px dashed var(--accent); border-radius: 6px; opacity: 0; pointer-events: none;
}
.marquee.is-visible::after { animation: marqueeBox 1.1s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes marqueeIn { to { opacity: 1; transform: translateY(0); } }
@keyframes marqueeBox {
  0%   { opacity: 0; inset: 2px; }
  30%  { opacity: 0.9; inset: -10px; }
  70%  { opacity: 0.9; inset: -10px; }
  100% { opacity: 0; inset: -14px; }
}
.marquee::before {
  content: attr(data-tag);
  position: absolute; top: -28px; left: -10px;
  font-family: var(--f-mono); font-size: 10.5px; color: var(--bg);
  background: var(--accent); padding: 3px 7px; border-radius: 4px;
  opacity: 0; white-space: nowrap;
}
.marquee.is-visible::before { animation: marqueeTag 1.1s cubic-bezier(0.16,1,0.3,1) forwards; }
@keyframes marqueeTag {
  0%   { opacity: 0; transform: translateY(4px); }
  25%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-4px); }
}

/* ================= HEADER / NAV ================= */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(11,12,19,0.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

.logo-wrapper .logo {
  margin-bottom: 0px;
}

.site-logo-link { display: flex; align-items: center; }
.site-logo-header { height: 36px; width: auto; display: block; filter: brightness(1.1); }
.logo { font-family: var(--f-mono); font-size: 19px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.logo .dot { color: var(--accent); }
.nav-links { display: flex; gap: 32px; font-family: var(--f-mono); font-size: 13px; text-transform: lowercase; }
.nav-links a { color: var(--ink-soft); position: relative; padding: 4px 0; transition: color 0.15s; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a:hover::after, .nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; background: var(--accent); }
.header-right-cta { display: flex; align-items: center; }
.nav-cta { font-family: var(--f-mono); font-size: 13px; border: 1.5px solid var(--accent); padding: 8px 22px; border-radius: 6px; background: transparent; color: var(--ink); transition: background 0.15s, transform 0.15s, box-shadow 0.15s; }
.nav-cta:hover { background: var(--accent); color: #0B0C13; box-shadow: 0 4px 16px rgba(139,107,255,0.3); transform: translateY(-1px); }

/* Standard Burger Icon */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex-direction: column; gap: 6px; width: 36px; height: 36px; justify-content: center; }
.nav-toggle .bar { width: 22px; height: 2px; background-color: var(--ink); border-radius: 2px; transition: all 0.2s ease-in-out; }
.nav-toggle.is-active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active .bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .header-right-cta { display: none; }
  .nav-links.is-open {
    display: flex; flex-direction: column; gap: 18px;
    position: absolute; top: 68px; left: 0; right: 0;
    background: rgba(11,12,19,0.96); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 24px 32px;
    z-index: 99;
  }
  .nav-toggle { display: flex; }
}

/* ================= HERO ================= */
.hero { position: relative; padding: 76px 0 84px; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; }
.hero-eyebrow { margin-bottom: 30px; font-size: 13.5px; text-transform: none; }
.hero h1 { font-size: clamp(38px, 5.6vw, 70px); max-width: 16ch; margin-bottom: 28px; }
.hero h1 em { font-style: normal; color: transparent; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; }
.hero-sub { font-size: 19px; color: var(--ink-soft); max-width: 58ch; margin-bottom: 40px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 40px; }
.hero-meta .item { display: flex; flex-direction: column; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; backdrop-filter: blur(6px); }
.hero-meta .k { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }
.hero-meta .v { font-size: 14.5px; font-weight: 500; }
.hero-actions { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }

@media (max-width: 640px) {
  .hero { padding: 28px 0 44px; }
  .hero-eyebrow { margin-bottom: 18px; }
  .hero h1 { margin-bottom: 16px; }
  .hero-sub { font-size: 14.5px !important; margin-bottom: 22px; } /* Slightly smaller for mobile reading ease */
  .hero-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 28px; }
  .hero-meta .item { padding: 10px 12px; }
  .hero-meta .k { font-size: 9.5px; }
  .hero-meta .v { font-size: 13px; }
  .btn-wide { width: auto; }
}

.btn { font-family: var(--f-mono); font-size: 13px; padding: 14px 26px; border-radius: 8px; display: inline-flex; align-items: center; gap: 8px; transition: transform 0.15s, box-shadow 0.15s, background 0.15s; }
.btn-primary { background: linear-gradient(100deg, var(--accent), #6C4CFF); color: #fff; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -8px rgba(139,107,255,0.55); }
.btn-wide { padding: 16px 44px; font-size: 13.5px; }
.btn-text { color: var(--ink-soft); border-bottom: 1px solid var(--line-strong); padding: 4px 0; }
.btn-text:hover { color: var(--ink); border-color: var(--ink); }

.dim-divider { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-family: var(--f-mono); font-size: 11px; margin: 0 auto; max-width: var(--container); padding: 0 32px; }
.dim-divider::before, .dim-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ================= SECTIONS ================= */
.section { padding: 96px 0; position: relative; }
.section-alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02) 15%, rgba(255,255,255,0.02) 85%, transparent); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 52px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(27px, 3vw, 38px); }
.section-head .note { color: var(--ink-soft); max-width: 46ch; font-size: 15px; }

/* ================= WORK GRID ================= */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 980px) { .work-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .work-grid { grid-template-columns: 1fr; } }

.work-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; backdrop-filter: blur(8px);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; position: relative;
}
.work-card:hover { border-color: rgba(139,107,255,0.5); transform: translateY(-4px); box-shadow: 0 20px 44px -20px rgba(139,107,255,0.35); }
.work-card::before, .work-card::after { content: ""; position: absolute; width: 8px; height: 8px; border: 1.5px solid var(--accent); background: var(--bg); opacity: 0; transition: opacity 0.2s; z-index: 3; }
.work-card::before { top: -4px; left: -4px; }
.work-card::after { bottom: -4px; right: -4px; }
.work-card:hover::before, .work-card:hover::after { opacity: 1; }

.work-thumb {
  aspect-ratio: 16/10;
  background-color: transparent;
  background-image:
    linear-gradient(135deg, rgba(139,107,255,0.14), rgba(255,138,99,0.08)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 160'%3E%3Crect x='10' y='10' width='220' height='140' rx='10' fill='none' stroke='%238B6BFF' stroke-opacity='0.4' stroke-width='2'/%3E%3Ccircle cx='24' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.4'/%3E%3Ccircle cx='34' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.4'/%3E%3Ccircle cx='44' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.4'/%3E%3Cline x1='10' y1='36' x2='230' y2='36' stroke='%238B6BFF' stroke-opacity='0.25' stroke-width='1'/%3E%3Crect x='24' y='52' width='90' height='60' rx='4' fill='%23FF8A63' fill-opacity='0.14' stroke='%23FF8A63' stroke-opacity='0.35' stroke-width='1.5'/%3E%3Crect x='126' y='52' width='90' height='14' rx='3' fill='%238B6BFF' fill-opacity='0.3'/%3E%3Crect x='126' y='72' width='90' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.18'/%3E%3Crect x='126' y='86' width='70' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.18'/%3E%3Crect x='126' y='100' width='50' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.18'/%3E%3Crect x='24' y='124' width='60' height='10' rx='5' fill='%235EEAD4' fill-opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;
  background-size: cover, 58% auto;
  position: relative;
  display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid var(--line);
}
.work-thumb .placeholder-note {
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-faint); text-align: center;
  padding: 6px 12px; margin: 12px; background: rgba(11,12,19,0.6); border-radius: 20px; border: 1px solid var(--line);
}

.work-body { padding: 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.work-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-family: var(--f-mono); font-size: 11px; color: var(--ink-soft); border: 1px solid var(--line-strong); padding: 3px 10px; border-radius: 20px; }
.work-body h3 { font-size: 21px; color: var(--ink); }
.work-body p { font-size: 14.5px; }
.work-result { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--f-mono); font-size: 12.5px; color: var(--metric); }

/* ================= ABOUT GRID (UPDATED) ================= */
.about-grid-updated { display: grid; grid-template-columns: 180px 1fr; gap: 48px; align-items: start; }
@media (max-width: 820px) { .about-grid-updated { grid-template-columns: 1fr; gap: 40px; } }

.about-photo-column { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.about-photo.large-photo {
  width: 260px; height: 260px; object-fit: cover; flex: none;
  border-radius: 42% 58% 63% 37% / 45% 38% 62% 55%;
  border: 1.5px solid var(--accent);
}

.about-copy p { font-size: 16.5px; }
.about-copy p:first-child { color: var(--ink); font-size: 19px; }

/* REPLACED TIMELINE -> ADDITIONAL EXPERIENCES CARDS */
.additional-exp-section { margin-top: 32px; }
.additional-exp-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.exp-card-clickable { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 20px; transition: border-color 0.15s, transform 0.15s; }
.exp-card-clickable:hover { border-color: var(--accent); transform: translateX(3px); }
.exp-role { font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--ink); }
.exp-details { font-size: 13px; color: var(--ink-soft); }

/* ================= TIMELINE / PROCESS TABLE ================= */
.timeline { display: flex; flex-direction: column; width: 100%; }
.timeline-item { display: grid; grid-template-columns: 100px 1fr; gap: 16px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.timeline-item:first-child { padding-top: 0; }
.timeline-item .yr { font-family: var(--f-mono); font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.timeline-bullet { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.role-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
} /* این بسته شده؟ */

.role-row .loc-tag {
  margin-left: 0;
} /* این بسته شده؟ */

.expandable-row .role-row {
  display: grid;
  grid-template-columns: 1fr auto 20px;
  align-items: center;
  gap: 10px;
  width: 100%;
} 
/*
.role { font-weight: 600; font-size: 15px; color: var(--ink); }
.org { font-size: 13.5px; color: var(--ink-soft); }
.loc-tag { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); text-transform: uppercase; border: 1px solid var(--line); padding: 2px 8px; border-radius: 4px; }

/* Interactive Expandable Timelines */
.expandable-row { cursor: pointer; transition: background 0.15s; }
.expandable-row:hover { background: rgba(255,255,255,0.015); }
.expand-arrow { font-size: 10px; color: var(--accent); transition: transform 0.2s; }
.expand-content { display: none; margin-top: 12px; padding: 10px 14px; background: rgba(139,107,255,0.03); border-radius: 6px; border: 1px solid var(--line); }
.expand-content ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.expand-content li { font-size: 13px; color: var(--ink-soft); position: relative; padding-left: 14px; }
.expand-content li::before { content: "—"; position: absolute; left: 0; color: var(--accent-2); }
.expandable-row.is-expanded .expand-arrow { transform: rotate(180deg); }
.expandable-row.is-expanded .expand-content { display: block; }

/* ================= EDUCATION CARDS ================= */
.education-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
@media (max-width: 760px) { .education-grid { grid-template-columns: 1fr; } }
.education-card { display: flex; gap: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(8px); }
.edu-icon-wrapper { width: 44px; height: 44px; border-radius: 8px; background: rgba(255,255,255,0.04); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid var(--line); }
.edu-svg-icon { width: 22px; height: 22px; color: var(--accent); }
.google-icon { width: 20px; height: 20px; }
.idf-logo-box { font-family: var(--f-mono); font-weight: 700; font-size: 11px; color: #fff; background: #002244; padding: 2px 6px; border-radius: 4px; }
.edu-info { display: flex; flex-direction: column; }
.edu-info h3 { font-size: 16px; margin: 6px 0 2px; color: var(--ink); }
.edu-info .school { font-size: 13px; color: var(--ink-soft); }

/* ================= SKILLS ================= */
.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
@media (max-width: 900px) { .skills-grid { grid-template-columns: repeat(2, 1fr); } }
.skill-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; backdrop-filter: blur(8px); }
.skill-group .spec-label { margin-bottom: 16px; }
.skill-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.skill-group li { font-size: 14.5px; color: var(--ink-soft); position: relative; padding-left: 14px; }
.skill-group li::before { content: "—"; position: absolute; left: 0; color: var(--ink-faint); }

/* ================= CONTACT / FOOTER ================= */
.contact-section { padding: 104px 0; }
.contact-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.contact-inner h2 { font-size: clamp(30px, 4.5vw, 54px); max-width: 14ch; }
.contact-links { display: flex; flex-direction: column; gap: 12px; font-family: var(--f-mono); font-size: 15px; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-soft); background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; backdrop-filter: blur(6px);
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.contact-row:hover { color: var(--ink); border-color: rgba(139,107,255,0.5); transform: translateX(3px); }
.c-icon { width: 20px; height: 20px; flex: none; color: var(--accent-ink); display: flex; }
.c-icon svg { width: 100%; height: 100%; }

.site-footer { border-top: 1px solid var(--line); padding: 26px 0; font-family: var(--f-mono); font-size: 12px; color: var(--ink-faint); }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* CASE STUDY BRAND HEADER */
.brand-link-header { display: flex; align-items: center; gap: 16px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 24px 0; }
.brand-logo-img { height: 40px; width: auto; object-fit: contain; }
.brand-details { display: flex; flex-direction: column; }
.brand-url-btn { font-family: var(--f-mono); font-size: 12.5px; color: var(--accent); border-bottom: 1px dashed var(--accent); width: fit-content; transition: color 0.1s; }
.brand-url-btn:hover { color: var(--ink); border-color: var(--ink); }

/* ================= CASE STUDY PAGES ================= */
.cs-hero { position: relative; overflow: hidden; padding: 68px 0 60px; border-bottom: 1px solid var(--line); }
.cs-back { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 34px; transition: color 0.15s; }
.cs-back:hover { color: var(--ink); }
.cs-hero h1 { font-size: clamp(30px, 4.2vw, 48px); max-width: 22ch; margin-bottom: 20px; }
.cs-hero .role { font-size: 17px; color: var(--ink-soft); max-width: 60ch; margin-bottom: 34px; }

.cs-meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 28px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { .cs-meta-grid { grid-template-columns: repeat(2, 1fr); } }
.cs-meta-grid .k { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 6px; }
.cs-meta-grid .v { font-size: 14.5px; font-weight: 500; color: var(--ink); }

.cs-section { padding: 68px 0; border-bottom: 1px solid var(--line); }
.cs-section:last-of-type { border-bottom: none; }
.cs-section-label { margin-bottom: 20px; }
.cs-section h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 22px; max-width: 30ch; color: var(--ink); }
.cs-body { max-width: 68ch; }
.cs-body p { font-size: 16px; margin-bottom: 16px; }
.cs-body ul { padding-left: 20px; color: var(--ink-soft); font-size: 16px; }
.cs-body li { margin-bottom: 8px; }

.cs-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; }
@media (max-width: 760px) { .cs-columns { grid-template-columns: 1fr; } }

.artifact-slot {
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background-color: var(--panel-solid);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 160'%3E%3Crect x='10' y='10' width='220' height='140' rx='10' fill='none' stroke='%238B6BFF' stroke-opacity='0.35' stroke-width='2'/%3E%3Ccircle cx='24' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.35'/%3E%3Ccircle cx='34' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.35'/%3E%3Ccircle cx='44' cy='24' r='3' fill='%238B6BFF' fill-opacity='0.35'/%3E%3Cline x1='10' y1='36' x2='230' y2='36' stroke='%238B6BFF' stroke-opacity='0.22' stroke-width='1'/%3E%3Crect x='24' y='52' width='90' height='60' rx='4' fill='%23FF8A63' fill-opacity='0.1' stroke='%23FF8A63' stroke-opacity='0.28' stroke-width='1.5'/%3E%3Crect x='126' y='52' width='90' height='14' rx='3' fill='%238B6BFF' fill-opacity='0.22'/%3E%3Crect x='126' y='72' width='90' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.14'/%3E%3Crect x='126' y='86' width='70' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.14'/%3E%3Crect x='126' y='100' width='50' height='8' rx='3' fill='%238B6BFF' fill-opacity='0.14'/%3E%3Crect x='24' y='124' width='60' height='10' rx='5' fill='%235EEAD4' fill-opacity='0.22'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 46% auto;
  backdrop-filter: blur(6px);
  aspect-ratio: 16/10;
  display: flex; align-items: flex-end; justify-content: center;
  text-align: center; padding: 18px; margin: 24px 0;
}
.artifact-slot .in {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(11,12,19,0.65); padding: 8px 14px; border-radius: 20px; border: 1px solid var(--line);
}
.artifact-slot .in .tag-pending { font-size: 10.5px; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.08em; }

.decision-list { display: flex; flex-direction: column; gap: 18px; }
.decision-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; backdrop-filter: blur(6px); }
.decision-item .q { font-family: var(--f-mono); font-size: 12px; color: var(--accent-2); margin-bottom: 8px; text-transform: lowercase; }
.decision-item p { font-size: 15px; }

.outcome-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
@media (max-width: 700px) { .outcome-stats { grid-template-columns: 1fr; } }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; background: var(--panel); backdrop-filter: blur(6px); }
.stat .num { font-family: var(--f-display); font-size: 40px; color: var(--metric); margin-bottom: 8px; }
.stat .label { font-size: 13.5px; color: var(--ink-soft); }

.cs-nav { display: flex; justify-content: space-between; padding: 44px 0; }
.cs-nav a { font-family: var(--f-mono); font-size: 13px; color: var(--ink-soft); transition: color 0.15s; }
.cs-nav a:hover { color: var(--ink); }
.cs-nav .next { text-align: right; }

/* ---- process stepper ---- */
.process-stepper-wrap { padding: 36px 0 4px; }
.process-stepper {
  display: flex;
  position: relative;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.process-stepper::-webkit-scrollbar { display: none; }
.process-stepper::before {
  content: "";
  position: absolute;
  top: 5px; left: 4px; right: 4px;
  height: 1px;
  background: var(--line-strong);
  z-index: 0;
}
.process-stepper .step {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  flex: 1 1 0; min-width: 92px;
}
.process-stepper .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line-strong); transition: background 0.2s, border-color 0.2s; }
.process-stepper .step.done .dot { background: var(--metric); border-color: var(--metric); }
.process-stepper .label { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); text-align: center; white-space: nowrap; }
.process-stepper .step.done .label { color: var(--ink-soft); }

/* MOBILE RE-ALIGNMENTS */
@media (max-width: 640px) {
  .contact-inner { flex-direction: column; align-items: stretch; gap: 24px; }
  /* Make the Chips sit below CTA with tighter gaps */
  .contact-links { order: 2; gap: 8px; margin-top: 12px; }
  .contact-row { padding: 10px 14px; font-size: 13px; }
  .contact-inner h2 { order: 1; margin: 0; }
}
.country-name {
  display: block;
  text-align: center;
  width: 100%;
}
.portfolio-logo {
    height: 48px; /* ابعاد هماهنگ و استاندارد برای هدر نمونه کارها */
    width: auto;
    object-fit: contain;
}
.work-thumb {
  overflow: hidden; /* جلوگیری از بیرون زدن لبه‌های عکس */
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-logo {
  width: 100%;
  height: 100%;
  object-fit: cover; /* عکس کل کادر مستطیل را به زیبایی پر می‌کند */
}
/* جابه‌جایی دکمه و جدول مشخصات به صورت اصولی */
.hero-inner {
  display: flex;
  flex-direction: column;
}

.hero-actions {
  order: 1; /* دکمه اولویت اول می‌شود و بالا می‌رود */
  margin-bottom: 40px; /* ایجاد فاصله مناسب با مشخصات زیرین */
}

.hero-meta {
  order: 2; /* مشخصات اولویت دوم می‌شوند و پایین می‌آیند */
}
.artifact-slot {
    overflow: hidden;
    padding: 0;
}

.artifact-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.artifact-slot a{
    display:block;
    width:100%;
    height:100%;
}

.artifact-slot img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform .3s ease;
    cursor:zoom-in;
}

.artifact-slot:hover img{
    transform:scale(1.03);
}
.process-label{
    margin-bottom:24px;
}
.cs-body ul {
    margin: 18px 0;
    padding-left: 24px;
}

.cs-body li {
    margin-bottom: 10px;
    line-height: 1.7;
}
header .logo-wrapper {
  display: flex !important;
  align-items: flex-end !important;
  gap: 20px !important;
}

header .logo-wrapper .logo {
  margin-bottom: 2px !important;
}
.section-head, .work-header, .skills-header, .education-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 12px !important;
}
/* اصلاح و بازگرداندن استایل کادر نام کشورها به حالت اولیه */
.loc-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-family: var(--f-mono) !important;
  font-size: 11px !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  color: var(--ink-soft) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  width: 110px !important; /* اندازه ثابت برای وسط‌چین ماندن دقیق */
  text-align: center !important;
  margin: 0 auto !important;
}

/* تراز کردن ردیف‌های بخش تجربیات برای جلوگیری از چسبیدن به چپ و راست */
.role-row {
  display: grid !important;
  grid-template-columns: 1fr 110px 20px !important;
  align-items: center !important;
  gap: 16px !important;
  width: 100% !important;
}

/* برای ردیف‌هایی که فلش بازشو ندارند، یک فضای خالی فرضی در سمت راست می‌گذاریم تا کشورها تکان نخورند */
.role-row:not(:has(.expand-arrow)) {
  grid-template-columns: 1fr 110px 20px !important;
}