/* ============================================================
   DAT WEB CO - cinematic scroll site, Lusion-inspired structure
   Ink black / azure accent / cream type / Space Grotesk display
   Statement hero over orbit scrub, letter-roll work list with
   live floating previews, kinetic type wall, astronaut drop.
   ============================================================ */

:root {
  --ink: #070907;
  --ink-2: #0c0e10;
  --ink-3: #121518;
  --cream: #f2ecdc;
  --cream-dim: rgba(242, 236, 220, 0.55);
  --cream-faint: rgba(242, 236, 220, 0.14);
  --azure: #38b6ff;
  --azure-deep: #0e4d7a;
  --azure-glow: rgba(56, 182, 255, 0.35);
  --azure-faint: rgba(56, 182, 255, 0.12);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --nav-h: 76px;
}

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

html { scroll-behavior: initial; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--azure); color: var(--ink); }

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-weight: 700; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--azure);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 28px; height: 1px;
  background: var(--azure);
  display: inline-block;
}

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 22px;
}
.loader__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: 0.04em;
}
.loader__brand span { color: var(--azure); }
.loader__bar {
  width: min(320px, 60vw); height: 2px;
  background: var(--cream-faint);
  overflow: hidden;
}
.loader__fill {
  width: 0%; height: 100%;
  background: var(--azure);
  transition: width 0.2s ease;
}
.loader__pct {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--cream-dim);
}

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

/* ---------- Custom cursor ---------- */
.cursor {
  position: fixed; top: 0; left: 0;
  z-index: 300;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid var(--azure);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.3s ease, background 0.25s ease;
  mix-blend-mode: difference;
}
.cursor.is-on { opacity: 0.9; }
.cursor.is-hover {
  width: 56px; height: 56px;
  margin: -28px 0 0 -28px;
  background: rgba(56, 182, 255, 0.12);
}
@media (pointer: coarse) { .cursor { display: none; } }

/* ---------- Floating live-site peek ---------- */
.peek {
  position: fixed; top: 0; left: 0;
  z-index: 90;
  width: 380px;
  border: 1px solid var(--cream-faint);
  border-radius: 10px;
  background: var(--ink-2);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 50px var(--azure-faint);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  will-change: transform;
}
.peek.is-on { opacity: 1; }
.peek__chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--cream-faint);
  background: var(--ink-3);
}
.bdot { width: 8px; height: 8px; border-radius: 50%; background: var(--cream-faint); display: inline-block; }
.peek__url {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--azure);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.peek__viewport {
  position: relative;
  width: 380px; height: 238px;
  background: var(--ink);
}
.peek__viewport iframe {
  position: absolute; top: 0; left: 0;
  width: 1280px; height: 800px;
  transform: scale(0.296875); /* 380 / 1280 */
  transform-origin: 0 0;
  border: 0;
  pointer-events: none;
  background: var(--ink);
}
@media (pointer: coarse) { .peek { display: none; } }

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  mix-blend-mode: difference;
}
.nav__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.05em;
}
.nav__brand span { color: var(--azure); }
.nav__links {
  display: flex; align-items: center;
  gap: clamp(18px, 3vw, 40px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.nav__links a { position: relative; padding: 6px 0; }
.nav__links a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--azure);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta {
  border: 1px solid var(--cream);
  padding: 10px 18px !important;
}
.nav__cta::after { display: none; }
.nav__cta:hover { background: var(--cream); color: var(--ink); }

/* ---------- Hero ---------- */
.hero { position: relative; height: 520vh; z-index: 1; }
.hero__sticky {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
#orbit-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
.hero__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 45%, transparent 55%, rgba(7, 9, 7, 0.72) 100%),
    linear-gradient(to bottom, rgba(7, 9, 7, 0.45), transparent 22%, transparent 78%, var(--ink) 100%);
  pointer-events: none;
}
.hero__hud {
  position: absolute;
  top: calc(var(--nav-h) + 18px);
  right: clamp(20px, 4vw, 56px);
  display: flex; gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
  pointer-events: none;
}
.hero__hud #hero-hud-deg { color: var(--azure); }
.hero__content {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: center;
  padding: 0 clamp(20px, 6vw, 96px);
  pointer-events: none;
}
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 13px);
  letter-spacing: 0.34em;
  color: var(--azure);
  margin-bottom: 26px;
  opacity: 0;
}
.hero__title { display: flex; flex-direction: column; line-height: 1.04; }
.hero__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(34px, 6.4vw, 96px);
  letter-spacing: -0.025em;
  display: block;
  overflow: hidden;
}
.hero__line em { font-style: normal; color: var(--azure); }
.hero__line .ltr { display: inline-block; will-change: transform; white-space: pre; }
.hero__scrollcue {
  position: absolute; bottom: 34px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.34em;
  color: var(--cream-dim);
}
.hero__scrollbar {
  width: 1px; height: 44px;
  background: var(--cream-faint);
  position: relative;
  overflow: hidden;
}
.hero__scrollbar::after {
  content: "";
  position: absolute; top: -50%; left: 0;
  width: 100%; height: 50%;
  background: var(--azure);
  animation: scrollcue 1.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes scrollcue { to { top: 100%; } }
.hero__caption {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.4vw, 76px);
  letter-spacing: -0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.hero__caption em { font-style: normal; color: var(--azure); }

/* ---------- Approach ---------- */
.approach {
  position: relative; z-index: 2;
  background: var(--ink);
  padding: clamp(100px, 16vh, 190px) clamp(20px, 6vw, 96px);
}
.approach__inner { max-width: 1200px; margin: 0 auto; }
.approach__heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 18ch;
}
.approach__body {
  margin-top: clamp(24px, 4vh, 40px);
  color: var(--cream-dim);
  font-size: clamp(16px, 1.6vw, 20px);
  max-width: 62ch;
}

/* ---------- Service tag strip ---------- */
.tagstrip {
  overflow: hidden;
  padding: 18px 0;
  border-top: 1px solid var(--cream-faint);
  border-bottom: 1px solid var(--cream-faint);
  background: var(--ink);
  position: relative; z-index: 2;
}
.tagstrip__track {
  display: flex; gap: 2.4em;
  white-space: nowrap;
  width: max-content;
  animation: tagscroll 32s linear infinite;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.3em;
  color: var(--cream-dim);
}
.tagstrip__track .ts-dot { color: var(--azure); }
@keyframes tagscroll { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Featured work ---------- */
.work {
  position: relative; z-index: 2;
  background: var(--ink);
  padding: clamp(100px, 15vh, 180px) clamp(20px, 6vw, 96px) clamp(70px, 10vh, 130px);
}
.work__head { max-width: 1400px; margin: 0 auto clamp(40px, 7vh, 80px); }
.work__lead {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
  max-width: 62ch;
  line-height: 2;
}
.work__list {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1px solid var(--cream-faint);
}
.work-row {
  display: block;
  padding: clamp(26px, 4.5vh, 48px) 0;
  border-bottom: 1px solid var(--cream-faint);
  position: relative;
}
.work-row__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  color: var(--cream-dim);
  margin-bottom: 12px;
  transition: color 0.35s ease;
}
.work-row:hover .work-row__tag { color: var(--azure); }
.work-row__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 7.6vw, 110px);
  letter-spacing: -0.025em;
  line-height: 1;
  text-transform: uppercase;
  display: flex; flex-wrap: wrap;
}
/* Lusion-signature letter roll: each letter holds two stacked copies;
   hover rolls to the azure copy with a per-letter stagger. */
.wl {
  display: inline-block;
  overflow: hidden;
  height: 1em;
  line-height: 1;
}
.wl__stack {
  display: block;
  transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 16ms);
}
.wl__stack span { display: block; height: 1em; line-height: 1; white-space: pre; }
.wl__stack span:last-child { color: var(--azure); }
.work-row:hover .wl__stack { transform: translateY(-1em); }
.work-row__arrow {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%) translateX(-10px) rotate(-45deg);
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 44px);
  color: var(--azure);
  opacity: 0;
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}
.work-row:hover .work-row__arrow {
  opacity: 1;
  transform: translateY(-50%) translateX(0) rotate(-45deg);
}

/* ---------- Philosophy ---------- */
.philosophy {
  position: relative; z-index: 2;
  background: var(--ink-2);
  padding: clamp(110px, 17vh, 200px) clamp(20px, 6vw, 96px);
}
.philosophy::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 55% 45% at 78% 20%, var(--azure-faint), transparent 65%);
  pointer-events: none;
}
.philosophy__inner { position: relative; max-width: 1200px; margin: 0 auto; }
.philosophy__heading {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.05;
  max-width: 20ch;
}
.philosophy__cols {
  margin-top: clamp(30px, 5vh, 56px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: clamp(24px, 4vw, 60px);
  color: var(--cream-dim);
  font-size: clamp(15px, 1.4vw, 18px);
  max-width: 1080px;
}

/* ---------- Kinetic type wall ---------- */
.wall {
  position: relative; z-index: 2;
  background: var(--ink);
  padding: clamp(120px, 20vh, 240px) clamp(12px, 3vw, 40px);
  overflow: hidden;
}
.wall__lines {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 0.1em;
}
.wall__line {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 9.4vw, 150px);
  letter-spacing: -0.02em;
  line-height: 0.98;
  white-space: nowrap;
  display: block;
}
.wall__line .wltr { display: inline-block; will-change: transform, opacity; white-space: pre; }
.wall__line:nth-child(2) .wltr { color: var(--azure); }

/* ---------- Drop (scroll-scrubbed astronaut finale) ---------- */
.drop { position: relative; height: 420vh; z-index: 2; background: var(--ink); }
.drop__sticky {
  position: sticky; top: 0;
  height: 100vh;
  overflow: hidden;
}
#drop-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
/* Tablet frame-in — the falling scene starts "on a device". The canvas sits
   inside .drop__zoom; the zoom wrapper and the bezel overlay are scaled by
   the SAME tween values, so the video can never escape the frame. */
.drop__zoom {
  position: absolute; inset: 0;
  overflow: hidden;
  border-radius: 30px;
  will-change: transform;
}
.drop__bezel {
  position: absolute; inset: 0;
  border: 18px solid #1a1d21;
  border-radius: 40px;
  box-shadow:
    inset 0 0 0 2px rgba(242, 236, 220, 0.14),
    0 30px 90px rgba(0, 0, 0, 0.65),
    0 0 80px var(--azure-faint);
  pointer-events: none;
  will-change: transform;
}
.drop__cam {
  position: absolute;
  top: -12px; left: 50%;
  transform: translate(-50%, 0);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #2c3138;
}
.drop__device-tag {
  position: absolute;
  left: 50%; bottom: 11%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.32em;
  color: var(--cream-dim);
  white-space: nowrap;
  pointer-events: none;
}
.drop__vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 85% 70% at 50% 50%, transparent 55%, rgba(7, 9, 7, 0.78) 100%),
    linear-gradient(to bottom, var(--ink), transparent 16%, transparent 84%, var(--ink) 100%);
  pointer-events: none;
}
.drop__caption {
  position: absolute; left: 50%; top: 17%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 5.6vw, 78px);
  letter-spacing: -0.02em;
  text-align: center;
  max-width: 92vw;
  line-height: 1.05;
  opacity: 0;
  pointer-events: none;
}
.drop__caption em { font-style: normal; color: var(--azure); }
.drop__caption--b {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: 0.4em;
  color: var(--cream-dim);
  top: auto; bottom: 40px;
}

/* ---------- Finale ---------- */
.finale {
  position: relative; z-index: 2;
  background: var(--ink);
  padding: clamp(120px, 20vh, 220px) clamp(20px, 5vw, 72px) clamp(80px, 12vh, 140px);
  text-align: center;
  overflow: hidden;
}
.finale::before {
  content: "";
  position: absolute;
  left: 50%; top: 0;
  transform: translateX(-50%);
  width: min(900px, 90vw); height: 420px;
  background: radial-gradient(ellipse at 50% 0%, rgba(56, 182, 255, 0.14), transparent 70%);
  pointer-events: none;
}
.finale__title {
  font-family: var(--font-display);
  font-size: clamp(44px, 9vw, 150px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  max-width: 14ch;
  margin: 0 auto;
}
.finale__title .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.finale__title .word > span { display: inline-block; will-change: transform; }
.finale__title .word--em { color: var(--azure); }
.finale__actions {
  margin-top: clamp(40px, 7vh, 70px);
  display: flex; gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 20px 38px;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.65, 0, 0.35, 1), box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.btn--primary { background: var(--azure); color: var(--ink); }
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 44px var(--azure-glow);
}
.btn--ghost { border-color: var(--cream-faint); color: var(--cream); }
.btn--ghost:hover {
  border-color: var(--azure);
  color: var(--azure);
  transform: translateY(-3px);
}
.finale__note {
  margin-top: clamp(30px, 5vh, 50px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--cream-dim);
}
/* The astronaut "breaks out" of the drop scene and waves at the CTA */
.finale__astro {
  position: absolute;
  right: clamp(4px, 6vw, 130px);
  bottom: -18px;
  height: clamp(230px, 46vh, 480px);
  width: auto;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 24px 60px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 44px rgba(56, 182, 255, 0.16));
  z-index: 0;
}
.finale__title, .finale__actions, .finale__note { position: relative; z-index: 1; }
.finale__astro.is-in { animation: astrobob 6s ease-in-out infinite; }
@keyframes astrobob {
  50% { transform: translateY(-16px) rotate(-2.2deg); }
}
@media (max-width: 860px) {
  .finale__astro { height: clamp(160px, 26vh, 260px); right: -2vw; opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) {
  .finale__astro.is-in { animation: none; }
}

/* ---------- Footer ---------- */
.footer {
  position: relative; z-index: 2;
  border-top: 1px solid var(--cream-faint);
  padding: clamp(40px, 7vh, 70px) clamp(20px, 5vw, 72px) 36px;
  display: flex;
  flex-direction: column;
  gap: clamp(36px, 6vh, 60px);
  background: var(--ink);
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(28px, 4vw, 56px);
  max-width: 1400px;
}
.footer__col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: 6px;
}
.footer__email {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(16px, 1.8vw, 22px);
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--cream-faint);
  padding-bottom: 3px;
  transition: border-color 0.3s ease, color 0.3s ease;
}
.footer__email:hover { color: var(--azure); border-color: var(--azure); }
.footer__socials {
  display: flex; flex-direction: column; gap: 8px;
  font-family: var(--font-body);
  font-size: 15px;
}
.footer__socials a { color: var(--cream-dim); transition: color 0.3s ease; }
.footer__socials a:hover { color: var(--azure); }
.footer__parent {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--cream-dim);
  transition: color 0.3s ease;
}
.footer__parent:hover { color: var(--azure); }
.footer__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cream-dim);
}
.footer__made em { font-style: normal; color: var(--azure); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav__links a:not(.nav__cta) { display: none; }
  .hero__content { justify-content: flex-end; padding-bottom: 140px; }
  .work-row__arrow { display: none; }
}

/* ---------- Reduced motion ----------
   Only the grain flicker is disabled; the tag strip must keep moving
   (many phones report reduced-motion via battery saver). */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none !important; }
  .tagstrip__track { animation-duration: 64s; }
}
