/* =========================================================================
   Ольга Лапига — Portfolio
   1. Tokens         2. Reset            3. Typography / base
   4. Layout         5. Navigation       6. Hero
   7. Components      8. Sections         9. Projects + Modal
   10. Form          11. Footer          12. Animations
   13. Reduced motion / utilities
   ========================================================================= */

/* ============ 1. TOKENS ============ */
:root {
  /* color — light */
  --bg: #fff;
  --bg-alt: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, .10);
  --card: #fff;
  --card-2: #f5f5f7;
  --accent: #059669;
  --accent-ink: #047857;
  --accent-soft: rgba(5, 150, 105, .10);
  --nav-bg: rgba(255, 255, 255, .72);
  --shadow-card: 0 24px 50px -24px rgba(0, 0, 0, .40);
  --shadow-pop: 0 40px 100px -30px rgba(0, 0, 0, .55);

  /* dark-on-light hero card constants (same in both themes) */
  --hero-bg: radial-gradient(120% 120% at 85% 0%, #13332a 0%, #0c1714 45%, #070707 100%);

  /* spacing scale */
  --sp-1: 8px;  --sp-2: 12px; --sp-3: 16px; --sp-4: 22px;
  --sp-5: 30px; --sp-6: 44px; --sp-7: 64px; --sp-8: 90px; --sp-9: 104px;

  /* radii */
  --r-sm: 10px; --r-md: 16px; --r-lg: 22px; --r-xl: 32px; --r-pill: 980px;

  /* typography */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;

  /* motion */
  --ease-out: cubic-bezier(.22, 1, .36, 1);  /* natural deceleration */
  --ease-soft: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .2s; --t-med: .35s; --t-slow: .7s;

  /* layout */
  --container: 1100px;
  --nav-h: 54px;
  --z-nav: 50; --z-progress: 60; --z-modal: 100;
}

html[data-theme="dark"] {
  --bg: #000;
  --bg-alt: #0b0b0c;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #86868b;
  --line: rgba(255, 255, 255, .13);
  --card: #1c1c1e;
  --card-2: #141415;
  --accent: #2dd4a7;
  --accent-ink: #34d399;
  --accent-soft: rgba(45, 212, 167, .12);
  --nav-bg: rgba(20, 20, 22, .72);
  --shadow-card: 0 24px 50px -24px rgba(0, 0, 0, .70);
  --shadow-pop: 0 40px 100px -30px rgba(0, 0, 0, .80);
}

/* ============ 2. RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent-soft); }

/* visible keyboard focus only */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============ 3. TYPOGRAPHY / BASE ============ */
.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 14px;
}
.section__title {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.section__title--center { text-align: center; }
.section__sub {
  font-size: clamp(16px, 2vw, 18px);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 600px;
  margin-top: 14px;
}

/* ============ 4. LAYOUT ============ */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(18px, 5vw, 28px);
}
.container--narrow { max-width: 720px; }

.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-1) var(--sp-7); }
.section--alt { background: var(--bg-alt); }
.hero { padding-block: 40px 44px; scroll-margin-top: 70px; }
#about, #skills, #projects, #contact { scroll-margin-top: 70px; }
#contact { padding-block: var(--sp-9); }

.skip-link {
  position: fixed;
  top: -60px; left: 12px;
  z-index: 200;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 14px; font-weight: 600;
  transition: top var(--t-fast) var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* page-load progress bar */
.scroll-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: var(--z-progress);
  background: transparent;
  pointer-events: none;
}
.scroll-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transform-origin: left;
}

/* ============ 5. NAVIGATION ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out),
              backdrop-filter var(--t-med) var(--ease-out);
}
.nav.is-scrolled {
  background: var(--nav-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}
.nav__inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__brand {
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
}
.nav__links { display: none; gap: 28px; }
.nav__link {
  position: relative;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-med) var(--ease-out);
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after { transform: scaleX(1); }

.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__actions .nav__cta { display: none; } /* shown ≥760px (beats .btn-pill specificity) */

.btn-pill {
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: background var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.btn-pill--ghost:hover { background: var(--accent-soft); }
.btn-pill--solid {
  background: var(--ink);
  color: var(--bg);
  border-color: transparent;
  font-weight: 500;
  padding: 0 18px;
}
.btn-pill--solid:hover { opacity: .85; }

.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--t-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--accent-soft); }
.icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: none; }
html[data-theme="dark"] .icon-moon { display: block; }

/* hamburger */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  padding: 0 9px;
}
.hamburger span {
  display: block;
  height: 1.5px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.hamburger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  display: flex;
  flex-direction: column;
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  padding: 8px clamp(18px, 5vw, 28px) 18px;
  overflow: hidden;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu__link {
  padding: 14px 4px;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  /* per-item stagger, toggled by .is-open on parent */
  opacity: 0;
  transform: translateY(-8px);
}
.mobile-menu.is-open .mobile-menu__link {
  animation: menuItemIn .4s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.mobile-menu__cta { color: var(--accent-ink); border-bottom: none; }

/* ============ 6. HERO ============ */
.hero__card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  background: var(--hero-bg);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .6);
  padding: clamp(30px, 4.5vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.hero__graphic {
  position: absolute;
  top: 0; right: 0;
  width: min(46%, 440px);
  height: auto;
  opacity: .5;
  pointer-events: none;
  will-change: transform;
}
.hero__body { position: relative; z-index: 1; }

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(94, 233, 181, .14);
  color: #7df0c4;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 24px;
}
.hero__badge-dot { width: 6px; height: 6px; border-radius: 50%; background: #5ee9b5; }
.hero__title {
  font-size: clamp(38px, 5.4vw, 66px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.03em;
  margin-bottom: 20px;
  color: #fff;
}
.hero__title-accent { color: #7df0c4; }
.hero__sub {
  font-size: clamp(17px, 1.6vw, 20px);
  color: rgba(255, 255, 255, .82);
  line-height: 1.5;
  max-width: 520px;
  margin-bottom: 12px;
}
.hero__open { font-size: 14px; color: rgba(255, 255, 255, .55); margin-bottom: 30px; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 26px 44px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  padding-top: 24px;
  margin-bottom: 26px;
}
.hero__stat { min-width: 80px; }
.hero__stat-num {
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.hero__stat-label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .65);
  margin-top: 6px;
  max-width: 140px;
  line-height: 1.3;
}
.hero__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hero__chip {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: var(--r-pill);
  color: rgba(255, 255, 255, .8);
}
.hero__avatar { position: relative; z-index: 1; align-self: center; width: min(360px, 100%); }

/* hero photo — edges dissolve into the dark card via a radial mask */
.hero__photo { position: relative; }
.hero__photo-img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 76% 84% at 52% 40%, #000 44%, transparent 80%);
          mask-image: radial-gradient(ellipse 76% 84% at 52% 40%, #000 44%, transparent 80%);
  transition: transform .6s var(--ease-out);
}
.hero__photo:hover .hero__photo-img { transform: scale(1.03); }

/* ============ AVATAR (squircle) ============ */
.avatar-frame {
  position: relative;
  overflow: hidden;
  clip-path: url(#squircle);
  -webkit-clip-path: url(#squircle);
  background: var(--card-2);
}
.avatar-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transition: transform .6s var(--ease-out), filter .6s var(--ease-out);
}
.avatar-frame::after {            /* subtle inner ring + sheen on hover */
  content: "";
  position: absolute; inset: 0;
  clip-path: url(#squircle);
  -webkit-clip-path: url(#squircle);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  background: linear-gradient(135deg, rgba(125, 240, 196, 0) 55%, rgba(125, 240, 196, .25) 100%);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
  pointer-events: none;
}
.avatar-frame--hero { aspect-ratio: 4 / 5; box-shadow: 0 26px 56px -22px rgba(0, 0, 0, .7); }
.avatar-frame:hover .avatar-frame__img { transform: scale(1.05); }
.avatar-frame:hover::after { opacity: 1; }
.avatar-frame--about {
  width: 132px;
  aspect-ratio: 1 / 1;
  float: left;
  margin: 4px 22px 10px 0;
  shape-outside: url(#squircle);
}

/* ============ 7. COMPONENTS — buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform var(--t-fast) var(--ease-out), filter var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}
.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { filter: brightness(1.1); }
.btn--glass {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .45);
  color: #fff;
}
.btn--glass:hover { background: rgba(255, 255, 255, .2); }
.btn--outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--outline:hover { background: var(--card); border-color: transparent; }
.btn--text { color: var(--accent-ink); padding: 14px 8px; }
.btn--text:hover { text-decoration: underline; }
.btn:active { transform: scale(.97); }

/* pulse attention ring (added by JS, one-shot) */
.btn.pulse { animation: ctaPulse 1.4s var(--ease-out) 2; }

/* ============ vibe strip ============ */
.vibe {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 26px 30px;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.vibe__text { font-size: 16px; color: var(--ink-2); line-height: 1.55; max-width: 680px; }
.vibe__text b { color: var(--ink); font-weight: 600; }
.vibe__tools { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-2);
}

/* ============ 8. SECTIONS — about ============ */
.about__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 40px;
  align-items: flex-start;
}
.about__lead { flex: 1 1 380px; max-width: 580px; }
.about__text { font-size: clamp(18px, 2.4vw, 21px); line-height: 1.65; color: var(--ink); }
.timeline { flex: 1 1 360px; min-width: 280px; }
.timeline__item { padding: 22px 0; border-bottom: 1px solid var(--line); }
.timeline__date { font-size: 12.5px; font-weight: 600; color: var(--accent-ink); }
.timeline__role { font-weight: 600; font-size: 17px; margin: 8px 0 6px; }
.timeline__desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

.about__edu { margin-top: 50px; padding-top: 36px; border-top: 1px solid var(--line); }
.edu-grid { display: flex; flex-wrap: wrap; gap: 40px; }
.edu { flex: 1 1 320px; min-width: 280px; }
.edu__title { font-weight: 600; font-size: 17px; margin-bottom: 8px; }
.edu__line { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }

/* ============ skills ============ */
.skills { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 36px; }
.skill-group { flex: 1 1 240px; min-width: 220px; }
.skill-group__title {
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.skill-group__items { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  color: var(--ink);
  transition: transform var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.skill-tag:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ============ 9. PROJECTS ============ */
.projects {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-top: 42px;
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform var(--t-med) var(--ease-out),
              box-shadow var(--t-med) var(--ease-out),
              border-color var(--t-med) var(--ease-out);
}
.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
  border-color: var(--accent);
}
/* media zone — a branded stage with a device peeking from the bottom */
.project-card__media {
  position: relative;
  height: 232px;
  overflow: hidden;
  background: var(--grad, var(--card-2));
}
/* device (shared card frame) */
.device {
  position: relative;
  background: #0c0c0d;
  border: 1px solid #2c2c2e;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
}
.device--card {
  position: absolute;
  left: 50%; top: 30px;
  transform: translateX(-50%);
  width: 152px;
  padding: 6px;
  border-radius: 27px;
  transition: transform .5s var(--ease-out);
}
.project-card:hover .device--card,
.project-card:focus-visible .device--card { transform: translateX(-50%) translateY(-6px); }
.device__screen {
  position: relative;
  border-radius: 21px;
  overflow: hidden;
  background: #fff;
  line-height: 0;
  min-height: 240px;
}
.device__shot { width: 100%; display: block; }
/* Dynamic Island — proportional to the device width (~iPhone 16/17) */
.device__island {
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 46px; height: 14px;
  background: #000;
  border-radius: 99px;
  z-index: 3;
}
/* slide-up overlay with short prompt */
.project-card__overlay {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, .72), rgba(0, 0, 0, 0));
  transform: translateY(100%);
  opacity: 0;
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-med) var(--ease-out);
}
.project-card:hover .project-card__overlay,
.project-card:focus-visible .project-card__overlay { transform: translateY(0); opacity: 1; }
.project-card__overlay-text { font-size: 13.5px; font-weight: 500; }
.project-card__arrow {
  flex: none;
  font-size: 18px;
  transition: transform var(--t-med) var(--ease-out);
}
.project-card:hover .project-card__arrow { transform: translateX(4px); }
/* body */
.project-card__body { display: flex; flex-direction: column; flex: 1; padding: 26px 30px 30px; }
.project-card__tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-ink);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.project-card__title { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 12px 0 10px; }
.project-card__desc { font-size: 15px; color: var(--ink-2); line-height: 1.55; flex: 1; }
.project-card__foot {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.project-card__stat { font-weight: 600; font-size: 15px; color: var(--ink); }
.project-card__stat small { font-weight: 500; color: var(--ink-3); }
.project-card__dau { white-space: nowrap; }
.project-card__more { font-size: 13.5px; font-weight: 500; color: var(--accent-ink); white-space: nowrap; }

/* ============ THEMED UI MOCK-UPS (device screens, no images) ============ */
.mock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: 28px 11px 12px;          /* top padding clears the Dynamic Island */
  font-size: 9px; line-height: 1.3; gap: 7px;
  text-align: left; letter-spacing: normal;
}
.mock__bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; color: #fff; padding: 5px 8px; border-radius: 7px;
}
.mock__cap { margin-top: auto; font-size: 8px; opacity: .65; }
/* API — partner → API → stations schema on dark */
.mock--api { background: #14152a; color: #c9cce6; }
.mock--api .mock__bar { background: #2a2c52; }
.mock__node {
  position: relative; background: #1f2142; border: 1px solid #34376a;
  border-radius: 8px; padding: 8px 9px; color: #e6e8ff; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.mock__node--mid { background: #2dd4a722; border-color: #2dd4a7; color: #7df0c4; }
.mock__dot { width: 7px; height: 7px; border-radius: 50%; background: #2dd4a7; box-shadow: 0 0 6px #2dd4a7; }
.mock__wire { width: 2px; height: 9px; background: #34376a; margin: -3px auto; }
.mock--api .mock__cap { color: #7df0c4; opacity: .9; }
/* Offer — paper→digital onboarding */
.mock--offer { background: #f4f6f5; color: #1d2b22; }
.mock--offer .mock__doc {
  position: relative; background: #fff; border: 1px solid #d7e3db; border-radius: 9px;
  padding: 10px; display: flex; flex-direction: column; gap: 5px;
}
.mock--offer .mock__doc span { height: 5px; border-radius: 3px; background: #d9e4dd; }
.mock--offer .mock__doc span.s { width: 55%; }
.mock__stamp {
  align-self: flex-start; margin-top: 4px; font-size: 9px; font-weight: 700;
  color: #0b8f5a; background: #d6f2e4; border-radius: 99px; padding: 3px 9px;
}
.mock__steps { display: flex; gap: 5px; }
.mock__steps i { flex: 1; height: 4px; border-radius: 3px; background: #d4ddd7; }
.mock__steps i.on { background: #0b8f5a; }
.mock__big { font-size: 14px; font-weight: 700; letter-spacing: -.02em; color: #0b6b45; }
/* Loyalty — dashboard */
.mock--loyalty { background: #0f2a20; color: #d7f0e3; }
.mock--loyalty .mock__bar { background: #18402f; }
.mock--loyalty .mock__bar span { color: #7df0c4; font-weight: 700; }
.mock__chart { display: flex; align-items: flex-end; gap: 4px; height: 56px; padding: 4px 2px; }
.mock__chart i { flex: 1; background: linear-gradient(to top, #2dd4a7, #7df0c4); border-radius: 3px 3px 0 0; }
.mock__row { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.mock__row b { font-size: 11px; }
.mock__progress { height: 6px; border-radius: 99px; background: #18402f; overflow: hidden; }
.mock__progress span { display: block; height: 100%; background: linear-gradient(90deg, #2dd4a7, #7df0c4); }
.mock--loyalty .mock__cap { color: #7df0c4; }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 20px;
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out);
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__dialog {
  position: relative;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 26px;
  max-width: 940px;
  width: 100%;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  opacity: 0;
  transform: scale(.96);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
  will-change: transform;
}
.modal.is-open .modal__dialog { opacity: 1; transform: scale(1); }

.modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 34px 38px 0; }
.modal__tag { font-size: 12px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .03em; }
.modal__title { font-size: clamp(26px, 3.4vw, 38px); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; margin-top: 12px; }
.modal__badge {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: var(--r-pill);
  padding: 7px 14px;
}
.modal__close {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-size: 18px; line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--t-fast) var(--ease-out);
}
.modal__close:hover { background: var(--accent-soft); }
.modal__body { padding: 24px 38px 8px; }
.modal__metrics { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.metric {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 20px;
  min-width: 120px;
}
.metric--accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.metric__num { font-size: 24px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.metric__num--sm { font-size: 16px; }
.metric__label { font-size: 12.5px; font-weight: 500; margin-top: 2px; color: var(--ink-3); }
.metric--accent .metric__label { color: inherit; opacity: .8; }
.modal__about { font-size: 17px; line-height: 1.6; color: var(--ink); margin-bottom: 28px; max-width: 680px; }
.modal__did-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-ink); margin-bottom: 14px; }
.modal__bullets { margin-bottom: 30px; }
.modal__bullet { display: flex; gap: 12px; padding: 8px 0; font-size: 15.5px; line-height: 1.5; color: var(--ink-2); }
.modal__bullet b { color: var(--accent); flex: none; font-weight: 700; }

.modal__screens { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 28px 38px 34px; }
.modal__screens-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--accent-ink); margin-bottom: 18px; }
.screens-rail { display: flex; gap: 22px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; }
.screen { flex: none; width: 222px; scroll-snap-align: start; }
.phone {
  position: relative;
  border-radius: 38px;
  background: #0c0c0d;
  padding: 9px;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45);
  border: 1px solid #2c2c2e;
}
.phone__island {
  position: absolute;
  top: 17px; left: 50%;
  transform: translateX(-50%);
  width: 68px; height: 20px;
  background: #000;
  border-radius: 99px;
  z-index: 4;
}
.phone__btn { position: absolute; background: #1c1c1e; border-radius: 3px; }
.phone__btn--1 { left: -2px; top: 120px; width: 3px; height: 30px; }
.phone__btn--2 { left: -2px; top: 165px; width: 3px; height: 46px; }
.phone__btn--3 { right: -2px; top: 140px; width: 3px; height: 60px; }
.phone__screen { border-radius: 30px; overflow: hidden; background: #fff; line-height: 0; }
.phone__screen img { width: 100%; }
.screen__cap { font-weight: 600; font-size: 14px; margin: 14px 0 4px; }
.screen__note { font-size: 13px; color: var(--ink-2); line-height: 1.45; }

/* ============ 10. PRODUCT-MANAGEMENT FLOW ============ */
.flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; margin-top: 44px; }
.flow__step {
  flex: 1 1 0;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out),
              border-color var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.js .flow__step { opacity: 0; transform: translateY(20px); }
.js .flow__step.is-in { opacity: 1; transform: none; }
.flow__step:hover { border-color: var(--accent); box-shadow: var(--shadow-card); }
.flow__num {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.flow__title { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.flow__tools { font-size: 13px; color: var(--ink-2); line-height: 1.45; margin-top: auto; }

.flow__arrow {
  flex: 0 0 auto;
  align-self: center;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-size: 22px;
  padding: 8px;
  transform: rotate(90deg);                     /* mobile: points down */
  transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
}
.js .flow__arrow { opacity: 0; transform: rotate(90deg) scale(.5); }
.js .flow__arrow.is-in { opacity: 1; transform: rotate(90deg) scale(1); }

.flow__cycle {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 24px;
  font-size: 13.5px; font-weight: 600; color: var(--accent-ink);
}
.flow__cycle::before, .flow__cycle::after {
  content: ""; height: 1px; flex: 1; max-width: 120px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.flow__cycle::after { background: linear-gradient(90deg, var(--accent), transparent); }

@media (min-width: 960px) {
  .flow { flex-direction: row; align-items: stretch; }
  .flow__arrow { transform: none; }                      /* desktop: points right */
  .js .flow__arrow { transform: scale(.5); }
  .js .flow__arrow.is-in { transform: scale(1); }
}

.contact__head { text-align: center; }
.contact__text { font-size: clamp(17px, 2.4vw, 20px); color: var(--ink-2); line-height: 1.55; max-width: 520px; margin: 18px auto 34px; }
.contact__cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 24px; }
.contact__location { font-size: 14px; color: var(--ink-3); }

/* ============ 11. FOOTER ============ */
.footer { background: #1d1d1f; color: #f5f5f7; padding: 48px 0 30px; }
.footer__top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; margin-bottom: 26px; }
.footer__brand { font-weight: 600; font-size: 18px; }
.footer__links { display: flex; gap: 12px; flex-wrap: wrap; }
.footer__link {
  background: rgba(255, 255, 255, .1);
  padding: 11px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 500;
  color: #f5f5f7;
  text-decoration: none;
  transition: background var(--t-fast) var(--ease-out);
}
.footer__link:hover { background: var(--accent); }
.footer__legal { border-top: 1px solid rgba(150, 150, 150, .25); padding-top: 18px; font-size: 12px; color: #86868b; line-height: 1.6; }

.noscript { padding: 20px 28px; background: var(--bg-alt); font-size: 15px; line-height: 1.6; }

/* ============ 12. ANIMATIONS ============ */
/* scroll reveal — only hide when JS is on; visible by default for no-JS/SEO */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
/* staggered children inside a revealed group (project cards) */
.js .project-card { opacity: 0; transform: translateY(30px); }
.js .project-card.is-visible {
  opacity: 1; transform: none;
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 120ms);
}

/* hero entrance */
.js .anim-up { opacity: 0; transform: translateY(18px); animation: heroUp .8s var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 90ms + 120ms); }
.js .line-mask { display: block; overflow: hidden; }
.js .line-mask__inner { display: block; transform: translateY(110%); animation: lineUp .9s var(--ease-out) forwards; animation-delay: calc(var(--d, 0) * 110ms + 120ms); }
.js .anim-avatar { opacity: 0; transform: translateY(24px) scale(.97); animation: avatarIn 1s var(--ease-soft) forwards; animation-delay: .35s; }

@keyframes heroUp { to { opacity: 1; transform: none; } }
@keyframes lineUp { to { transform: none; } }
@keyframes avatarIn { to { opacity: 1; transform: none; } }
@keyframes menuItemIn { to { opacity: 1; transform: none; } }
@keyframes ctaPulse {
  0% { box-shadow: 0 0 0 0 var(--accent-soft); }
  70% { box-shadow: 0 0 0 16px rgba(5, 150, 105, 0); }
  100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ============ 14. v4 COMPONENTS ============ */

/* preloader */
#preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: #070707;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .45s var(--ease-out), visibility .45s var(--ease-out);
}
#preloader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.preloader__inner { text-align: center; }
.preloader__initials {
  display: block; margin-bottom: 22px;
  font-size: 46px; font-weight: 600; letter-spacing: .12em; color: #fff;
  animation: preloaderPulse .7s ease-in-out infinite alternate;
}
.preloader__bar { width: 120px; height: 2px; margin: 0 auto; border-radius: 2px; background: rgba(255,255,255,.16); overflow: hidden; }
.preloader__fill { height: 100%; width: 0; border-radius: 2px; background: #34d399; animation: preloaderLoad .85s var(--ease-out) forwards; }
@keyframes preloaderPulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes preloaderLoad { from { width: 0; } to { width: 100%; } }

/* language switch RU | EN */
.lang-switch { display: flex; align-items: center; gap: 5px; }
.lang-btn {
  font-size: 13px; font-weight: 600; letter-spacing: .03em;
  padding: 5px 7px; border: none; background: none; cursor: pointer;
  color: var(--ink-3); border-radius: 6px;
  transition: color var(--t-fast) var(--ease-out);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn--active { color: var(--ink); }
.lang-divider { color: var(--line); font-size: 14px; }

/* hero featured stat */
.hero-stat {
  display: inline-flex; flex-direction: column; align-items: flex-start;
  padding: 12px 20px; margin-bottom: 30px;
  border: 1px solid rgba(125, 240, 196, .35); border-radius: 14px;
  background: rgba(125, 240, 196, .08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hero-stat__number { font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1; color: #fff; }
.hero-stat__label { font-size: 11.5px; color: rgba(255,255,255,.62); text-transform: uppercase; letter-spacing: .06em; margin-top: 5px; }

/* career timeline (vertical) */
.timeline { position: relative; padding-left: 34px; margin-top: 36px; max-width: 720px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline__item {
  position: relative; padding-bottom: 34px;
  opacity: 0; transform: translateX(-16px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item.is-visible { opacity: 1; transform: none; }
.timeline__dot {
  position: absolute; left: -34px; top: 4px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--bg);
}
.timeline__dot--active { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline__period { font-size: 12.5px; color: var(--ink-3); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.timeline__role { font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.timeline__company { font-size: 13.5px; font-weight: 500; color: var(--accent-ink); margin: 0 0 9px; }
.timeline__desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin: 0; max-width: 560px; }

/* testimonials */
.testimonials-grid { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 38px; }
.testimonial-card {
  margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px 26px 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px;
  transition: border-color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.testimonial-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-card); }
.testimonial-card__quote { margin: 0; }
.testimonial-card__mark { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 46px; line-height: .6; color: var(--accent); opacity: .55; margin-bottom: 10px; }
.testimonial-card__text { font-size: 14.5px; line-height: 1.68; color: var(--ink-2); margin: 0; }
.testimonial-card__author { display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.testimonial-card__avatar {
  flex: none; width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.testimonial-card__role { font-size: 13.5px; font-weight: 600; margin: 0 0 2px; color: var(--ink); }
.testimonial-card__company { font-size: 11px; color: var(--ink-3); margin: 0; text-transform: uppercase; letter-spacing: .06em; }

/* projects: head + nav arrows + filters + horizontal scroll */
.projects__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.projects-nav { display: none; gap: 10px; }
.projects-nav__btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.projects-nav__btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.projects-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 4px; }
.filter-btn {
  padding: 6px 16px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  transition: background var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out);
}
.filter-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.filter-btn--active { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.projects {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding: 4px 4px 18px; margin-inline: -4px;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent; scroll-padding-left: 4px;
}
.projects::-webkit-scrollbar { height: 6px; }
.projects::-webkit-scrollbar-track { background: transparent; }
.projects::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.project-card { flex: 0 0 300px; scroll-snap-align: start; }
/* .is-dimmed defined after .is-visible so it wins the filter state on revealed cards */
.js .project-card.is-dimmed { opacity: .3; pointer-events: none; filter: grayscale(.35); }

/* before / after */
.before-after-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.before-after {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card-2);
}
.ba-item { display: flex; flex-direction: column; gap: 4px; min-width: 90px; }
.ba-label { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.ba-value { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ba-value--before { color: var(--ink-3); }
.ba-value--after { color: var(--accent-ink); }
.ba-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; color: var(--ink-3); }
.ba-arrow span[aria-hidden] { font-size: 20px; line-height: 1; }
.ba-delta { font-size: 13px; font-weight: 600; color: var(--accent-ink); }

/* case reading progress (inside modal) */
.case-progress { position: sticky; top: 0; height: 3px; background: var(--line); z-index: 6; }
.case-progress__fill { height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* back to top */
.back-top {
  position: fixed; right: 28px; bottom: 28px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--ink); color: var(--bg); border: none; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out), background var(--t-fast) var(--ease-out);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.back-top.is-visible { opacity: 1; pointer-events: auto; transform: none; }
.back-top:hover { transform: translateY(-3px); }

/* footer bottom + uptime badge */
.footer__bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer__bottom .footer__legal { border-top: none; padding-top: 0; flex: 1 1 320px; }
.uptime-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: #86868b; text-decoration: none; transition: color var(--t-fast) var(--ease-out); white-space: nowrap; }
.uptime-badge:hover { color: #f5f5f7; }
.uptime-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: uptimePulse 2s ease-in-out infinite; }
@keyframes uptimePulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* ============ RESPONSIVE ============ */
@media (min-width: 760px) {
  .nav__links { display: flex; }
  .nav__actions .nav__cta { display: inline-flex; }
  .hamburger { display: none; }
  .hero__card { flex-direction: row; align-items: stretch; }
  .hero__body { flex: 2 1 360px; min-width: 280px; }
  .hero__avatar { flex: 1 1 270px; min-width: 230px; max-width: 340px; margin-left: auto; align-self: center; }
  .projects-nav { display: flex; }
  .project-card { flex-basis: 320px; }
  .testimonials-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
  .project-card { flex-basis: 82vw; }
  .before-after { flex-direction: row; }
  .back-top { right: 18px; bottom: 84px; }
}

/* ============ 13. REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .js [data-reveal],
  .js .project-card,
  .js .timeline__item,
  .js .anim-up,
  .js .anim-avatar { opacity: 1 !important; transform: none !important; }
  .js .line-mask__inner { transform: none !important; }
  #preloader { display: none !important; }
}
