/* MA Looks — v2. Deep blue technology lab. */
:root {
  --navy: #050b1f;      /* ground */
  --deep: #0b1736;      /* surface */
  --deep-2: #10204a;    /* raised surface */
  --blue: #2563eb;      /* action */
  --electric: #3b82f6;
  --cyan: #5ee7ff;      /* light, signals */
  --white: #ffffff;
  --text: #e8eeff;
  --soft: #9aa8cc;
  --line: rgba(120, 160, 255, .14);

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --s-small: 13px;
  --s-body: clamp(16px, 0.95rem + 0.2vw, 18px);
  --s-lead: clamp(18px, 1rem + 0.6vw, 22px);
  --s-h3: clamp(22px, 1.1rem + 0.8vw, 28px);
  --s-h2: clamp(40px, 1.4rem + 4vw, 84px);
  --s-hero: clamp(40px, 0.8rem + 5vw, 100px);

  --gutter: clamp(16px, 4vw, 64px);
  --max: 1360px;
  --r: 18px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--navy); color: var(--text);
  font-family: var(--body); font-size: var(--s-body); line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, p, ol { margin: 0; padding: 0; }
ol { list-style: none; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
button { font: inherit; color: inherit; }
::selection { background: var(--cyan); color: var(--navy); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; }

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: var(--navy);
  display: grid; place-content: center; justify-items: center; gap: 28px;
  transition: opacity .7s var(--ease), visibility .7s;
  /* fail-safe: the loader lifts itself even if no script ever runs */
  animation: loader-failsafe .7s var(--ease) 5s forwards;
}
.loader.done { opacity: 0; visibility: hidden; }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
.loader-mark { width: 84px; height: 84px; color: var(--white); --mark-accent: var(--cyan); }
.loader-mark .piece { opacity: 0; transform: translateY(-14px) scale(.6); transform-box: fill-box; transform-origin: center; animation: piece .6s var(--ease) forwards; }
@keyframes piece { to { opacity: 1; transform: none; } }
/* the cyan pixel leaves its slot in the frame and settles in view */
.loader-mark .mark-pixel.piece { transform: translate(-24px, 10px); animation: pixel-out .9s var(--ease) forwards; }
@keyframes pixel-out { 0% { opacity: 0; transform: translate(-24px, 10px); } 30% { opacity: 1; transform: translate(-24px, 10px); } 100% { opacity: 1; transform: none; } }
.loader-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 0; background: var(--cyan); transition: width .3s linear; }

/* ---------- cursor glow ---------- */
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px;
  border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(circle, rgba(59,130,246,.16), rgba(59,130,246,0) 65%);
  transform: translate3d(var(--gx, -999px), var(--gy, -999px), 0);
  transition: opacity .4s; opacity: 0;
}
body.has-pointer .cursor-glow { opacity: 1; }

/* ---------- 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(--gutter);
  transition: background-color .4s, padding .4s var(--ease), backdrop-filter .4s;
}
.nav.scrolled { background: rgba(5, 11, 31, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 32px; height: 32px; color: var(--white); --mark-accent: var(--cyan); transition: transform .6s var(--ease); }
.brand-word { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.nav-links { display: flex; gap: 36px; font-weight: 500; font-size: 15px; }
.nav-links a { position: relative; color: var(--soft); transition: color .3s; }
.nav-links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--cyan); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }

/* ---------- buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--blue); color: var(--white);
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .01em;
  transition: background-color .3s, box-shadow .4s var(--ease), transform .3s var(--ease);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; transition: transform .4s var(--ease); }
.btn:active { transform: scale(.97); }
.btn-small { padding: 11px 20px; font-size: 15px; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px rgba(160,190,255,.35); }
.btn-big { font-size: clamp(18px, 1rem + 1vw, 28px); padding: 22px 34px; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; overflow: hidden; isolation: isolate; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(5,11,31,.92) 0%, rgba(5,11,31,.55) 42%, rgba(5,11,31,0) 72%),
    linear-gradient(0deg, var(--navy) 0%, rgba(5,11,31,0) 28%); }
.hero-inner { width: 100%; max-width: var(--max); margin: 0 auto; padding: 120px var(--gutter) 120px; }
.hero-title { font-family: var(--display); font-weight: 700; font-size: var(--s-hero); line-height: .95; letter-spacing: -0.02em; color: var(--white); }
.hero-title .line { display: block; }
.hero-sub { margin-top: 28px; max-width: 34ch; font-size: var(--s-lead); color: var(--soft); }
/* keeps the copy readable when bright cubes pass behind it */
.hero-title, .hero-sub { text-shadow: 0 0 2px rgba(5,11,31,.85), 0 0 18px rgba(5,11,31,.9), 0 0 36px rgba(5,11,31,.6); }
.hero-cta { margin-top: 40px; display: flex; gap: 12px; flex-wrap: wrap; }
.hud { position: absolute; bottom: 28px; font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); display: flex; align-items: center; gap: 10px; }
.hud span { color: var(--cyan); }
.hud-bl { left: var(--gutter); }
.hud-br { right: var(--gutter); }
.blink { width: 8px; height: 8px; background: var(--cyan); animation: blink 1.2s steps(2) 5; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- ticker ---------- */
.ticker { border-block: 1px solid var(--line); overflow: hidden; padding-block: 22px; background: var(--navy); }
.ticker-track { display: flex; align-items: center; gap: 40px; width: max-content; animation: tick 34s linear infinite; }
.ticker span { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 1rem + 1.6vw, 40px); color: var(--white); white-space: nowrap; }
.ticker i { width: 12px; height: 12px; background: var(--cyan); flex: none; transform: rotate(45deg); }
@keyframes tick { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: clamp(110px, 14vw, 200px) var(--gutter) 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.h2 { font-family: var(--display); font-weight: 700; font-size: var(--s-h2); line-height: .95; letter-spacing: -0.02em; color: var(--white); }
.section-sub { max-width: 34ch; color: var(--soft); font-size: var(--s-lead); }

/* bento */
.bento { margin-top: 64px; display: grid; grid-template-columns: repeat(6, 1fr); grid-auto-rows: minmax(300px, auto); gap: 16px; }
.card {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--deep); box-shadow: inset 0 0 0 1px var(--line);
  display: flex; flex-direction: column; justify-content: flex-end;
  transform-style: preserve-3d; transition: transform .5s var(--ease), box-shadow .4s;
  --mx: 50%; --my: 50%;
}
.card::before { /* cursor spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(94,231,255,.12), transparent 60%);
}
.card::after { /* glowing edge that follows the cursor */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .4s;
  background: radial-gradient(260px circle at var(--mx) var(--my), rgba(94,231,255,.9), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.card-games { grid-column: span 3; grid-row: span 2; }
.card-apps { grid-column: span 3; }
.card-web { grid-column: span 3; }
.card-soft { grid-column: span 3; }
.card-growth { grid-column: span 3; }
.viz { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-text { position: relative; padding: 28px; background: linear-gradient(0deg, var(--deep) 30%, rgba(11,23,54,0)); }
.card h3 { font-family: var(--display); font-weight: 600; font-size: var(--s-h3); color: var(--white); line-height: 1.1; }
.card p { margin-top: 8px; color: var(--soft); max-width: 36ch; }

/* ---------- process (pinned) ---------- */
.process { position: relative; height: 420vh; margin-top: clamp(110px, 14vw, 200px); }
.process-pin { position: sticky; top: 0; height: 100vh; height: 100svh; max-width: var(--max); margin: 0 auto; padding: 100px var(--gutter) 60px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.steps { margin-top: 48px; display: grid; gap: 8px; }
.step { padding: 18px 22px; border-radius: 14px; transition: background-color .5s var(--ease), opacity .5s; opacity: .45; }
.step h3 { font-family: var(--display); font-weight: 600; font-size: var(--s-h3); color: var(--white); display: flex; align-items: center; gap: 14px; }
.step h3::before { content: ""; width: 10px; height: 10px; background: var(--soft); transform: rotate(45deg); transition: background-color .4s, box-shadow .4s; }
.step p { margin-top: 4px; color: var(--soft); max-height: 0; overflow: hidden; transition: max-height .6s var(--ease); }
.step.is-active { opacity: 1; background: var(--deep); }
.step.is-active h3::before { background: var(--cyan); box-shadow: 0 0 14px var(--cyan); }
.step.is-active p { max-height: 6em; }
/* without JavaScript nothing moves the active step, so show every step in a normal flow */
html:not(.js) .process { height: auto; }
html:not(.js) .process-pin { position: relative; height: auto; }
html:not(.js) .step { opacity: 1; background: var(--deep); }
html:not(.js) .step p { max-height: none; }
.process-progress { margin-top: 28px; height: 2px; background: var(--line); }
.process-progress i { display: block; height: 100%; width: 0; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.process-right { position: relative; height: min(70vh, 620px); height: min(70svh, 620px); border-radius: var(--r); background: var(--deep); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
#morph { position: absolute; inset: 0; width: 100%; height: 100%; }
.morph-label { position: absolute; left: 22px; bottom: 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
/* short desktop windows (e.g. laptops at 125% scaling): tighten so the pinned frame fits */
@media (min-width: 1001px) and (max-height: 760px) {
  .process-pin { padding-top: 84px; padding-bottom: 24px; }
  .steps { margin-top: 24px; }
  .step { padding-block: 12px; }
}

/* ---------- why ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.why-item { padding: 36px 28px 40px; border-radius: var(--r); background: linear-gradient(180deg, var(--deep-2), var(--deep)); box-shadow: inset 0 0 0 1px var(--line); transition: transform .5s var(--ease); }
.why-item h3 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 1rem + 2vw, 46px); line-height: 1; color: var(--white); }
.why-item p { margin-top: 14px; color: var(--soft); }
.why-for { margin-top: 40px; font-size: var(--s-lead); color: var(--text); text-align: center; }

/* ---------- contact ---------- */
.contact { position: relative; margin-top: clamp(60px, 8vw, 120px); min-height: 80vh; min-height: 80svh; display: grid; place-items: center; overflow: hidden; isolation: isolate; text-align: center; }
#contact-grid { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.contact-inner { padding: 80px var(--gutter); }
.contact-title { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 1rem + 9vw, 168px); line-height: .9; letter-spacing: -0.03em; color: var(--white); }
.contact-sub { margin-top: 22px; font-size: var(--s-lead); color: var(--soft); }
.contact-actions { margin-top: 44px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- footer ---------- */
.footer { max-width: var(--max); margin: 0 auto; padding: 36px var(--gutter) 44px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; border-top: 1px solid var(--line); color: var(--soft); font-size: 14px; }
.footer-end { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.motion-toggle { background: none; border: 0; padding: 0; color: var(--soft); font-size: 14px; cursor: pointer; }
.motion-paused .ticker-track, .motion-paused .blink { animation-play-state: paused; }

/* hover effects only where a real pointer can hover (no sticky states after a tap) */
@media (hover: hover) and (pointer: fine) {
  .brand:hover .brand-mark { transform: scale(1.1); }
  .nav-links a:hover { color: var(--white); }
  .nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
  .btn:hover { background: var(--blue); box-shadow: 0 0 0 6px rgba(59,130,246,.18), 0 12px 40px rgba(37,99,235,.45); }
  .btn:hover svg { transform: translate(3px, -3px); }
  .btn-ghost:hover { background: rgba(59,130,246,.12); box-shadow: inset 0 0 0 1px var(--cyan); }
  .ticker:hover .ticker-track { animation-play-state: paused; }
  .card:hover::before, .card:hover::after { opacity: 1; }
  .why-item:hover { transform: translateY(-6px); }
  .footer-mail:hover, .motion-toggle:hover { color: var(--cyan); }
}

/* ---------- reveal motion ---------- */
.js .reveal { opacity: 0; transform: translateY(36px); filter: blur(6px); transition: opacity 1s var(--ease), transform 1.1s var(--ease), filter 1s var(--ease); transition-delay: var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; filter: none; }
.scramble { white-space: pre-wrap; }

/* ---------- responsive ---------- */
/* "How we work" stops pinning on narrow or very short screens (matches main.js) */
@media (max-width: 1000px), (max-height: 560px) {
  .process { height: auto; scroll-margin-top: 88px; }
  .process-pin { position: relative; height: auto; grid-template-columns: 1fr; padding-top: 0; }
  .process-right { height: 360px; }
  .step { opacity: 1; background: var(--deep); }
  .step p { max-height: none; }
}
@media (max-width: 1000px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .card-games { grid-column: span 2; grid-row: span 1; min-height: 380px; }
  .card-apps, .card-web, .card-soft, .card-growth { grid-column: span 1; }
  .why-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .brand-word { font-size: 18px; }
  .hero-inner { padding-top: 110px; }
  .hero-shade { background: linear-gradient(0deg, rgba(5,11,31,.95) 10%, rgba(5,11,31,.35) 60%, rgba(5,11,31,.6) 100%); }
  .hero-title { max-width: none; }
  .hud-br { display: none; }
  .bento { grid-template-columns: 1fr; grid-auto-rows: minmax(280px, auto); }
  .card-games, .card-apps, .card-web, .card-soft, .card-growth { grid-column: span 1; }
  .btn-big { font-size: 18px; padding: 18px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; filter: none; }
  .ticker-track, .blink { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ---------- 404 page ---------- */
.nf { min-height: 100vh; min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 24px; padding: 120px var(--gutter) 80px; text-align: center; }
.nf-mark { width: 120px; height: 120px; margin-bottom: 12px; }
.nf-sub { color: var(--soft); font-size: var(--s-lead); margin-bottom: 12px; }
