/* WebPixels Agency
   Palette: an LCD seen up close. Deep ink screen, three subpixel colors,
   one per craft. Design is all three together. */

@font-face {
  font-family: "Doto";
  src: url("fonts/doto-latin-900-normal.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}
@font-face {
  font-family: "Doto";
  src: url("fonts/doto-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --ink: #0A0C1C;
  --ink-raised: #13162E;
  --ink-line: rgba(233, 236, 248, 0.14);
  --text: #E9ECF8;
  --muted: #9AA0C2;
  --red: #FF4D6D;
  --green: #2EE89A;
  --blue: #4D8DFF;

  --display: "Doto", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Perfect-fourth scale from a 17px base */
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.4167rem;
  --step-2: 1.8889rem;
  --step-3: clamp(2.2rem, 4.2vw, 3.3rem);
  --step-4: clamp(2.9rem, 7.4vw, 6.2rem);

  --gutter: clamp(16px, 4vw, 56px);
  --measure: 34rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The 3D layer and its readability scrim */
#voxels {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(10, 12, 28, 0.92) 0%, rgba(10, 12, 28, 0.62) 38%, rgba(10, 12, 28, 0) 62%);
}
.no-webgl #voxels { display: none; }
.no-webgl body, body.no-webgl {
  background-image:
    linear-gradient(90deg, rgba(255, 77, 109, 0.07) 0 33.3%, rgba(46, 232, 154, 0.07) 33.3% 66.6%, rgba(77, 141, 255, 0.07) 66.6%);
  background-size: 9px 9px;
}

main, .site-footer { position: relative; z-index: 2; }

a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--text);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header */
/* The header must sit above the page content, or sections scroll over it and swallow clicks. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px var(--gutter);
  background: rgba(10, 12, 28, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.site-header.is-scrolled {
  background: rgba(10, 12, 28, 0.9);
  border-bottom-color: var(--ink-line);
}
.wordmark {
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  line-height: 1;
}
.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
}
.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--text); }
.site-nav .nav-login {
  color: var(--text);
  padding-left: 22px;
  border-left: 1px solid var(--ink-line);
}
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  margin-left: auto;
  border: 1px solid var(--ink-line);
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: 600 0.92rem var(--body);
  cursor: pointer;
}
.nav-toggle-bars { display: grid; gap: 3px; }
.nav-toggle-bars i { display: block; width: 16px; height: 2px; background: currentColor; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: 600 1rem/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--text); color: var(--ink); }
.btn-primary:hover { background: #ffffff; }
.btn-ghost { background: rgba(10, 12, 28, 0.4); color: var(--text); border-color: var(--ink-line); }
.btn-ghost:hover { border-color: var(--text); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 0.92rem; background: var(--text); color: var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: progress; }

.text-link {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font: 500 1rem var(--body);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
  cursor: pointer;
}
.text-link:hover { text-decoration-thickness: 2px; }

/* Subpixel markers: a tiny color key that matches the 3D */
.px {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex: none;
}
.px-blue { background: var(--blue); }
.px-red { background: var(--red); }
.px-green { background: var(--green); }
.px-rgb { background: linear-gradient(90deg, var(--red) 0 33.3%, var(--green) 33.3% 66.6%, var(--blue) 66.6%); }

/* Type */
h1, h2 {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.005em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); line-height: 0.98; }
h2 { font-size: var(--step-3); line-height: 1.05; }
h3 {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
p { margin: 0; }

/* Layout */
main > section {
  padding-inline: var(--gutter);
}

.hero {
  min-height: calc(100svh - 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 48px;
  padding-block: 40px 56px;
}
.hero-copy { max-width: 46rem; }
.hero h1 { max-width: 12ch; }
.lead {
  margin-top: 28px;
  max-width: var(--measure);
  font-size: var(--step-1);
  line-height: 1.45;
  color: #CDD2EA;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}
.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  color: var(--muted);
  font-size: 0.95rem;
}
.legend li { display: flex; align-items: center; gap: 10px; }

.section-intro {
  max-width: var(--measure);
  padding-block: 18vh 8vh;
}
.section-intro p,
.work > p,
.contact-copy > p {
  margin-top: 20px;
  color: #CDD2EA;
  max-width: var(--measure);
}

.service {
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--measure);
  padding-block: 8vh;
}
.service h3 {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: var(--step-3);
}
.service h3 .px { width: 14px; height: 14px; }
.service-line {
  margin-top: 16px;
  font-size: var(--step-1);
  line-height: 1.4;
  color: #CDD2EA;
}
.deliverables {
  list-style: none;
  margin: 28px 0 30px;
  padding: 0;
  border-top: 1px solid var(--ink-line);
}
.deliverables li {
  padding: 13px 0;
  border-bottom: 1px solid var(--ink-line);
}

.work {
  padding-block: 4vh 10vh;
  max-width: 82rem;
}
.work-intro {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 40rem;
}
.work-intro p {
  margin-top: 20px;
  color: #CDD2EA;
  max-width: var(--measure);
}
.work-group { padding-top: 40px; }
.work-group[hidden] { display: none; }
.work-group h3 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--step-1);
  margin-bottom: 18px;
}
.vgrid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.vgrid-long { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.vgrid-short { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.vcard {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  text-align: left;
  color: var(--text);
  font: inherit;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.vcard:hover { border-color: var(--text); }
.vthumb {
  position: relative;
  display: block;
  background: #05060F;
  aspect-ratio: 16 / 9;
}
.vcard-short .vthumb { aspect-ratio: 9 / 16; }
.vthumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vthumb-missing {
  background: linear-gradient(90deg, rgba(255, 77, 109, 0.18) 0 33.3%, rgba(46, 232, 154, 0.18) 33.3% 66.6%, rgba(77, 141, 255, 0.18) 66.6%);
  background-size: 9px 9px;
}
.vplay {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(10, 12, 28, 0.72);
  border: 1px solid rgba(233, 236, 248, 0.5);
}
.vplay::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 15px;
  border-style: solid;
  border-width: 9px 0 9px 14px;
  border-color: transparent transparent transparent var(--text);
}
.vcard:hover .vplay { background: var(--red); border-color: var(--red); }
.vmeta { display: grid; gap: 2px; padding: 12px 14px 14px; }
.vtitle { font-weight: 600; font-size: 0.98rem; line-height: 1.3; }
.vlabel { font-size: 0.84rem; color: var(--muted); }
.work-more { display: inline-block; margin-top: 26px; }

.video-dialog {
  padding: 0;
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  background: var(--ink-raised);
  color: var(--text);
  width: min(1040px, 94vw);
  max-height: 94svh;
  overflow: hidden;
}
.video-dialog::backdrop { background: rgba(5, 6, 15, 0.86); }
.video-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border-bottom: 1px solid var(--ink-line);
}
.video-head h2 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0;
}
.video-frame { background: #000; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-frame-long { aspect-ratio: 16 / 9; }
.video-frame-short { aspect-ratio: 9 / 16; height: min(80svh, 820px); margin: 0 auto; }
.video-dialog:has(.video-frame-short) { width: auto; }

.process { padding-block: 16vh 10vh; }
.steps {
  list-style: none;
  counter-reset: step;
  margin: 48px 0 0;
  padding: 0;
  max-width: 40rem;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  column-gap: 20px;
  padding: 22px 0;
  border-top: 1px solid var(--ink-line);
}
.steps li:last-child { border-bottom: 1px solid var(--ink-line); }
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--muted);
}
.steps h3 { font-size: var(--step-1); }
.steps p { margin-top: 6px; color: var(--muted); }

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
  gap: 48px 64px;
  align-items: start;
  padding-block: 14vh 12vh;
  max-width: 76rem;
}
.direct {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.direct a {
  font-weight: 500;
  text-underline-offset: 5px;
}

.contact-form {
  display: grid;
  gap: 18px;
  padding: 28px;
  background: rgba(19, 22, 46, 0.86);
  border: 1px solid var(--ink-line);
  border-radius: 10px;
  backdrop-filter: blur(8px);
}
.field { display: grid; gap: 7px; }
.field label { font-size: 0.92rem; font-weight: 500; color: #CDD2EA; }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  font: 400 1rem/1.4 var(--body);
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--text);
}
.field input::placeholder,
.field textarea::placeholder { color: #6F7598; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.6em; font-size: 0.95rem; color: var(--muted); }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--red); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 28px var(--gutter) 96px;
  border-top: 1px solid var(--ink-line);
  color: var(--muted);
  font-size: 0.92rem;
  background: var(--ink);
}

/* Chat */
.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border-radius: 26px;
  border: 1px solid var(--ink-line);
  background: var(--ink-raised);
  color: var(--text);
  font: 600 0.98rem var(--body);
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.chat-launcher:hover { border-color: var(--text); }
.chat-launcher[aria-expanded="true"] { display: none; }
.chat-launcher-dots { display: inline-flex; gap: 3px; }
.chat-launcher-dots i { width: 7px; height: 7px; display: block; }
.chat-launcher-dots i:nth-child(1) { background: var(--red); }
.chat-launcher-dots i:nth-child(2) { background: var(--green); }
.chat-launcher-dots i:nth-child(3) { background: var(--blue); }

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(392px, calc(100vw - 32px));
  height: min(600px, calc(100svh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px 18px;
  border-bottom: 1px solid var(--ink-line);
}
.chat-head h2 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0;
}
.chat-sub { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.chat-close {
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}
.chat-close:hover { border-color: var(--ink-line); }

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.msg p + p, .msg p + ul, .msg ul + p { margin-top: 8px; }
.msg ul { margin: 6px 0 0; padding-left: 18px; }
.msg a { color: var(--text); text-underline-offset: 3px; }
.msg-bot { align-self: flex-start; background: var(--ink); border: 1px solid var(--ink-line); }
.msg-user { align-self: flex-end; background: var(--text); color: var(--ink); }
.msg-error { align-self: flex-start; color: var(--red); background: none; padding-left: 0; }

.typing { display: inline-flex; gap: 4px; padding: 14px 14px; }
.typing i { width: 7px; height: 7px; display: block; animation: blink 1s infinite steps(2, jump-none); }
.typing i:nth-child(1) { background: var(--red); }
.typing i:nth-child(2) { background: var(--green); animation-delay: 0.15s; }
.typing i:nth-child(3) { background: var(--blue); animation-delay: 0.3s; }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: 0.2; } }

.chat-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-line);
}
.chat-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 6px;
  border: 1px solid var(--ink-line);
  background: none;
  color: var(--muted);
  font: 600 0.88rem var(--body);
  cursor: pointer;
}
.chat-modes button[aria-pressed="true"] { background: var(--text); color: var(--ink); border-color: var(--text); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.live-status {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: 1px solid var(--ink-line);
}
.live-status.is-online { color: var(--green); }
.live-start {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
}
.live-start p { font-size: 0.92rem; color: #CDD2EA; margin-bottom: 6px; }
.live-start label { font-size: 0.85rem; font-weight: 500; color: #CDD2EA; }
.live-start input {
  min-height: 44px;
  padding: 0 12px;
  font: 400 1rem var(--body);
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
}
.live-start input:focus { outline: none; border-color: var(--text); }
.live-start .btn { margin-top: 8px; }
.live-error { color: var(--red); font-size: 0.88rem; min-height: 1.2em; }
.msg-who { display: block; font-size: 0.74rem; font-weight: 600; color: var(--green); margin-bottom: 2px; }
.live-cta { margin-top: 24px; }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}
.chat-suggestions[hidden] { display: none; }
.chat-suggestions button {
  padding: 7px 11px;
  border-radius: 16px;
  border: 1px solid var(--ink-line);
  background: none;
  color: var(--text);
  font: 500 0.85rem var(--body);
  cursor: pointer;
}
.chat-suggestions button:hover { border-color: var(--text); }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--ink-line);
}
.chat-form input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  font: 400 1rem var(--body);
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 6px;
}
.chat-form input:focus { outline: none; border-color: var(--text); }
.chat-form button {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: var(--text);
  color: var(--ink);
  cursor: pointer;
}
.chat-form button[disabled] { opacity: 0.5; cursor: progress; }
.chat-note {
  padding: 0 16px 12px;
  font-size: 0.76rem;
  color: #7C82A6;
}

/* Tablet and phone */
@media (max-width: 860px) {
  .site-header { justify-content: space-between; gap: 12px; }
  .nav-toggle { display: inline-flex; }
  .site-header .btn-small { margin-left: auto; }
  .site-header .btn-small + .nav-toggle { margin-left: 0; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px var(--gutter) 16px;
    background: rgba(10, 12, 28, 0.97);
    border-bottom: 1px solid var(--ink-line);
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-nav a {
    padding: 14px 0;
    font-size: 1.05rem;
    color: var(--text);
    border-bottom: 1px solid var(--ink-line);
  }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav .nav-login { padding-left: 0; border-left: 0; }
  .scrim { background: rgba(10, 12, 28, 0.62); }
  .contact { grid-template-columns: 1fr; }
  .service { min-height: 80vh; }
}
@media (max-width: 520px) {
  .vgrid-short { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .vgrid-long { grid-template-columns: 1fr; }
  .site-header { padding-block: 14px; }
  .wordmark { font-size: 1.35rem; }
  .btn-small { display: none; }
  .hero { min-height: calc(100svh - 60px); gap: 36px; }
  .lead { font-size: 1.15rem; }
  .actions .btn { flex: 1 1 100%; }
  .contact-form { padding: 20px; }
  .steps li { grid-template-columns: 3rem 1fr; column-gap: 14px; }
  .steps li::before { font-size: 2rem; }
  .chat-panel {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100svh;
    border-radius: 0;
    border: 0;
  }
  .chat-launcher { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .typing i { animation: none; }
}
