/* =====================================================
   Roman Khanbekov — Personal Site
   Style: Corporate-Minimalist
   ===================================================== */

/* === Reset & Custom Properties === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg:        #ffffff;
  --bg-alt:    #f7f8fa;
  --bg-dark:   #0d1117;
  --text:      #111827;
  --text-mid:  #374151;
  --text-muted:#6b7280;
  --text-light:rgba(255, 255, 255, 0.65);
  --accent:    #2563eb;
  --accent-h:  #1d4ed8;
  --accent-bg: #eff6ff;
  --border:    #e5e7eb;
  --border-d:  rgba(255,255,255,0.1);
  --radius:    8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.06);
  --container: 1080px;
  --pad-v:     96px;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === Layout === */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

.section {
  padding: var(--pad-v) 0;
}
.section--alt  { background: var(--bg-alt); }
.section--dark { background: var(--bg-dark); }

/* === Typography Utilities === */
.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.label--light { color: rgba(96,165,250,1); }

.heading {
  font-size: clamp(26px, 3.8vw, 38px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 48px;
}
.heading--light { color: #ffffff; }
.heading--sm {
  font-size: clamp(22px, 2.8vw, 30px);
  margin-bottom: 0;
}

/* =====================================================
   HEADER / NAV
   ===================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.header.scrolled {
  box-shadow: 0 1px 16px rgba(0,0,0,0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 20px;
}

.nav__logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav__logo span { color: var(--accent); }

.nav__links {
  display: flex;
  list-style: none;
  gap: 2px;
}
.nav__links a {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.nav__links a:hover,
.nav__links a.active { color: var(--text); background: var(--bg-alt); }

.nav__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 3px;
  gap: 1px;
}
.lang-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* Burger */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
}
.nav__burger span {
  display: block;
  width: 21px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================
   HERO
   ===================================================== */
.hero {
  padding: 96px 0 80px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: center;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.hero__name {
  font-size: clamp(42px, 6vw, 68px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.04;
  color: var(--text);
  margin-bottom: 14px;
}

.hero__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 22px;
  line-height: 1.5;
}

.hero__tagline {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 40px;
}

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

/* Photo */
.hero__photo {
  width: 280px;
  height: 340px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: none;
}
.hero__img.loaded { display: block; }
.hero__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 100%);
}
.hero__img.loaded + .hero__placeholder { display: none; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 7px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-h);
  border-color: var(--accent-h);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}
.btn--ghost {
  background: transparent;
  color: var(--text-mid);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-alt);
  border-color: #d1d5db;
}

/* =====================================================
   ABOUT
   ===================================================== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 64px;
  align-items: start;
}

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

.about__text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.about__text p:last-child { margin-bottom: 0; }
.about__text strong { color: var(--text-mid); font-weight: 600; }

/* Sidebar */
.about__sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 4px;
}

.sidebar-block__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.sidebar-block__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.sidebar-block__list li {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.sidebar-block__list li span.muted {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 13px;
}

/* =====================================================
   STATS
   ===================================================== */
.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border-d);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat {
  padding: 44px 32px;
  border-right: 1px solid var(--border-d);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat:last-child { border-right: none; }

.stat__value {
  font-size: clamp(38px, 4vw, 52px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #ffffff;
  line-height: 1;
}

.stat__label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  margin-top: 4px;
}

.stat__sub {
  font-size: 12px;
  color: var(--text-light);
}

/* =====================================================
   EXPERIENCE / TIMELINE
   ===================================================== */
.timeline {
  display: flex;
  flex-direction: column;
}

.timeline__item {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}
.timeline__item:first-child { padding-top: 0; }
.timeline__item:last-child  { border-bottom: none; padding-bottom: 0; }

.timeline__period {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  padding-top: 3px;
  line-height: 1.5;
}

.timeline__role {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.timeline__company {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 16px;
}
.timeline__bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.timeline__bullets li {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  padding-left: 18px;
  position: relative;
}
.timeline__bullets li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border);
  font-weight: 400;
}

/* Education entries (compact) */
.edu__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.edu-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.edu-card__degree {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}
.edu-card__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}
.edu-card__sub {
  font-size: 13px;
  color: var(--text-muted);
}

/* =====================================================
   CASES
   ===================================================== */
.cases__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.case-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}
.case-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.case-card__tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 2px;
}
.case-card__company {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}
.case-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--text);
}
.case-card__challenge {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  flex-grow: 1;
}
.case-card__results {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.case-card__results li {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.case-card__results li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 11px;
  top: 1px;
}
.case-card__links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.case-card__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s;
}
.case-card__link:hover { color: var(--accent-h); }
.case-card__link--secondary {
  color: var(--text-muted);
  font-weight: 500;
}
.case-card__link--secondary:hover { color: var(--text-mid); }

/* =====================================================
   SKILLS
   ===================================================== */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.skills__group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.skills__group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.skills__group li {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-mid);
}

/* =====================================================
   CONTACT
   ===================================================== */
.contact__inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}
.contact__inner .heading { margin-bottom: 16px; }
.contact__text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-light);
  margin-bottom: 44px;
}
.contact__links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.contact__item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  padding: 13px 22px;
  border: 1px solid var(--border-d);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
}
.contact__item:hover {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}
.contact__icon {
  font-size: 15px;
  opacity: 0.6;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.contact__icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 0;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.footer p {
  font-size: 13px;
  color: var(--text-muted);
}
.footer__lang {
  display: flex;
  gap: 6px;
}
.footer__lang-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}
.footer__lang-btn:hover { color: var(--accent); }
.footer__lang-btn.active { color: var(--accent); }
.footer__lang span { color: var(--border); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 960px) {
  :root { --pad-v: 72px; }

  .hero__inner { grid-template-columns: 1fr; }
  .hero__photo { display: none; }
  .hero__tagline { max-width: 100%; }

  .about__grid { grid-template-columns: 1fr; gap: 40px; }

  .stats__grid { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: none; border-bottom: 1px solid var(--border-d); }
  .stat:nth-child(odd) { border-right: 1px solid var(--border-d); }
  .stat:nth-last-child(-n+2) { border-bottom: none; }

  .timeline__item { grid-template-columns: 1fr; gap: 10px; }
  .timeline__period { padding-top: 0; }

  .cases__grid { grid-template-columns: 1fr; }

  .skills__grid { grid-template-columns: repeat(2, 1fr); }

  .edu__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --pad-v: 56px; }

  .nav__links { display: none; }
  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav__links.open li { width: 100%; }
  .nav__links.open a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
  }
  .nav__burger { display: flex; }

  .hero { padding: 64px 0 56px; }
  .hero__name { font-size: 38px; }

  .stats__grid { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--border-d); }
  .stat:nth-child(odd) { border-right: none; }
  .stat:last-child { border-bottom: none; }

  .skills__grid { grid-template-columns: 1fr; }

  .contact__inner { text-align: left; }
  .contact__links { justify-content: flex-start; }

  .footer__inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}
