/* Ivan Orlov — визитка. Пастельный луг, рисунок от руки. */

@font-face { font-family: "Caveat"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/caveat-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 200 1000; font-display: swap; src: url("fonts/nunito-latin-wght-normal.woff2") format("woff2"); }

:root {
  --paper: #eef4e2;      /* туманный мох — фон */
  --petal: #fbfcf6;      /* лепесток — светлые поверхности */
  --meadow: #a9cb8c;     /* луг */
  --meadow-soft: #dcebc8;
  --teal: #9ccfc4;       /* бирюза тени */
  --sun: #fff4c2;        /* солнечный блик */
  --apricot: #f2b880;    /* рыжий кот */
  --apricot-deep: #e9a466;
  --ink: #34502f;        /* глубокий лист — текст */
  --ink-soft: #4f6b48;
  --bark: #a98163;

  --hand: "Caveat", "Comic Sans MS", cursive;
  --body: "Nunito", "Segoe UI", system-ui, sans-serif;

  --wobbly: 255px 18px 225px 16px / 16px 225px 18px 255px;
  --wobbly-2: 18px 220px 20px 240px / 230px 16px 240px 20px;
  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--paper);
  /* бумажное зерно */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .31 0 0 0 0 .18 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
p, li, dd { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; }
::selection { background: var(--sun); color: var(--ink); }

a { color: var(--ink); text-decoration-color: var(--apricot-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--ink); }

:focus-visible {
  outline: 3px dashed var(--apricot-deep);
  outline-offset: 4px;
  border-radius: 6px;
}

.skip {
  position: absolute; left: 16px; top: -60px;
  background: var(--petal); padding: 8px 14px; border-radius: var(--wobbly); z-index: 20;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--max), 100% - 2 * var(--gutter)); margin-inline: auto; }

/* ---------- Шапка ---------- */

.top {
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  padding-block: 18px;
}
.top--solid { position: relative; }
.top .wrap { display: flex; align-items: center; gap: 24px; }

.brand {
  font-family: var(--hand); font-size: 30px; font-weight: 700; line-height: 1;
  text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.brand svg { width: 30px; height: 30px; }

.nav { margin-left: auto; display: flex; gap: 22px; align-items: center; }
.nav a { font-weight: 700; font-size: 16px; text-decoration: none; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline wavy var(--apricot-deep) 2px; text-underline-offset: 6px; }

.lang {
  font: 700 15px/1 var(--body); color: var(--ink);
  background: var(--petal); border: 2px solid var(--ink-soft); border-radius: var(--wobbly);
  padding: 7px 12px; cursor: pointer;
}
.lang:hover { background: var(--sun); }

/* ---------- Первый экран ---------- */

.hero {
  position: relative; overflow: hidden;
  min-height: min(92vh, 900px);
  display: flex; align-items: center;
  padding-block: 120px 80px;
}
.hero__scene { position: absolute; inset: 0; }
.hero__scene svg { width: 100%; height: 100%; }
.hero__text { position: relative; z-index: 2; max-width: 560px; }

.hero h1 {
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(64px, 10vw, 132px); line-height: .9;
  margin: 0 0 6px; letter-spacing: -.01em;
  color: var(--ink);
}
.hero .alias {
  font-family: var(--hand); font-size: clamp(26px, 3vw, 34px); color: var(--ink-soft);
  margin: 0 0 22px; transform: rotate(-2deg); transform-origin: left;
}
.hero h1 .alias {
  display: block; font-weight: 400; line-height: 1.6; letter-spacing: normal;
  margin: 6px 0 22px;
}
.hero .lead { font-size: clamp(18px, 1.6vw, 21px); margin: 0 0 30px; max-width: 34em; }

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

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 800 17px/1 var(--body); text-decoration: none; color: var(--ink);
  padding: 15px 24px; border: 2.5px solid var(--ink); border-radius: var(--wobbly);
  background: var(--apricot);
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translate(-1px, -2px); box-shadow: 4px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn--ghost { background: var(--petal); border-radius: var(--wobbly-2); }

/* Солнечные блики в тени кроны — единственная фоновая анимация */
.dapples > * { animation: dapple 7s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.dapples > *:nth-child(3n) { animation-duration: 9s; animation-delay: -3s; }
.dapples > *:nth-child(3n+1) { animation-duration: 11s; animation-delay: -6s; }
@keyframes dapple {
  0%   { opacity: .35; transform: translate(0, 0) scale(.92); }
  50%  { opacity: .9; }
  100% { opacity: .55; transform: translate(6px, -4px) scale(1.06); }
}

/* ---------- Секции ---------- */

section { padding-block: clamp(64px, 9vw, 112px); }

.grass { height: 34px; border: 0; margin: 0; position: relative; overflow: hidden; opacity: .9; }
.grass::before {
  content: ""; position: absolute; inset: 0 -12px; transform-origin: 50% 100%;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='34' viewBox='0 0 240 34'%3E%3Cg fill='none' stroke='%2385ad73' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M0 30 Q60 26 120 30 T240 30'/%3E%3Cpath d='M18 30 q-2 -12 4 -20M24 30 q3 -9 10 -14M70 30 q-3 -14 -9 -22M75 30 q2 -10 -1 -17M130 30 q2 -13 9 -19M137 30 q-1 -8 -6 -12M188 30 q-4 -10 -11 -15M193 30 q1 -14 6 -21M200 30 q4 -6 9 -8'/%3E%3C/g%3E%3Cg fill='%23fbfcf6' stroke='%23c9b8a6' stroke-width='1'%3E%3Ccircle cx='96' cy='26' r='3'/%3E%3Ccircle cx='160' cy='27' r='2.5'/%3E%3C/g%3E%3C/svg%3E") repeat-x bottom / 240px 34px;
}

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 {
  font-family: var(--hand); font-weight: 700;
  font-size: clamp(46px, 6vw, 68px); line-height: 1; margin: 0 0 14px;
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 19px; }

/* Обо мне */
.about { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(32px, 6vw, 80px); align-items: center; }
.about .prose p { margin: 0 0 18px; max-width: 36em; }
.about .prose p:first-of-type { font-size: 21px; }
.portrait { position: relative; }
.portrait svg { width: 100%; height: auto; }
.portrait figcaption { font-family: var(--hand); font-size: 23px; line-height: 1.15; text-align: center; color: var(--ink-soft); margin-top: 6px; transform: rotate(-1.5deg); text-wrap: balance; }

/* Услуги */
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 36px); }
.services li { padding: 6px 4px; }
.services svg { width: 64px; height: 64px; margin-bottom: 10px; }
.services h3 { font-family: var(--hand); font-size: 34px; line-height: 1.05; margin: 0 0 8px; font-weight: 700; }
.services p { margin: 0; color: var(--ink-soft); }
.services .offer { margin-top: 10px; color: var(--ink); font-weight: 800; }
.services-note { margin: 24px 0 0; color: var(--ink-soft); }

/* Небольшая первая услуга */
.spot {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 52px); align-items: center;
  margin-bottom: clamp(36px, 5vw, 56px); padding: clamp(22px, 3.4vw, 36px);
  background: var(--sun); border: 2.5px solid var(--ink); border-radius: var(--wobbly-2); box-shadow: 4px 5px 0 var(--ink);
  scroll-margin-top: 24px;
}
.spot__tag { margin: 0 0 4px; font-weight: 800; font-size: 15.5px; color: var(--ink-soft); }
.spot h3 { font-family: var(--hand); font-size: clamp(40px, 5vw, 54px); line-height: 1; margin: 0 0 10px; font-weight: 700; }
.spot__main > p:last-child { margin: 0; color: var(--ink-soft); }
.spot ul { margin: 0 0 18px; padding-left: 20px; color: var(--ink); font-weight: 700; font-size: 17px; line-height: 1.4; }
.spot li + li { margin-top: 6px; }
.spot__fine { margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); }

/* ---------- Инфографика: тропинка ---------- */

.infographic { background: color-mix(in srgb, var(--meadow-soft) 55%, transparent); }

.path { position: relative; margin-bottom: clamp(72px, 9vw, 112px); }
.path__line { position: absolute; left: 0; right: 0; top: 34px; height: 60px; pointer-events: none; }
.path ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; position: relative; }
.path li { text-align: center; padding-inline: 6px; }
.stone {
  width: 92px; height: 74px; margin: 0 auto 16px;
  display: grid; place-items: center;
  font-family: var(--hand); font-size: 44px; font-weight: 700; line-height: 1;
  background: var(--petal); border: 2.5px solid var(--ink-soft);
  border-radius: 58% 42% 52% 48% / 55% 48% 52% 45%;
  box-shadow: 0 7px 0 -2px color-mix(in srgb, var(--meadow) 80%, var(--ink) 10%);
}
.path li:nth-child(2) .stone { background: var(--sun); border-radius: 45% 55% 48% 52% / 50% 56% 44% 50%; }
.path li:nth-child(3) .stone { background: #dff0ec; border-radius: 52% 48% 58% 42% / 46% 52% 48% 54%; }
.path li:nth-child(4) .stone { background: #fde3cc; }
.path h3 { font-family: var(--hand); font-size: 32px; margin: 0 0 6px; line-height: 1.05; }
.path p { margin: 0; font-size: 16.5px; color: var(--ink-soft); }

/* ---------- Инфографика: дерево навыков ---------- */

.tree { position: relative; display: grid; grid-template-columns: 1fr 1fr; column-gap: 120px; row-gap: 8px; max-width: 980px; margin-inline: auto; padding-bottom: 70px; }
.tree__trunk { position: absolute; left: 50%; top: -10px; bottom: 0; width: 70px; transform: translateX(-50%); }
.tree__trunk svg { width: 100%; height: 100%; }
.branch { position: relative; padding-block: 10px; }
.branch:nth-child(odd) { grid-column: 1; text-align: right; }
.branch:nth-child(even) { grid-column: 2; margin-top: 70px; }
.branch::after { /* веточка к стволу */
  content: ""; position: absolute; top: 30px; width: 64px; height: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 34'%3E%3Cpath d='M2 20 C 30 8, 60 26, 94 12' fill='none' stroke='%23a98163' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M48 17 c 6 -12 16 -14 22 -12 c -4 8 -12 13 -22 12z' fill='%23a9cb8c' stroke='%234f6b48' stroke-width='1.2'/%3E%3C/svg%3E") no-repeat center / contain;
}
.branch:nth-child(odd)::after { right: -62px; }
.branch:nth-child(even)::after { left: -62px; transform: scaleX(-1); }
.branch h3 { font-family: var(--hand); font-size: 38px; margin: 0 0 4px; line-height: 1.05; }
.branch p { margin: 0 0 12px; font-size: 16.5px; color: var(--ink-soft); }
.leaves { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.branch:nth-child(odd) .leaves { justify-content: flex-end; }
.leaves li {
  font-weight: 700; font-size: 15.5px; line-height: 1.2;
  padding: 7px 14px; background: var(--petal);
  border: 2px solid var(--meadow); border-radius: 18px 3px 18px 3px;
}
.branch:nth-child(2) .leaves li { border-color: var(--teal); }
.branch:nth-child(3) .leaves li { border-color: var(--apricot); }
.branch:nth-child(4) .leaves li { border-color: #c9b8e0; }

.infographic .note { font-family: var(--hand); font-size: 25px; color: var(--ink-soft); text-align: center; margin: 8px 0 0; }

/* ---------- Проекты ---------- */

.projects { list-style: none; margin: 0; padding: 0; }
.project {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(0, 260px); gap: 8px 32px; align-items: start;
  padding-block: 30px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='8' viewBox='0 0 300 8'%3E%3Cpath d='M0 4 Q 37 0 75 4 T 150 4 T 225 4 T 300 4' fill='none' stroke='%2385ad73' stroke-width='1.6' stroke-dasharray='2 7' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x bottom / 300px 8px;
}
.project:last-child { background: none; }
.project svg { width: 88px; height: 88px; }
.project h3 { font-family: var(--hand); font-size: 38px; line-height: 1; margin: 2px 0 8px; }
.project p { margin: 0; max-width: 38em; }
.project .stack { margin: 0; padding: 0; list-style: none; font-size: 15px; color: var(--ink-soft); }
.project .stack li { display: inline; }
.project .stack li + li::before { content: ", "; }
.project .stack dt { font-weight: 800; color: var(--ink); }
.project .meta { font-size: 15.5px; color: var(--ink-soft); }
.project .meta strong { color: var(--ink); display: block; margin-bottom: 2px; }
.projects-note { margin-top: 28px; color: var(--ink-soft); max-width: 40em; }

/* ---------- Блог-анонс и контакты ---------- */

.teaser { display: grid; grid-template-columns: 160px minmax(0, 640px); gap: 36px; align-items: center; }
.teaser svg { width: 160px; height: auto; }
.teaser h2 { font-family: var(--hand); font-size: clamp(44px, 5.5vw, 60px); line-height: 1; margin: 0 0 10px; }
.teaser p { margin: 0 0 22px; color: var(--ink-soft); }

.contact {
  position: relative;
  background: var(--petal); border: 2.5px solid var(--ink-soft); border-radius: var(--wobbly-2);
  padding: clamp(28px, 5vw, 56px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px;
}
.contact h2 { font-family: var(--hand); font-size: clamp(46px, 6vw, 66px); line-height: 1; margin: 0 0 12px; }
.contact p { margin: 0 0 18px; }
.contact .pay { color: var(--ink-soft); font-size: 16.5px; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; align-content: center; }
.links a { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; font-weight: 700; text-decoration: none; }
.links a > span:last-child { text-decoration: underline; text-decoration-color: var(--apricot-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; overflow-wrap: anywhere; }
.links a:hover > span:last-child { text-decoration-color: var(--ink); }
.links small { display: inline-block; width: 100%; font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.links svg { width: 34px; height: 34px; }

/* ---------- Подвал ---------- */

.foot { padding-block: 40px 56px; font-size: 15.5px; color: var(--ink-soft); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; }
.foot .hand { font-family: var(--hand); font-size: 24px; }

/* ---------- Блог ---------- */

.blog-head { padding-block: 40px 20px; }
.blog-head h1 { font-family: var(--hand); font-size: clamp(64px, 9vw, 110px); line-height: .9; margin: 0 0 12px; }
.blog-head p { margin: 0; color: var(--ink-soft); font-size: 19px; max-width: 34em; }

.empty {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; align-items: center;
  max-width: 820px; padding-block: 48px 96px;
}
.empty h2 { font-family: var(--hand); font-size: 46px; line-height: 1; margin: 0 0 10px; }
.empty p { margin: 0 0 22px; color: var(--ink-soft); max-width: 30em; }

.posts { list-style: none; margin: 0; padding: 24px 0 96px; display: grid; gap: 26px; max-width: 760px; }
.posts a { text-decoration: none; }
.posts h2 { font-family: var(--hand); font-size: 38px; line-height: 1; margin: 0 0 6px; }
.posts time { font-size: 15px; color: var(--ink-soft); }
.posts p { margin: 6px 0 0; }

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .hero { flex-direction: column; align-items: stretch; min-height: 0; padding-block: 96px 0; }
  .hero__text { padding-bottom: 28px; }
  .hero > .wrap { order: 1; }
  .hero__scene { order: 2; position: relative; inset: auto; height: clamp(340px, 46vw, 470px); }
  .hero__scene .text-glow { display: none; }
}

@media (max-width: 900px) {
  .about { grid-template-columns: 1fr; }
  .portrait { max-width: 260px; }
  .services { grid-template-columns: 1fr; }
  .spot { grid-template-columns: 1fr; }
  .services li { display: grid; grid-template-columns: 64px 1fr; gap: 0 18px; }
  .services svg { grid-row: span 3; margin: 0; }
  .project { grid-template-columns: 72px minmax(0, 1fr); }
  .project svg { width: 68px; height: 68px; }
  .project .meta { grid-column: 2; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .nav { gap: 14px; }
  .nav .nav-hide { display: none; }


  .path__line { display: none; }
  .path ol { grid-template-columns: 1fr; gap: 0; }
  .path li { display: grid; grid-template-columns: 76px 1fr; gap: 0 16px; text-align: left; padding: 0 0 22px; position: relative; }
  .path li:not(:last-child)::before { content: ""; position: absolute; left: 37px; top: 64px; bottom: 4px; border-left: 3px dashed var(--meadow); }
  .stone { width: 72px; height: 60px; font-size: 36px; margin: 0; grid-row: span 2; }

  .tree { grid-template-columns: 1fr; padding-left: 44px; row-gap: 18px; padding-bottom: 20px; }
  .tree__trunk { left: 0; transform: none; width: 34px; }
  .branch:nth-child(odd), .branch:nth-child(even) { grid-column: 1; text-align: left; margin-top: 0; }
  .branch:nth-child(odd) .leaves { justify-content: flex-start; }
  .branch::after, .branch:nth-child(odd)::after, .branch:nth-child(even)::after { left: -34px; right: auto; width: 40px; height: 22px; top: 22px; transform: scaleX(-1); }

  .teaser, .empty { grid-template-columns: 1fr; gap: 18px; }
  .teaser svg { width: 120px; }
  .empty svg { width: 180px; }
}

@media (max-width: 420px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dapples > * { animation: none; }
  .btn { transition: none; }
}
