/* Red & white palette: white surfaces, BennaByte red for accents, a red-black for readable text. */
:root {
  --bg: #ffffff;
  --tint: #fff4f3;
  --ink: #1f0707;
  --muted: #8a5a58;
  --line: rgba(221, 2, 0, 0.16);
  --red: #dd0200;
  --red-deep: #b30200;
  --red-tint: #e43937; /* 22% paper over red, solid so autofill can match it */
  --paper: #ffffff;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gutter: clamp(16px, 4vw, 48px);
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Lenis smooth scrolling (js/motion.js) takes over from native smooth scroll. */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

::selection { background: var(--red); color: var(--paper); }

/* ---------- Motion ---------- */

/* Scroll reveals (js/motion.js adds .is-in). An animation rather than a transition, with
   backwards fill only, so it never fights the elements' own hover transforms afterwards. */
.js :is(.section__head, .service, .work__head, .reviews__head, .work-table tbody tr, .careers__head, .careers__cols, .jobs-list > li, .careers__foot,
        .footer__wordmark, .subscribe, .subscribe__note, .social, .footer__cols > div):not(.is-in) {
  opacity: 0;
}
.js .is-in {
  animation: rise 0.9s var(--ease) backwards;
  animation-delay: var(--reveal-delay, 0ms);
}

/* ---------- Loading screen (js/loader.js) ---------- */

.loader { display: none; }
.js .loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  background:
    radial-gradient(45% 45% at 50% 50%, rgba(255, 255, 255, 0.08), transparent 70%),
    var(--red);
  color: var(--paper);
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.9s var(--ease) 0.15s;
}
.loader.is-done { clip-path: inset(0 0 100% 0); }
.loader__inner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
/* Full-screen counter drawn from changing characters; js/loader.js sizes it to the viewport */
.loader__num {
  display: block;
  margin-top: -4vh; /* sit a little above centre, clear of the status line */
  transition: transform 0.8s var(--ease), opacity 0.5s ease;
}
.loader.is-done .loader__num { transform: scale(1.12); opacity: 0; }
.loader__status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(32px, 7vh, 64px);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: opacity 0.4s ease;
}
.loader.is-done .loader__status { opacity: 0; }

/* Hold the hero intro until the loading screen has gone */
html.is-loading { overflow: hidden; }
.is-loading .hero, .is-loading .hero * { animation-play-state: paused !important; }

/* Hero intro on page load */
.js .hero__grid { animation: fade 1.4s ease backwards 0.2s; }
.js .nav { animation: rise 0.9s var(--ease) backwards 0.05s; }
.js .hero__title { animation: rise-lg 1.1s var(--ease) backwards 0.15s; }
.js .hero__aside { animation: rise 0.9s var(--ease) backwards 0.45s; }

@keyframes rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes rise-lg { from { opacity: 0; transform: translateY(60px); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -10% 0); } }
@keyframes fade { from { opacity: 0; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { margin: 0; font-weight: 400; letter-spacing: -0.03em; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: clamp(620px, 100svh, 1100px);
  overflow: hidden;
  padding: 24px var(--gutter) var(--gutter);
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);
}

.hero__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero > :not(canvas) { position: relative; z-index: 1; }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.brand small { font-weight: 400; color: var(--muted); font-size: 12px; }

.nav__links {
  display: flex;
  gap: clamp(16px, 3vw, 36px);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.nav__links a { position: relative; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav__links a:hover::after { transform: scaleX(1); }

.hero__title {
  align-self: center;
  justify-self: start;
  margin-top: -6vh;
  font-size: clamp(48px, 8.4vw, 132px);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.hero__aside {
  justify-self: end;
  max-width: 330px;
  font-size: 14px;
  line-height: 1.45;
}

.hero__aside p { margin: 0 0 16px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s var(--ease);
}
.btn:hover { background: var(--red-deep); }
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover span { transform: translateX(4px); }


/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 12vw, 160px) var(--gutter);
  border-top: 1px solid var(--line);
}

.section__head {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 3fr;
  gap: 24px;
  margin-bottom: clamp(40px, 6vw, 80px);
}

.section__head h2 {
  font-size: clamp(32px, 4.6vw, 64px);
  line-height: 1.02;
  max-width: 16ch;
}

.label {
  font: 400 12px/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding-top: 0.6em;
}

/* Services */

.services { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.service {
  display: grid;
  grid-template-columns: 56px 40px minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  transition: background 0.4s var(--ease), padding 0.4s var(--ease);
}

.service:hover { background: var(--tint); padding-inline: 16px; }

.service__num { font: 400 12px var(--mono); color: var(--muted); }

.service h3 { font-size: clamp(20px, 2.2vw, 28px); line-height: 1.15; }

.service p { margin: 0; color: var(--muted); font-size: 15px; }

.glyph {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1px;
  width: 30px;
  height: 30px;
}
.glyph b { background: var(--red); transition: background 0.2s ease; }
.glyph b.off { background: transparent; }
.service:hover .glyph b:not(.off) { background: var(--red-deep); }

/* About facts (used in the journey intro) */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.facts dt { font: 400 12px var(--mono); text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 18px; }

/* Work */

.work__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: clamp(32px, 5vw, 64px);
}
.work__title {
  font-size: clamp(96px, 20vw, 300px);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  margin-left: -0.04em; /* optically align the W with the gutter */
}
.work__title::after { content: "."; color: var(--red); }

.work-table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(16px, 1.6vw, 22px);
}
.work-table th, .work-table td {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}
.work-table thead th {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 14px;
}
.work-table :is(th, td):last-child { text-align: right; }
.work-table tbody tr { transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.work-table tbody tr:hover { background: var(--tint); color: var(--red); }
.work-table tbody :is(th, td):first-child { padding-left: 0; transition: padding 0.4s var(--ease); }
.work-table tbody :is(th, td):last-child { transition: padding 0.4s var(--ease); }
.work-table tbody tr:hover :is(th, td):first-child { padding-left: 16px; }
.work-table tbody tr:hover :is(th, td):last-child { padding-right: 16px; }

.work-table tbody tr { position: relative; cursor: pointer; }
.work__name { font-weight: 500; outline: none; }
.work__name::before { content: ""; position: absolute; inset: 0; } /* whole row is the link */
.work-table tbody tr:has(.work__name:focus-visible) { outline: 2px solid var(--red); outline-offset: -2px; }
.work__name::after {
  content: " ↗";
  display: inline-block;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.work-table tbody tr:is(:hover, :focus-within) .work__name::after { opacity: 1; transform: none; }

.work__more { margin: 28px 0 0; color: var(--muted); font-size: 15px; }
.work__more a { color: var(--red); font-weight: 500; }
.work__more a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Reviews */

.reviews { overflow: hidden; }

.reviews__head { display: grid; justify-items: center; gap: 18px; text-align: center; }
.reviews__head h2 {
  font-size: clamp(32px, 4.4vw, 60px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.045em;
}
.reviews__badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 4px 0 0; padding: 0; }
.reviews__badges li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border-radius: 10px;
  background: var(--tint);
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}
.reviews__badge-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: inset 0 0 0 5px var(--tint);
}

.reviews__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  height: 620px;
  margin-top: clamp(40px, 6vw, 72px);
  /* fade cards in and out at the top and bottom edges */
  -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(transparent, #000 14%, #000 86%, transparent);
}
.reviews__col { overflow: hidden; }
.reviews__track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  animation: reviews-up 46s linear infinite;
}
.reviews__col--down .reviews__track { animation-name: reviews-down; animation-duration: 52s; }
.reviews__col:nth-child(3) .reviews__track { animation-duration: 40s; }
.reviews__cols:hover .reviews__track { animation-play-state: paused; }

/* Two identical sets + one 14px gap between them: shifting by half the track plus half a gap loops seamlessly. */
@keyframes reviews-up { to { transform: translateY(calc(-50% - 7px)); } }
@keyframes reviews-down { from { transform: translateY(calc(-50% - 7px)); } to { transform: none; } }

.review {
  flex: none;
  padding: 20px;
  border: 1px solid var(--red-deep);
  border-radius: 16px;
  background: var(--paper);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.review:hover { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 12px 30px -20px rgba(221, 2, 0, 0.5); }
.review__stars { color: var(--red); letter-spacing: 2px; font-size: 14px; }
.review__stars span { color: var(--line); }
.review blockquote { margin: 12px 0 16px; font-size: 15px; line-height: 1.45; }
.review__who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.review__who b { display: block; font-weight: 600; }
.review__who small { color: var(--muted); font-size: 12px; }
/* Initials badge (or the client's photo, same size) */
.review__avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: var(--paper);
  font: 600 13px var(--sans);
  letter-spacing: 0.02em;
  object-fit: cover;
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--line);
}

/* About journey */

.journey {
  position: relative;
  height: 500vh; /* replaced by js/journey.js with the exact scroll distance */
  border-top: 1px solid var(--line);
  /* faint paper grain */
  background:
    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='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .87 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    var(--bg);
}

.journey__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.journey__bar {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 400 12px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.journey__bar--top { top: 28px; }
.journey__bar--bottom { bottom: 28px; }
.journey__count { color: var(--red); white-space: nowrap; }

.journey__track {
  position: absolute;
  top: 0;
  left: 0;
  width: 500vw;
  height: 100%;
  will-change: transform;
}

.journey__line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.journey__line path {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.journey__intro {
  position: absolute;
  left: 1.2%;
  top: 50%;
  transform: translateY(-50%);
  width: min(560px, 54vw);
}
.journey__intro h2 {
  font-size: clamp(32px, 4.2vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}
.journey__intro p { margin: 20px 0 0; max-width: 46ch; color: var(--muted); font-size: clamp(15px, 1.3vw, 18px); }
.journey__intro .facts { margin-top: 32px; }

/* Nodes are zero-size anchors placed on the path; the dot centres on the anchor. */
.node, .note, .journey__end { position: absolute; }

.node__dot {
  position: absolute;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--red);
  border-radius: 50%;
  background: var(--bg);
  transition: background 0.3s ease, transform 0.3s ease;
}
.node.is-active .node__dot { background: var(--red); transform: scale(1.15); }

.node__body {
  position: absolute;
  left: -14px;
  width: min(340px, 72vw);
  opacity: 0.28;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.node--below .node__body { top: 22px; }
.node--above .node__body { bottom: 22px; }
.node--above .node__body { transform: translateY(-8px); }
.node--left .node__body { left: auto; right: -14px; text-align: right; }
.node.is-active .node__body { opacity: 1; transform: none; }

.node__num {
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font-size: clamp(36px, 3.6vw, 52px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
}
.node__title {
  margin-bottom: 6px;
  color: var(--red);
  font-size: clamp(34px, 3.4vw, 52px);
  font-weight: 600;
  line-height: 1;
}
.node__body p { margin: 0; font-size: clamp(17px, 1.6vw, 23px); line-height: 1.3; letter-spacing: -0.01em; }
.node__body a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }

.note {
  margin: 0;
  transform: translate(-50%, -50%) rotate(-3deg);
  font: 500 clamp(17px, 1.6vw, 23px)/1.05 "Caveat", cursive;
  color: var(--red);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.note.is-active, .note--static { opacity: 1; }

.journey__end {
  transform: translate(-50%, calc(-100% - 28px));
  text-align: right;
  opacity: 0.28;
  transition: opacity 0.5s ease;
}
.journey__end.is-active { opacity: 1; }
.journey__end .note { position: static; transform: rotate(-3deg); margin-bottom: 14px; }
.journey__end h3 {
  color: var(--red);
  font-size: clamp(30px, 3.6vw, 54px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

/* Careers: accordion list (location | team | position) */

.careers {
  --cols: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 3.2fr);
}

.careers__head {
  display: grid;
  grid-template-columns: var(--cols);
  column-gap: clamp(16px, 2.4vw, 32px);
  margin-bottom: clamp(48px, 7vw, 96px);
}
.careers__head .label { grid-column: 1 / 3; }
.careers__head h2 {
  grid-column: 3;
  max-width: 16ch;
  font-size: clamp(30px, 3.6vw, 52px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.careers__cols, .job {
  display: grid;
  grid-template-columns: var(--cols);
  column-gap: clamp(16px, 2.4vw, 32px);
}
.careers__cols {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink);
  font-size: clamp(16px, 1.5vw, 20px);
  color: var(--muted);
}

.jobs-list { list-style: none; margin: 0; padding: 0; }

.job {
  padding: clamp(16px, 2vw, 22px) 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.job__loc, .job__team { padding-top: 0.55em; font-size: 13px; color: var(--muted); }
.job__team b { display: block; color: var(--ink); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em; }
.job__team span { display: block; }
.job__team a {
  display: inline-block;
  margin-top: 14px;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  visibility: hidden; /* shown with the open row */
}
.job.is-open .job__team a { visibility: visible; }
.job__team a:hover { color: var(--red); }

.job h3 { margin: 0; }
.job__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  font: 500 clamp(26px, 3.4vw, 48px)/1.05 var(--sans);
  letter-spacing: -0.045em;
  cursor: pointer;
  transition: color 0.3s var(--ease);
}
.job:hover .job__toggle, .job.is-open .job__toggle { color: var(--red); }
.job__toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 4px; }

/* plus that turns into a minus */
.job__icon { position: relative; flex: none; width: 22px; height: 22px; }
.job__icon::before, .job__icon::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: currentColor;
  transition: transform 0.35s var(--ease);
}
.job__icon::after { transform: rotate(90deg); }
.job.is-open .job__icon::after { transform: rotate(0deg); }

/* height animation via grid rows */
.job__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s var(--ease);
  cursor: auto;
}
.job.is-open .job__panel { grid-template-rows: 1fr; }
.job__panel-inner { overflow: hidden; }
.job__panel-inner > :first-child { margin-top: 16px; }
.job__panel p { max-width: 52ch; margin: 0; font-size: 15px; line-height: 1.5; }

.job__facts { display: grid; gap: 4px; margin: 28px 0 22px; font-size: 13px; }
.job__facts div { display: flex; gap: 8px; flex-wrap: wrap; }
.job__facts dt { font-weight: 600; }
.job__facts dd { margin: 0; color: var(--muted); }

.job__apply {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 9px 22px;
  border: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.job__apply:hover { background: var(--red); border-color: var(--red); color: var(--paper); }

.careers__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: clamp(28px, 4vw, 44px);
}
.careers__foot p { margin: 0; color: var(--muted); font-size: 15px; }
.careers__apply {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s var(--ease);
}
.careers__apply:hover { background: var(--red-deep); }
.careers__apply span { transition: transform 0.3s var(--ease); }
.careers__apply:hover span { transform: translateX(4px); }

/* Footer */

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

.footer__body {
  background: var(--red);
  color: var(--paper);
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(40px, 6vw, 72px);
}

.footer__wordmark { margin-bottom: clamp(40px, 6vw, 72px); }
.footer__wordmark canvas { display: block; width: 100%; }

.subscribe {
  display: flex;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 999px;
  background: var(--red-tint);
  transition: box-shadow 0.2s ease;
}
.subscribe input {
  flex: 1;
  align-self: stretch; /* the whole pill is the hit area, not a strip in the middle */
  min-width: 0;
  padding: 0 clamp(16px, 2.4vw, 26px);
  background: none;
  border: 0;
  border-radius: 999px;
  outline: none;
  color: var(--paper);
  caret-color: var(--paper);
  font: 400 clamp(17px, 2.4vw, 28px) var(--sans);
}
.subscribe input::placeholder { color: rgba(253, 252, 252, 0.6); }
/* Browser autofill paints its own light-blue box and dark text; repaint it as the pill. */
.subscribe input:-webkit-autofill,
.subscribe input:-webkit-autofill:hover,
.subscribe input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--paper);
  -webkit-box-shadow: 0 0 0 100px var(--red-tint) inset;
  transition: background-color 600000s 0s;
}
.subscribe:focus-within { box-shadow: 0 0 0 2px var(--paper); }
.subscribe.is-invalid { box-shadow: 0 0 0 2px var(--ink); }
.subscribe button {
  flex: none;
  padding: clamp(12px, 1.4vw, 16px) clamp(18px, 2.2vw, 28px);
  border: 0;
  border-radius: 999px;
  background: var(--paper);
  color: var(--red);
  font: 600 clamp(16px, 2.2vw, 26px) var(--sans);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.subscribe button:hover { background: var(--ink); color: var(--paper); }

.subscribe__note {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  min-height: 1.5em;
}
.subscribe__note.is-error::before { content: "⚠ "; }

.social {
  display: flex;
  justify-content: center;
  gap: 22px;
  list-style: none;
  margin: clamp(40px, 6vw, 64px) 0 clamp(48px, 7vw, 80px);
  padding: 0;
}
.social a { display: block; width: 18px; height: 18px; transition: opacity 0.2s ease; }
.social a:hover { opacity: 0.65; }
.social svg { display: block; width: 100%; height: 100%; }

.footer__cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px clamp(16px, 2.4vw, 24px);
}
.footer__cols h4 {
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(253, 252, 252, 0.45);
  font: 400 12px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: rgba(253, 252, 252, 0.75);
}
.footer__cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; font-weight: 500; }
.footer__cols li:last-child:not(:has(a)) { font-weight: 400; color: rgba(253, 252, 252, 0.75); }
.footer__cols a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__cols .contacts { gap: 12px; }
.contacts li { display: grid; gap: 1px; }
.contacts span { font-size: 12px; font-weight: 400; color: rgba(253, 252, 252, 0.7); }
.contacts a { overflow-wrap: anywhere; }

/* ---------- Byte, the guide (js/bot.js) ---------- */

.bot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  width: 70px;
  pointer-events: none;
  will-change: transform;
}
.bot__svg {
  display: block;
  width: 70px;
  height: 98px;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 6px 6px rgba(31, 7, 7, 0.18));
}
.bot__svg * { transform-box: view-box; }
.bot__limb {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bot__foot, .bot__hand { fill: var(--ink); }
/* Pixel face, as in the logo */
.bot__eyes, .bot__mouth { fill: #fdfcfc; }

/* Always-on life: breathing and blinking (poses and limbs are driven by js/bot.js) */
.bot__body { transform-origin: 50px 90px; animation: bot-breathe 2.8s ease-in-out infinite; }
.bot__face { transition: transform 0.3s ease; }
.bot__eyes { transform-origin: 26px 46.5px; animation: bot-blink 4.6s infinite; }
.bot[data-eyes="closed"] .bot__eyes { animation: none; transform: scaleY(0.15); transition: transform 0.3s ease; }
.bot__mouth { transform-origin: 25.5px 60.7px; transition: transform 0.2s ease; }
.bot[data-pose="dance"] .bot__mouth { transform: scaleY(1.7); }
.bot.is-typing .bot__mouth { animation: bot-talk 0.16s ease-in-out infinite alternate; }
@keyframes bot-talk { from { transform: scaleY(0.5); } to { transform: scaleY(1.5); } }

@keyframes bot-breathe { 50% { transform: scale(1.025, 0.975); } }
@keyframes bot-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(0.08); } }

/* Props, shown by pose */
.bot__phone, .bot__ball, .bot__zzz, .bot__notes { opacity: 0; transition: opacity 0.3s ease; }
.bot[data-props~="phone"] .bot__phone,
.bot[data-props~="ball"] .bot__ball,
.bot[data-props~="zzz"] .bot__zzz,
.bot[data-props~="notes"] .bot__notes { opacity: 1; }

.bot__phone rect:first-child { fill: var(--ink); }
.bot__screen { fill: #fff; animation: bot-screen 1.2s steps(2) infinite; }
@keyframes bot-screen { 50% { fill: #ffe1df; } }

.bot__ball { fill: var(--red); stroke: var(--ink); stroke-width: 2; }

.bot__zzz text, .bot__notes text { fill: var(--ink); font: 700 12px var(--sans); }
.bot__zzz text { animation: bot-float 2.4s ease-in infinite; }
.bot__zzz text:nth-child(2) { animation-delay: 0.8s; font-size: 14px; }
.bot__zzz text:nth-child(3) { animation-delay: 1.6s; font-size: 17px; }
.bot__notes text { fill: var(--red); font-size: 16px; animation: bot-float 1.6s ease-out infinite; }
.bot__notes text:nth-child(2) { animation-delay: 0.8s; }
@keyframes bot-float { from { opacity: 0; transform: translate(0, 6px); } 30% { opacity: 1; } to { opacity: 0; transform: translate(6px, -14px); } }

/* Landing squash */
.bot.is-landing .bot__body { animation: bot-squash 0.38s var(--ease); }
@keyframes bot-squash { 35% { transform: scale(1.14, 0.84); } 70% { transform: scale(0.95, 1.06); } }

/* Speech bubble */
.bot__bubble {
  position: absolute;
  bottom: calc(100% - 6px);
  left: 0;
  width: max-content;
  max-width: min(240px, 70vw);
  padding: 10px 30px 10px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(8px) scale(0.94);
  transform-origin: var(--tail, 50%) 100%;
  transition: opacity 0.25s ease, transform 0.35s var(--ease);
}
.bot__bubble::after {
  /* tail pointing down at Byte */
  content: "";
  position: absolute;
  top: 100%;
  left: var(--tail, 50%);
  margin-left: -7px;
  border: 7px solid transparent;
  border-top-color: var(--ink);
}
.bot.is-talking .bot__bubble { opacity: 1; transform: none; }
.bot:not(.is-talking) .bot__bubble { pointer-events: none; }
.bot__text { display: block; min-height: 1.4em; }
.bot__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: var(--paper);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}
.bot__close:hover { background: var(--red); }

@media (max-width: 640px) {
  .bot, .bot__svg { width: 46px; }
  .bot__svg { height: 64px; }
  .bot__bubble { font-size: 12px; }
}

/* ---------- Responsive ---------- */

/* ---------- Legal pages (privacy.html, terms.html) ---------- */

.legal-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px var(--gutter);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
.legal-back:hover { background: var(--red); color: var(--paper); }
.legal-back span { transition: transform 0.3s var(--ease); }
.legal-back:hover span { transform: translateX(-3px); }

.legal-hero {
  padding: clamp(56px, 10vw, 128px) var(--gutter) clamp(40px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
  background: radial-gradient(60% 260px at 85% 0, rgba(221, 2, 0, 0.12), transparent 75%);
}
.legal-hero h1 {
  margin-top: 16px;
  font-size: clamp(48px, 10vw, 140px);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.055em;
}
.legal-hero h1::after { content: "."; color: var(--red); }
.legal-meta { margin: 20px 0 0; font: 400 13px var(--mono); color: var(--muted); }
.legal-intro { max-width: 60ch; margin: 24px 0 0; font-size: clamp(16px, 1.5vw, 19px); line-height: 1.55; }

.legal-page a:not(.brand, .legal-back) { color: var(--red); }
.legal-body a, .legal-intro a { text-decoration: underline; text-underline-offset: 3px; }

/* Placeholders still to be filled in */
mark.fill {
  padding: 0 4px;
  border-radius: 4px;
  background: #ffe36e;
  color: var(--ink);
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(0, 2.6fr);
  gap: clamp(24px, 5vw, 80px);
  padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(64px, 9vw, 120px);
}

.legal-toc { position: sticky; top: 96px; align-self: start; }
.legal-toc ol {
  display: grid;
  gap: 2px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}
.legal-toc li { counter-increment: toc; }
.legal-toc a {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted) !important;
  font-size: 14px;
  transition: background 0.25s ease, color 0.25s ease;
}
.legal-toc a::before { content: counter(toc, decimal-leading-zero); font: 400 11px/1.9 var(--mono); }
.legal-toc a:hover { color: var(--ink) !important; }
.legal-toc a.is-active { background: var(--tint); color: var(--red) !important; font-weight: 600; }

.legal-body { max-width: 72ch; }
.legal-body section { padding: 8px 0 clamp(28px, 4vw, 44px); scroll-margin-top: 96px; }
.legal-body section + section { padding-top: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line); }
.legal-body h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  letter-spacing: -0.035em;
}
.legal-body h2 span { color: var(--red); font: 500 13px var(--mono); letter-spacing: 0; }
.legal-body h3 { margin: 24px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.legal-body p, .legal-body li { font-size: 16px; line-height: 1.65; }
.legal-body p { margin: 12px 0 0; }
.legal-body ul { margin: 12px 0 0; padding-left: 0; list-style: none; }
.legal-body li { position: relative; padding-left: 22px; margin-top: 6px; }
.legal-body li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  background: var(--red);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); /* tiny hexagon, like the logo */
}

.legal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 32px;
  padding: 28px var(--gutter);
  background: var(--red);
  color: var(--paper);
  font-size: 14px;
}
.legal-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.legal-page .legal-footer a { color: var(--paper); }
.legal-footer a:hover, .legal-footer a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 860px) {
  .legal-layout { grid-template-columns: 1fr; }
  .legal-toc { position: static; padding: 16px; border-radius: 14px; background: var(--tint); }
  .legal-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .legal-bar .brand small { display: none; }
  .legal-toc ol { grid-template-columns: 1fr; }
}

@media print {
  .legal-bar, .legal-toc, .legal-footer { display: none; }
  .legal-layout { display: block; padding: 0; }
  .legal-hero { background: none; }
}

/* ---------- 404 page ---------- */

.nf-page { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
.nf {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 14px;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  text-align: center;
  background: radial-gradient(50% 50% at 50% 30%, rgba(221, 2, 0, 0.08), transparent 70%);
}
.nf__digits {
  display: flex;
  gap: clamp(10px, 2.4vw, 28px);
  margin-bottom: clamp(16px, 3vw, 32px);
}
.nf__digit {
  display: grid;
  grid-template-columns: repeat(5, clamp(12px, 3.2vw, 34px));
  grid-auto-rows: clamp(12px, 3.2vw, 34px);
  gap: clamp(2px, 0.4vw, 4px);
}
.nf__digit i { border-radius: 2px; }
.nf__digit i.on {
  background: var(--red);
  animation: nf-pop 0.5s var(--ease) backwards;
  animation-delay: var(--d, 0ms);
  transition: transform 0.25s var(--ease), background 0.25s ease;
}
.nf__digit i.on:hover { transform: translateY(-4px); background: var(--red-deep); }
@keyframes nf-pop { from { opacity: 0; transform: scale(0.2) rotate(-20deg); } }

.nf__title {
  font-size: clamp(36px, 5.6vw, 72px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.045em;
}
.nf__title span { color: var(--red); }
.nf__text { max-width: 44ch; margin: 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 18px); line-height: 1.5; }
.nf__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.nf-page .nf__actions .btn { color: var(--paper); }
.nf__ghost {
  display: inline-flex;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid var(--ink);
  color: var(--ink) !important;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.3s var(--ease);
}
.nf__ghost:hover { background: var(--tint); }
.nf__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-top: 22px; font-size: 14px; }
.nf__links a { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Consent banner (js/consent.js) ---------- */

.consent {
  position: fixed;
  left: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: 90;
  width: min(400px, calc(100vw - 24px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 24px 60px -24px rgba(31, 7, 7, 0.35);
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}
.consent.is-visible { opacity: 1; transform: none; }
.consent__head { display: flex; align-items: center; gap: 10px; }
.consent__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--tint);
  font-size: 17px;
}
.consent h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.consent p { margin: 12px 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.consent p a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.consent__actions { display: flex; gap: 8px; }
.consent__btn {
  flex: 1;
  padding: 11px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: 600 13px var(--sans);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.consent__btn:hover { background: var(--tint); }
.consent__btn--primary { border-color: var(--red); background: var(--red); color: var(--paper); }
.consent__btn--primary:hover { border-color: var(--red-deep); background: var(--red-deep); }
.consent__btn:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* Menu button: only shown on small screens */
.nav__toggle { display: none; }

@media (max-width: 1024px) {
  .reviews__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviews__col:nth-child(3) { display: none; }
  .careers { --cols: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 2.6fr); }
}

@media (max-width: 860px) {
  /* Hamburger menu: links open as a full-screen red panel */
  .nav__toggle {
    position: relative;
    z-index: 2;
    display: grid;
    place-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--red);
    cursor: pointer;
  }
  .nav__toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--paper);
    transition: transform 0.35s var(--ease);
  }
  .nav.is-open .nav__toggle { background: var(--paper); }
  .nav.is-open .nav__toggle span { background: var(--red); }
  .nav.is-open .nav__toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.is-open .nav__toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav.is-open { z-index: 80; }
  .nav__links {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 96px var(--gutter) 48px;
    background: var(--red);
    font-size: clamp(34px, 9vw, 56px);
    font-weight: 500;
    letter-spacing: -0.04em;
    text-transform: none;
    color: var(--paper);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav__links li { transform: translateY(16px); transition: transform 0.5s var(--ease); }
  .nav.is-open .nav__links li { transform: none; }
  .nav__links a::after { display: none; }
  .nav.is-open .brand { position: relative; z-index: 2; color: var(--paper); }
  .nav.is-open .brand small { color: rgba(253, 252, 252, 0.75); }

  .service { grid-template-columns: 32px 30px minmax(0, 1fr); gap: 8px 16px; }
  .service p { grid-column: 3; }
  .service:hover { padding-inline: 0; background: none; }
  .section__head { grid-template-columns: 1fr; gap: 12px; }
  .journey__track { width: 650vw; }
  .journey__line path { stroke-width: 5; }
  .journey__intro { left: 0.8%; width: 80vw; }
  .journey__intro .facts { grid-template-columns: 1fr 1fr 1fr; }
  .node__body { width: min(260px, 66vw); }

  /* Careers: location + team side by side, the position full width under them */
  .careers { --cols: minmax(0, 1fr) minmax(0, 1fr); }
  .careers__head .label, .careers__head h2 { grid-column: 1 / -1; }
  .careers__head h2 { margin-top: 12px; }
  .careers__cols { display: none; }
  .jobs-list { border-top: 1px solid var(--ink); }
  .job__loc, .job__team { padding-top: 0; }
  .job__team a { margin-top: 6px; }
  .job__main { grid-column: 1 / -1; margin-top: 12px; }
}

@media (max-width: 640px) {
  .brand small { display: none; }
  .hero__aside { justify-self: stretch; max-width: none; }
  .facts { grid-template-columns: 1fr; }
  .work__head { flex-direction: column-reverse; gap: 12px; }
  .reviews__col:nth-child(3) { display: block; }
  /* Reviews: the three columns become three rows scrolling left / right / left */
  .reviews__cols {
    grid-template-columns: 1fr;
    height: auto;
    margin-inline: calc(var(--gutter) * -1);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  }
  .reviews__track { flex-direction: row; width: max-content; animation-name: reviews-left; }
  .reviews__col--down .reviews__track { animation-name: reviews-right; }
  .review { width: 270px; }
  @keyframes reviews-left { to { transform: translateX(calc(-50% - 7px)); } }
  @keyframes reviews-right { from { transform: translateX(calc(-50% - 7px)); } to { transform: none; } }
  .work-table :is(th, td):nth-child(3) { display: none; } /* drop Client on phones */
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__cols > div:has(.contacts) { grid-column: 1 / -1; } /* emails need the full width */
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
