/* ============================================================
   TOKENS
   ============================================================ */
:root{
  --bg:#0c0d11;
  --bg-elevated:#15171d;
  --bg-elevated-2:#1b1e26;
  --border:#272a33;
  --border-soft:#1e2128;
  --text:#e9eaee;
  --text-dim:#9296a3;
  --text-faint:#5d6170;
  --cyan:#5fe6cf;
  --purple:#a78bfa;
  --amber:#f3b766;
  --rose:#f08389;
  --shadow: 0 20px 60px rgba(0,0,0,0.45);
  --radius-s:8px;
  --radius-m:14px;
  --radius-l:22px;
  --font-display:'Space Grotesk', sans-serif;
  --font-body:'Inter', sans-serif;
  --font-mono:'JetBrains Mono', monospace;
  --font-fa:'Vazirmatn', 'Inter', sans-serif;
  --transition: 0.25s cubic-bezier(.4,0,.2,1);
}
html[data-theme="light"]{
  --bg:#f6f6f3;
  --bg-elevated:#ffffff;
  --bg-elevated-2:#f0f0ec;
  --border:#e1e1da;
  --border-soft:#ebebe5;
  --text:#16171b;
  --text-dim:#5a5d68;
  --text-faint:#9a9da7;
  --cyan:#0e9c87;
  --purple:#7c5cf0;
  --amber:#c8791f;
  --rose:#d14a52;
  --shadow: 0 20px 50px rgba(20,20,15,0.08);
}

*{box-sizing:border-box; margin:0; padding:0;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg); color:var(--text); font-family:var(--font-body); line-height:1.6;
  -webkit-font-smoothing:antialiased; transition:background var(--transition), color var(--transition);
  overflow-x:hidden;
}
::selection{ background:var(--cyan); color:#0c0d11; }
img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
button{font-family:inherit; cursor:pointer;}
ul{list-style:none;}

/* ---- RTL (Persian) ---- */
html[lang="fa"] body{ font-family:var(--font-fa); }
html[dir="rtl"] .term-body,
html[dir="rtl"] .eyebrow,
html[dir="rtl"] .logo,
html[dir="rtl"] .nav-links a .tag,
html[dir="rtl"] .lang-btn,
html[dir="rtl"] .p-meta-item,
html[dir="rtl"] .step-tag,
html[dir="rtl"] .repo-line,
html[dir="rtl"] .footer-inner p,
html[dir="rtl"] .form-note,
html[dir="rtl"] .cert-hero-meta,
html[dir="rtl"] .cert-code{ direction:ltr; unicode-bidi:isolate; }
html[dir="rtl"] .eyebrow{ display:inline-flex; }
html[dir="rtl"]{ direction:rtl; }
html[dir="rtl"] .btn svg,
html[dir="rtl"] .back-link svg,
html[dir="rtl"] .cert-link svg{ transform:scaleX(-1); }

.container{
  max-width:1180px;
  margin:0 auto;
  padding:0 32px;
}
.eyebrow{
  font-family:var(--font-mono);
  font-size:13px;
  color:var(--cyan);
  letter-spacing:0.02em;
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:14px;
}
.eyebrow::before{content:"//"; color:var(--text-faint);}
h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:-0.01em;
}
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3, html[lang="fa"] h4{
  font-family:var(--font-fa); font-weight:700;
}
section{ padding:120px 0; border-bottom:1px solid var(--border-soft); }
section:last-of-type{ border-bottom:none; }
.section-head{ margin-bottom:56px; max-width:640px; }
.section-head h2{ font-size:clamp(28px,4vw,40px); }
.section-head p{ color:var(--text-dim); margin-top:12px; font-size:16px; }

/* ============================================================
   NAV
   ============================================================ */
header{
  position:fixed; top:0; left:0; right:0; z-index:500;
  background:rgba(12,13,17,0.78);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  isolation:isolate;
  border-bottom:1px solid var(--border-soft);
  transition:background var(--transition), border-color var(--transition);
}
html[data-theme="light"] header{ background:rgba(246,246,243,0.82); }
.nav-inner{
  display:flex; align-items:center; justify-content:space-between;
  height:68px; max-width:1180px; margin:0 auto; padding:0 32px;
}
.logo{
  font-family:var(--font-mono); font-weight:600; font-size:16px;
  display:flex; align-items:center; gap:6px;
}
.logo .cursor{
  width:9px; height:18px; background:var(--cyan);
  animation:blink 1.1s steps(2) infinite; border-radius:1px;
}
@keyframes blink{ 50%{ opacity:0; } }
.logo .dim{ color:var(--text-faint); }

.nav-links{ display:flex; align-items:center; gap:4px; }
.nav-links a{
  font-family:var(--font-mono); font-size:13.5px; color:var(--text-dim);
  padding:9px 14px; border-radius:7px; position:relative;
  transition:color var(--transition), background var(--transition);
  white-space:nowrap;
}
html[lang="fa"] .nav-links a{ font-family:var(--font-fa); font-size:14.5px; }
.nav-links a .tag{ color:var(--text-faint); }
.nav-links a:hover, .nav-links a.active{ color:var(--text); background:var(--bg-elevated); }
.nav-links a.active{ color:var(--cyan); }

.nav-tools{ display:flex; align-items:center; gap:10px; }
.tool-btn{
  width:38px; height:38px; border-radius:9px; border:1px solid var(--border);
  background:var(--bg-elevated); color:var(--text-dim);
  display:flex; align-items:center; justify-content:center;
  transition:all var(--transition);
}
.tool-btn:hover{ color:var(--text); border-color:var(--cyan); }
.tool-btn svg{ width:17px; height:17px; }
.lang-btn{
  font-family:var(--font-mono); font-size:11.5px; font-weight:600;
  border:1px solid var(--border); background:var(--bg-elevated); color:var(--text-faint);
  border-radius:9px; padding:0 10px; height:38px;
  display:flex; align-items:center; gap:5px;
  transition:all var(--transition);
}
.lang-btn:hover{ border-color:var(--purple); }
.lang-btn .sep{ color:var(--text-faint); }
.lang-btn .lang-opt{ transition:color var(--transition); }
.lang-btn .lang-opt.on{ color:var(--text); }

.menu-toggle{
  display:none; width:38px; height:38px; border-radius:9px; border:1px solid var(--border);
  background:var(--bg-elevated); align-items:center; justify-content:center; color:var(--text);
}
.menu-toggle svg{ width:18px; height:18px; }

/* mobile dropdown menu */
@media (max-width:760px){
  .nav-links{
    position:fixed; top:68px; left:0; right:0; bottom:0;
    background:#0c0d11;
    z-index:600;
    -webkit-transform:translateX(100%) translateZ(0);
    transform:translateX(100%) translateZ(0);
    -webkit-backface-visibility:hidden;
    backface-visibility:hidden;
    flex-direction:column; align-items:stretch; padding:20px; gap:6px;
    transition:transform var(--transition);
    border-top:1px solid var(--border-soft);
  }
  html[data-theme="light"] .nav-links{ background:#ffffff; }
  html[dir="rtl"] .nav-links{
    -webkit-transform:translateX(-100%) translateZ(0);
    transform:translateX(-100%) translateZ(0);
  }
  .nav-links.open{
    -webkit-transform:translateX(0) translateZ(0);
    transform:translateX(0) translateZ(0);
  }
  .nav-links a{ padding:14px 16px; font-size:15px; }
  .menu-toggle{ display:flex; }
  .container{ padding:0 20px; }
  section{ padding:72px 0; }
}

/* ============================================================
   HERO (index page)
   ============================================================ */
.hero{
  min-height:100vh; display:flex; align-items:center;
  padding-top:130px; padding-bottom:80px; border-bottom:1px solid var(--border-soft);
  position:relative;
}
.hero::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(560px 360px at 85% 10%, rgba(95,230,207,0.07), transparent 60%),
    radial-gradient(480px 320px at 10% 80%, rgba(167,139,250,0.06), transparent 60%);
}
.hero-grid{ display:grid; grid-template-columns:1.15fr 0.85fr; gap:60px; align-items:center; position:relative; }
.hero-kicker{
  font-family:var(--font-mono); font-size:13px; color:var(--text-dim);
  border:1px solid var(--border); display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:99px; margin-bottom:24px; background:var(--bg-elevated);
}
.hero-kicker .dot{ width:7px; height:7px; border-radius:50%; background:var(--cyan); box-shadow:0 0 0 3px rgba(95,230,207,0.18); }
.hero h1{ font-size:clamp(38px,5.4vw,62px); line-height:1.08; }
.hero h1 .accent{ color:var(--cyan); }
.hero-sub{ color:var(--text-dim); font-size:18px; max-width:540px; margin-top:22px; }
.hero-actions{ display:flex; gap:14px; margin-top:36px; flex-wrap:wrap; }
.btn{
  font-family:var(--font-mono); font-size:14px; font-weight:500;
  padding:13px 24px; border-radius:99px; border:1px solid transparent;
  display:inline-flex; align-items:center; gap:8px; transition:all var(--transition);
}
html[lang="fa"] .btn{ font-family:var(--font-fa); font-weight:600; }
.btn-primary{ background:var(--text); color:var(--bg); }
.btn-primary:hover{ background:var(--cyan); transform:translateY(-2px); }
.btn-ghost{ border-color:var(--border); color:var(--text); background:var(--bg); }
.btn-ghost:hover{ border-color:var(--text); transform:translateY(-2px); }

.hero-social{ display:flex; gap:10px; margin-top:40px; }
.social-icon{
  width:40px; height:40px; border-radius:10px; border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; color:var(--text-dim);
  transition:all var(--transition); background:var(--bg-elevated);
}
.social-icon:hover{ color:var(--bg); background:var(--cyan); border-color:var(--cyan); transform:translateY(-2px); }
.social-icon svg{ width:18px; height:18px; }

.term-card{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-m);
  box-shadow:var(--shadow); overflow:hidden;
}
.term-bar{
  display:flex; align-items:center; gap:7px; padding:12px 16px; border-bottom:1px solid var(--border-soft);
}
.term-bar span{ width:10px; height:10px; border-radius:50%; }
.term-bar span:nth-child(1){ background:#f0726a; }
.term-bar span:nth-child(2){ background:#f3b766; }
.term-bar span:nth-child(3){ background:#5fe6cf; }
.term-bar .term-title{ margin-left:auto; font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); }
html[dir="rtl"] .term-bar .term-title{ margin-left:0; margin-right:auto; }
.term-body{ padding:22px 20px; font-family:var(--font-mono); font-size:13px; line-height:1.9; color:var(--text-dim); direction:ltr; text-align:left; }
.term-body .kw{ color:var(--purple); }
.term-body .fn{ color:var(--cyan); }
.term-body .str{ color:var(--amber); }
.term-body .com{ color:var(--text-faint); }
.term-body .num{ color:var(--rose); }
.type-cursor{ display:inline-block; width:7px; height:14px; background:var(--cyan); vertical-align:middle; animation:blink 1s steps(2) infinite; }

/* ============================================================
   SKILLS
   ============================================================ */
.skills-cols{ display:grid; grid-template-columns:repeat(3,1fr); gap:24px; }
.skill-col{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:26px 22px;
}
.skill-col h3{ font-size:16px; display:flex; align-items:center; gap:10px; margin-bottom:20px; }
.skill-col h3 svg{ width:20px; height:20px; color:var(--cyan); flex-shrink:0; }
.skill-row{ margin-bottom:16px; }
.skill-row:last-child{ margin-bottom:0; }
.skill-row .meta{ display:flex; justify-content:space-between; font-size:13px; margin-bottom:7px; }
.skill-row .meta span:first-child{ color:var(--text); }
.skill-row .meta span:last-child{ font-family:var(--font-mono); color:var(--text-faint); font-size:12px; }
.bar{ height:6px; border-radius:99px; background:var(--bg-elevated-2); overflow:hidden; }
.bar-fill{ height:100%; border-radius:99px; background:linear-gradient(90deg,var(--cyan),var(--purple)); width:0; transition:width 1.1s cubic-bezier(.4,0,.2,1); }
html[dir="rtl"] .bar-fill{ background:linear-gradient(270deg,var(--cyan),var(--purple)); }

/* ============================================================
   CERTIFICATES (index grid)
   ============================================================ */
.cert-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.cert-card{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-m);
  transition:all var(--transition); overflow:hidden; display:flex; flex-direction:column;
  cursor:default;
}
a.cert-card{ cursor:pointer; }
.cert-card:hover{ border-color:var(--cyan); transform:translateY(-4px); }
.cert-thumb{
  aspect-ratio: 16 / 9; position:relative; background:#ffffff; border-bottom:1px solid var(--border-soft);
  overflow:hidden; padding:8px;
}
.cert-thumb img{ width:100%; height:100%; object-fit:fill; display:block; }
.cert-thumb .thumb-fallback{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:var(--amber);
}
.cert-thumb .thumb-fallback svg{ width:30px; height:30px; }
.cert-body{ padding:20px 22px 22px; flex:1; display:flex; flex-direction:column; }
.cert-card h4{ font-size:15.5px; margin-bottom:6px; }
.cert-card .issuer{ font-size:13px; color:var(--text-dim); }
.cert-card .year{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); margin-top:14px; display:block; }
.cert-link{
  margin-top:14px; font-family:var(--font-mono); font-size:12px; color:var(--cyan);
  display:inline-flex; align-items:center; gap:5px; width:fit-content; transition:gap 0.2s;
}
.cert-link svg{ width:12px; height:12px; }
.cert-link:hover{ gap:8px; text-decoration:underline; }

/* ============================================================
   RESUME
   ============================================================ */
.resume-wrap{ display:grid; grid-template-columns:0.9fr 1.1fr; gap:60px; }
.resume-photo-row{ display:flex; align-items:center; gap:18px; margin-bottom:28px; flex-wrap:wrap; }
.resume-photo{
  width:128px; height:128px; border-radius:var(--radius-m); overflow:hidden; flex-shrink:0;
  border:1px solid var(--border); background:var(--bg-elevated); position:relative;
}
.resume-photo img{ width:100%; height:100%; object-fit:cover; display:block; }
.resume-photo .photo-fallback{
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:6px; color:var(--text-faint); background:var(--bg-elevated-2); text-align:center; padding:8px;
}
.resume-photo .photo-fallback svg{ width:26px; height:26px; }
.resume-photo .photo-fallback span{ font-family:var(--font-mono); font-size:9.5px; line-height:1.4; }
.resume-name h3{ font-size:18px; margin-bottom:4px; }
.resume-name p{ font-size:13.5px; color:var(--text-dim); margin:0; }
.resume-summary p{ color:var(--text-dim); margin-bottom:18px; }
.resume-stats{ display:grid; grid-template-columns:repeat(2,1fr); gap:16px; margin-top:28px; }
.stat{ border:1px solid var(--border); border-radius:var(--radius-s); padding:16px; background:var(--bg-elevated); }
.stat .num{ font-family:var(--font-display); font-size:26px; color:var(--cyan); }
.stat .label{ font-size:12.5px; color:var(--text-dim); margin-top:4px; }

.timeline{ border-left:1px solid var(--border); padding-left:28px; }
html[dir="rtl"] .timeline{ border-left:none; border-right:1px solid var(--border); padding-left:0; padding-right:28px; }
.tl-item{ position:relative; padding-bottom:32px; }
.tl-item:last-child{ padding-bottom:0; }
.tl-item::before{
  content:""; position:absolute; left:-33px; top:4px; width:9px; height:9px; border-radius:50%;
  background:var(--bg); border:2px solid var(--cyan);
}
html[dir="rtl"] .tl-item::before{ left:auto; right:-33px; }
.tl-item .tl-date{ font-family:var(--font-mono); font-size:12px; color:var(--text-faint); }
.tl-item h4{ font-size:16px; margin:6px 0 4px; }
.tl-item .tl-org{ font-size:13.5px; color:var(--purple); margin-bottom:8px; }
.tl-item p{ color:var(--text-dim); font-size:14px; }

/* ============================================================
   PROJECTS
   ============================================================ */
.project-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.project-card{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-m);
  overflow:hidden; transition:all var(--transition); display:flex; flex-direction:column;
  cursor:default;
}
a.project-card{ cursor:pointer; }
.project-card:hover{ transform:translateY(-5px); border-color:var(--cyan); box-shadow:var(--shadow); }
.project-thumb{
  height:150px; position:relative; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:30px; font-weight:700; color:rgba(255,255,255,0.92);
  border-bottom:1px solid var(--border-soft);
}
.project-thumb::after{ content:""; position:absolute; inset:0; background:rgba(0,0,0,0.06); }
.project-thumb span{ position:relative; z-index:1; }
.project-body{ padding:18px 18px 20px; flex:1; display:flex; flex-direction:column; }
.project-body h4{ font-size:15.5px; margin-bottom:6px; }
.project-date{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); margin-bottom:12px; }
.project-tech{ display:flex; gap:8px; margin-top:auto; flex-wrap:wrap; }
.tech-badge{
  width:28px; height:28px; border-radius:7px; background:var(--bg-elevated-2);
  display:flex; align-items:center; justify-content:center; color:var(--text-dim);
  border:1px solid var(--border-soft); position:relative;
}
.tech-badge svg{ width:14px; height:14px; }
.tech-badge::after{
  content:attr(data-name); position:absolute; bottom:120%; left:50%; transform:translateX(-50%);
  font-family:var(--font-mono); font-size:10.5px; background:var(--text); color:var(--bg);
  padding:3px 7px; border-radius:5px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity 0.15s;
}
.tech-badge:hover::after{ opacity:1; }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap{ display:grid; grid-template-columns:0.85fr 1.15fr; gap:56px; align-items:start; }
.contact-info p{ color:var(--text-dim); margin-bottom:24px; }
.info-row{ display:flex; align-items:center; gap:12px; margin-bottom:16px; font-size:14px; color:var(--text-dim); }
.info-row svg{ width:18px; height:18px; color:var(--cyan); flex-shrink:0; }
.contact-info .hero-social{ margin-top:30px; }

.contact-form{ display:flex; flex-direction:column; gap:22px; }
.form-row{ display:grid; grid-template-columns:1fr 1fr; gap:22px; }
.field{
  position:relative; border:1px solid var(--border); border-radius:var(--radius-m);
  background:var(--bg-elevated); transition:border-color var(--transition);
}
.field:focus-within{ border-color:var(--cyan); }
.field input, .field textarea{
  width:100%; background:transparent; border:none; outline:none; color:var(--text);
  font-family:var(--font-body); font-size:15px; padding:20px 22px;
}
html[lang="fa"] .field input, html[lang="fa"] .field textarea{ font-family:var(--font-fa); }
.field textarea{ min-height:170px; resize:vertical; }
.field input::placeholder, .field textarea::placeholder{ color:var(--text-dim); }
.send-btn{
  width:100%; padding:18px; border-radius:99px; border:1px solid var(--border);
  background:transparent; color:var(--text); font-family:var(--font-body); font-weight:600; font-size:15.5px;
  transition:all var(--transition); display:flex; align-items:center; justify-content:center; gap:10px;
}
html[lang="fa"] .send-btn{ font-family:var(--font-fa); }
.send-btn:hover{ background:var(--text); color:var(--bg); border-color:var(--text); }
.send-btn svg{ width:17px; height:17px; }
.form-note{ font-family:var(--font-mono); font-size:12px; color:var(--text-faint); text-align:center; min-height:16px; }

.form-status{ min-height:20px; }
.form-status-msg{
  display:none; align-items:center; justify-content:center; gap:8px;
  font-family:var(--font-mono); font-size:13px; text-align:center;
  padding:12px 16px; border-radius:var(--radius-s); border:1px solid transparent;
}
html[lang="fa"] .form-status-msg{ font-family:var(--font-fa); font-size:13.5px; }
.form-status-msg.show{ display:flex; }
.form-status-msg.loading{ color:var(--text-dim); }
.form-status-msg.loading::before{
  content:""; width:13px; height:13px; border-radius:50%;
  border:2px solid var(--border); border-top-color:var(--cyan);
  animation:spin 0.7s linear infinite; flex-shrink:0;
}
@keyframes spin{ to{ transform:rotate(360deg); } }
.form-status-msg.error{ color:var(--rose); background:color-mix(in srgb, var(--rose) 12%, transparent); border-color:color-mix(in srgb, var(--rose) 30%, transparent); }
.form-status-msg.success{ color:var(--cyan); background:color-mix(in srgb, var(--cyan) 12%, transparent); border-color:color-mix(in srgb, var(--cyan) 30%, transparent); }

/* ============================================================
   FOOTER
   ============================================================ */
footer{ padding:48px 0; }
.footer-inner{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:20px; }
.footer-inner p{ font-family:var(--font-mono); font-size:12.5px; color:var(--text-faint); }
.footer-social{ display:flex; gap:10px; }
.footer-social .social-icon{ width:34px; height:34px; }
.footer-social .social-icon svg{ width:15px; height:15px; }
.footer-text{ display:flex; flex-direction:column; gap:4px; }
.footer-left{ display:flex; align-items:center; gap:18px; flex-wrap:wrap; }
.footer-back{
  font-family:var(--font-mono); font-size:12.5px; color:var(--text-dim);
  display:flex; align-items:center; gap:7px; transition:color var(--transition);
}
.footer-back:hover{ color:var(--cyan); }
.footer-back svg{ width:14px; height:14px; }

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top{
  position:fixed; bottom:28px; right:28px; width:46px; height:46px; border-radius:50%;
  background:var(--text); color:var(--bg); border:none; display:flex; align-items:center;
  justify-content:center; box-shadow:var(--shadow); opacity:0; transform:translateY(12px) scale(0.9);
  pointer-events:none; transition:opacity 0.3s ease, transform 0.3s ease, background 0.3s ease; z-index:400;
}
html[dir="rtl"] .back-to-top{ right:auto; left:28px; }
.back-to-top.show{ opacity:1; transform:translateY(0) scale(1); pointer-events:auto; }
.back-to-top:hover{ background:var(--cyan); }
.back-to-top svg{ width:19px; height:19px; }

/* ============================================================
   REVEAL
   ============================================================ */
.reveal{ opacity:0; transform:translateY(22px); transition:opacity 0.7s ease, transform 0.7s ease; }
.reveal.in{ opacity:1; transform:translateY(0); }

/* ============================================================
   SUB-PAGE HEADER (project & certificate detail pages)
   ============================================================ */
.subpage-header .nav-inner{ max-width:900px; height:66px; }
.back-link{
  font-family:var(--font-mono); font-size:13.5px; color:var(--text-dim);
  display:flex; align-items:center; gap:8px; transition:color var(--transition);
}
html[lang="fa"] .back-link{ font-family:var(--font-fa); font-size:14px; }
.back-link:hover{ color:var(--cyan); }
.back-link svg{ width:16px; height:16px; }
.subpage-tools{ display:flex; align-items:center; gap:10px; }

.subcontainer{ max-width:900px; margin:0 auto; padding:0 32px; }
@media (max-width:760px){ .subcontainer{ padding:0 20px; } }

/* ============================================================
   PROJECT DETAIL PAGE
   ============================================================ */
.p-hero{ padding:64px 0 48px; text-align:center; }
.p-kicker{
  font-family:var(--font-mono); font-size:13px; color:var(--text-dim);
  border:1px solid var(--border); display:inline-flex; align-items:center; gap:8px;
  padding:6px 12px; border-radius:99px; margin-bottom:22px; background:var(--bg-elevated);
}
.p-kicker .dot{ width:7px; height:7px; border-radius:50%; background:var(--cyan); box-shadow:0 0 0 3px rgba(95,230,207,0.18); }
.p-hero h1{ font-size:clamp(32px,5.5vw,50px); line-height:1.1; margin-bottom:18px; }
.p-hero h1 .accent{ color:var(--cyan); }
.p-hero > .subcontainer > p{ color:var(--text-dim); font-size:17px; max-width:620px; margin:0 auto; }

.p-meta{
  display:flex; align-items:center; justify-content:center; gap:24px; flex-wrap:wrap;
  margin-top:32px; padding-top:28px; border-top:1px solid var(--border-soft);
}
.p-meta-item{ display:flex; align-items:center; gap:8px; font-family:var(--font-mono); font-size:12.5px; color:var(--text-faint); }
.p-meta-item svg{ width:15px; height:15px; color:var(--cyan); }
.p-tech-row{ display:flex; gap:8px; }
.p-tech-badge{
  width:30px; height:30px; border-radius:8px; background:var(--bg-elevated);
  border:1px solid var(--border); display:flex; align-items:center; justify-content:center;
  color:var(--text-dim); position:relative;
}
.p-tech-badge svg{ width:15px; height:15px; }
.p-tech-badge::after{
  content:attr(data-name); position:absolute; bottom:120%; left:50%; transform:translateX(-50%);
  font-family:var(--font-mono); font-size:10px; background:var(--text); color:var(--bg);
  padding:3px 7px; border-radius:5px; white-space:nowrap; opacity:0; pointer-events:none; transition:opacity 0.15s;
}
.p-tech-badge:hover::after{ opacity:1; }

.cover-frame{
  margin-top:40px; border-radius:var(--radius-l); overflow:hidden; border:1px solid var(--border);
  box-shadow:var(--shadow);
}
.cover-frame .term-bar{ display:flex; align-items:center; gap:7px; padding:12px 16px; background:var(--bg-elevated); border-bottom:1px solid var(--border-soft); }
.cover-frame .term-bar span{ width:10px; height:10px; border-radius:50%; }
.cover-frame .term-bar span:nth-child(1){ background:#f0726a; }
.cover-frame .term-bar span:nth-child(2){ background:#f3b766; }
.cover-frame .term-bar span:nth-child(3){ background:#5fe6cf; }
.cover-img{
  aspect-ratio:16/9; background:linear-gradient(135deg,#1f5f5a,#0c0d11);
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:20px; color:rgba(255,255,255,0.5);
}

section.sub{ padding:70px 0; border-bottom:1px solid var(--border-soft); }
section.sub:last-of-type{ border-bottom:none; }
.overview p{ color:var(--text-dim); margin-bottom:16px; font-size:15.5px; }
.overview p:last-child{ margin-bottom:0; }

.highlight-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:32px; }
.highlight-card{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-m);
  padding:20px; text-align:center;
}
.highlight-card svg{ width:22px; height:22px; color:var(--cyan); margin-bottom:12px; }
.highlight-card h4{ font-size:14px; margin-bottom:6px; }
.highlight-card p{ font-size:12.5px; color:var(--text-dim); margin:0; }

.steps{ display:flex; flex-direction:column; }
.step{ display:grid; grid-template-columns:56px 1fr; gap:24px; }
html[dir="rtl"] .step{ grid-template-columns:1fr 56px; }
html[dir="rtl"] .step-marker{ order:2; }
html[dir="rtl"] .step-content{ order:1; }
.step-marker{ display:flex; flex-direction:column; align-items:center; }
.step-num{
  width:40px; height:40px; border-radius:50%; background:var(--bg-elevated); border:1px solid var(--border);
  display:flex; align-items:center; justify-content:center; font-family:var(--font-mono); font-weight:600;
  font-size:14px; color:var(--cyan); flex-shrink:0;
}
.step-connector{
  flex:1; width:2px; background:repeating-linear-gradient(to bottom, var(--border) 0 6px, transparent 6px 12px);
  margin:8px 0; min-height:24px;
}
.step-arrow{
  width:26px; height:26px; color:var(--cyan); margin:2px 0;
  animation:arrowPulse 1.8s ease-in-out infinite;
}
@keyframes arrowPulse{ 0%,100%{ transform:translateY(0); opacity:0.55; } 50%{ transform:translateY(4px); opacity:1; } }

.step-content{ padding-bottom:44px; }
.step-content h3{ font-size:19px; margin-bottom:8px; }
.step-content .step-tag{ font-family:var(--font-mono); font-size:11.5px; color:var(--text-faint); margin-bottom:10px; display:block; }
.step-content p{ color:var(--text-dim); font-size:14.5px; margin-bottom:16px; }

.step-shot{
  border-radius:var(--radius-m); overflow:hidden; border:1px solid var(--border); background:var(--bg-elevated);
}
.step-shot .shot-bar{ display:flex; align-items:center; gap:6px; padding:9px 12px; border-bottom:1px solid var(--border-soft); }
.step-shot .shot-bar span{ width:8px; height:8px; border-radius:50%; }
.step-shot .shot-bar span:nth-child(1){ background:#f0726a; }
.step-shot .shot-bar span:nth-child(2){ background:#f3b766; }
.step-shot .shot-bar span:nth-child(3){ background:#5fe6cf; }
.step-shot .shot-bar .shot-title{ margin-left:auto; font-family:var(--font-mono); font-size:10.5px; color:var(--text-faint); }
html[dir="rtl"] .step-shot .shot-bar .shot-title{ margin-left:0; margin-right:auto; }
.shot-img{
  aspect-ratio:16/9; display:flex; align-items:center; justify-content:center;
  font-family:var(--font-mono); font-size:13px; color:var(--text-faint);
}

.download-block{
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:var(--radius-l);
  padding:48px 40px; text-align:center; position:relative; overflow:hidden;
}
.download-block::before{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(420px 260px at 50% 0%, rgba(95,230,207,0.08), transparent 65%);
}
.download-block h2{ font-size:clamp(22px,3.4vw,28px); margin-bottom:10px; position:relative; }
.download-block p{ color:var(--text-dim); font-size:14.5px; max-width:440px; margin:0 auto 30px; position:relative; }
.download-actions{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; position:relative; }
.repo-line{
  margin-top:22px; font-family:var(--font-mono); font-size:12px; color:var(--text-faint);
  display:flex; align-items:center; justify-content:center; gap:8px; position:relative;
}
.repo-line code{ color:var(--text-dim); }

/* ============================================================
   CERTIFICATE DETAIL PAGE
   ============================================================ */
.cert-hero{ padding:64px 0 20px; }
.cert-detail-grid{ display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center; }
.cert-image-frame{
  border-radius:var(--radius-l); overflow:hidden; border:1px solid var(--border); box-shadow:var(--shadow);
  background:var(--bg-elevated);
}
.cert-image-frame .term-bar{ display:flex; align-items:center; gap:7px; padding:12px 16px; border-bottom:1px solid var(--border-soft); }
.cert-image-frame .term-bar span{ width:10px; height:10px; border-radius:50%; }
.cert-image-frame .term-bar span:nth-child(1){ background:#f0726a; }
.cert-image-frame .term-bar span:nth-child(2){ background:#f3b766; }
.cert-image-frame .term-bar span:nth-child(3){ background:#5fe6cf; }
.cert-image{
  aspect-ratio:4/3; display:flex; align-items:center; justify-content:center; color:var(--amber);
  background:var(--bg-elevated-2);
}
.cert-image svg{ width:52px; height:52px; }
.cert-hero-meta h1{ font-size:clamp(26px,4vw,36px); margin-bottom:10px; }
.cert-hero-meta .issuer-line{ font-family:var(--font-mono); font-size:13.5px; color:var(--purple); margin-bottom:18px; }
.cert-hero-meta p{ color:var(--text-dim); font-size:15px; margin-bottom:22px; }
.cert-facts{ display:flex; flex-direction:column; gap:10px; margin-bottom:26px; }
.cert-fact{ display:flex; align-items:center; gap:10px; font-size:13.5px; color:var(--text-dim); }
.cert-fact svg{ width:16px; height:16px; color:var(--cyan); flex-shrink:0; }
.cert-code{ font-family:var(--font-mono); color:var(--text-faint); }

.skills-covered{ display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.skill-chip{
  font-family:var(--font-mono); font-size:12px; color:var(--text-dim);
  border:1px solid var(--border); background:var(--bg-elevated); padding:6px 12px; border-radius:99px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width:1440px){
  .container{ max-width:1320px; }
  .hero h1{ font-size:clamp(46px,4.6vw,72px); }
}
@media (max-width:1180px){ .container{ padding:0 28px; } }

@media (max-width:980px){
  .hero-grid{ grid-template-columns:1fr; gap:48px; }
  .resume-wrap{ grid-template-columns:1fr; gap:40px; }
  .contact-wrap{ grid-template-columns:1fr; gap:36px; }
  .skills-cols{ grid-template-columns:1fr 1fr; }
  .cert-grid{ grid-template-columns:1fr 1fr; }
  .project-grid{ grid-template-columns:1fr 1fr; }
  .cert-detail-grid{ grid-template-columns:1fr; gap:32px; }
}

@media (max-width:760px){
  .skills-cols{ grid-template-columns:1fr; }
  .cert-grid{ grid-template-columns:1fr; }
  .project-grid{ grid-template-columns:1fr 1fr; gap:16px; }
  .form-row{ grid-template-columns:1fr; }
  .hero{ padding-top:108px; min-height:auto; }
  .hero-actions{ width:100%; }
  .hero-actions .btn{ flex:1; justify-content:center; }
  .resume-stats{ grid-template-columns:1fr 1fr; }
  .back-to-top{ width:42px; height:42px; bottom:20px; right:20px; }
  html[dir="rtl"] .back-to-top{ right:auto; left:20px; }
  .p-hero{ padding:44px 0 36px; }
  .highlight-grid{ grid-template-columns:1fr; }
  .p-meta{ gap:16px; }
  .download-block{ padding:36px 22px; }
  .download-actions{ flex-direction:column; }
  .download-actions .btn{ width:100%; justify-content:center; }
  .step{ grid-template-columns:44px 1fr; gap:16px; }
  html[dir="rtl"] .step{ grid-template-columns:1fr 44px; }
  .step-num{ width:34px; height:34px; font-size:12.5px; }
  section.sub{ padding:56px 0; }
}

@media (max-width:560px){
  .container{ padding:0 18px; }
  .nav-inner{ padding:0 18px; }
  section{ padding:60px 0; }
  .eyebrow{ font-size:12px; }
  .hero h1{ font-size:clamp(30px,8vw,40px); }
  .hero-sub{ font-size:15.5px; }
  .hero-kicker{ font-size:12px; }
  .project-grid{ grid-template-columns:1fr; }
  .resume-stats{ grid-template-columns:1fr 1fr; gap:10px; }
  .term-body{ font-size:11.5px; padding:18px 16px; }
  .social-icon{ width:36px; height:36px; }
  .logo{ font-size:14px; }
  .lang-btn{ padding:0 8px; font-size:10.5px; }
  .field input, .field textarea{ padding:16px 16px; font-size:14px; }
  .send-btn{ padding:15px; font-size:14.5px; }
  .p-hero h1{ font-size:clamp(26px,8vw,34px); }
  .p-hero > .subcontainer > p{ font-size:15px; }
  .step-content h3{ font-size:17px; }
}

@media (max-width:380px){
  .nav-tools{ gap:6px; }
  .tool-btn, .menu-toggle{ width:34px; height:34px; }
  .hero-actions{ flex-direction:column; }
  .hero-actions .btn{ width:100%; }
}

@media (min-width:1800px){ .container{ max-width:1480px; } }
