/* ═══════════════════════════════════════════════════════════
   Mohammad Hosein Karimi — Portfolio Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Reset & Custom Properties ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0a0f1e;
  --bg-card:    #111827;
  --bg-card2:   #1a2235;
  --accent:     #38bdf8;
  --accent2:    #818cf8;
  --accent3:    #34d399;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --border:     #1e293b;
  --grad1:      linear-gradient(135deg, #38bdf8, #818cf8);
  --grad2:      linear-gradient(135deg, #34d399, #38bdf8);
  --shadow:     0 4px 32px rgba(56,189,248,.08);
  --radius:     16px;
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── Subtle noise overlay ──────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: .4;
}

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2.5rem;
  background: rgba(10,15,30,.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--grad1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .5px;
  transition: color .25s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--accent); }

.nav-cta {
  padding: .45rem 1.2rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
  transition: background .25s, color .25s !important;
}
.nav-cta:hover {
  background: var(--accent) !important;
  color: var(--bg) !important;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS — shared
   ═══════════════════════════════════════════════════════════ */
section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 2rem;
}

.sec-header {
  text-align: center;
  margin-bottom: 3rem;
}
.sec-label {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.sec-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
}
.sec-title span {
  background: var(--grad1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sec-line {
  width: 48px; height: 3px;
  background: var(--grad1);
  border-radius: 2px;
  margin: .8rem auto 0;
}

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 6rem;
  max-width: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(56,189,248,.1), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(129,140,248,.06), transparent 70%);
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 1rem;
  border: 1px solid rgba(56,189,248,.3);
  border-radius: 100px;
  font-size: .8rem;
  color: var(--accent);
  background: rgba(56,189,248,.06);
  margin-bottom: 1.5rem;
  animation: fadeInDown .6s ease both;
}
.hero-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent3);
  box-shadow: 0 0 6px var(--accent3);
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  animation: fadeInUp .7s .1s ease both;
}
.hero-title .name {
  background: var(--grad1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 2rem;
  animation: fadeInUp .7s .2s ease both;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 2.5rem;
  animation: fadeInUp .7s .3s ease both;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp .7s .4s ease both;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: var(--text-muted);
  font-size: .75rem;
  animation: bounce 2s infinite;
}
.hero-scroll svg { opacity: .5; }

/* ═══════════════════════════════════════════════════════════
   TAGS
   ═══════════════════════════════════════════════════════════ */
.tag {
  padding: .3rem .85rem;
  border-radius: 100px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(129,140,248,.12);
  color: var(--accent2);
  border: 1px solid rgba(129,140,248,.25);
}
.tag.green {
  background: rgba(52,211,153,.1);
  color: var(--accent3);
  border-color: rgba(52,211,153,.25);
}
.tag.blue {
  background: rgba(56,189,248,.1);
  color: var(--accent);
  border-color: rgba(56,189,248,.25);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn-primary {
  padding: .75rem 1.8rem;
  background: var(--grad1);
  color: #0a0f1e;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: opacity .25s, transform .25s;
}
.btn-primary:hover { opacity: .88; transform: translateY(-2px); }

.btn-outline {
  padding: .75rem 1.8rem;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transition: border-color .25s, color .25s, transform .25s;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════════════════
   CARDS — shared
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,.3);
  box-shadow: 0 8px 40px rgba(56,189,248,.12);
}

/* ═══════════════════════════════════════════════════════════
   ABOUT
   ═══════════════════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.about-text p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: .95rem;
}
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
  transition: transform .25s, border-color .25s;
}
.stat-card:hover {
  transform: scale(1.04);
  border-color: rgba(56,189,248,.3);
}
.stat-num {
  font-size: 2rem;
  font-weight: 800;
  background: var(--grad1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* ═══════════════════════════════════════════════════════════
   EXPERIENCE — Timeline
   ═══════════════════════════════════════════════════════════ */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2), transparent);
  border-radius: 2px;
}
.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2.45rem; top: .4rem;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  border: 2px solid var(--bg);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .8rem;
}
.exp-role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.exp-company {
  font-size: .9rem;
  color: var(--accent);
  font-weight: 600;
}
.exp-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .25rem;
}
.exp-period {
  font-size: .78rem;
  color: var(--text-muted);
  background: var(--bg-card2);
  padding: .2rem .7rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.exp-location {
  font-size: .75rem;
  color: var(--text-muted);
}
.exp-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.exp-bullets li {
  font-size: .875rem;
  color: var(--text-muted);
  padding-left: 1.1rem;
  position: relative;
  line-height: 1.6;
}
.exp-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════
   PROJECTS
   ═══════════════════════════════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}
.project-card {
  display: flex;
  flex-direction: column;
}
.project-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.project-desc {
  font-size: .85rem;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 1rem;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.stack-tag {
  padding: .2rem .65rem;
  border-radius: 100px;
  font-size: .72rem;
  font-weight: 600;
  background: rgba(56,189,248,.08);
  color: var(--accent);
  border: 1px solid rgba(56,189,248,.2);
}
.project-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.project-highlights li {
  font-size: .8rem;
  color: var(--text-muted);
  padding-left: 1rem;
  position: relative;
  line-height: 1.5;
}
.project-highlights li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent3);
  font-size: .7rem;
}

/* ═══════════════════════════════════════════════════════════
   SKILLS
   ═══════════════════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.2rem;
}
.skill-group-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.skill-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.skill-pill {
  padding: .25rem .7rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 500;
  background: var(--bg-card2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all .25s;
}
.skill-pill:hover {
  background: rgba(56,189,248,.1);
  color: var(--accent);
  border-color: rgba(56,189,248,.3);
}

/* ═══════════════════════════════════════════════════════════
   EDUCATION
   ═══════════════════════════════════════════════════════════ */
.edu-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
}
.edu-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(56,189,248,.15), rgba(129,140,248,.15));
  border: 1px solid rgba(56,189,248,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.edu-body { flex: 1; }
.edu-degree {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .2rem;
}
.edu-school {
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .3rem;
}
.edu-period {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
}
.edu-courses {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.course-tag {
  padding: .2rem .7rem;
  border-radius: 6px;
  font-size: .75rem;
  background: rgba(52,211,153,.08);
  color: var(--accent3);
  border: 1px solid rgba(52,211,153,.2);
}

/* ═══════════════════════════════════════════════════════════
   LANGUAGES
   ═══════════════════════════════════════════════════════════ */
#languages { padding-top: 0; }

.lang-grid {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.lang-card {
  flex: 1;
  min-width: 180px;
  text-align: center;
}
.lang-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: .3rem;
}
.lang-level {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
}
.lang-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.lang-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--grad1);
  transition: width 1s ease;
}

/* ═══════════════════════════════════════════════════════════
   CONTACT
   ═══════════════════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .25s, transform .25s;
}
.contact-item:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.contact-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(56,189,248,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.contact-detail-label {
  font-size: .72rem;
  color: var(--text-muted);
  margin-bottom: .1rem;
}
.contact-detail-value {
  font-size: .88rem;
  font-weight: 600;
}
.contact-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.contact-cta-title {
  font-size: 1.4rem;
  font-weight: 700;
}
.contact-cta-sub {
  font-size: .875rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: .4; }
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  nav { padding: 1rem 1.2rem; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: rgba(10,15,30,.97);
    padding: 1.5rem;
    gap: 1.2rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }

  .about-grid   { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .edu-card     { flex-direction: column; }

  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid   { grid-template-columns: 1fr; }
}
