:root {
  --bg: #f8f9fd;
  --bg-soft: #f1f3fb;
  --card: #ffffff;
  --text: #171923;
  --muted: #6e7484;
  --line: #e7eaf3;
  --accent: #5d61df;
  --accent-2: #7c80ee;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(50, 56, 96, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
  font: inherit;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0;
  background: rgba(248, 249, 253, 0.78);
  backdrop-filter: blur(16px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  font-size: 1.08rem;
  font-weight: 800;
}

.logo span {
  width: 5px;
  height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 48px;
  color: #242838;
  font-size: 0.9rem;
  font-weight: 600;
}

.nav a,
.header-button {
  transition: color 180ms ease, transform 180ms ease;
}

.nav a:hover {
  color: var(--accent);
}

.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 24px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(93, 97, 223, 0.22);
}

.hero {
  position: relative;
  min-height: calc(100dvh - 78px);
  display: block;
  overflow: hidden;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(34px, 7vh, 58px) 0 30px;
  background: var(--bg);
}

.hero-bg {
  --hero-image-y: -46%;
  position: absolute;
  top: 50%;
  right: -2px;
  z-index: 0;
  width: min(900px, 72vw);
  height: auto;
  object-fit: contain;
  object-position: right center;
  pointer-events: none;
  filter: drop-shadow(0 26px 34px rgba(50, 56, 96, 0.14));
  animation: heroImageIn 1250ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes heroImageIn {
  from {
    opacity: 0;
    transform: translate(28px, var(--hero-image-y));
  }
  to {
    opacity: 1;
    transform: translate(0, var(--hero-image-y));
  }
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(500px, 46%);
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 600;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 500px;
  margin-bottom: 16px;
  font-size: clamp(2.1rem, 3.45vw, 3.35rem);
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow),
.section-head p,
.benefit-card p,
.work-meta p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 34px;
}

.button,
.contact-button {
  --mx: 0px;
  --my: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 700;
  transform: translate(var(--mx), var(--my));
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.button.primary,
.contact-button.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 36px rgba(93, 97, 223, 0.22);
}

.button.secondary:hover,
.contact-button:hover {
  border-color: rgba(93, 97, 223, 0.35);
  box-shadow: 0 14px 30px rgba(50, 56, 96, 0.08);
}

.hero-services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 570px;
}

.hero-services article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(93, 97, 223, 0.22);
  border-radius: 7px;
  color: var(--accent);
  background: #fff;
}

.hero-services strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.82rem;
}

.hero-services small {
  color: var(--muted);
  font-size: 0.72rem;
}

.section {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 110px 0;
}

.section-head {
  max-width: 690px;
  margin: 0 auto 68px;
  text-align: center;
}

.about {
  position: relative;
}

.benefits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 42px;
}

.benefit-card {
  transition: transform 220ms ease;
}

.benefit-card:hover {
  transform: translateY(-8px);
}

.benefit-card .icon {
  margin-bottom: 24px;
}

.benefit-card h3 {
  margin-bottom: 12px;
  font-size: 1.08rem;
}

.benefit-card p {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.work-card {
  content-visibility: auto;
  contain-intrinsic-size: 620px 500px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 0 18px 50px rgba(50, 56, 96, 0.06);
  cursor: pointer;
  transition: transform 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
}

.work-card:hover {
  border-color: rgba(93, 97, 223, 0.28);
  transform: translateY(-10px);
  box-shadow: var(--shadow);
}

.browser-preview {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  margin: 18px 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.browser-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform 420ms cubic-bezier(0.16, 1, 0.3, 1);
}

.work-card:hover .browser-preview img {
  transform: scale(1.035);
}

.work-meta {
  position: relative;
  padding: 24px 24px 28px;
}

.work-meta h3 {
  margin: 0 58px 18px 0;
  font-size: 1.22rem;
}

.work-meta p {
  margin: 0;
  font-size: 0.9rem;
}

.work-meta button {
  position: absolute;
  right: 22px;
  bottom: 24px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.work-card:hover .work-meta button {
  color: #fff;
  background: var(--accent);
  transform: rotate(8deg);
}

.contact {
  padding-bottom: 78px;
}

.contact-actions {
  display: flex;
  justify-content: center;
  gap: 42px;
}

.contact-button {
  gap: 10px;
  min-width: 170px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 58px;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer a {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: #fff;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  padding: 20px;
}

.preview-modal.open {
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 25, 35, 0.58);
  backdrop-filter: blur(12px);
}

.modal-shell {
  position: relative;
  width: min(1280px, 100%);
  height: min(820px, calc(100dvh - 40px));
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  animation: modalIn 220ms ease both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.modal-head div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-link,
.modal-head button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.modal-frame {
  display: block;
  width: 100%;
  height: calc(100% - 74px);
  border: 0;
}

.reveal {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(46px) scale(0.99);
  transition:
    filter 780ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 820ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 980ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

.reveal.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
  will-change: auto;
}

.button:active,
.contact-button:active,
.header-button:active {
  transform: translateY(1px) scale(0.99);
}

@media (max-width: 980px) {
  .header {
    grid-template-columns: auto auto;
  }

  .nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 42px;
    padding-bottom: 270px;
  }

  .hero-bg {
    --hero-image-y: 0;
    top: auto;
    inset: auto -18px 0 auto;
    width: min(760px, 112vw);
    height: auto;
    object-fit: contain;
    object-position: right bottom;
  }

  .hero-copy {
    width: 100%;
    max-width: 560px;
  }

  .benefits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .header,
  .hero,
  .section,
  .footer {
    width: min(100% - 28px, 1160px);
  }

  h1 {
    font-size: 2.32rem;
  }

  .hero-services,
  .benefits,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .button,
  .contact-button {
    width: 100%;
  }

}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* Mobile reveal tuning */
@media (prefers-reduced-motion: no-preference) and (pointer: coarse), (prefers-reduced-motion: no-preference) and (max-width: 768px) {
  .reveal,
  .reveal-card {
    transition:
      filter 720ms cubic-bezier(0.16, 1, 0.3, 1),
      opacity 780ms cubic-bezier(0.16, 1, 0.3, 1),
      transform 940ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .reveal:not(.visible),
  .reveal-card:not(.visible) {
    transform: translate3d(0, 42px, 0) scale(0.99);
  }
}

