/* ---------- Fonts (self-hosted Manrope, latin + cyrillic) ---------- */
@font-face {
  font-family: 'Manrope'; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope'; font-weight: 400; font-display: swap;
  src: url('../assets/fonts/manrope-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'Manrope'; font-weight: 600; font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope'; font-weight: 600; font-display: swap;
  src: url('../assets/fonts/manrope-latin-600-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}
@font-face {
  font-family: 'Manrope'; font-weight: 800; font-display: swap;
  src: url('../assets/fonts/manrope-cyrillic-800-normal.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope'; font-weight: 800; font-display: swap;
  src: url('../assets/fonts/manrope-latin-800-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+2000-206F;
}

/* ---------- Tokens ---------- */
:root {
  --bg: #f1f3f6;
  --card: #ffffff;
  --ink: #101623;
  --muted: #5d6675;
  --line: #e4e8ee;
  --indigo: #4f46e5;
  --indigo-dark: #4338ca;
  --mint: #dcf5e8;
  --lavender: #e8e6fb;
  --peach: #ffeadb;
  --sky: #e1f0fd;
  --green: #12b76a;
  --r: 24px;
  --font: 'Manrope', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
::selection { background: var(--indigo); color: #fff; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: clamp(1.25rem, 3vw, 2rem); }

.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.cell {
  background: var(--card);
  border-radius: var(--r);
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: 0 1px 2px rgba(16, 22, 35, .04), 0 8px 24px -12px rgba(16, 22, 35, .08);
}
article.cell { transition: transform .25s ease, box-shadow .25s ease; }
article.cell:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(16, 22, 35, .05), 0 16px 36px -12px rgba(16, 22, 35, .14);
}

/* ---------- Hero ---------- */
.hero-main { grid-column: span 8; display: flex; flex-direction: column; justify-content: center; }
.pill {
  display: inline-block;
  align-self: flex-start;
  background: var(--ink);
  color: #fff;
  font-size: .78rem;
  font-weight: 600;
  padding: .35rem .9rem;
  border-radius: 999px;
}
.hero-main h1 {
  font-weight: 800;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  letter-spacing: -.03em;
  line-height: 1.08;
  margin-top: 1.1rem;
}
.hero-main .role { font-size: 1.15rem; color: var(--muted); margin-top: .7rem; }
.hero-main .role b { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }
.btn {
  display: inline-block;
  padding: .7rem 1.3rem;
  border-radius: 14px;
  font-weight: 600;
  font-size: .93rem;
  text-decoration: none;
  background: var(--bg);
  transition: background .2s, transform .2s;
}
.btn:hover { background: #e6e9f0; transform: translateY(-1px); }
.btn-primary { background: var(--indigo); color: #fff; }
.btn-primary:hover { background: var(--indigo-dark); }

.hero-side { grid-column: span 4; display: grid; gap: 1.1rem; }
.stat { border-radius: var(--r); padding: 1.4rem 1.6rem; }
.stat b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: #3d4654; font-size: .9rem; }
.stat-mint { background: var(--mint); }
.stat-lav { background: var(--lavender); }
.stat-peach { background: var(--peach); }
.status-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green);
  margin-right: .5em;
}

.about { grid-column: span 12; color: var(--muted); font-size: 1.05rem; }
.about b { color: var(--ink); }

/* ---------- Section titles ---------- */
.sec { grid-column: span 12; margin-top: 1.6rem; }
.sec h2 { font-weight: 800; font-size: clamp(1.4rem, 3.2vw, 1.9rem); letter-spacing: -.02em; }
.sec p { color: var(--muted); margin-top: .2rem; font-size: .95rem; }

/* ---------- Skills ---------- */
.skill-cell { grid-column: span 6; }
.skill-cell h3 {
  font-size: .82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { background: var(--bg); font-weight: 600; font-size: .86rem; padding: .35rem .8rem; border-radius: 10px; }
.skill-mint { background: var(--mint); }
.skill-lav { background: var(--lavender); }
.skill-sky { background: var(--sky); }
.skill-peach { background: var(--peach); }
.skill-mint .chip, .skill-lav .chip, .skill-sky .chip, .skill-peach .chip { background: rgba(255, 255, 255, .75); }

/* ---------- Experience ---------- */
.exp { grid-column: span 12; }
.exp h3 { font-size: 1.15rem; font-weight: 800; }
.exp .desc { color: var(--muted); margin-top: .4rem; }
.exp ul { margin-top: 1rem; display: grid; gap: .6rem; }
.exp li { padding-left: 1.7rem; position: relative; font-size: .97rem; }
.exp li::before {
  content: '✓';
  position: absolute;
  left: 0; top: 0;
  width: 1.1rem; height: 1.1rem;
  margin-top: .2rem;
  border-radius: 6px;
  background: var(--mint);
  color: #0e7d4c;
  font-size: .72rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.1rem; }
.tag { background: var(--bg); color: var(--muted); font-weight: 600; font-size: .78rem; padding: .25rem .7rem; border-radius: 8px; }

/* ---------- Pet projects ---------- */
.pet { grid-column: span 6; display: flex; flex-direction: column; }
.pet-wide { grid-column: span 12; }
.pet h3 { font-size: 1.1rem; font-weight: 800; }
.pet p { color: var(--muted); margin-top: .5rem; font-size: .95rem; flex: 1; }
.pet h3 a { text-decoration: none; }
.pet h3 a:hover { text-decoration: underline; }

.pet-hero {
  grid-column: span 12;
  background: linear-gradient(120deg, #3730b8 0%, #4f46e5 60%, #6d5ff0 100%);
  color: #fff;
}
.pet-hero h3 { font-size: 1.35rem; }
.pet-hero p { color: #efedff; }
.pet-hero .tag { background: rgba(255, 255, 255, .16); color: #fff; }

.live {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: .18rem .6rem;
  border-radius: 999px;
  margin-left: .6ch;
  vertical-align: middle;
}
.link-out { font-weight: 700; margin-top: 1.2rem; display: inline-block; color: #fff; text-decoration: none; }
.link-out:hover { text-decoration: underline; }
.link-dark { color: var(--indigo); }

/* ---------- Education ---------- */
.edu { grid-column: span 12; }
.edu-row { display: grid; grid-template-columns: 140px 1fr; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.edu-row:last-child { border-bottom: none; }
.edu-row time { font-weight: 700; font-size: .85rem; color: var(--indigo); }
.edu-row h3 { font-size: 1rem; font-weight: 700; }
.edu-row p { color: var(--muted); font-size: .9rem; margin-top: .1rem; }

/* ---------- Footer ---------- */
.foot {
  grid-column: span 12;
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: clamp(2.5rem, 6vw, 3.5rem);
}
.foot h2 { font-weight: 800; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -.02em; }
.foot p { color: #9aa3b2; margin-top: .5rem; }
.foot .actions { justify-content: center; margin-top: 1.6rem; }
.foot .btn { background: rgba(255, 255, 255, .1); color: #fff; }
.foot .btn:hover { background: rgba(255, 255, 255, .2); }
.foot .btn-primary { background: var(--indigo); }
.foot .btn-primary:hover { background: var(--indigo-dark); }
.copy { grid-column: span 12; text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 0 2rem; }

/* ---------- Scroll reveal (только при работающем JS: html.js) ---------- */
.reveal { transition: opacity .5s ease, transform .5s ease; }
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-main, .hero-side, .skill-cell, .pet { grid-column: span 12; }
  .edu-row { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
