/* Redeemed Branding — black and chrome.
   The brand is black in every theme, so these colors don't change with light/dark mode. */
:root {
  --black: #000000;
  --graphite: #161616;
  --steel: #8d9198;
  --mercury: #dcdfe4;
  --white: #ffffff;
  --line: rgba(220, 223, 228, 0.16);
  --line-strong: rgba(255, 255, 255, 0.5);

  --display: "Michroma", "Eurostile", "Helvetica Neue", Arial, sans-serif;
  --body: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
  --voice: "Inter Tight", "Helvetica Neue", Arial, sans-serif; /* Remi's words */

  --ease: cubic-bezier(0.7, 0, 0.2, 1);
  --page-width: 1160px;
  --gutter: clamp(20px, 3.4vw, 48px);

  color-scheme: dark;
  box-sizing: border-box;
}

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

html {
  background: var(--black);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--mercury);
  font: 400 1.0625rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
body.is-loading { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--white); text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
a:hover { text-decoration-color: var(--white); }
button { font: inherit; }

:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

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

/* ── Loading screen ─────────────────────────────────── */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--black);
  color: var(--mercury);
  font: 400 clamp(0.95rem, 1.1vw, 1.1rem)/1.35 var(--voice);
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.1s var(--ease);
}
.preloader.is-done { clip-path: inset(0 0 100% 0); }
.pre-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(54px, 5vw, 76px);
  transform: translate(-50%, -50%);
  animation: pre-flicker 2.4s steps(1) infinite;
}
@keyframes pre-flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 0.25; }
  43% { opacity: 1; }
  77% { opacity: 0.5; }
  78% { opacity: 1; }
}
.pre-lines { position: absolute; white-space: nowrap; }
.pre-lines-a { left: 34%; top: 9%; }
.pre-lines-b { left: 42%; top: 64%; }
.pre-count {
  position: absolute;
  right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.pre-pct { font: 400 0.36em/1 var(--voice); vertical-align: top; margin-left: 0.2em; color: var(--steel); }

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--gutter);
  color: #0b0b0c;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.brand img { width: auto; height: 22px; filter: invert(1); }
.brand span {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.site-header nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 34px); }
.site-header nav a {
  color: inherit;
  font: 400 0.98rem/1 var(--voice);
  text-decoration: none;
  padding: 6px 0;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.4s var(--ease);
}
.site-header nav a:hover { background-size: 100% 1px; }

/* Sound: just an icon. Bars dance while on, lie flat while off. */
.sound-toggle {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: -8px -8px -8px 0;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.25s;
}
.sound-toggle:hover { background: rgba(11, 11, 12, 0.08); }
.sound-bars { display: inline-flex; align-items: flex-end; gap: 2.5px; height: 14px; }
.sound-bars i {
  width: 2.5px;
  height: 100%;
  background: currentColor;
  transform-origin: bottom;
  animation: bars 0.9s ease-in-out infinite alternate;
}
.sound-bars i:nth-child(2) { animation-delay: -0.3s; }
.sound-bars i:nth-child(3) { animation-delay: -0.6s; }
.sound-bars i:nth-child(4) { animation-delay: -0.15s; }
@keyframes bars { from { transform: scaleY(0.25); } to { transform: scaleY(1); } }
.sound-toggle.is-off .sound-bars i { animation: none; transform: scaleY(0.2); }

/* ── Stage: Remi in a grey studio ───────────────────── */
.stage {
  --ink: #0b0b0c;
  --ink-soft: rgba(11, 11, 12, 0.55);
  --ink-line: rgba(11, 11, 12, 0.2);
  position: relative;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
  background: #8f9093;
}

/* The studio light: a soft pool behind Remi that follows him when he steps aside */
.stage-light {
  position: absolute;
  top: -30%;
  left: -40%;
  width: 180%;
  height: 160%;
  z-index: -4;
  background: radial-gradient(closest-side, #f2f2f2 0%, #dcdcdd 30%, #bdbec0 60%, #9a9b9e 100%);
  transform: translateX(0);
  transition: transform 1.8s var(--ease);
}
.stage.is-live .stage-light { transform: translateX(10%); }

.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  mix-blend-mode: multiply;
  transition: opacity 1.4s ease;
  z-index: -3;
}
.stage-video.is-ready { opacity: 0.18; }

/* The RB logo: invisible at rest, flickers in when Remi's screen glitches */
.rb-back {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(70vw, 980px);
  aspect-ratio: 760 / 622;
  transform: translate(-50%, -50%);
  z-index: -2;
  pointer-events: none;
  mix-blend-mode: multiply;
  transition: left 1.8s var(--ease);
}
.stage.is-live .rb-back { left: 68%; }
.rb-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.rb-base { opacity: 0; filter: grayscale(1) contrast(1.1); }
.rb-red, .rb-cyan { opacity: 0; }
.rb-red { filter: grayscale(1) sepia(1) saturate(8) hue-rotate(-40deg); }
.rb-cyan { filter: grayscale(1) sepia(1) saturate(8) hue-rotate(150deg); }

.stage.is-glitching .rb-base { animation: rb-jolt 0.9s steps(1) both; }
.stage.is-glitching .rb-red { animation: rb-split-red 0.9s steps(1) both; }
.stage.is-glitching .rb-cyan { animation: rb-split-cyan 0.9s steps(1) both; }
@keyframes rb-jolt {
  0%, 100% { transform: none; opacity: 0; }
  15% { transform: translateX(10px) skewX(-3deg) scale(1.02); opacity: 0.34; }
  30% { transform: translateX(-6px); opacity: 0.16; }
  55% { transform: translateX(4px) skewX(2deg); opacity: 0.26; }
  80% { transform: none; opacity: 0; }
}
@keyframes rb-split-red {
  0%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  12% { opacity: 0.5; transform: translateX(-18px); clip-path: inset(18% 0 52% 0); }
  28% { transform: translateX(9px); clip-path: inset(58% 0 12% 0); }
  44% { transform: translateX(-6px); clip-path: inset(4% 0 78% 0); }
  60% { opacity: 0.38; transform: translateX(-12px); clip-path: inset(36% 0 34% 0); }
  76% { opacity: 0; }
}
@keyframes rb-split-cyan {
  0%, 100% { opacity: 0; transform: none; clip-path: inset(0); }
  12% { opacity: 0.5; transform: translateX(18px); clip-path: inset(22% 0 48% 0); }
  28% { transform: translateX(-9px); clip-path: inset(62% 0 8% 0); }
  44% { transform: translateX(7px); clip-path: inset(8% 0 74% 0); }
  60% { opacity: 0.38; transform: translateX(12px); clip-path: inset(40% 0 30% 0); }
  76% { opacity: 0; }
}

/* Remi fills the stage; the camera decides where he stands */
.remi-3d { position: absolute; inset: 0; z-index: 1; }
.remi-3d canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.remi-3d.is-ready canvas { opacity: 1; }
.remi-3d.is-flat { display: grid; place-items: center; }
.remi-3d .flat-screen {
  position: static;
  width: auto;
  height: min(44%, 320px);
  aspect-ratio: 4 / 3;
  opacity: 1;
  border-radius: 26px;
  border: 12px solid #cfd3d8;
  box-shadow: 0 0 0 2px #8b9097, 0 24px 60px rgba(0, 0, 0, 0.35);
  transition: transform 1.8s var(--ease);
}
.stage.is-live .remi-3d .flat-screen { transform: translateX(18vw); }

/* Start screen: the whole stage is one big button */
.gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.gate[hidden] { display: none; }
.gate:focus-visible { outline: 2px solid var(--ink); outline-offset: -8px; }
.gate-hint {
  position: absolute;
  left: 50%;
  bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.72);
  font: 400 0.68rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease 0.6s;
}
body:not(.is-loading) .gate-hint { opacity: 1; }

/* The conversation: one line at a time, on the left */
.flow {
  position: absolute;
  z-index: 5;
  left: var(--gutter);
  top: 50%;
  transform: translateY(-40%);
  width: min(500px, 36vw);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease 0.5s, visibility 0s 0.5s;
}
.stage.is-live .flow { opacity: 1; visibility: visible; }

/* What Remi said before, drifted up and out of focus */
.previous {
  margin: 0 0 -6px;
  max-width: 30ch;
  min-height: 1.3em;
  font: 400 clamp(0.95rem, 1.15vw, 1.15rem)/1.3 var(--voice);
  opacity: 0.38;
  filter: blur(3.5px);
  user-select: none;
}
.previous:empty { display: none; }
.previous.is-in { animation: drift-up 0.7s var(--ease) both; }
@keyframes drift-up {
  from { opacity: 1; filter: blur(0); transform: translateY(26px) scale(1.25); transform-origin: left bottom; }
  to { opacity: 0.38; filter: blur(3.5px); transform: none; }
}

.question {
  margin: 0;
  min-height: 2.3em;
  max-width: 21ch;
  font: 400 clamp(1.5rem, 2.15vw, 2.25rem)/1.14 var(--voice);
  letter-spacing: -0.018em;
  white-space: pre-wrap;
}
/* The block cursor: blinks after Remi's words */
.q-visible::after {
  content: "";
  display: inline-block;
  width: 0.42em;
  height: 0.86em;
  margin-left: 0.14em;
  vertical-align: -0.08em;
  background: currentColor;
  animation: caret 1s steps(1) infinite;
}
.stage.is-typing .q-visible::after { animation: none; }
.stage.is-thinking .q-visible::after { animation: caret 0.5s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.answers { display: flex; flex-wrap: wrap; gap: 8px; max-width: 460px; }
.answers:empty { display: none; }

.choice {
  padding: 10px 18px 11px;
  color: var(--ink);
  font: 500 0.9rem/1.15 var(--voice);
  background: #ffffff;
  border: 1px solid #ffffff;
  border-radius: 999px;
  cursor: pointer;
  animation: rise 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 60ms);
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
.choice:hover { background: var(--ink); border-color: var(--ink); color: #ffffff; }
.choice.is-secondary { background: transparent; border-color: var(--ink-line); }
.choice.is-secondary:hover { background: var(--ink); border-color: var(--ink); }
.choice .u { text-decoration: underline; text-underline-offset: 3px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.answer-form {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  animation: rise 0.55s var(--ease) both;
}
.answer-form[hidden] { display: none; }
.answer-field { flex: 1; min-width: 0; }
.answer-field input,
.answer-field textarea {
  width: 100%;
  padding: 10px 0;
  color: var(--ink);
  font: 400 1.1rem/1.45 var(--voice);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-line);
  border-radius: 0;
  outline: none;
  resize: none;
  transition: border-color 0.2s;
}
.answer-field textarea { max-height: 140px; }
.answer-field input:focus,
.answer-field textarea:focus { border-bottom-color: var(--ink); }
.answer-field input::placeholder,
.answer-field textarea::placeholder { color: var(--ink-soft); }

.round-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 36px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.25s var(--ease);
}
.round-button:hover { transform: translateX(3px); }
.stage :focus-visible { outline-color: var(--ink); }

.stage .type-instead { font: 400 0.88rem/1.4 var(--voice); color: var(--ink-soft); text-decoration-color: var(--ink-line); }
.stage .type-instead:hover { color: var(--ink); }
.type-instead[hidden] { display: none; }

/* "Click to continue" */
.continue {
  padding: 4px 0;
  color: rgba(11, 11, 12, 0.7);
  font: 400 0.7rem/1 var(--display);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: none;
  border: 0;
  cursor: pointer;
  animation: rise 0.6s var(--ease) 0.5s both, pulse 1.6s ease-in-out 1.1s infinite;
}
.continue::before { content: "[ "; }
.continue::after { content: " ]"; }
.continue:hover { color: var(--ink); }
.continue[hidden] { display: none; }
@keyframes pulse { 50% { opacity: 0.45; } }
.stage.is-live:not(.is-gate) { cursor: default; }

.stage-note { margin: 0; min-height: 1.2em; color: var(--ink-soft); font-size: 0.85rem; }
.stage-note:empty { display: none; }

.restart {
  position: absolute;
  z-index: 5;
  left: var(--gutter);
  bottom: calc(30px + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, transform 0.4s var(--ease);
}
.stage.is-live .restart { opacity: 1; visibility: visible; }
.restart:hover { transform: rotate(-35deg); }

/* Progress: a hairline along the bottom of the stage */
.progress {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
}
.progress span { display: block; height: 100%; width: 0%; background: var(--ink); transition: width 0.9s var(--ease); }

.button {
  flex: none;
  padding: 11px 20px;
  color: var(--black);
  font-weight: 600;
  font-size: 0.95rem;
  background: var(--mercury);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.button:hover { background: var(--white); }
.button:disabled { opacity: 0.4; cursor: default; }

/* Phones and narrow windows: Remi on top, the conversation below */
@media (max-width: 819px) {
  .stage { min-height: 600px; }
  .stage-light { top: -45%; }
  .stage.is-live .stage-light { transform: translateY(-8%); }
  .stage.is-live .rb-back { left: 50%; }
  .rb-back { top: 30%; width: 130vw; }
  .site-header nav a { display: none; }
  .flow {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: auto;
    padding: 64px var(--gutter) calc(92px + env(safe-area-inset-bottom, 0px));
    gap: 16px;
    background: linear-gradient(to bottom, rgba(170, 171, 174, 0), rgba(176, 177, 180, 0.94) 38%);
  }
  .previous { display: none; }
  .question { font-size: 1.45rem; min-height: 0; max-width: none; }
  .stage.is-live .remi-3d .flat-screen { transform: translateY(-18vh); }
}
@media (max-width: 480px) {
  .brand span { display: none; }
  .choice { padding: 9px 15px 10px; }
}

/* ── Sections ───────────────────────────────────────── */
.section {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) 0;
  border-top: 1px solid var(--line);
}

h2 {
  margin: 0;
  color: var(--white);
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 40px;
  margin-bottom: 44px;
}
.section-head p { margin: 0; max-width: 46ch; color: var(--steel); }

.text-button {
  padding: 0;
  color: var(--white);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  cursor: pointer;
}
.text-button:hover { text-decoration-color: var(--white); }

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
.tile .thumb { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.tile:hover .thumb { transform: scale(1.03); }

.tile.is-empty { cursor: default; }
.tile.is-empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/rb-mark-white.png") center 42% / 20% auto no-repeat;
  opacity: 0.08;
}

.tile-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}
.tile-title { display: block; color: var(--white); font-weight: 600; }
.tile-type { display: block; color: var(--steel); font-size: 0.9rem; }

/* Services */
.service-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
  margin: 0;
}
.service-list > div { padding: 26px 0; border-top: 1px solid var(--line); }
.service-list dt {
  margin-bottom: 8px;
  color: var(--white);
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.service-list dd { margin: 0; max-width: 48ch; color: var(--steel); }

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 48px 80px;
  align-items: start;
}
.contact-copy p { margin: 16px 0 0; max-width: 40ch; color: var(--steel); }

.contact-form { display: grid; gap: 18px; }
.field label { display: block; margin-bottom: 6px; color: var(--steel); font-size: 0.9rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--white);
  font: inherit;
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--line-strong); }
.contact-form .button { justify-self: start; padding: 12px 22px; }
.form-status { margin: 0; min-height: 1.4em; color: var(--steel); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Footer ─────────────────────────────────────────── */
.site-footer {
  width: min(100% - 2 * var(--gutter), var(--page-width));
  margin: 0 auto;
  padding: 44px 0 56px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.footer-lockup { width: 240px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px 28px; color: var(--steel); font-size: 0.95rem; }
.footer-links a { color: var(--mercury); text-decoration: none; }
.footer-links a:hover { color: var(--white); }

/* ── Video lightbox ─────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox[hidden] { display: none; }
.lightbox-frame { width: min(100%, 1100px); aspect-ratio: 16 / 9; }
.lightbox-frame iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; }
.lightbox-close {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: 16px;
  padding: 8px 14px;
  color: var(--white);
  background: var(--graphite);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

/* ── Smaller screens ────────────────────────────────── */
@media (max-width: 800px) {
  .service-list { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .brand span { display: none; }

  .footer-lockup { width: 200px; }
}

/* Visitors with "reduce motion" on still get the experience; only page scrolling stops being animated */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
