/* ==========================================================================
   Abduqodirov Sarvar — Portfolio & CV
   Minimal SaaS design · Light + Dark theme
   ========================================================================== */

/* ---- Design tokens ---- */
:root {
  --bg:            #ffffff;
  --bg-subtle:     #f7f8fa;
  --surface:       #ffffff;
  --surface-2:     #f9fafb;
  --border:        #e6e8ec;
  --border-strong: #d1d5db;
  --text:          #0f172a;
  --text-muted:    #5b6472;
  --text-faint:    #8b95a5;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-soft:   #eff4ff;
  --accent-text:   #ffffff;
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:     0 4px 16px rgba(15, 23, 42, 0.06);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-pill:   999px;
  --maxw:          880px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg:            #0b0f17;
  --bg-subtle:     #0d1220;
  --surface:       #111826;
  --surface-2:     #0f1522;
  --border:        #1e2635;
  --border-strong: #2b3548;
  --text:          #e7edf6;
  --text-muted:    #9aa6b6;
  --text-faint:    #6b7688;
  --accent:        #4f86f7;
  --accent-hover:  #6b9bff;
  --accent-soft:   rgba(79, 134, 247, 0.12);
  --accent-text:   #ffffff;
  --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:     0 6px 24px rgba(0, 0, 0, 0.35);
}

/* ---- Base ---- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ---- Header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 62px;
  max-width: 1080px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 0 auto; }
.site-header nav { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }

.brand .logo {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; letter-spacing: .5px;
}

.brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.brand-text .name { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; }
.brand-text .role { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }

.nav-links {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color .15s, background-color .15s;
}

/* Hide brand subtitle when horizontal space is tight (hero already shows it) */
@media (max-width: 1180px) {
  .brand-text .role { display: none; }
}
.nav-links a:hover { color: var(--text); background: var(--bg-subtle); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* ---- Controls: theme + language ---- */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg-subtle); border-color: var(--border-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.lang-select {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 0 30px 0 12px;
  height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235b6472' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.lang-select:hover { border-color: var(--border-strong); }

.menu-toggle { display: none; }

/* ---- Hero ---- */
.hero { padding: 72px 0 56px; }
.hero .eyebrow {
  color: var(--accent);
  font-size: 14px; font-weight: 600;
  letter-spacing: .3px;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.hero .subtitle {
  font-size: clamp(16px, 2.4vw, 19px);
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 22px;
}
.hero .summary {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 680px;
  margin-bottom: 28px;
}

.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}
.fact .k { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .5px; }
.fact .v { font-size: 14px; font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; color: var(--accent-text); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--bg-subtle); text-decoration: none; color: var(--text); }

/* ---- Sections ---- */
.section { padding: 44px 0; border-top: 1px solid var(--border); }
.section-head { margin-bottom: 26px; }
.section-head h2 {
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--text-faint);
}
.section-head h2::before {
  content: ""; display: inline-block;
  width: 18px; height: 2px; background: var(--accent);
  vertical-align: middle; margin-right: 10px; border-radius: 2px;
}

/* ---- Timeline (experience / education) ---- */
.timeline { display: flex; flex-direction: column; gap: 4px; }
.tl-item {
  position: relative;
  padding: 18px 0 18px 26px;
  border-left: 2px solid var(--border);
}
.tl-item::before {
  content: ""; position: absolute; left: -6px; top: 24px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.tl-item:last-child { border-left-color: transparent; }
.tl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.tl-head .title { font-size: 16px; font-weight: 700; }
.tl-head .org { color: var(--accent); font-weight: 600; }
.tl-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--text-faint);
  margin: 4px 0 8px;
}
.tl-meta .badge {
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 9px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: 12px;
}
.tl-item p { margin: 0; color: var(--text-muted); font-size: 14.5px; }

/* ---- Projects grid ---- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .card-tag {
  display: inline-block;
  font-size: 12px; font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px; border-radius: var(--radius-pill);
  margin-bottom: 10px;
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.card p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ---- Skills ---- */
.skills-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.skill-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.skill-block h3 { font-size: 14.5px; font-weight: 700; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12.5px; font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 4px 10px; border-radius: var(--radius-pill);
}

/* ---- Lists (certs / languages) ---- */
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.plain-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
}
.plain-list li .lvl { color: var(--text-faint); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.contact-card .row { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 5px 0; font-size: 14.5px; }
.contact-card .row .k { color: var(--text-faint); min-width: 82px; font-weight: 600; }
.contact-card .row a { min-width: 0; overflow-wrap: anywhere; }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .site-header .container { gap: 10px; }
  .grid, .skills-grid, .contact-grid { grid-template-columns: 1fr; }
  .nav-links {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 14px;
    box-shadow: var(--shadow-md);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px; }
  .menu-toggle { display: inline-flex; }
  /* Name lives in the hero on mobile; keep only the logo in the header */
  .brand-text { display: none; }
  .hero { padding: 48px 0 40px; }
}
