/* ===========================================================
   APXGRD — Digital Agency Bureau
   =========================================================== */

:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --fg: #f4f1ea;
  --fg-dim: #8a8780;
  --line: rgba(244, 241, 234, 0.12);
  --accent: #c6ff4a;     /* acid lime */
  --accent-2: #5b8cff;   /* electric blue */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-2: cubic-bezier(0.7, 0, 0.3, 1);

  --pad: clamp(1.25rem, 5vw, 5rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.4;
  overflow-x: hidden;
  cursor: none;
}

@media (hover: none) { body { cursor: auto; } }

::selection { background: var(--accent); color: #0a0a0b; }

a { color: inherit; text-decoration: none; }
em { font-style: italic; font-family: "Space Grotesk", sans-serif; }

/* ---------- Grain ---------- */
.grain {
  position: fixed; inset: -50%;
  z-index: 9998; pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.5s steps(2) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  50% { transform: translate(-3%, 2%); }
}

/* ---------- Custom cursor ---------- */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none; z-index: 9999;
  mix-blend-mode: difference;
  will-change: transform;
}
.cursor {
  width: 36px; height: 36px;
  border: 1px solid var(--fg);
  transform: translate(-50%, -50%);
  transition: width .35s var(--ease), height .35s var(--ease),
              background .35s var(--ease), opacity .3s;
}
.cursor-dot {
  width: 5px; height: 5px; background: var(--fg);
  transform: translate(-50%, -50%);
}
.cursor.is-hover { width: 64px; height: 64px; background: var(--fg); }
.cursor.is-view {
  width: 96px; height: 96px; background: var(--accent);
  border-color: var(--accent); mix-blend-mode: normal;
}
.cursor.is-view::after {
  content: "VIEW"; color: #0a0a0b; font-family: "Space Grotesk";
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.cursor.is-view ~ .cursor-dot { opacity: 0; }
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* ---------- Preloader ---------- */
.preloader {
  position: fixed; inset: 0; z-index: 10000;
  background: var(--bg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: transform 1s var(--ease-2);
}
.preloader.done { transform: translateY(-101%); }
.preloader__inner {
  display: flex; align-items: baseline; gap: clamp(1rem,4vw,3rem);
  font-family: "Space Grotesk";
}
.preloader__mark {
  font-size: clamp(2rem, 8vw, 5rem); font-weight: 500;
  letter-spacing: -0.03em;
}
.preloader__count {
  font-size: clamp(2rem, 8vw, 5rem); font-weight: 300; color: var(--accent);
}
.preloader__count i { font-size: 0.4em; font-style: normal; color: var(--fg-dim); }
.preloader__bar {
  position: absolute; bottom: 0; left: 0; width: 100%; height: 2px;
  background: var(--line);
}
.preloader__bar span {
  display: block; height: 100%; width: 0%;
  background: var(--accent);
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--accent); z-index: 9997;
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem var(--pad); z-index: 900;
  mix-blend-mode: difference;
  transition: transform .5s var(--ease);
}
.nav.hide { transform: translateY(-110%); }
.nav__logo {
  font-family: "Space Grotesk"; font-weight: 600; font-size: 1.05rem;
  letter-spacing: 0.05em; display: flex; align-items: center; gap: .5rem;
}
.nav__logo-mark { color: var(--accent); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 3vw, 2.5rem); }
.nav__links a {
  font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase;
  position: relative;
}
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 1px;
  background: var(--fg); transition: width .4s var(--ease);
}
.nav__links a:not(.nav__cta):hover::after { width: 100%; }
.nav__cta {
  border: 1px solid var(--fg); border-radius: 100px;
  padding: .55rem 1.1rem; transition: background .4s var(--ease), color .4s var(--ease);
}
.nav__cta:hover { background: var(--fg); color: var(--bg); }
.nav__clock {
  background: none; border: none; color: var(--fg);
  font-family: "Space Grotesk"; font-size: 0.82rem; letter-spacing: 0.05em;
  cursor: none;
}
@media (max-width: 720px) {
  .nav__links a:not(.nav__cta), .nav__clock { display: none; }
}

/* ---------- Reveal utility ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* word reveal */
.line { display: block; overflow: hidden; }
.word { display: inline-block; transform: translateY(110%); transition: transform 1.1s var(--ease-2); }
.word.in { transform: none; }

/* ---------- HERO ---------- */
.hero {
  position: relative; min-height: 100svh;
  padding: 7rem var(--pad) 2.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden;
}
.hero__grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: clamp(40px, 7vw, 90px) clamp(40px, 7vw, 90px);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 30%, transparent 100%);
}
.hero > * { position: relative; z-index: 1; }
.hero__top {
  display: flex; justify-content: space-between;
  font-family: "Space Grotesk"; font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--fg-dim);
}
.tag::before { content: "● "; color: var(--accent); font-size: .7em; vertical-align: middle; }
.tag--right::before { display: none; }

.hero__title {
  font-family: "Space Grotesk"; font-weight: 500;
  font-size: clamp(4.5rem, 24vw, 24rem);
  line-height: 0.82; letter-spacing: -0.04em;
  margin: auto 0; padding: 1rem 0;
}
.hero__reg { font-size: 0.18em; vertical-align: super; color: var(--accent); -webkit-text-fill-color: var(--accent); }

.hero__bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 2rem; flex-wrap: wrap;
}
.hero__lede {
  max-width: 34ch; font-size: clamp(1rem, 1.6vw, 1.35rem);
  color: var(--fg); line-height: 1.45;
}
.hero__lede em { color: var(--accent); -webkit-text-fill-color: var(--accent); }

.scroll-cue { display: flex; align-items: center; gap: .8rem; font-family: "Space Grotesk"; font-size: .8rem; text-transform: uppercase; letter-spacing: 0.12em; }
.scroll-cue__line { width: 60px; height: 1px; background: var(--fg-dim); position: relative; overflow: hidden; }
.scroll-cue__line::after { content:""; position:absolute; inset:0; background: var(--accent); transform: translateX(-100%); animation: cue 2s var(--ease) infinite; }
@keyframes cue { 0%{transform:translateX(-100%)} 50%{transform:translateX(0)} 100%{transform:translateX(100%)} }

/* ---------- Marquee ---------- */
.marquee {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; padding: 1.5rem 0; background: var(--bg);
}
.marquee__track {
  display: flex; align-items: center; gap: 2.5rem; width: max-content;
  font-family: "Space Grotesk"; font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 400; white-space: nowrap;
  animation: marquee 28s linear infinite;
}
.marquee__track .dot { color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section index ---------- */
.section-index {
  display: inline-block; font-family: "Space Grotesk";
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 2.5rem;
}

/* ---------- Manifesto ---------- */
.manifesto { padding: clamp(6rem, 14vw, 12rem) var(--pad); }
.manifesto__text {
  font-family: "Space Grotesk"; font-weight: 400;
  font-size: clamp(1.8rem, 5.2vw, 5rem);
  line-height: 1.08; letter-spacing: -0.02em; max-width: 18ch;
}
.manifesto__text span { display: block; }
.manifesto__text em { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.manifesto__text [data-line] {
  opacity: 0.12; transition: opacity .6s var(--ease);
}
.manifesto__text [data-line].lit { opacity: 1; }

/* ---------- Services ---------- */
.services { padding: clamp(4rem, 8vw, 8rem) var(--pad); border-top: 1px solid var(--line); }
.services__head { display: flex; flex-direction: column; margin-bottom: 3rem; }
.services__head h3 {
  font-family: "Space Grotesk"; font-weight: 500;
  font-size: clamp(2rem, 6vw, 4.5rem); letter-spacing: -0.03em; line-height: 1;
}
.services__list { list-style: none; }
.service {
  display: grid;
  grid-template-columns: 80px minmax(0, 1.1fr) minmax(0, 1fr) 60px;
  align-items: center; gap: 2rem;
  padding: clamp(1.5rem, 3vw, 2.6rem) 0;
  border-top: 1px solid var(--line);
  position: relative; transition: padding-left .5s var(--ease);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service::before {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  transform: scaleY(0); transform-origin: bottom; z-index: -1;
  transition: transform .5s var(--ease);
}
.service:hover { padding-left: 2rem; color: var(--bg); }
.service:hover::before { transform: scaleY(1); transform-origin: top; }
.service__num { font-family: "Space Grotesk"; font-size: .9rem; color: var(--fg-dim); transition: color .5s; }
.service:hover .service__num { color: var(--bg); }
.service__title { font-family: "Space Grotesk"; font-weight: 500; font-size: clamp(1.2rem, 2.6vw, 2rem); letter-spacing: -0.02em; }
.service__desc { color: var(--fg-dim); font-size: .95rem; max-width: 40ch; transition: color .5s; }
.service:hover .service__desc { color: #1a1a0e; }
.service__arrow { font-size: 1.4rem; justify-self: end; transform: translate(-6px,6px); opacity: 0; transition: all .5s var(--ease); }
.service:hover .service__arrow { transform: none; opacity: 1; }
@media (max-width: 820px) {
  .service { grid-template-columns: 50px 1fr 40px; }
  .service__desc { display: none; }
}

/* ---------- Work ---------- */
.work { padding: clamp(4rem, 8vw, 8rem) var(--pad); border-top: 1px solid var(--line); position: relative; }
.work__head { margin-bottom: 3rem; }
.work__head h3 { font-family: "Space Grotesk"; font-weight: 500; font-size: clamp(2.5rem, 8vw, 6rem); letter-spacing: -0.03em; line-height: 0.9; }
.work__list { position: relative; z-index: 2; }
.project {
  display: grid; grid-template-columns: 60px 1fr auto 60px;
  align-items: baseline; gap: 1.5rem;
  padding: clamp(1.4rem, 3vw, 2.4rem) 0;
  border-top: 1px solid var(--line);
  transition: opacity .4s, transform .6s var(--ease);
}
.project:last-child { border-bottom: 1px solid var(--line); }
.work__list:hover .project { opacity: 0.35; }
.work__list .project:hover { opacity: 1; transform: translateX(min(2vw, 24px)); }
.project__index { font-family: "Space Grotesk"; font-size: .85rem; color: var(--fg-dim); }
.project__name { font-family: "Space Grotesk"; font-weight: 500; font-size: clamp(1.6rem, 5vw, 3.6rem); letter-spacing: -0.03em; }
.project__tags { color: var(--fg-dim); font-size: .85rem; text-align: right; }
.project__year { font-family: "Space Grotesk"; color: var(--accent); font-size: 1rem; justify-self: end; }
.work__floating {
  position: fixed; top: 0; left: 0; width: 280px; height: 340px;
  border-radius: 6px; pointer-events: none; z-index: 1;
  opacity: 0; transform: translate(-50%,-50%) scale(0.85);
  transition: opacity .4s var(--ease), transform .5s var(--ease);
  background-size: cover; overflow: hidden;
  will-change: transform;
}
.work__floating.show { opacity: 1; }
@media (max-width: 720px) {
  .project { grid-template-columns: 36px 1fr auto; }
  .project__tags { display: none; }
}

/* ---------- Clients (rolling) ---------- */
.clients {
  border-top: 1px solid var(--line);
  padding: clamp(3rem, 7vw, 6rem) 0;
  overflow: hidden;
}
.clients__label {
  display: block; padding: 0 var(--pad);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.clients__marquee {
  position: relative;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.clients__track {
  display: flex; align-items: center; width: max-content;
  animation: clients 30s linear infinite;
}
.clients__marquee:hover .clients__track { animation-play-state: paused; }
.client {
  display: inline-flex; align-items: center; gap: clamp(2rem, 5vw, 4.5rem);
  font-family: "Space Grotesk"; font-weight: 500;
  font-size: clamp(2.2rem, 6vw, 5rem); letter-spacing: -0.03em;
  padding-left: clamp(2rem, 5vw, 4.5rem);
  -webkit-text-stroke: 1px var(--fg);
  -webkit-text-fill-color: transparent;
  transition: -webkit-text-fill-color .4s var(--ease), -webkit-text-stroke-color .4s var(--ease);
  white-space: nowrap;
}
.client:hover { -webkit-text-fill-color: var(--accent); -webkit-text-stroke-color: var(--accent); }
.client__dot { -webkit-text-stroke: 0; -webkit-text-fill-color: var(--accent); font-size: 0.5em; }
@keyframes clients { to { transform: translateX(-50%); } }

/* ---------- Process ---------- */
.process { padding: clamp(5rem, 10vw, 10rem) var(--pad); border-top: 1px solid var(--line); }
.process__rows { margin-top: 2rem; }
.process__row {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr);
  gap: 2rem; padding: clamp(1.6rem,3.5vw,3rem) 0;
  border-top: 1px solid var(--line); align-items: start;
}
.process__row:last-child { border-bottom: 1px solid var(--line); }
.process__phase { font-family: "Space Grotesk"; font-weight: 500; font-size: clamp(1.6rem, 4vw, 3rem); letter-spacing: -0.02em; }
.process__row p { color: var(--fg-dim); font-size: clamp(1rem, 1.4vw, 1.2rem); max-width: 46ch; }
@media (max-width: 720px) { .process__row { grid-template-columns: 1fr; gap: .8rem; } }

/* ---------- CTA ---------- */
.cta {
  padding: clamp(6rem, 14vw, 13rem) var(--pad);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.cta__title {
  font-family: "Space Grotesk"; font-weight: 500;
  font-size: clamp(2.8rem, 11vw, 9rem); line-height: 0.92; letter-spacing: -0.04em;
  margin: 1.5rem 0 3rem;
}
.cta__btn {
  display: inline-flex; align-items: center; gap: 1rem;
  background: var(--accent); color: #0a0a0b;
  font-family: "Space Grotesk"; font-weight: 600; font-size: clamp(1rem, 2vw, 1.4rem);
  padding: 1.2rem 2.4rem; border-radius: 100px;
  transition: transform .3s var(--ease);
}
.cta__btn-arrow { transition: transform .4s var(--ease); }
.cta__btn:hover .cta__btn-arrow { transform: translateX(8px); }
.cta__meta {
  display: flex; flex-direction: column; gap: .4rem; margin-top: 3rem;
  font-family: "Space Grotesk"; color: var(--fg-dim);
}
.cta__meta a { color: var(--fg); font-size: 1.1rem; }
.cta__meta a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.footer { padding: clamp(3rem,6vw,5rem) var(--pad) 2rem; border-top: 1px solid var(--line); }
.footer__top { display: flex; justify-content: space-between; gap: 3rem; flex-wrap: wrap; margin-bottom: 4rem; }
.footer__mark { font-family: "Space Grotesk"; font-weight: 600; font-size: clamp(2rem, 8vw, 5.5rem); letter-spacing: -0.02em; }
.footer__cols { display: flex; gap: clamp(2rem, 6vw, 5rem); flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: .7rem; }
.footer__h { font-size: .75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--fg-dim); margin-bottom: .4rem; }
.footer__col a { font-family: "Space Grotesk"; font-size: 1rem; transition: color .3s; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 2rem; border-top: 1px solid var(--line); color: var(--fg-dim); font-size: .82rem; }
.footer__back { background: none; border: none; color: var(--fg-dim); font: inherit; cursor: none; transition: color .3s; }
.footer__back:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .word { transform: none; }
  .reveal { opacity: 1; transform: none; }
}
