/* ================================
   Portfolio Boilerplate
   Author: Abolfazl Mohammadijoo
   Structure:
   - Fixed sidebar on desktop
   - Collapsible sidebar on tablet/mobile
   - Right-pane section navigation
   ================================ */

:root {
  --sidebar-width: 310px;
  --bg-main: #f5f7fb;
  --bg-card: #ffffff;
  --bg-sidebar: #101827;
  --bg-sidebar-soft: #172033;
  --text-main: #172033;
  --text-muted: #667085;
  --text-light: #e5e7eb;
  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.12);
  --border: #e6e9f0;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  line-height: 1.7;
}

a {
  color: inherit;
}

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

/* ================================
   Mobile header
   ================================ */

.mobile-header {
  display: none;
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  z-index: 1100;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(16, 24, 39, 0.96);
  color: white;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.mobile-brand {
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.hamburger {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 999px;
  transition: 0.25s ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ================================
   Sidebar
   ================================ */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.30), transparent 35%),
    var(--bg-sidebar);
  color: var(--text-light);
  z-index: 1200;
  padding: 34px 26px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 14px 0 45px rgba(15, 23, 42, 0.20);
}

.profile {
  text-align: center;
}

.profile-photo {
  width: 138px;
  height: 138px;
  margin: 0 auto 18px;
  border-radius: 999px;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  background: var(--bg-sidebar-soft);
}

.profile h1 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.profile p {
  margin: 8px 0 18px;
  color: #b7c0d4;
  font-size: 0.92rem;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.social-links a {
  text-decoration: none;
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  transition: 0.2s ease;
}

.social-links a:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.side-nav {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.nav-link {
  text-decoration: none;
  color: #cbd5e1;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 650;
  letter-spacing: -0.01em;
  transition: 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.10);
}

.nav-link.active {
  box-shadow: inset 4px 0 0 #60a5fa;
}

.resume-link {
  margin-top: 12px;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  color: white;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
  color: #94a3b8;
  text-align: center;
}

.sidebar-overlay {
  display: none;
}

/* ================================
   Main content
   ================================ */

.content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.section {
  min-height: 100vh;
  padding: 86px min(7vw, 86px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  scroll-margin-top: 20px;
}

.section:nth-child(even) {
  background: #ffffff;
}

.hero-section {
  background:
    linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(20, 184, 166, 0.12)),
    var(--bg-main);
}

.hero-content {
  max-width: 950px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.hero-content h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: 1.02;
  letter-spacing: -0.07em;
}

.hero-content h2 span {
  color: var(--accent);
}

.hero-content h3 {
  margin: 20px 0 0;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  color: var(--text-muted);
  font-weight: 700;
}

.hero-content p {
  max-width: 740px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 800;
  transition: 0.2s ease;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.25);
}

.btn.secondary {
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.card,
.project-card,
.timeline-card,
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  padding: 30px;
}

.card p {
  color: var(--text-muted);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.about-grid strong {
  display: block;
  margin-bottom: 8px;
}

.about-grid ul,
.card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

/* ================================
   Timeline
   ================================ */

.timeline {
  position: relative;
  display: grid;
  gap: 24px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 18px;
}

.timeline-marker {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  border: 5px solid white;
  box-shadow: 0 0 0 1px var(--border);
  z-index: 1;
}

.timeline-card {
  padding: 26px;
}

.timeline-card h3,
.project-card h3,
.card h3 {
  margin-top: 0;
}

.meta {
  color: var(--text-muted);
  font-weight: 700;
  margin-top: -8px;
}

.tags {
  color: var(--accent);
  font-weight: 800;
  margin-bottom: 0;
}

/* ================================
   Projects
   ================================ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.project-card {
  padding: 28px;
  transition: 0.22s ease;
}

.project-card:hover {
  transform: translateY(-8px);
}

.project-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 1.75rem;
  border-radius: 16px;
  background: var(--accent-soft);
  margin-bottom: 18px;
}

.project-card p {
  color: var(--text-muted);
}

.project-card a {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
}

/* ================================
   Skills
   ================================ */

.skills-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.skill {
  margin-top: 20px;
}

.skill-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
  font-weight: 800;
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: #e9eef7;
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  transition: width 1.1s ease;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-group span {
  display: inline-flex;
  padding: 8px 12px;
  background: var(--accent-soft);
  color: #1e40af;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.9rem;
}

/* ================================
   Contact
   ================================ */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.contact-card {
  padding: 24px;
  text-decoration: none;
  transition: 0.22s ease;
}

.contact-card:hover {
  transform: translateY(-6px);
}

.contact-card strong {
  display: block;
  font-size: 1.05rem;
}

.contact-card span {
  display: block;
  color: var(--text-muted);
  margin-top: 6px;
  overflow-wrap: anywhere;
}

/* ================================
   Back to top
   ================================ */

.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(29, 78, 216, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.22s ease;
  z-index: 900;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ================================
   Responsive
   ================================ */

@media (max-width: 1024px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-overlay.is-visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    z-index: 1150;
  }

  .content {
    margin-left: 0;
    padding-top: 64px;
  }

  .section {
    min-height: auto;
    padding: 72px 28px;
    scroll-margin-top: 64px;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: min(86vw, 310px);
  }

  .about-grid,
  .project-grid,
  .skills-layout,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .section {
    padding: 58px 20px;
  }

  .card,
  .project-card,
  .timeline-card,
  .contact-card {
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: #e9eef7;
  overflow: hidden;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #14b8a6);
  transition: width 1.1s ease;
}

.courses-intro-card {
  margin: 24px 0 42px;
  padding: 34px;
}

.courses-intro-content h3 {
  margin: 0 0 14px;
  font-size: 1.8rem;
  letter-spacing: -0.04em;
  color: var(--text-main);
}

.courses-intro-content p {
  color: var(--text-muted);
  text-align: justify;
  margin: 0 0 14px;
}

.courses-intro-content p:last-child {
  margin-bottom: 0;
}

.courses-intro-content a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.courses-intro-content a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .courses-intro-card {
    padding: 24px;
  }

  .courses-intro-content p {
    text-align: left;
  }
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.publication-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
  transition: 0.2s ease;
}

.publication-links a:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
}

.donation-card {
  max-width: 900px;
}

.donation-card h3 {
  margin-top: 0;
  font-size: 1.6rem;
  letter-spacing: -0.04em;
}

.donation-card p {
  color: var(--text-muted);
}

.wallet-box {
  margin: 22px 0;
  padding: 18px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid rgba(29, 78, 216, 0.18);
}

.wallet-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-main);
  font-weight: 800;
}

.wallet-box code {
  display: block;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.donation-warning {
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: #991b1b;
  line-height: 1.7;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.08);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.project-links a:hover {
  background: rgba(37, 99, 235, 0.14);
  text-decoration: none;
}

