:root {
  --bg: #0b0f17;
  --surface: #121a27;
  --surface2: #1a2438;
  --border: #2a3650;
  --text: #e8edf7;
  --muted: #8b9bb8;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-family: "Inter", system-ui, sans-serif;
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface2: #eef2f9;
  --border: #d5dde9;
  --text: #0f172a;
  --muted: #5b6b86;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

html[lang="fa"] {
  font-family: "Vazirmatn", "Inter", system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(960px, 92vw);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

.header {
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.nav-btn:hover {
  border-color: var(--accent);
}

.nav-btn-accent {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

.nav-btn-accent:hover {
  background: var(--accent-hover);
}

.nav-btn-icon {
  padding: 0.45rem;
}

.nav-icon {
  width: 1.1rem;
  height: 1.1rem;
}

.theme-icon-sun {
  display: none;
}

html[data-theme="light"] .theme-icon-moon {
  display: none;
}

html[data-theme="light"] .theme-icon-sun {
  display: block;
}

.nav-lang-wrap {
  position: relative;
}

.lang-popover {
  position: absolute;
  top: calc(100% + 0.35rem);
  inset-inline-end: 0;
  min-width: 9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 20;
}

.lang-popover.hidden {
  display: none;
}

.lang-option {
  display: block;
  width: 100%;
  text-align: start;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.lang-option:hover,
.lang-option.active {
  background: var(--surface2);
}

.main {
  flex: 1;
  padding: 2.5rem 0 3rem;
}

.hero {
  margin-bottom: 3rem;
}

.hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.hero-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.hero-greeting {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 1rem;
}

.hero-greeting strong {
  color: var(--text);
  font-weight: 700;
}

.hero-role {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.hero-location {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-location svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.hero-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  max-width: 52ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}

.btn-primary:hover {
  border-color: var(--accent);
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.about {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.85rem;
}

.about p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-title {
  margin: 0 0 1.25rem;
  font-size: 1.2rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.project-name {
  margin: 0;
  font-size: 1.1rem;
}

.project-meta {
  color: var(--muted);
  font-size: 0.8rem;
}

.project-desc {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.92rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}

.footer-inner {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.footer-note {
  margin: 0 0 0.5rem;
}

.footer-links {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-copy {
  margin: 0;
}

@media (max-width: 640px) {
  .hero-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-photo {
    margin-inline: auto;
  }

  .hero-location,
  .hero-cta {
    justify-content: center;
  }

  .hero-lead {
    margin-inline: auto;
  }
}
