/* =========================================================
   Qobil Allaberdiyev — Win11 Fluent design
   Light + Dark themes, no heavy frameworks.
   ========================================================= */

:root {
  --accent: #0067c0;
  --accent-hover: #0078d4;
  --accent-soft: rgba(0, 103, 192, 0.10);

  --bg: #f3f3f3;
  --bg-alt: #ececec;
  --surface: rgba(255, 255, 255, 0.70);
  --surface-solid: #ffffff;
  --card: #ffffff;
  --card-border: rgba(0, 0, 0, 0.06);
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.05);

  --text: #1f1f1f;
  --text-muted: #5d5d5d;
  --text-faint: #8a8a8a;

  --border: rgba(0, 0, 0, 0.08);
  --divider: rgba(0, 0, 0, 0.06);

  --topbar-bg: rgba(243, 243, 243, 0.80);
  --topbar-border: rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  --transition: 150ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

[data-theme="dark"] {
  --accent: #60cdff;
  --accent-hover: #9bdfff;
  --accent-soft: rgba(96, 205, 255, 0.12);

  --bg: #1f1f1f;
  --bg-alt: #2b2b2b;
  --surface: rgba(43, 43, 43, 0.70);
  --surface-solid: #2b2b2b;
  --card: #2b2b2b;
  --card-border: rgba(255, 255, 255, 0.06);
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.40), 0 1px 2px rgba(0, 0, 0, 0.30);
  --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.35);

  --text: #ffffff;
  --text-muted: #c5c5c5;
  --text-faint: #8a8a8a;

  --border: rgba(255, 255, 255, 0.08);
  --divider: rgba(255, 255, 255, 0.06);

  --topbar-bg: rgba(31, 31, 31, 0.80);
  --topbar-border: rgba(255, 255, 255, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; }
p { margin: 0 0 .75rem; }
ul { margin: 0; padding: 0; list-style: none; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ---------- Top bar (acrylic) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--topbar-border);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
}
.brand-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  flex: 1;
}
.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--accent-soft); color: var(--text); }
.nav-link.active { color: var(--accent); background: var(--accent-soft); }

.topbar-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  background: var(--surface-solid);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn:active { transform: scale(0.96); }

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: var(--surface-solid);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--accent); }

/* ---------- Hero (combined Home + About) ---------- */
.hero { padding: 40px 0 32px; }
.hero-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 36px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  align-items: start;
  background-image:
    radial-gradient(circle at top right, var(--accent-soft), transparent 55%),
    radial-gradient(circle at bottom left, var(--accent-soft), transparent 65%);
}

.hero-left { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.avatar {
  width: 220px; height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.hero-right { min-width: 0; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 124, 16, 0.10);
  color: #107c10;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
[data-theme="dark"] .status-pill { background: rgba(108, 203, 95, 0.12); color: #6ccb5f; }
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(16, 124, 16, 0.20);
}
[data-theme="dark"] .status-dot { box-shadow: 0 0 0 3px rgba(108, 203, 95, 0.20); }

.hero-card h1 {
  font-size: clamp(26px, 3.4vw, 36px);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.hero-subtitle {
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 14px;
  font-size: 15px;
}
.hero-quote {
  color: var(--text-muted);
  font-size: 14px;
  max-width: 640px;
  margin: 0 0 20px;
  font-style: italic;
}
.hero-right .info-list { margin: 0 0 20px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}
.info-row {
  display: grid;
  grid-template-columns: 36px auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-solid);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--transition), background-color var(--transition), transform var(--transition);
}
a.info-row:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.info-row-icon {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
}
.info-row-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}
.info-row-value {
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.socials { display: flex; gap: 8px; justify-content: center; }
.socials a {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: var(--surface-solid);
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}
.socials a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 26px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  display: inline-block;
  position: relative;
  padding-bottom: 6px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 3px; width: 36px;
  background: var(--accent);
  border-radius: 2px;
}
.section-subtitle { color: var(--text-muted); margin-bottom: 28px; }
.subsection-title { font-size: 18px; margin: 32px 0 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 24px;
}
.card-title { font-size: 16px; margin-bottom: 16px; }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: start;
}
.about-photo { padding: 8px; }
.about-photo img { border-radius: var(--radius); width: 100%; }
.about-info h3 { font-size: 18px; margin-bottom: 8px; }
.info-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  margin-top: 16px;
}
.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--divider);
  font-size: 14px;
}
.info-list li span { color: var(--text-muted); }
.info-list li strong { font-weight: 600; text-align: right; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
}
.pill-success { background: rgba(16, 124, 16, 0.15); color: #107c10; }
[data-theme="dark"] .pill-success { background: rgba(108, 203, 95, 0.15); color: #6ccb5f; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 24px;
}
.stat { text-align: center; padding: 20px 12px; }
.stat-num { font-size: 32px; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.skill {
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
}
.skill span { font-weight: 500; }
.skill i { font-style: normal; color: var(--text-muted); font-size: 13px; text-align: right; }
.bar {
  height: 6px;
  background: var(--bg-alt);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
[data-theme="dark"] .bar { background: rgba(255,255,255,0.06); }
.bar > div {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width 600ms cubic-bezier(0.1, 0.9, 0.2, 1);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.tool-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: transform var(--transition), border-color var(--transition);
}
.tool-box:hover { transform: translateY(-2px); border-color: var(--accent); }
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  background: var(--accent-soft);
}

/* ---------- Resume ---------- */
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.resume-block { margin-bottom: 16px; }
.resume-block h3 {
  font-size: 16px;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--divider);
}
.resume-block h4 { font-size: 15px; margin: 8px 0 4px; }
.timeline-item {
  position: relative;
  padding-left: 16px;
  margin-bottom: 16px;
  border-left: 2px solid var(--accent-soft);
}
.timeline-item::before {
  content: "";
  position: absolute;
  left: -5px; top: 6px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}
.timeline-meta {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 6px;
}
.dot-list { padding-left: 0; }
.dot-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.dot-list li::before {
  content: "";
  position: absolute;
  left: 4px; top: 9px;
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.center-row { text-align: center; margin-top: 24px; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.service { transition: transform var(--transition), box-shadow var(--transition); }
.service:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); }
.service h4 { font-size: 16px; margin-bottom: 8px; }
.service-icon {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 14px;
}

/* ---------- Portfolio ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.portfolio-item {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  box-shadow: var(--card-shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  font: inherit;
  text-align: left;
  padding: 0;
  width: 100%;
}
.portfolio-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow-hover);
  color: var(--text);
}
.portfolio-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--bg-alt);
}
.portfolio-info { padding: 14px 16px; }
.portfolio-info h4 { font-size: 15px; margin-bottom: 4px; }
.portfolio-info p { color: var(--text-muted); font-size: 13px; margin: 0; }

.portfolio-item.hidden { display: none; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal.open { display: flex; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 200ms ease;
}
.modal-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.30);
  max-width: 720px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  animation: slideUp 250ms cubic-bezier(0.1, 0.9, 0.2, 1);
}
.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: 1px solid var(--card-border);
  background: var(--surface-solid);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background-color var(--transition), border-color var(--transition);
}
.modal-close:hover { background: var(--accent-soft); border-color: var(--accent); }
.modal-image {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  display: block;
  background: var(--bg-alt);
}
.modal-body { padding: 24px; }
.modal-body h3 {
  font-size: 22px;
  margin-bottom: 12px;
}
.modal-body p {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

body.modal-open { overflow: hidden; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 32px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-card {
    grid-template-columns: 1fr;
    gap: 24px;
    text-align: center;
  }
  .hero-right .info-list { text-align: left; }
  .hero-actions { justify-content: center; }
  .skills-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .resume-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    background: var(--surface-solid);
    border-bottom: 1px solid var(--border);
    padding: 8px;
    gap: 2px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition), transform var(--transition);
  }
  .nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link { padding: 10px 14px; }
  .hero-card { padding: 24px; }
  .avatar { width: 160px; height: 160px; }
  .info-list { grid-template-columns: 1fr; }
  .skill { grid-template-columns: 110px 1fr 80px; }
}

@media (max-width: 520px) {
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .topbar-inner { padding: 8px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
