/* Портфоліо Саші Пономарьова
   Ритм: червоний герой з обличчям → світлий контент → темний футер із вигнутим краєм.
   Типографіка за design-principles: Manrope 500, заголовки −0.05em, текст −0.03em, лейбли 700. */

/* Manrope лежить на нашому сайті (не на Google Fonts) — IP відвідувачів не йде в Google */
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("/assets/fonts/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope"; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #1C1A17;
  --ink-2: #26231F;
  --paper: #F3F2EC;
  --paper-2: #FCFCF8;
  --cream: #FCFCF4;
  --cream-soft: rgba(252, 252, 244, .58);
  --cream-line: rgba(252, 252, 244, .14);
  --muted: rgba(28, 26, 23, .58);
  --line: rgba(28, 26, 23, .12);
  --accent: #E84B1C;
  --accent-hover: #cf3d11;
  --hero-top: #BE0B06;
  --hero-mid: #D40A03;
  --hero-glow: #F36508;

  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -.03em;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.container { width: 100%; max-width: 1480px; margin: 0 auto; padding-inline: var(--gutter); }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Типографіка ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px; margin: 0 0 18px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}
.eyebrow::before { content: ""; width: 24px; height: 1.5px; background: currentColor; }
.h2 {
  margin: 0; font-weight: 500; letter-spacing: -.05em; line-height: .95;
  font-size: clamp(44px, 7.4vw, 120px); text-wrap: balance;
}
.h2 sup { font-size: .22em; letter-spacing: -.02em; vertical-align: top; margin-left: .25em; position: relative; top: .5em; color: var(--muted); }

/* ---------- Прелоадер ---------- */
.preloader { display: none; }
.is-loading .preloader {
  will-change: transform;
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: var(--ink); color: var(--cream);
  animation: pl-failsafe 0s 4.5s forwards;
}
/* Вигин під шторкою: окремий блок, висоту якого під час підйому стискаємо до нуля (як у Dennis) */
.pl-curve { position: absolute; left: 0; right: 0; top: 100%; height: 10vh; overflow: hidden; pointer-events: none; }
.pl-curve span { position: absolute; left: -25%; width: 150%; height: 750%; bottom: 0; background: var(--ink); border-radius: 0 0 50% 50%; }
@media (max-width: 640px) { .pl-curve { height: 5vh; } }
.pl-word { display: flex; align-items: center; gap: 14px; margin: 0; font-size: clamp(36px, 5vw, 64px); letter-spacing: -.05em; }
.pl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
@keyframes pl-failsafe { to { visibility: hidden; opacity: 0; } }

/* ---------- Шапка ---------- */
.site-header {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(env(safe-area-inset-top, 0px) + 26px) var(--gutter) 0;
  color: var(--cream); font-size: 15px;
}
.brand { white-space: nowrap; }
.brand-c { display: inline-block; transition: transform .6s var(--ease); }
.brand:hover .brand-c { transform: rotate(360deg); }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 50%; bottom: -10px; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; transform: translateX(-50%) scale(0); transition: transform .35s var(--ease);
}
.nav-link:hover::after { transform: translateX(-50%) scale(1); }
.langs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 100px; background: rgba(28, 26, 23, .3); }
.langs a { padding: 5px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; letter-spacing: .06em; opacity: .75; }
.langs a[aria-current="page"] { background: var(--cream); color: var(--ink); opacity: 1; }
.langs a:hover { opacity: 1; }

/* Плаваюча кнопка заявки */
.float-cta {
  position: fixed; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 18px); right: var(--gutter);
  transform: scale(0); transition: transform .5s var(--ease);
}
.float-cta.is-on { transform: scale(1); }
.float-cta-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 56px; padding: 0 26px;
  border-radius: 100px; background: var(--ink); color: var(--cream); font-size: 15px;
  box-shadow: 0 10px 30px rgba(28, 26, 23, .25);
}
.float-cta-btn:hover { background: var(--accent); }

/* ---------- Герой ---------- */
.hero {
  position: relative; height: 100vh; height: 100svh; min-height: 620px; overflow: hidden; color: var(--cream);
  background:
    radial-gradient(52% 58% at 34% 62%, rgba(243, 101, 8, .9) 0%, rgba(243, 101, 8, 0) 70%),
    linear-gradient(180deg, var(--hero-top) 0%, var(--hero-mid) 45%, #CD0A03 100%);
}
.hero-media { position: absolute; inset: 0; display: block; will-change: transform; }
.hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; will-change: transform; }
.hero-status {
  position: absolute; left: var(--gutter); top: 43%; margin: 0;
  display: inline-flex; align-items: center; gap: 12px; padding: 14px 22px 14px 18px;
  border-radius: 0 100px 100px 0; margin-left: calc(var(--gutter) * -1); padding-left: calc(var(--gutter) + 4px);
  background: var(--ink); color: var(--cream); font-size: 15px;
}
.pulse { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #3ddc84; }
.pulse::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid #3ddc84; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
.hero-role { position: absolute; right: var(--gutter); top: 34%; width: min(300px, 30vw); }
.hero-arrow { width: 26px; height: 26px; margin-bottom: 28px; }
.hero-role .role { margin: 0; font-size: clamp(22px, 2vw, 30px); letter-spacing: -.05em; line-height: 1.1; }
.hero-role .sub { margin: 8px 0 0; font-size: 16px; line-height: 1.4; color: rgba(252, 252, 244, .82); }
.hero-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 54px; padding: 0 26px; margin-top: 26px;
  border-radius: 100px; background: var(--cream); color: var(--ink); font-size: 15px; white-space: nowrap;
  box-shadow: 0 12px 30px -12px rgba(28, 26, 23, .45); transition: background .3s, color .3s;
}
.hero-btn:hover { background: var(--ink); color: var(--cream); }
.marquee {
  position: absolute; left: 0; bottom: clamp(16px, 4vh, 48px); width: 100%;
  white-space: nowrap; pointer-events: none; user-select: none;
}
.marquee-track {
  display: inline-flex; will-change: transform;
  font-size: clamp(84px, 15vw, 250px); line-height: .9; letter-spacing: -.05em;
  animation: marquee 30s linear infinite;
}
.marquee-track span { padding-right: .32em; }
.marquee-track i { font-style: normal; margin-left: .32em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Інтро ---------- */
.intro { padding-block: clamp(96px, 13vw, 200px) clamp(72px, 9vw, 140px); }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .42fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.intro-big { margin: 0; font-size: clamp(32px, 4.4vw, 68px); line-height: 1.06; letter-spacing: -.05em; text-wrap: balance; }
.intro-big .w { display: inline-block; will-change: filter, opacity; }
.intro-side { display: grid; gap: 40px; justify-items: start; padding-top: .6em; }
.intro-small { margin: 0; color: var(--muted); max-width: 40ch; }
.round-btn {
  display: grid; place-items: center; width: clamp(150px, 13vw, 190px); aspect-ratio: 1; border-radius: 50%;
  background: var(--ink); color: var(--cream); text-align: center; padding: 22px; font-size: 16px; line-height: 1.2;
  transition: background .3s;
}
.round-btn:hover { background: var(--accent); }
.round-btn span, .hero-btn span, .submit span, .float-cta-btn span { display: inline-block; pointer-events: none; }

.sec-head { margin-bottom: clamp(36px, 5vw, 72px); }

/* ---------- Роботи ---------- */
.works { position: relative; z-index: 2; background: var(--paper); padding-block: clamp(24px, 3vw, 48px) clamp(110px, 12vw, 180px); }
.works-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.works-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(20px, 3vw, 48px); row-gap: clamp(64px, 7vw, 110px); }
.work:nth-child(even) { margin-top: clamp(0px, 9vw, 150px); }
.work-media { position: relative; display: block; padding: 0 6% 9% 0; }
.browser {
  border-radius: 14px; overflow: hidden; background: #121110;
  box-shadow: 0 30px 60px -30px rgba(28, 26, 23, .45), 0 0 0 1px rgba(28, 26, 23, .08);
  transition: transform .7s var(--ease);
}
.work-media:hover .browser { transform: scale(.985); }
.browser-bar { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: #1f1d1b; }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(252, 252, 244, .2); }
.browser-bar span {
  margin: 0 auto; transform: translateX(-20px); padding: 3px 14px; border-radius: 100px;
  background: rgba(252, 252, 244, .08); color: rgba(252, 252, 244, .6); font-size: 11.5px; letter-spacing: 0;
}
.browser-screen { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #121110; }
.browser-screen img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; opacity: 0; transition: opacity .6s ease; }
.browser-screen img.is-on { opacity: 1; }
.phone {
  position: absolute; right: 0; bottom: 0; width: 21%; aspect-ratio: 9 / 19.5;
  border-radius: 22px; overflow: hidden; background: #121110;
  border: 5px solid #121110; box-shadow: 0 24px 50px -18px rgba(28, 26, 23, .55);
  will-change: transform;
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 16px; }
.work-info { margin-top: 26px; display: grid; gap: 8px; }
.work-top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.work-name { margin: 0; font-weight: 500; letter-spacing: -.05em; line-height: 1; font-size: clamp(30px, 3.2vw, 48px); }
.work-link { font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 2px; transition: border-color .3s, color .3s; }
.work-link:hover { color: var(--accent); border-color: var(--accent); }
.work-niche { margin: 0; color: var(--muted); font-size: 15px; }
.work-desc { margin: 4px 0 0; max-width: 52ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.tags li { padding: 5px 12px; border-radius: 100px; background: rgba(28, 26, 23, .06); font-size: 13.5px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 100px; font-size: 13.5px; background: rgba(232, 75, 28, .12); color: var(--accent-hover); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Вигнутий край перед футером */
.curve { position: absolute; left: 0; right: 0; top: 100%; height: 10vh; overflow: hidden; pointer-events: none; }
.curve span { position: absolute; left: -25%; width: 150%; height: 750%; bottom: 0; background: var(--paper); border-radius: 0 0 50% 50%; box-shadow: 0 60px 60px rgba(0, 0, 0, .12); }

/* ---------- Контакт ---------- */
.contact { position: relative; background: var(--ink); color: var(--cream); padding-top: clamp(140px, 16vw, 240px); overflow: hidden; }
.contact .eyebrow { margin: 0; }
.contact-meta { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.avatar { width: clamp(76px, 7vw, 108px); height: auto; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.contact-title { margin: 0; font-weight: 500; letter-spacing: -.05em; line-height: .95; font-size: clamp(46px, 8.6vw, 148px); max-width: 12ch; text-wrap: balance; }
.contact-sub { margin: 26px 0 0; max-width: 46ch; color: var(--cream-soft); }
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); gap: clamp(40px, 7vw, 120px);
  margin-top: clamp(56px, 7vw, 100px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--cream-line);
}
.lead-form { display: grid; gap: 30px; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 10px; }
.field label, .field legend { font-size: 14px; color: var(--cream-soft); padding: 0; }
.field legend { margin-bottom: 10px; }
.field input[type="text"], .field textarea {
  width: 100%; border: 0; border-bottom: 1px solid var(--cream-line); background: transparent; color: var(--cream);
  font: inherit; font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -.04em; padding: 6px 0 14px; border-radius: 0;
  transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 64px; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea::placeholder { color: rgba(252, 252, 244, .3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-input { position: relative; }
.chip-input input { position: absolute; opacity: 0; pointer-events: none; }
.chip-input span {
  display: inline-block; padding: 10px 18px; border-radius: 100px; border: 1px solid var(--cream-line);
  font-size: 15px; cursor: pointer; transition: background .25s, color .25s, border-color .25s;
}
.chip-input span:hover { border-color: rgba(252, 252, 244, .45); }
.chip-input input:checked + span { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.chip-input input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.submit {
  display: grid; place-items: center; width: clamp(150px, 12vw, 180px); aspect-ratio: 1; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--ink); cursor: pointer; font-size: 16px; padding: 18px; line-height: 1.2; text-align: center;
  transition: background .3s;
}
.submit:hover { background: var(--cream); }
.is-sending .submit { opacity: .7; pointer-events: none; }
.form-status { margin: 0; max-width: 34ch; font-size: 16px; }
.form-status[data-state="ok"] { color: #7fe3a8; }
.form-status[data-state="err"] { color: #ffb199; }
.form-status a { text-decoration: underline; color: var(--cream); }

.direct { display: grid; align-content: start; }
.direct .eyebrow { margin-bottom: 16px; }
.direct-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 14px;
  padding: 22px 0; border-bottom: 1px solid var(--cream-line); transition: color .3s;
}
.direct-link:hover .dl-name { color: var(--accent); }
.dl-name { font-size: clamp(22px, 2vw, 30px); letter-spacing: -.05em; transition: color .3s; }
.dl-handle { color: var(--cream-soft); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.direct-mail { grid-template-columns: minmax(0, 1fr) auto; }
.direct-mail a { display: grid; gap: 4px; min-width: 0; }
.direct-mail .dl-handle { text-align: left; }
.copy-btn { border: 1px solid var(--cream-line); background: transparent; border-radius: 100px; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.copy-btn:hover { border-color: var(--cream); }

.footer { margin-top: clamp(90px, 10vw, 150px); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--cream-soft); }
.footer-row a:hover { color: var(--cream); }
.footer-row { position: relative; z-index: 1; }
.wordmark {
  pointer-events: none; user-select: none; -webkit-user-select: none;
  margin: clamp(20px, 3vw, 40px) 0 0; text-align: center; white-space: nowrap;
  font-size: 25.2vw; line-height: .74; letter-spacing: -.065em; color: var(--cream);
  transform: translateY(6%);
}

/* ---------- Курсор ---------- */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  width: 96px; height: 96px; border-radius: 50%; background: var(--accent); color: var(--ink);
  display: none; place-items: center; font-size: 14px; transform: scale(0);
}
@media (pointer: fine) { .cursor { display: grid; } }

.consent { margin: -8px 0 0; font-size: 13px; color: var(--cream-soft); max-width: 46ch; }
.consent a, .footer-row a[href*="privacy"] { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--cream-line); }
.consent a:hover { color: var(--cream); }

/* ---------- Сторінка політики ---------- */
.doc-page { background: var(--ink); color: var(--cream); }
.doc { padding-block: calc(env(safe-area-inset-top, 0px) + 140px) clamp(64px, 8vw, 110px); }
.doc-inner { max-width: 820px; }
.doc-title { margin: 0 0 clamp(32px, 4vw, 56px); font-weight: 500; letter-spacing: -.05em; line-height: 1; font-size: clamp(40px, 6.4vw, 88px); text-wrap: balance; }
.doc h2 { margin: 44px 0 12px; font-weight: 500; letter-spacing: -.04em; line-height: 1.15; font-size: clamp(21px, 2vw, 27px); }
.doc p, .doc li { margin: 0 0 12px; max-width: 64ch; color: var(--cream-soft); line-height: 1.6; text-wrap: pretty; }
.doc ul { margin: 0 0 12px; padding-left: 1.15em; }
.doc li::marker { color: var(--accent); }
.doc-footer { padding-block: 28px calc(env(safe-area-inset-bottom, 0px) + 36px); border-top: 1px solid var(--cream-line); }
.doc-page .nav-link { display: inline; }

/* Рівні рядки в підзаголовках і описах: без довгого першого й куцого другого */
.hero-role .sub, .intro-small, .work-niche, .work-desc, .contact-sub, .form-status { text-wrap: balance; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .hero-role { width: min(260px, 38vw); }
}
@media (max-width: 860px) {
  .intro-grid, .contact-grid { grid-template-columns: 1fr; }
  .works-grid { grid-template-columns: 1fr; }
  .work:nth-child(even) { margin-top: 0; }
}
@media (max-width: 640px) {
  .nav-link { display: none; }
  .site-header { font-size: 14px; }
  .hero-photo { object-position: 50% 100%; }
  .hero-status { top: calc(env(safe-area-inset-top, 0px) + 76px); font-size: 14px; padding-block: 11px; }
  .hero-role { left: var(--gutter); right: var(--gutter); top: auto; bottom: calc(clamp(16px, 4vh, 48px) + 24vw); width: auto; display: grid; justify-items: start; }
  .hero-role .role, .hero-role .sub { max-width: 78%; }
  .hero-arrow { width: 22px; height: 22px; margin-bottom: 14px; }
  .hero-role .role { font-size: 22px; }
  .hero-role .sub { font-size: 14px; }
  .hero-btn { height: 50px; margin-top: 18px; }
  .marquee-track { font-size: 24vw; }
  .float-cta { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px); }
  .float-cta-btn { height: 52px; }
  .round-btn { width: 140px; font-size: 15px; }
  .submit { width: 100%; aspect-ratio: auto; height: 60px; border-radius: 100px; }
  .form-foot { display: grid; }
  .work-media { padding: 0 4% 12% 0; }
  .phone { width: 26%; border-width: 4px; border-radius: 16px; }
  .phone img { border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .pulse::after { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
