/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08080b;
  --surface: #0e0e13;
  --surface-2: #131318;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f5f5f7;
  --muted: #9a9aa7;
  --muted-2: #6b6b76;
  --accent: #8b5cf6;
  --accent-2: #a78bfa;
  --accent-soft: rgba(139, 92, 246, 0.12);
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 14px;
  --container: 1160px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Background grid + glow ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.hero-glow {
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(closest-side, rgba(139,92,246,0.22), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 20px 24px;
  background: rgba(8,8,11,0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(8,8,11,0.85); }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 2px rgba(139,92,246,0.6);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  font-size: 0.95rem;
  margin-left: auto;
}
.nav-links a:not(.btn) { color: var(--muted); transition: color .2s; }
.nav-links a:not(.btn):hover { color: var(--text); }
.nav-cta { padding: 10px 20px; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  transition: transform .25s, opacity .25s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Language switcher ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.lang-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lang-btn {
  display: flex;
  align-items: center;
  width: 32px;
  height: 24px;
  padding: 3px;
  border-radius: 6px;
  border: 1px solid transparent;
  opacity: 0.5;
  transition: opacity .2s, border-color .2s;
}
.lang-btn svg {
  width: 100%;
  height: 100%;
  border-radius: 3px;
  display: block;
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn.is-active { opacity: 1; border-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: transform .18s ease, background .2s, border-color .2s, box-shadow .2s;
}
.btn:active { transform: scale(0.97); }

.btn-solid {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 24px -8px rgba(139,92,246,0.6);
}
.btn-solid:hover { background: #7c4de8; box-shadow: 0 10px 30px -6px rgba(139,92,246,0.75); }

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent-2); background: var(--accent-soft); }

.btn-invert {
  background: #fff;
  color: #0a0a0d;
}
.btn-invert:hover { background: #e8e8ea; }

.wa-icon { width: 18px; height: 18px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.eyebrow.center { text-align: center; }

.section-title {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.section-sub {
  color: var(--muted);
  max-width: 320px;
  font-size: 1rem;
  text-align: right;
}

section { position: relative; z-index: 1; padding: 100px 0; }

/* ---------- Hero ---------- */
.hero { padding-top: 140px; padding-bottom: 80px; position: relative; overflow: hidden; }

.hero-title {
  font-size: clamp(2.6rem, 8vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.02;
  position: relative;
  z-index: 1;
}
.accent {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 10px;
  text-decoration-thickness: 4px;
}

.hero-desc {
  margin-top: 28px;
  max-width: 560px;
  font-size: 1.15rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.stats {
  display: flex;
  gap: 56px;
  margin-top: 88px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted-2); font-size: 0.85rem; }

/* ---------- Cards (shared) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .25s, transform .25s, background .25s;
}

/* ---------- Work grid ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.work-card {
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.work-card:hover { border-color: var(--border-strong); transform: translateY(-4px); }
.work-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 10px;
  border-radius: 6px;
}

.thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  background:
    repeating-linear-gradient(135deg, rgba(139,92,246,0.08) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, #1a1424, #0e0e13 65%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb video,
.thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.thumb-placeholder { opacity: 0.85; }

.play-btn {
  position: relative;
  z-index: 2;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10,10,14,0.55);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background .2s, transform .2s;
}
.play-btn svg { width: 20px; height: 20px; margin-left: 2px; }
.work-card:hover .play-btn { background: var(--accent); transform: scale(1.08); }

.card-body { padding: 16px 18px 20px; }
.card-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  margin-bottom: 8px;
}
.card-title { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }

.is-soon .thumb { opacity: 0.55; }
.is-soon .card-title, .is-soon .card-tag { opacity: 0.6; }
.is-soon { cursor: default; }

/* ---------- Services ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.service-card { padding: 32px; display: flex; flex-direction: column; }
.service-card:hover { border-color: var(--border-strong); }
.service-title { font-size: 1.5rem; font-weight: 700; margin: 14px 0 12px; letter-spacing: -0.01em; }
.service-desc { color: var(--muted); margin-bottom: 22px; }
.service-list { display: flex; flex-direction: column; gap: 12px; }
.service-list li { display: flex; gap: 10px; font-size: 0.95rem; color: var(--text); }
.service-list .arrow { color: var(--accent); flex-shrink: 0; }

/* ---------- Process ---------- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.process-card { padding: 30px; }
.process-card:hover { border-color: var(--border-strong); }
.process-title { font-size: 1.2rem; font-weight: 700; margin: 12px 0 10px; }
.process-desc { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }
.process-tools { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted-2); }

/* ---------- Contact ---------- */
.contact { padding-top: 40px; }
.contact-box {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 80px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-box::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(closest-side, rgba(139,92,246,0.18), transparent 70%);
  pointer-events: none;
}
.contact-title {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  position: relative;
}
.contact-desc {
  color: var(--muted);
  margin: 20px auto 0;
  max-width: 420px;
  position: relative;
}
.contact-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 36px;
  flex-wrap: wrap;
  position: relative;
}

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 36px 0; position: relative; z-index: 1; }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-copy { color: var(--muted-2); font-size: 0.85rem; }
.footer-links { display: flex; gap: 20px; font-size: 0.85rem; color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Video modal ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.video-modal.is-open { opacity: 1; pointer-events: auto; }

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4,4,6,0.88);
  backdrop-filter: blur(6px);
}

.video-modal-frame {
  position: relative;
  z-index: 1;
  width: min(92vw, 400px);
  max-height: 88vh;
  transform: scale(0.94);
  transition: transform .25s ease, width .2s ease;
}
.video-modal.is-open .video-modal-frame { transform: scale(1); }

.video-modal-frame video {
  width: 100%;
  max-height: 88vh;
  border-radius: 16px;
  background: #000;
  aspect-ratio: 9/16;
  object-fit: contain;
}

.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: 1fr; }
  .section-sub { text-align: left; max-width: 100%; }
}

@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 68px;
    left: 16px;
    right: 16px;
    background: rgba(12,12,16,0.97);
    border: 1px solid var(--border);
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 4px;
    padding: 12px;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
  }
  .nav-links.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a:not(.btn) { padding: 12px; border-radius: 10px; }
  .nav-links a:not(.btn):hover { background: rgba(255,255,255,0.05); }
  .nav-cta { margin-top: 6px; justify-content: center; }

  .hero { padding-top: 110px; }
  .stats { gap: 32px; }
  .contact-box { padding: 56px 24px; }
}

@media (max-width: 520px) {
  .work-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .contact-actions { flex-direction: column; align-items: stretch; }
}
