/* Sadra Satvat — portfolio, adapted from the vCard theme (codewithsadee) */

:root {
  --bg: #121212;
  --card: #1e1e1f;
  --card-2: #1a1a1b;
  --border: #383838;
  --text: #fafafa;
  --muted: #d6d6d6;
  --dim: #a3a3a3;
  --accent: #ffdb70;
  --accent-soft: rgba(255, 219, 112, 0.14);
  --radius: 20px;
  --shadow: 0 16px 40px -20px #000;
  --font: "Vazirmatn", "IRANSans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

body[dir="ltr"] { line-height: 1.65; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
  padding-block: 24px 56px;
  display: grid;
  gap: 20px;
}

@media (min-width: 1024px) {
  .wrap {
    grid-template-columns: 290px 1fr;
    align-items: start;
    gap: 28px;
    padding-block: 40px 64px;
  }
  .sidebar { position: sticky; top: 32px; }
}

/* ---------- sidebar ---------- */
.sidebar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: grid;
  gap: 16px;
  justify-items: center;
  text-align: center;
}

.avatar {
  width: 104px; height: 104px;
  border-radius: 28px;
  background: linear-gradient(145deg, #2a2a2c, #171718);
  border: 1px solid var(--border);
  padding: 6px;
}

.avatar img { width: 100%; height: 100%; border-radius: 22px; }

.identity h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }

.badge {
  margin-top: 8px;
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(255, 219, 112, 0.28);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 999px;
}

.location { color: var(--dim); font-size: 0.78rem; margin-top: 10px; }

.divider { width: 100%; height: 1px; background: var(--border); }

.links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.links a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-2);
  color: var(--accent);
  transition: transform 0.18s ease, background 0.18s ease;
}

.links a:hover { transform: translateY(-2px); background: #26262a; }
.links svg { width: 19px; height: 19px; fill: currentColor; }

/* ---------- nav ---------- */
.nav {
  display: flex;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  width: 100%;
}

.nav button {
  flex: 1;
  background: none;
  border: 0;
  color: var(--dim);
  font-family: inherit;
  font-size: 0.78rem;
  padding: 11px 4px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.18s ease, background 0.18s ease;
}

.nav button:hover { color: var(--text); }
.nav button { border-bottom: 0; }
.nav button[aria-selected="true"] {
  color: #121212;
  background: var(--accent);
  border-radius: 11px;
  font-weight: 600;
}

/* ---------- main ---------- */
.main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  min-height: 420px;
}

@media (min-width: 768px) { .main { padding: 36px 40px; } }

.page { display: none; animation: fade 0.25s ease; }
.page.is-active { display: block; }

@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-title {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.page-title::after {
  content: "";
  display: block;
  width: 44px; height: 4px;
  margin-top: 12px;
  border-radius: 4px;
  background: var(--accent);
}

.page-intro { color: var(--muted); margin-block: 18px 26px; }

/* about */
.about p { color: var(--muted); margin-bottom: 14px; }

.facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-block: 26px 8px;
}

@media (min-width: 640px) { .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.fact {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  text-align: center;
}

.fact b { display: block; color: var(--accent); font-size: 1.35rem; line-height: 1.2; }
.fact span { color: var(--dim); font-size: 0.72rem; }

/* skills */
.skills { display: grid; gap: 14px; margin-top: 8px; }

.skill-group {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
}

.skill-group h3 {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  font-size: 0.75rem;
  color: var(--muted);
  background: #232325;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

/* projects */
.projects { display: grid; gap: 16px; margin-top: 20px; }

@media (min-width: 900px) { .projects { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.project {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.project:hover { border-color: rgba(255, 219, 112, 0.4); transform: translateY(-2px); }

.project-top { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
@media (min-width: 560px) { .project-top { flex-direction: row; align-items: center; justify-content: space-between; } }

.project h3 { font-size: 0.98rem; font-weight: 600; }

.tag { font-size: 0.68rem; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 3px 10px; }

.project p { color: var(--muted); font-size: 0.85rem; }
.project .tag { align-self: flex-start; }

.project-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

.btn {
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.18s ease, color 0.18s ease;
}

.btn:hover { background: #26262a; color: var(--text); }
.btn.primary { border-color: rgba(255, 219, 112, 0.45); color: var(--accent); }

/* contact */
.contact-grid { display: grid; gap: 12px; margin-top: 22px; }

@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.contact-card {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.18s ease;
}

.contact-card:hover { border-color: rgba(255, 219, 112, 0.4); }
.contact-card svg { width: 22px; height: 22px; fill: var(--accent); flex: none; }
.contact-card span { font-size: 0.82rem; color: var(--muted); }
.contact-card b { display: block; font-size: 0.85rem; color: var(--text); font-weight: 600; }

/* footer */
.footer {
  text-align: center;
  color: #6f6f6f;
  font-size: 0.72rem;
  padding-top: 8px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  background: var(--card-2);
}

.lang-switch svg { width: 14px; height: 14px; fill: currentColor; }
.lang-switch:hover { color: var(--accent); border-color: rgba(255, 219, 112, 0.4); }

@media (max-width: 480px) {
  .main { padding: 20px; }
  .page-title { font-size: 1.35rem; }
  .nav button { font-size: 0.72rem; }
  .avatar { width: 96px; height: 96px; }
}

/* RTL tweaks */
body[dir="rtl"] .page-title::after { margin-inline-start: 0; }
body[dir="ltr"] .page-title::after { margin-inline-start: 0; }
