/* ========== Tokens ========== */
:root {
  --bg: #07060b;
  --bg-2: #0e0c15;
  --line: rgba(242, 240, 234, 0.12);
  --text: #f2f0ea;
  --muted: #9a97a6;
  --accent: #b9ff66;
  --violet: #7b5cff;
  --cyan: #00e0c6;
  --radius: 22px;
  --pad: clamp(18px, 4vw, 56px);
  --font-display: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--bg); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.03em; line-height: 1; }

/* ========== Canvas & grain ========== */
#webgl {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-1%); } 80% { transform: translate(3%,3%); }
}
main, .footer { position: relative; z-index: 2; }

/* ========== Loader ========== */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: var(--pad);
}
.loader__count { font-family: var(--font-display); font-size: clamp(64px, 16vw, 220px); line-height: 0.85; font-weight: 600; letter-spacing: -0.05em; }
.loader__bar { height: 2px; background: var(--line); margin: 24px 0 14px; overflow: hidden; }
.loader__bar span { display: block; height: 100%; width: 0; background: var(--accent); }
.loader__logo { height: 34px; width: auto; opacity: .7; align-self: flex-start; }

/* ========== Cursor ========== */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 90; pointer-events: none;
  border-radius: 50%; transform: translate(-50%, -50%);
  opacity: 0; transition: opacity .3s;
}
body.has-cursor .cursor, body.has-cursor .cursor-dot { opacity: 1; }
.cursor {
  width: 38px; height: 38px; border: 1px solid rgba(242,240,234,0.5);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 500; color: var(--bg); text-transform: uppercase; letter-spacing: 0.05em;
  transition: width .35s var(--ease), height .35s var(--ease), background .35s, border-color .35s;
}
.cursor-dot { width: 6px; height: 6px; background: var(--accent); }
.cursor.is-hover { width: 64px; height: 64px; background: rgba(185,255,102,0.12); border-color: var(--accent); }
.cursor.is-label { width: 84px; height: 84px; background: var(--accent); border-color: var(--accent); }
@media (hover: none), (pointer: coarse) { .cursor, .cursor-dot { display: none; } }

/* ========== Buttons & bits ========== */
.btn {
  --h: 54px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 28px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--bg);
  font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer;
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--text);
  border-radius: inherit; transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::before { transform: translateY(0); }
.btn .arrow { transition: transform .4s var(--ease); }
.btn:hover .arrow { transform: translateX(4px); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { color: var(--bg); }
.btn--small { --h: 44px; padding: 0 20px; font-size: 14px; }
.btn--full { width: 100%; }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(14,12,21,0.5); backdrop-filter: blur(10px);
  font-size: 13px; color: var(--muted);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(185,255,102,.6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(185,255,102,0); } 100% { box-shadow: 0 0 0 0 rgba(185,255,102,0); } }
.accent { color: var(--accent); }

/* ========== Nav ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 18px var(--pad);
  transition: transform .5s var(--ease), background .4s, backdrop-filter .4s;
}
.nav.is-scrolled { background: rgba(7,6,11,0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__logo { display: block; flex: 0 0 auto; }
.nav__logo img { height: 40px; width: auto; }
.nav__links { display: flex; gap: 6px; padding: 6px; border-radius: 999px; border: 1px solid var(--line); background: rgba(14,12,21,0.4); backdrop-filter: blur(10px); }
.nav__links a { padding: 8px 16px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color .3s, background .3s; }
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: rgba(242,240,234,0.08); }
.nav__toggle { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; cursor: pointer; position: relative; }
.nav__toggle span { position: absolute; left: 13px; right: 13px; height: 2px; background: var(--text); transition: transform .4s var(--ease), top .4s var(--ease); }
.nav__toggle span:first-child { top: 17px; } .nav__toggle span:last-child { top: 25px; }
.nav__toggle[aria-expanded="true"] span:first-child { top: 21px; transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:last-child { top: 21px; transform: rotate(-45deg); }

/* ========== Hero ========== */
.hero {
  min-height: 100svh; position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--pad) 48px;
}
.hero__meta { margin-bottom: 28px; }
.hero__title { font-size: clamp(48px, 10.5vw, 176px); line-height: 0.9; font-weight: 600; letter-spacing: -0.055em; }
.hero__title em { font-style: normal; color: var(--accent); }
.line { display: block; overflow: hidden; padding-bottom: 0.06em; }
.word { display: inline-block; will-change: transform; }
.outline { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.hero__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; margin-top: 40px; flex-wrap: wrap; }
.hero__lead { max-width: 440px; margin: 0; color: var(--muted); font-size: 17px; }
.hero__lead strong { color: var(--text); font-weight: 500; }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__scroll { position: absolute; right: var(--pad); top: 50%; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); writing-mode: vertical-rl; }
.hero__scroll i { width: 1px; height: 60px; background: linear-gradient(var(--accent), transparent); animation: scrollLine 2s var(--ease) infinite; transform-origin: top; }
@keyframes scrollLine { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ========== Marquee ========== */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 22px 0; background: rgba(7,6,11,0.4); backdrop-filter: blur(6px); }
.marquee__track { display: flex; align-items: center; gap: 40px; width: max-content; animation: marquee 30s linear infinite; }
.marquee__track--reverse { animation-direction: reverse; animation-duration: 40s; }
.marquee span { font-family: var(--font-display); font-size: clamp(28px, 4vw, 56px); font-weight: 600; letter-spacing: -0.03em; white-space: nowrap; }
.marquee b { color: var(--accent); font-size: 22px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ========== Sections ========== */
.section { padding: clamp(90px, 14vw, 180px) var(--pad); position: relative; }
.section__label { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin-bottom: 28px; }
.section__head { display: flex; flex-direction: column; margin-bottom: clamp(40px, 6vw, 80px); }
.section__title { font-size: clamp(38px, 6.5vw, 96px); max-width: 14ch; }
.split .w-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w { display: inline-block; }

/* About */
.about__grid { display: grid; grid-template-columns: 1fr; gap: 72px; }
.big-text { font-size: clamp(30px, 4.6vw, 68px); line-height: 1.08; font-weight: 500; max-width: 22ch; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 32px 24px 0 0; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--line); }
.stat__num { font-family: var(--font-display); font-size: clamp(40px, 6vw, 88px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.stat__label { color: var(--muted); margin-top: 10px; font-size: 14px; }

/* Services cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; perspective: 1200px; }
.card {
  position: relative; padding: 36px 32px 40px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(30,26,44,0.7), rgba(12,10,18,0.7));
  border: 1px solid var(--line); overflow: hidden; min-height: 320px;
  display: flex; flex-direction: column;
  transform-style: preserve-3d; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: border-color .4s;
}
.card:hover { border-color: rgba(185,255,102,0.4); }
.card__glow { position: absolute; width: 360px; height: 360px; border-radius: 50%; pointer-events: none; left: var(--mx, 50%); top: var(--my, 50%); transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(185,255,102,0.18), transparent 60%); opacity: 0; transition: opacity .4s; }
.card:hover .card__glow { opacity: 1; }
.card__num { position: absolute; top: 28px; right: 30px; font-family: var(--font-display); color: var(--muted); font-size: 14px; }
.card__icon { width: 46px; height: 46px; color: var(--accent); margin-bottom: auto; transform: translateZ(40px); }
.card h3 { font-size: 26px; margin: 48px 0 12px; transform: translateZ(30px); }
.card p { margin: 0; color: var(--muted); font-size: 15px; transform: translateZ(20px); }

/* Process */
.process { position: relative; }
.process__pin { min-height: 100vh; display: flex; align-items: center; gap: 6vw; padding: 100px var(--pad); overflow: hidden; }
.process__intro { flex: 0 0 auto; width: min(34vw, 460px); }
.process__intro .section__title { font-size: clamp(44px, 6vw, 92px); }
.process__progress { margin-top: 40px; height: 2px; background: var(--line); width: 100%; max-width: 280px; }
.process__progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.process__track { display: flex; gap: 24px; will-change: transform; }
.step {
  flex: 0 0 auto; width: min(460px, 70vw); min-height: 440px; padding: 40px; border-radius: var(--radius);
  border: 1px solid var(--line); background: rgba(14,12,21,0.55); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden;
}
.step__num { position: absolute; top: 18px; left: 32px; font-family: var(--font-display); font-size: 150px; font-weight: 700; line-height: 1; letter-spacing: -0.06em; color: transparent; -webkit-text-stroke: 1px rgba(185,255,102,0.45); }
.step h3 { font-size: 44px; margin-bottom: 16px; }
.step p { margin: 0; color: var(--muted); font-size: 17px; max-width: 34ch; }

/* Work */
.projects { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 24px; }
.project { display: block; }
.project:nth-child(even) { margin-top: 120px; }
.project__media {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: #120f1b; border: 1px solid var(--line);
}
.project__media img {
  position: absolute; left: 0; top: -4%; width: 100%; height: 108%; max-width: none;
  object-fit: cover; object-position: var(--pos, center);
}
.project__media img { transition: scale .9s var(--ease); }
.project:hover .project__media img { scale: 1.06; }
.project__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(7,6,11,0.45), rgba(7,6,11,0.05) 50%); transition: opacity .6s var(--ease); }
.project:hover .project__media::after { opacity: 0; }
.project__info { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 20px 4px 0; flex-wrap: wrap; }
.project__info h3 { font-size: clamp(22px, 2.4vw, 32px); }
.project__tag { order: 2; font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; }

/* Clients */
.clients { padding: 0 0 clamp(60px, 10vw, 120px); position: relative; }
.clients .section__label { padding: 0 var(--pad); }
.marquee--clients span { color: var(--muted); transition: color .3s; }
.marquee--clients span:hover { color: var(--text); }
.marquee--clients b { font-size: 12px; }

/* FAQ */
.faq__list { border-top: 1px solid var(--line); max-width: 1000px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 30px 0; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 30px); font-weight: 500; letter-spacing: -0.02em;
  transition: color .3s;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary:hover { color: var(--accent); }
.faq__item summary i { flex: 0 0 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: transform .5s var(--ease), background .3s; }
.faq__item summary i::before, .faq__item summary i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: currentColor; transform: translate(-50%,-50%); }
.faq__item summary i::after { transform: translate(-50%,-50%) rotate(90deg); }
.faq__item[open] summary i { transform: rotate(135deg); background: var(--accent); color: var(--bg); border-color: var(--accent); }
.faq__item p { margin: 0 0 30px; color: var(--muted); max-width: 70ch; font-size: 17px; }

/* Contact */
.contact__title { font-size: clamp(48px, 10vw, 160px); line-height: 0.92; letter-spacing: -0.055em; margin-bottom: clamp(48px, 7vw, 96px); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 100px); align-items: start; }
.contact__details { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.contact__link { font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 44px); font-weight: 500; letter-spacing: -0.03em; background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease); word-break: break-word; }
.contact__link:hover { background-size: 100% 2px; }
.contact__loc { color: var(--muted); margin: 8px 0 28px; }
.form { display: flex; flex-direction: column; gap: 14px; padding: clamp(24px, 3vw, 40px); border-radius: var(--radius); border: 1px solid var(--line); background: rgba(14,12,21,0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.field { position: relative; display: block; }
.field input, .field textarea, .field select {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: 16px; padding: 26px 0 10px; outline: none; resize: vertical; border-radius: 0;
  transition: border-color .3s; appearance: none; -webkit-appearance: none;
}
.field select { cursor: pointer; }
.field select option { background: var(--bg-2); color: var(--text); }
.field span { position: absolute; left: 0; top: 24px; color: var(--muted); pointer-events: none; transition: transform .35s var(--ease), color .3s, font-size .35s; transform-origin: left; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); }
.field input:focus + span, .field input:not(:placeholder-shown) + span,
.field textarea:focus + span, .field textarea:not(:placeholder-shown) + span,
.field select:focus + span, .field select:valid + span { transform: translateY(-20px) scale(.78); color: var(--accent); }
.form .btn { margin-top: 18px; }

/* Footer */
.footer { padding: 0 var(--pad) 32px; overflow: hidden; }
.footer__big { font-family: var(--font-display); font-weight: 700; font-size: 22.5vw; line-height: .8; letter-spacing: -0.07em; text-align: center; color: transparent; -webkit-text-stroke: 1px rgba(242,240,234,0.18); user-select: none; margin: 0 calc(var(--pad) * -1); }
.footer__row { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 24px; color: var(--muted); font-size: 14px; }
.footer__row { align-items: center; }
.footer__row a:hover { color: var(--accent); }
.footer__logo { height: 30px; width: auto; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav__links {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px;
    padding: 0 var(--pad); border: 0; border-radius: 0; background: rgba(7,6,11,0.96); backdrop-filter: blur(20px);
    clip-path: circle(0% at calc(100% - 40px) 40px); transition: clip-path .7s var(--ease);
  }
  .nav__links.is-open { clip-path: circle(150% at calc(100% - 40px) 40px); }
  .nav__links a { font-family: var(--font-display); font-size: 44px; color: var(--text); padding: 6px 0; letter-spacing: -0.03em; background: none !important; }
  .nav__toggle { display: block; }
  .nav .btn--small { display: none; }
  .hero__scroll { display: none; }
  .process__pin { flex-direction: column; align-items: stretch; overflow: visible; min-height: 0; }
  .process__intro { width: 100%; }
  .process__progress { display: none; }
  .process__track { flex-direction: column; }
  .step { width: 100%; min-height: 320px; }
  .projects { grid-template-columns: 1fr; }
  .project:nth-child(even) { margin-top: 0; }
  .contact__grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 0; }
  .stats { grid-template-columns: 1fr; }
  .stat, .stat + .stat { padding: 24px 0; border-left: 0; border-bottom: 1px solid var(--line); }
  .step__num { font-size: 110px; }
  .step h3 { font-size: 34px; }
  .outline { -webkit-text-stroke-width: 1px; }
}

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