/* ============================================================
   Денис Дробышев — сайт-визитка. Vanilla CSS, без фреймворков.
   Нейтральная сине-графитовая тема.
   ============================================================ */

:root {
  --bg: #0d1017;
  --bg-2: #0f131b;
  --surface: #151a23;
  --surface-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e7ebf1;
  --muted: #929cac;
  --accent: #6a8ec9;
  --accent-2: #8aa2cc;
  --grad: linear-gradient(90deg, #6f97d6, #5179c0);
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
  --radius: 16px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-2: #eceff4;
  --surface: #ffffff;
  --surface-2: rgba(20, 30, 50, 0.04);
  --border: rgba(10, 20, 40, 0.10);
  --border-strong: rgba(10, 20, 40, 0.18);
  --text: #1a2233;
  --muted: #566173;
  --accent: #3f66b8;
  --accent-2: #3f66b8;
  --grad: linear-gradient(90deg, #4f77c4, #3f66b8);
  --shadow: 0 20px 45px -24px rgba(27, 42, 74, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background — сдержанный, один акцент */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55rem 40rem at 85% -10%, rgba(106, 142, 201, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -0.02em; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 4vw, 2.5rem);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
}
.brand-name { font-size: 0.98rem; }

.nav { margin-left: auto; display: flex; gap: 1.4rem; }
.nav a { color: var(--muted); font-size: 0.92rem; transition: color 0.2s; }
.nav a:hover { color: var(--text); }

.theme-toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 1.05rem;
  transition: border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ===== Layout ===== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem) 0;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  margin-bottom: 2rem;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.section-title .num {
  font-size: 0.9rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--accent-2);
  font-weight: 600;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem) 0;
}
.hero-glow {
  position: absolute;
  top: -20%; right: -5%;
  width: 34rem; height: 34rem;
  background: radial-gradient(circle, rgba(106, 142, 201, 0.16), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 5vw, 4rem);
  flex-wrap: wrap-reverse;
  justify-content: space-between;
}
.hero-text { flex: 1 1 420px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-2);
  margin: 0 0 0.9rem;
}
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); font-weight: 800; }
.lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  max-width: 34rem;
  margin: 1.2rem 0 1.8rem;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 11px;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 28px -14px rgba(81, 121, 192, 0.8);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -14px rgba(81, 121, 192, 0.9); }
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); }

.hero-badges { list-style: none; padding: 0; margin: 1.8rem 0 0; }
.hero-badges li {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-size: 0.9rem; color: var(--muted);
}
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #35b98a;
  box-shadow: 0 0 0 4px rgba(53, 185, 138, 0.16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(53, 185, 138, 0.05); } }

/* Avatar */
.hero-avatar { flex: 0 0 auto; }
.avatar-ring {
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--border-strong));
  box-shadow: var(--shadow);
}
.avatar-ring img {
  display: block;
  width: clamp(150px, 30vw, 220px);
  height: clamp(150px, 30vw, 220px);
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
}

/* Stats */
.stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: clamp(2.5rem, 6vw, 4rem) 0 0;
  padding: 0;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
.stats b {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--accent);
}
.stats span { font-size: 0.82rem; color: var(--muted); }

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}
.about-grid p { margin: 0 0 1rem; color: var(--muted); }
.about-grid strong { color: var(--text); }
.about-facts {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}
.fact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fact span { color: var(--muted); font-size: 0.88rem; }
.fact b { font-size: 0.9rem; text-align: right; }

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  transition: border-color 0.25s, transform 0.25s;
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-card h3 { font-size: 1.02rem; margin-bottom: 0.9rem; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0; }
.tags li {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Tech badges strip */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 2rem;
}
.badges img { height: 22px; display: block; border-radius: 4px; }

/* ===== Showcase (главный проект) ===== */
.showcase {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  padding: 1.5rem 1.7rem;
  margin-bottom: 1.6rem;
}
.showcase-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent-2);
  margin-bottom: 0.5rem;
}
.showcase h3 { font-size: 1.25rem; margin-bottom: 0.55rem; }
.showcase p { color: var(--muted); font-size: 0.95rem; margin: 0 0 0.9rem; max-width: 65ch; }
.showcase .tags { margin-bottom: 0.6rem; }
.showcase .proj-note { display: block; }

/* ===== Filters + Projects ===== */
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.6rem; }
.filter {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.filter:hover { color: var(--text); border-color: var(--accent); }
.filter.is-active { background: var(--grad); color: #fff; border-color: transparent; }

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1rem;
}
.proj {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.3rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}
.proj:hover { border-color: var(--accent); transform: translateY(-3px); }
.proj h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 0.4rem; }
.proj h3::after { content: "↗"; color: var(--muted); font-size: 0.8rem; opacity: 0; transition: opacity 0.2s; }
.proj:hover h3::after { opacity: 1; }
.proj p { margin: 0; font-size: 0.88rem; color: var(--muted); flex: 1; }
.proj-tags {
  font-size: 0.74rem;
  color: var(--accent-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.proj.is-hidden { display: none; }

/* Непубличные проекты — без ссылки */
.proj--static { cursor: default; }
.proj--static:hover { transform: none; border-color: var(--border-strong); }
.proj--static h3::after { content: none; }
.proj-note {
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.75;
  letter-spacing: 0.02em;
}

.proj-more { margin-top: 1.6rem; color: var(--muted); font-size: 0.92rem; }
.proj-more a { color: var(--accent-2); font-weight: 600; }
.proj-more a:hover { text-decoration: underline; }

/* ===== Timeline ===== */
.timeline { display: grid; gap: 0.5rem; position: relative; }
.tl-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  padding-bottom: 1.5rem;
}
.tl-dot {
  position: relative;
  width: 13px; height: 13px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.tl-dot::after {
  content: "";
  position: absolute;
  left: 50%; top: 19px; bottom: -24px;
  transform: translateX(-50%);
  width: 2px;
  background: var(--border-strong);
}
.tl-item:last-child .tl-dot::after { display: none; }
.tl-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}
.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.tl-top h3 { font-size: 1rem; }
.tl-date {
  font-size: 0.8rem;
  color: var(--accent-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap;
}
.tl-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ===== Contact ===== */
.contact { padding-bottom: 2rem; }
.contact-card {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(2rem, 6vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.contact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(30rem 20rem at 50% -30%, rgba(106, 142, 201, 0.12), transparent 65%);
  pointer-events: none;
}
.contact-card h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 0.6rem; }
.contact-card p { color: var(--muted); margin: 0 auto 1.8rem; max-width: 30rem; }
.contact-links { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; }

/* ===== Footer ===== */
.site-footer {
  max-width: var(--max);
  margin: clamp(3rem, 7vw, 5rem) auto 0;
  padding: 2rem clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.site-footer a:hover { color: var(--text); }
.site-footer .counter { height: 20px; opacity: 0.8; border-radius: 4px; }

/* ===== Language switch ===== */
.lang-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
}
.lang-switch a {
  padding: 0.4rem 0.6rem;
  color: var(--muted);
  transition: color 0.2s, background 0.2s;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.is-active { background: var(--grad); color: #fff; }

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 820px) {
  .nav { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .brand-name { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-cta { width: 100%; }
}

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