/* ===== Портфоліо Ангеліни Краснової ===== */
:root {
  --bg: #FBFAF7;
  --surface: #FFFFFF;
  --sage: #4E8070;
  --sage-dark: #35594D;
  --sage-soft: #EAF2EE;
  --sage-line: #C9DDD3;
  --terra: #B8664F;
  --peach: #FBEDE6;
  --peach-deep: #F3D9CC;
  --text: #2F3437;
  --muted: #6B7570;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(47, 52, 55, .04), 0 12px 32px -12px rgba(47, 52, 55, .14);
  --max: 1160px;
  --display: "Unbounded", "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }

/* ---------- Навігація ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--sage-line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { font-family: var(--display); font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -.01em; }
.logo span { color: var(--terra); }
.nav__links { display: flex; align-items: center; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__links a { text-decoration: none; font-weight: 600; font-size: 15px; color: var(--muted); transition: color .2s; white-space: nowrap; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--sage-dark); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px;
  font-weight: 700; font-size: 15px; text-decoration: none;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--sage); color: #fff; }
.btn--primary:hover { background: var(--sage-dark); }
.btn--ghost { border-color: var(--sage-line); color: var(--sage-dark); background: var(--surface); }
.btn--ghost:hover { border-color: var(--sage); }
.btn--small { padding: 9px 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--sage-soft); color: var(--sage-dark);
  padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 700;
}
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--sage); }
.hero h1 {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(32px, 4.6vw, 56px); line-height: 1.08; letter-spacing: -.03em;
  margin: 22px 0 20px;
}
.hero h1 em { font-style: normal; color: var(--terra); }
.hero__lead { font-size: 19px; color: var(--muted); max-width: 34em; margin: 0 0 30px; }
.hero__lead strong { color: var(--text); font-weight: 700; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__photo { position: relative; justify-self: center; width: min(360px, 100%); }
.hero__photo::before {
  content: ""; position: absolute; inset: 22px -22px -22px 22px;
  background: var(--peach-deep); border-radius: var(--radius);
}
.hero__photo img { position: relative; border-radius: var(--radius); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: auto; }
.hero__badge {
  position: absolute; left: -26px; bottom: -26px;
  background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 12px 16px; font-size: 14px; line-height: 1.35;
}
.hero__badge b { display: block; font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--sage-dark); }

/* ---------- Секції ---------- */
.section { padding: 72px 0; }
.section--tint { background: var(--sage-soft); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 36px; flex-wrap: wrap; }
.section__kicker { color: var(--sage); font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.section h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 3.6vw, 42px); letter-spacing: -.02em; line-height: 1.12; margin: 8px 0 0; }
.section__note { color: var(--muted); max-width: 30em; margin: 0; }
.video {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #1f2523; box-shadow: var(--shadow); border: 0; padding: 0; width: 100%; cursor: pointer;
}
.video img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s, opacity .3s; opacity: .92; }
.video:hover img { transform: scale(1.03); opacity: 1; }
.video__play {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .25s;
}
.video:hover .video__play { transform: scale(1.08); }
.video__play svg { width: 30px; height: 30px; margin-left: 5px; fill: var(--terra); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; color: var(--terra); background: var(--peach); padding: 5px 12px; border-radius: 999px; }
.roles { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 22px; }
.roles li { background: var(--sage-soft); color: var(--sage-dark); font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 10px; }
.steps { list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; }
.steps li { position: relative; padding: 0 0 14px 46px; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--peach); color: var(--terra); font-weight: 800; font-size: 14px;
  display: grid; place-items: center;
}
.steps li b { display: block; }
.steps li span { color: var(--muted); font-size: 15px; }

/* ---------- Статті ---------- */
.articles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.article {
  background: var(--surface); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; text-decoration: none;
  border: 1px solid transparent; box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s;
}
.article:hover { transform: translateY(-4px); border-color: var(--sage-line); }
.article__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; }
.article__format { font-size: 13px; font-weight: 700; color: var(--sage-dark); background: var(--sage-soft); padding: 5px 11px; border-radius: 999px; }
.article__views { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.article__views svg { width: 16px; height: 16px; stroke: var(--muted); }
.article h3 { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.28; margin: 0 0 10px; letter-spacing: -.01em; }
.article p { color: var(--muted); font-size: 15px; margin: 0 0 20px; }
.article__site { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; color: var(--terra); }
.article__site svg { width: 18px; height: 18px; stroke: var(--terra); transition: transform .25s; }
.article:hover .article__site svg { transform: translate(3px, -3px); }
.articles__note { margin-top: 26px; color: var(--muted); font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.articles__note svg { width: 20px; height: 20px; stroke: var(--sage); flex: none; margin-top: 2px; }

/* ---------- Навички ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill { background: var(--surface); border-radius: var(--radius); padding: 26px; border: 1px solid var(--sage-line); }
.skill h3 { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.skill h3 i { width: 10px; height: 10px; border-radius: 50%; background: var(--terra); display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { background: var(--bg); border: 1px solid var(--sage-line); padding: 6px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.chips small { color: var(--muted); font-weight: 600; }

/* ---------- Контакти ---------- */
.contact { background: var(--sage-dark); color: #fff; border-radius: 32px; padding: clamp(32px, 6vw, 64px); display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.contact h2 { font-family: var(--display); font-weight: 600; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.contact p { color: rgba(255, 255, 255, .78); margin: 0; }
.contact__list { display: grid; gap: 12px; }
.contact__item {
  display: flex; align-items: center; gap: 14px; text-decoration: none;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
  padding: 14px 18px; border-radius: 16px; transition: background .2s, transform .2s;
}
.contact__item:hover { background: rgba(255, 255, 255, .15); transform: translateX(4px); }
.contact__item svg { width: 22px; height: 22px; stroke: var(--peach-deep); flex: none; }
.contact__item small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255, 255, 255, .6); }
.contact__item span { font-weight: 700; word-break: break-all; }

.footer { padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- Поява при скролі ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .hero__grid, .contact { grid-template-columns: 1fr; }
  .hero__photo { order: -1; width: min(230px, 66%); }
  .hero__badge { left: -12px; }
  .articles, .skills { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .nav__links li:nth-child(-n+2) { display: none; }
  .nav__links { gap: 12px; }
  .nav__links a { font-size: 14px; }
  .nav__links .btn--small { padding: 8px 12px; font-size: 13px; }
  .logo { font-size: 13px; }
  .hero { padding-top: 36px; }
  .hero__badge { left: 50%; transform: translateX(-50%); bottom: -40px; white-space: nowrap; padding: 9px 14px; font-size: 13px; }
  .hero__badge b { font-size: 14px; }
  .hero__photo { margin-bottom: 36px; }
  .articles, .skills { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
}
.nav__links .btn--primary, .nav__links .btn--primary:hover { color: #fff; }

/* ---------- Картки проєктів (головна) ---------- */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.project {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid transparent;
  transition: transform .3s, border-color .3s;
}
a.project:hover { transform: translateY(-6px); border-color: var(--sage-line); }
.project__thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sage-soft); }
.project__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
a.project:hover .project__thumb img { transform: scale(1.05); }
.project__play {
  position: absolute; right: 16px; bottom: 16px; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255, 255, 255, .92); display: grid; place-items: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
.project__play svg { width: 20px; height: 20px; margin-left: 3px; fill: var(--terra); }
.project__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project__body h3 { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; margin: 12px 0 8px; letter-spacing: -.01em; }
.project__body p { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.project__more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--sage-dark); }
.project__more svg { width: 18px; height: 18px; stroke: currentColor; transition: transform .25s; }
a.project:hover .project__more svg { transform: translateX(4px); }

/* ---------- Сторінка проєкту ---------- */
.back { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; color: var(--sage-dark); font-size: 15px; }
.back svg { width: 18px; height: 18px; stroke: currentColor; transition: transform .25s; }
.back:hover svg { transform: translateX(-4px); }
.case-hero { padding: 40px 0 28px; }
.case-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 52px); line-height: 1.1; letter-spacing: -.02em; margin: 16px 0 14px; }
.case-hero__lead { font-size: 19px; color: var(--muted); max-width: 40em; margin: 0; }
.case-video { margin-top: 28px; }
.case-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; padding: 56px 0 24px; }
.case-grid h2 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 0 0 14px; letter-spacing: -.01em; }
.case-grid p { margin: 0 0 16px; }
.case-side { display: flex; flex-direction: column; gap: 18px; }
.case-box { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.case-box h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--sage); margin: 0 0 12px; }
.case-box dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 15px; }
.case-box dt { color: var(--muted); }
.case-box dd { margin: 0; font-weight: 600; }
.case-photo { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 40px 0 72px; }
.case-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; height: auto; }
.case-photo h2 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 8px 0 18px; }
.script-quote { border-left: 3px solid var(--terra); background: var(--peach); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 18px 22px; margin: 6px 0 20px; font-style: italic; color: var(--text); }
.script-quote cite { display: block; font-style: normal; font-size: 13px; color: var(--muted); margin-top: 8px; }

@media (max-width: 960px) {
  .projects { grid-template-columns: 1fr 1fr; }
  .case-grid, .case-photo { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 680px) {
  .projects { grid-template-columns: 1fr; }
}
.project__body .tag { align-self: flex-start; }
.case-gear { margin: 4px 0 24px; }
.case-gear img { aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius-sm); width: 100%; height: auto; }
.case-gear figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* ---------- Галерея ---------- */
.gallery__title { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); margin: 8px 0 24px; letter-spacing: -.01em; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 340px; gap: 16px; }
.gallery figure { margin: 0; position: relative; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.gallery__wide { grid-column: span 2; }
.gallery figcaption {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(255, 255, 255, .9); color: var(--text);
  font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px;
}
@media (max-width: 680px) {
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 220px; gap: 10px; }
}

/* Картка статті: вся картка клікабельна */
.article { position: relative; }
.article h3 a { text-decoration: none; }
.article h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.article__site span { display: inline-flex; align-items: center; gap: 6px; }

/* Рівні володіння програмами */
.levels { margin: 0; display: grid; gap: 12px; }
.levels dt { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); }
.levels dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- Про мене ---------- */
.about { display: grid; grid-template-columns: .8fr 1.2fr; gap: 64px; align-items: center; }
.about__photo { justify-self: start; }
.about__title { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4vw, 46px); line-height: 1.1; letter-spacing: -.02em; margin: 10px 0 22px; }
.about__text p { margin: 0 0 16px; font-size: 18px; }
.about__facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 28px 0 30px; padding: 22px 0 0; border-top: 1px solid var(--sage-line); font-size: 15px; }
.about__facts dt { color: var(--sage); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; padding-top: 2px; }
.about__facts dd { margin: 0; }
@media (max-width: 960px) {
  .about { grid-template-columns: 1fr; gap: 36px; }
  .about__photo { justify-self: center; width: min(260px, 72%); }
}
@media (max-width: 680px) {
  .about__text p { font-size: 16px; }
  .about__facts { grid-template-columns: 1fr; gap: 2px; }
  .about__facts dd { margin-bottom: 10px; }
}
@media (max-width: 400px) {
  .logo { font-size: 12px; }
  .nav__links { gap: 10px; }
  .nav__links a { font-size: 13px; }
}
