/* ==========================================================
   Valeria — портфоліо
   Палітра: молочний / графіт / пудровий тауп / світло-сірий
   ========================================================== */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/manrope.woff") format("woff");
  font-weight: 200 800;
  font-display: swap;
}
/* запасний шрифт з пропорціями Manrope — поки Manrope вантажиться, текст не «стрибає» */
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans"), local("Roboto");
  size-adjust: 99%;
  ascent-override: 107.8%;
  descent-override: 30.3%;
  line-gap-override: 0%;
}

:root {
  --milk:  #F7F6F3;
  --ink:   #242424;
  --taupe: #CDB8B0;
  --line:  #D8D6D1;

  --ink-70: rgba(36, 36, 36, .7);
  --ink-50: rgba(36, 36, 36, .5);

  --pad: clamp(16px, 4vw, 56px);
  --max: 1440px;
  --nav-h: 68px;
  --radius: 20px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font-family: "Manrope", "Manrope Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.035em; line-height: 1; }
p { margin: 0; }
::selection { background: var(--taupe); color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Навігація ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  background: rgba(247, 246, 243, .97);
  border-bottom-color: var(--line);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.04em; display: inline-flex; align-items: baseline; }
.logo::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--taupe); margin-left: 3px; }
.nav__links { display: flex; gap: clamp(18px, 2.6vw, 40px); list-style: none; margin: 0; padding: 0; }
.nav__links a { font-size: 15px; position: relative; padding: 6px 0; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-active::after { transform: scaleX(1); }
/* бургер (лише на телефоні) */
.nav__toggle {
  display: none; position: relative; width: 44px; height: 44px; margin-right: -10px;
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%;
}
.nav__toggle i {
  position: absolute; left: 12px; right: 12px; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: transform .35s var(--ease), opacity .25s var(--ease), top .35s var(--ease);
}
.nav__toggle i:nth-child(1) { top: 15px; }
.nav__toggle i:nth-child(2) { top: 21.25px; }
.nav__toggle i:nth-child(3) { top: 27.5px; }

@media (max-width: 760px) {
  .nav__toggle { display: block; }
  /* на телефоні шапка завжди з фоном — бургер добре видно поверх будь-якого вмісту */
  .nav { background: rgba(247, 246, 243, .97); border-bottom-color: var(--line); }
  .nav__toggle i { height: 2px; left: 11px; right: 11px; }
  .nav.is-open .nav__toggle i:nth-child(1) { top: 21.25px; transform: rotate(45deg); }
  .nav.is-open .nav__toggle i:nth-child(2) { opacity: 0; }
  .nav.is-open .nav__toggle i:nth-child(3) { top: 21.25px; transform: rotate(-45deg); }

  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--milk); border-bottom: 1px solid var(--line);
    padding: 18px var(--pad) 28px;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  /* той самий стиль, що й на комп'ютері: текстові посилання з тонким підкресленням */
  .nav__links a { display: inline-block; padding: 10px 0; font-size: 20px; }
  .nav__links a::after { bottom: 6px; }
  .nav.is-open { background: var(--milk); border-bottom-color: var(--line); }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; transform: none; }
  .nav.is-open .nav__links li { animation: navIn .45s var(--ease) both; }
  .nav.is-open .nav__links li:nth-child(2) { animation-delay: .04s; }
  .nav.is-open .nav__links li:nth-child(3) { animation-delay: .08s; }
  .nav.is-open .nav__links li:nth-child(4) { animation-delay: .12s; }
}
@keyframes navIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid var(--ink); border-radius: 999px;
  font-size: 15px; font-weight: 600; line-height: 1;
  background: transparent; cursor: pointer;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn--fill { background: var(--ink); color: var(--milk); }
.btn--fill:hover { background: transparent; color: var(--ink); }
.btn:not(.btn--fill):hover { background: var(--ink); color: var(--milk); }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateY(2px); }
.btn:hover .arr--ne { transform: translate(2px, -2px); }
.btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- Hero ---------- */
.hero {
  /* на всю висоту екрана, але з обмеженням — щоб у вбудованих переглядах hero не розтягувався безкінечно */
  position: relative; min-height: min(100vh, 980px); min-height: min(100svh, 980px);
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 40px) 0 clamp(36px, 7vh, 80px);
  overflow: hidden; isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -2; }
.hero__waves { position: absolute; inset: 0; overflow: hidden; contain: strict; }
.hero__layer, .hero__glow { position: absolute; inset: -3%; width: 106%; height: 106%; display: block; }
.hero__layer--back { will-change: transform; backface-visibility: hidden; }
/* м'яке світіння — звичайні CSS-градієнти замість SVG-розмиття (у рази дешевше) */
.hero__glow {
  background:
    radial-gradient(ellipse 30% 34% at 77% 36%, rgba(205,184,176,.55) 0%, rgba(205,184,176,.22) 45%, rgba(205,184,176,0) 72%),
    radial-gradient(ellipse 40% 20% at 48% 90%, rgba(216,214,209,.75) 0%, rgba(216,214,209,0) 70%);
}
.hero__layer--back  { animation: wFloat 16s ease-in-out infinite alternate; }
/* коли hero поза екраном — анімація на паузі */
.hero.is-paused .hero__layer { animation-play-state: paused; }
@keyframes wFloat { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-1.4%, 1.4%, 0); } }
.hero::before {               /* м'який молочний ореол під текстом */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 18% 66%, rgba(247,246,243,.88) 0%, rgba(247,246,243,.55) 55%, rgba(247,246,243,0) 100%);
}
.hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; }
.hero__eyebrow { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-70); margin-bottom: 22px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--taupe); flex: none; }
.hero h1 { font-size: clamp(42px, 7.6vw, 124px); max-width: 11.5ch; line-height: .95; }
.hero h1 em { font-style: normal; position: relative; white-space: nowrap; }
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: .06em; height: .14em;
  background: var(--taupe); z-index: -1; transform-origin: left; transform: scaleX(0);
  animation: underline 1s .7s var(--ease) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.hero__lead { margin-top: 26px; max-width: 34ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; }
.hero__actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__aside { font-size: 13px; color: var(--ink-70); text-align: right; line-height: 1.7; padding-bottom: 6px; }
.hero__aside b { display: block; color: var(--ink); font-weight: 700; }
@media (max-width: 760px) {
  .hero { align-items: flex-end; min-height: min(100svh, 720px); min-height: min(100vh, 720px); min-height: min(100svh, 720px); padding-top: calc(var(--nav-h) + 24px); }
  .hero__waves { width: 240%; height: 72%; left: auto; right: -12%; top: 0;
    -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%); mask-image: linear-gradient(180deg, #000 55%, transparent 100%); }
  .hero::before { background: linear-gradient(180deg, rgba(247,246,243,0) 30%, rgba(247,246,243,.85) 58%); }
  .hero__inner { grid-template-columns: 1fr; }
  .hero__aside { display: none; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* ---------- Секції ---------- */
.section { padding: clamp(80px, 12vw, 160px) 0 0; scroll-margin-top: calc(var(--nav-h) - 1px); }
.sec-head {
  display: grid; grid-template-columns: minmax(64px, 1fr) 11fr; align-items: baseline; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 22px; margin-bottom: clamp(36px, 5vw, 64px);
}
.sec-head__idx { font-size: 14px; font-weight: 600; color: var(--ink-50); font-variant-numeric: tabular-nums; }
.sec-head h2 { font-size: clamp(36px, 5.6vw, 84px); }
.sec-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
@media (max-width: 760px) {
  .sec-head { grid-template-columns: auto 1fr; gap: 20px; }
  .sec-head__row { gap: 12px; }
}
.carousel__controls.is-static { display: none; }
.carousel.is-static .carousel__progress { visibility: hidden; }

/* ---------- Про мене ---------- */
.about { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.about--no-photo { grid-template-columns: minmax(64px, 1fr) 11fr; column-gap: 16px; }
.about--no-photo .about__text { grid-column: 2; max-width: 760px; }
@media (max-width: 860px) { .about--no-photo .about__text { grid-column: 1 / -1; } }
.about__photo { position: relative; margin: 0; width: 100%; max-width: 420px; justify-self: center; }
.about__photo::before {                 /* тонкий контур зі зсувом — легкий вихід за межі */
  content: ""; position: absolute; inset: -18px 18px 18px -18px;
  border: 1px solid var(--line); border-radius: var(--radius); pointer-events: none;
}
.about__frame {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--radius); background: var(--taupe);
}
.about__frame img { width: 100%; height: 100%; object-fit: cover; }
.about__frame::after {                  /* легке пудрове напилення поверх фото */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(160deg, rgba(205,184,176,.18), rgba(205,184,176,0) 55%, rgba(205,184,176,.12));
}
.about__tag {
  position: absolute; right: -14px; bottom: 28px; z-index: 2;
  background: var(--milk); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px;
}
.about__text { max-width: 560px; }
.about__text .lead { font-size: clamp(22px, 2.3vw, 32px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.about__text p + p { margin-top: 18px; }
.about__text .body { color: var(--ink-70); font-size: 17px; }
.about__facts { margin: 36px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.about__facts li { display: grid; grid-template-columns: 140px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.about__facts span { color: var(--ink-50); }
@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 340px; justify-self: start; margin: 18px 0 0 18px; }
  .about__tag { right: 12px; }
  .about__facts li { grid-template-columns: 110px 1fr; }
}

/* ---------- Карусель ---------- */
.carousel { position: relative; container-type: inline-size; }
.carousel__controls { display: flex; align-items: center; gap: 18px; }
.carousel__count { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-50); text-align: right; white-space: nowrap; }
.carousel__count b { color: var(--ink); font-weight: 700; }
.arrow {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--ink);
  background: transparent; cursor: pointer; display: grid; place-items: center;
  transition: background-color .3s var(--ease), color .3s var(--ease), opacity .3s;
}
.arrow:hover { background: var(--ink); color: var(--milk); }
.arrow:disabled { opacity: .25; pointer-events: none; }
.arrow svg { width: 18px; height: 18px; }

.carousel__track {
  --gap: clamp(14px, 1.8vw, 24px);
  display: flex; gap: var(--gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding: 0 var(--pad) 8px;
  scroll-padding-inline: var(--pad);
  scrollbar-width: none; -ms-overflow-style: none;
  cursor: grab; user-select: none; -webkit-user-select: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.carousel__track.is-dragging .card { pointer-events: none; }
@media (min-width: 1440px) {
  .carousel__track { padding-inline: calc((100vw - var(--max)) / 2 + var(--pad)); scroll-padding-inline: calc((100vw - var(--max)) / 2 + var(--pad)); }
}
.carousel__progress { margin-top: 28px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.carousel__progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); width: 0; transition: width .4s var(--ease), transform .4s var(--ease); }

.card {
  /* 3 картки в ряд у межах сітки сторінки */
  flex: 0 0 calc((min(100cqw, var(--max)) - 2 * var(--pad) - 2 * var(--gap)) / 3);
  scroll-snap-align: start; display: block; -webkit-user-drag: none;
}
@media (max-width: 1024px) { .card { flex-basis: calc((100cqw - 2 * var(--pad) - var(--gap)) / 2); } }
.card__media {
  position: relative; aspect-ratio: 1616 / 1264; overflow: hidden;
  border-radius: var(--radius); background: var(--line);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); -webkit-user-drag: none; pointer-events: none; }
.card__go {
  position: absolute; right: 16px; top: 16px; width: 48px; height: 48px; border-radius: 50%;
  background: var(--milk); display: grid; place-items: center;
  opacity: 0; transform: scale(.8); transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.card__go svg { width: 18px; height: 18px; }
.card__meta { display: flex; flex-direction: column; gap: 4px; padding: 16px 4px 0; }
.card__title { font-size: clamp(18px, 1.6vw, 22px); font-weight: 800; letter-spacing: -.02em; display: flex; align-items: baseline; gap: 10px; }
.card__num { font-weight: 600; color: var(--ink-50); font-variant-numeric: tabular-nums; }
.card__dash { color: var(--taupe); font-weight: 600; }
.card__cat { font-size: 13px; color: var(--ink-50); }
a.card:hover .card__media img { transform: scale(1.035); }
a.card:hover .card__go { opacity: 1; transform: none; }
a.card .card__title { transition: color .3s var(--ease); }
a.card:hover .card__title { color: var(--ink-70); }

/* картка «скоро» */
.card--soon { cursor: default; }
.card--soon .card__media {
  background: var(--milk); border: 1px solid var(--line);
  display: grid; place-items: center;
}
.card--soon .card__media::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .9;
}
.soon__word { position: relative; font-size: clamp(48px, 6vw, 96px); font-weight: 800; letter-spacing: -.05em; color: var(--ink); opacity: .14; }
.badge {
  position: absolute; left: 16px; top: 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  padding: 7px 12px; border-radius: 999px; background: var(--taupe); color: var(--ink);
}
@media (max-width: 760px) {
  .card { flex-basis: 78vw; }
  .carousel__controls .arrow { display: none; }
  .card__go { opacity: 1; transform: none; width: 40px; height: 40px; }
}

/* ---------- Контакти ---------- */
.contact { padding-bottom: clamp(48px, 7vw, 96px); }
.contact__title { font-size: clamp(40px, 7vw, 112px); max-width: 14ch; line-height: .98; }
.contact__title span { color: var(--ink); background: linear-gradient(transparent 72%, var(--taupe) 72%, var(--taupe) 90%, transparent 90%); }
.contact__row { margin-top: clamp(32px, 4vw, 56px); display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.contact__text { max-width: 40ch; font-size: 18px; color: var(--ink-70); }
.contact__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.contact__actions .btn { min-height: 56px; padding: 0 28px; font-size: 16px; }
.contact__note { margin-top: 10px; font-size: 13px; color: var(--ink-50); }

.footer { border-top: 1px solid var(--line); }
.footer .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 28px; font-size: 13px; color: var(--ink-50); }
.footer a:hover { color: var(--ink); }

/* ---------- Поява при прокручуванні ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ==========================================================
   Сторінка кейсу
   ========================================================== */
.case-bar { position: sticky; top: 0; z-index: 40; background: rgba(247,246,243,.97); border-bottom: 1px solid var(--line); }
.case-bar .wrap { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.back { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 18px 0 14px; border: 1px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 600; transition: background-color .3s var(--ease), color .3s var(--ease); }
.back svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.back:hover { background: var(--ink); color: var(--milk); }
.back:hover svg { transform: translateX(-3px); }

.case-head { max-width: 1240px; padding-top: clamp(48px, 8vw, 112px); padding-bottom: clamp(32px, 4vw, 56px); }
.case-head__meta { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-70); margin-bottom: 20px; }
.case-head h1 { font-size: clamp(52px, 11vw, 168px); line-height: .9; letter-spacing: -.05em; }
.case-head__cat { margin-top: 24px; font-size: clamp(16px, 1.5vw, 20px); color: var(--ink-70); border-top: 1px solid var(--line); padding-top: 18px; }

.case-body { max-width: 1240px; margin: 0 auto; padding: 0 var(--pad); }
.case-body figure { position: relative; margin: 0; background: var(--line); }
.case-body { --r: var(--radius); }
.case-body figure:first-child { border-radius: var(--r) var(--r) 0 0; overflow: hidden; }
.case-body figure:last-child { border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
.case-body img { width: 100%; height: auto; }
.case-body img[data-loading] { min-height: 40vh; }

.case-next { margin-top: clamp(64px, 9vw, 120px); border-top: 1px solid var(--line); }
.case-next .wrap { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 28px; padding-bottom: 48px; flex-wrap: wrap; }
.case-next__link { display: flex; flex-direction: column; gap: 6px; text-align: right; margin-left: auto; }
.case-next__link small { font-size: 13px; color: var(--ink-50); }
.case-next__link strong { font-size: clamp(28px, 4vw, 56px); font-weight: 800; letter-spacing: -.04em; line-height: 1; transition: color .3s; }
.case-next__link:hover strong { color: var(--ink-70); }
.case-empty { padding: 120px 0; text-align: center; }

/* заклик написати на сторінці кейсу */
.case-cta {
  max-width: 1240px; margin-top: clamp(56px, 8vw, 104px);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.case-cta h2 { font-size: clamp(30px, 4.2vw, 56px); line-height: 1; }
.case-cta p { margin-top: 14px; max-width: 42ch; font-size: 17px; color: var(--ink-70); }
.case-cta .btn { min-height: 56px; padding: 0 28px; font-size: 16px; }
.case-next { margin-top: clamp(48px, 6vw, 80px); }

/* клікабельний напис @нік на картинці кейсу */
.case-ig { position: absolute; display: block; border-radius: 999px; transition: box-shadow .3s var(--ease), background-color .3s var(--ease); }
.case-ig:hover, .case-ig:focus-visible { background: rgba(205,184,176,.18); box-shadow: 0 0 0 1.5px var(--taupe); outline: none; }
