/* Личный сайт Валентина Москалёва.
   Идея: страница устроена как его рилс. Цвета взяты из аватарки (эспрессо-фон,
   розовые линзы) и из титров роликов (субтитры F7F5F0, жёлтый панч F0B427),
   заголовки набраны тем же Bitcrusher, что и титры. Единственная анимация —
   титр в шапке собирается по словам, как в роликах. */

@font-face {
  font-family: "Bitcrusher";
  src: url("/assets/fonts/bitcrusher-cd-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/golos-text-cyrillic-wght.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text";
  src: url("/assets/fonts/golos-text-latin-wght.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --espresso: #170e08;   /* фон за портретом на аватарке */
  --roast: #2b1c12;      /* поверхность чуть светлее фона */
  --glow: #6a3d22;       /* тёплое свечение из-за плеча на фото */
  --paper: #f7f5f0;      /* цвет субтитров в роликах */
  --signal: #f0b427;     /* жёлтый панч титров */
  --lens: #e8ab92;       /* розовые линзы очков */
  --muted: #c2b1a2;
  --display: "Bitcrusher", "Oswald", "Arial Narrow", sans-serif;
  --text: "Golos Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { background: var(--espresso); color-scheme: dark; }
body {
  margin: 0;
  background: var(--espresso);
  color: var(--paper);
  font: 400 1.0625rem/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--lens); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--paper); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* Верхняя строка: только переключатель языка, без навигационного шума. */
.top { display: flex; justify-content: flex-end; padding-top: 1.25rem; font-size: .95rem; }
.top a { color: var(--muted); text-decoration: none; padding: .35rem .2rem; }
.top a:hover { color: var(--paper); }

/* ---------- Шапка: титр + портрет ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(1rem, 4vw, 3rem);
  min-height: min(80vh, 780px);
  padding-bottom: 3rem;
}
.title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(3.3rem, 7.2vw, 7.4rem);
  line-height: .86;
  letter-spacing: .005em;
  margin: 0 0 2.25rem;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.title .line { display: block; white-space: nowrap; }
.title .punch { color: var(--signal); }
.title .w { display: inline-block; }

.intro { max-width: 30rem; font-size: 1.15rem; color: var(--muted); margin: 0 0 2rem; }
.intro strong { color: var(--paper); font-weight: 600; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.cta {
  display: inline-flex; align-items: center; gap: .6rem;
  background: var(--signal); color: var(--espresso);
  font-weight: 650; text-decoration: none;
  padding: .9rem 1.35rem; border-radius: 999px;
  transition: transform .15s ease-out, background-color .15s ease-out;
}
.cta:hover { color: var(--espresso); background: #ffc845; }
.cta:active { transform: scale(.97); }
.cta svg { width: 1.15em; height: 1.15em; }
.actions .note { color: var(--muted); font-size: .95rem; }

/* Портрет «выходит» из фона: фон фото и страницы — один и тот же эспрессо,
   радиальная маска растворяет края квадрата. */
.portrait { position: relative; justify-self: end; width: min(100%, 560px); aspect-ratio: 1; }
.portrait::before {
  content: ""; position: absolute; inset: 8% 4% 0;
  background: radial-gradient(closest-side, rgba(106, 61, 34, .55), transparent 72%);
  filter: blur(10px);
}
.portrait img {
  position: relative; width: 100%; height: 100%; object-fit: cover;
  -webkit-mask-image: radial-gradient(70% 72% at 50% 44%, #000 58%, transparent 100%);
          mask-image: radial-gradient(70% 72% at 50% 44%, #000 58%, transparent 100%);
}

/* ---------- Где меня найти ---------- */
.channels { border-top: 1px solid rgba(247, 245, 240, .12); }
.channels ul {
  list-style: none; margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
}
.channels li + li { border-left: 1px solid rgba(247, 245, 240, .12); }
.channels a {
  display: block; padding: 1.4rem 1.25rem 1.5rem 1.25rem; text-decoration: none; color: var(--paper);
  transition: background-color .15s ease-out;
}
.channels a:hover { background: var(--roast); color: var(--paper); }
/* первая колонка встаёт по левому краю текста страницы */
.channels li:first-child a { padding-left: 0; }
.channels .name { display: block; font-family: var(--display); font-size: 2rem; line-height: 1; margin-bottom: .45rem; }
.channels .what { display: block; color: var(--muted); font-size: .95rem; }
.channels .handle { color: var(--lens); }

/* ---------- Ролики ---------- */
section { padding: clamp(3.5rem, 8vw, 6.5rem) 0 0; }
.section-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.2rem); line-height: .95; margin: 0 0 .75rem;
}
.lead { color: var(--muted); max-width: 36rem; margin: 0 0 2rem; }

.reels {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(170px, 19vw, 216px);
  gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  /* лента уходит за правый край экрана: видно, что её листают */
  padding: 0 var(--gutter) 1rem; margin: 0 calc(50% - 50vw) 0 calc(var(--gutter) * -1);
  scrollbar-width: thin; scrollbar-color: var(--glow) transparent;
}
.reel { scroll-snap-align: start; text-decoration: none; color: var(--paper); }
.reel figure { margin: 0; }
.reel .frame {
  aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: var(--roast);
  box-shadow: 0 0 0 1px rgba(247, 245, 240, .08);
}
.reel img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease-out; }
.reel:hover img { transform: scale(1.03); }
.reel figcaption { padding: .6rem .15rem 0; font-size: .92rem; line-height: 1.35; color: var(--muted); }
.reel:hover figcaption { color: var(--paper); }

/* ---------- Кто я ---------- */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(1.5rem, 5vw, 4rem); }
.about p { margin: 0 0 1.1rem; max-width: 38rem; }
.facts { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 1.1rem; }
.facts li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; align-items: center; }
.facts b { font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: .9; color: var(--signal); }
.facts span { color: var(--muted); }

/* ---------- Проекты ---------- */
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(247, 245, 240, .12); }
.projects li { border-bottom: 1px solid rgba(247, 245, 240, .12); }
.projects a, .projects .row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem 2rem; align-items: center;
  padding: 1.6rem 0; text-decoration: none; color: var(--paper);
}
.projects .pname { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.4rem); line-height: .95; transition: color .15s ease-out; }
.projects a:hover .pname { color: var(--signal); }
.projects .pdesc { color: var(--muted); }

/* ---------- Подвал ---------- */
footer {
  margin-top: clamp(4rem, 9vw, 7rem); padding: 2rem 0 3rem;
  border-top: 1px solid rgba(247, 245, 240, .12);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem;
  color: var(--muted); font-size: .92rem;
}
footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }

/* ---------- Анимация титра: слова появляются по одному, как в роликах ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* порядок слова задаёт --i в разметке: титр собирается сверху вниз */
  .title .w {
    opacity: 0; transform: translateY(.18em) scale(1.06);
    animation: word .42s cubic-bezier(.2, .7, .2, 1) forwards;
    animation-delay: calc(var(--i, 0) * 140ms + 120ms);
  }
  @keyframes word { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Мобильная раскладка ---------- */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 0; padding-top: .5rem; }
  .portrait { order: -1; justify-self: center; width: min(78vw, 400px); margin-bottom: -2.5rem; }
  .title { margin-bottom: 1.5rem; }
  .channels ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channels li:nth-child(3) { border-left: 0; }
  .channels li:nth-child(n + 3) { border-top: 1px solid rgba(247, 245, 240, .12); }
  .channels li:nth-child(odd) a { padding-left: 0; }
  .about { grid-template-columns: 1fr; }
  .projects a { grid-template-columns: 1fr; gap: .4rem; }
}
@media (max-width: 420px) {
  .channels a { padding: 1.1rem .9rem 1.2rem; }
  .channels .name { font-size: 1.7rem; }
  .facts li { grid-template-columns: 5.2rem 1fr; }
}
