/* The home page: the hero, then five numbered sections. Each section names the formation the swarm builds behind
   it (data-formation in index.html). The shared system is in site.css: tokens, nav, buttons, labels and footer, the
   hero's layout (shared with the 404), and the parts /lab/ shows too (chips, tags, topics, the empty state, Fig. 1). */

.manifesto, .halves, .boqo, .lab, .contact {
  position: relative;
  padding-inline: var(--pad);
}

/* ---------- Hero ---------- */
/* Dims the swarm behind the lede and the foot. It sits on the content layer, so above the canvas. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .7));
  pointer-events: none;
}

.hero__row {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2rem;
  margin-top: 30px;
}
@media (max-width: 820px) {
  .hero__row { flex-direction: column; align-items: flex-start; gap: 24px; }
}

/* ---------- 01 Why we exist ---------- */
.manifesto {
  min-height: 130vh;
  display: flex;
  align-items: center;
  padding-block: 14vh;
}
.manifesto__text {
  max-width: 23ch;
  font-size: clamp(30px, 4.3vw, 72px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.035em;
}
.manifesto__text .em { color: var(--red); }
/* site.js splits the words and lights them as the text rises; without it, nothing is dimmed. */
.js .manifesto__text .w { opacity: .13; transition: opacity .3s; }
.js .manifesto__text .w.on { opacity: 1; }

/* ---------- 02 One company, two halves ---------- */
.halves { padding-block: 16vh; }
.halves__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.half { min-width: 0; padding: 40px 48px 0 0; }
.half + .half { padding: 40px 0 0 48px; border-left: 1px solid var(--line); }
.half h2 {
  font-size: clamp(44px, 5.4vw, 92px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.048em;
}
/* The swarm's figure: a lattice under Studio ("we build"), an orbit under Lab ("we study"). */
.half__fig { height: 300px; margin: 28px 0; }
html:not(.js) .half__fig { height: 0; margin-bottom: 0; }
.half p {
  max-width: 42ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--mute);
  text-wrap: pretty;
}

@media (max-width: 820px) {
  .halves__grid { grid-template-columns: 1fr; }
  .half, .half + .half { padding: 36px 0 0; border-left: 0; }
  .half + .half { margin-top: 40px; border-top: 1px solid var(--line); }
  .half__fig { height: 240px; }
}

/* ---------- 03 From the studio: boqo ---------- */
.boqo { padding-block: 14vh 16vh; }
.boqo__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 72px;
}
.boqo__name {
  font-size: clamp(88px, 15vw, 260px);
  font-weight: 700;
  line-height: .78;
  letter-spacing: -.065em;
}
.boqo__lede {
  max-width: 40ch;
  font-size: 18px;
  color: var(--mute);
  text-wrap: pretty;
}
.boqo__state {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

/* The reel: the featured clip in the middle, where the swarm draws its frame; the sides step back. */
.reel { max-width: 1080px; margin: 0 auto; }
.reel__clips {
  display: grid;
  grid-template-columns: 1fr 1.22fr 1fr;
  align-items: center;
  gap: 4vw;
}
.clip {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border-radius: 16px;
  background: #0d0d0d;
}
.clip video { width: 100%; height: 100%; object-fit: cover; }
.clip--side { transform: scale(.88); }
.clip--side video { opacity: .5; filter: saturate(.7); }   /* the video only, so a play button stays bright */
.reel__caption { margin-top: 72px; text-align: center; }

/* Shown only when motion is off (reduced motion, or paused): a clip then waits for this button. While the clip
   plays, the button steps aside to a corner as a pause button. */
.clip__play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: border-color .2s;
}
.clip__play:hover { border-color: #fff; }
.clip__icon { width: 24px; height: 24px; fill: currentColor; }
.clip__icon--pause, .clip__play[aria-pressed="true"] .clip__icon--play { display: none; }
.clip__play[aria-pressed="true"] .clip__icon--pause { display: block; }
.clip__play[aria-pressed="true"] {
  top: auto;
  right: 12px;
  bottom: 12px;
  left: auto;
  width: 44px;
  height: 44px;
  transform: none;
}
.clip__play[aria-pressed="true"] .clip__icon { width: 18px; height: 18px; }

@media (max-width: 820px) {
  .boqo__head { flex-direction: column; align-items: flex-start; gap: 32px; margin-bottom: 56px; }
  .reel__clips { grid-template-columns: 1fr; max-width: 300px; margin: 0 auto; }
  .clip--side { display: none; }
  .reel__caption { margin-top: 48px; }
}

/* ---------- 04 From the lab ---------- */
.lab {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 5vw;
  padding-block: 14vh;
}
.lab__text { min-width: 0; }
.lab h2 {
  font-size: clamp(44px, 6vw, 104px);
  font-weight: 600;
  line-height: .95;
  letter-spacing: -.048em;
  text-wrap: balance;
}
.lab__promise {
  max-width: 44ch;
  margin-top: 24px;
  font-size: 18px;
  color: var(--mute);
  text-wrap: pretty;
}

@media (max-width: 820px) {
  .lab { grid-template-columns: 1fr; gap: 64px; }
}

/* ---------- 05 Contact ---------- */
.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: 14vh;
}
/* Where the swarm rests when the pointer is idle: the right side, halfway down. The disk it gathers in reaches 95px
   round this point. */
.contact__rest {
  position: absolute;
  top: 50%;
  right: calc(var(--pad) + 6vw);
  width: 1px;
  height: 1px;
}
/* On a phone or a tablet the form takes the whole width, so the swarm rests above the section instead: in the middle
   of the gap between the lab and this heading, two 14vh paddings deep, clear of the fields. */
@media (max-width: 820px) {
  .contact__rest { top: 0; right: auto; left: 50%; }
}
.contact h2 {
  font-size: clamp(72px, 13vw, 220px);
  font-weight: 700;
  line-height: .84;
  letter-spacing: -.065em;
}
.contact__mail {
  align-self: flex-start;
  max-width: 100%;
  margin-top: 30px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--red);
  font-size: clamp(20px, 2.6vw, 40px);
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  transition: border-color .2s;
}
.contact__mail:hover { border-color: var(--fg); }

.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 14px;
  max-width: 760px;
  margin-top: 60px;
}
.field { display: grid; gap: 8px; min-width: 0; }
.field--wide, .form__foot { grid-column: 1 / -1; }
.field label {
  font: 11px/1.3 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
/* 16px text, so phones don't zoom in on focus. The border is --dim, for 3:1 against the page. */
.field input, .field textarea {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid var(--dim);
  border-radius: 12px;
  background: rgba(8, 8, 8, .88);
  font-size: 16px;
  line-height: 1.4;
  color: var(--fg);
  appearance: none;
  transition: border-color .2s;
}
.field input:hover, .field textarea:hover { border-color: rgba(255, 255, 255, .75); }
.field input:focus, .field textarea:focus { border-color: var(--fg); }
/* The field contact.js refused. It stays red, focused or not, until the visitor edits it. After the rules above. */
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); }
.field textarea { min-height: 140px; resize: vertical; }
.field ::placeholder { color: var(--dim); opacity: 1; }
/* Autofill keeps the dark field instead of the browser's light one. */
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--fg);
  box-shadow: 0 0 0 100px #080808 inset;
}

/* The honeypot: people never see it; bots that fill every field do. */
.hp { display: none; }

.form__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 24px;
  margin-top: 6px;
}
.form-status { font-size: 14px; color: var(--mute); text-wrap: balance; overflow-wrap: anywhere; }
/* Without the script, the status line holds the one thing it can say: the "Sent." a visitor comes back to from
   FormSubmit, at /?sent=1#sent. It shows only there (:target), and the page lands on it. contact.js takes this class
   off and says in the line what happened. */
.form-sent { display: none; color: var(--fg); }
.form-sent:target { display: block; }
/* contact.js adds one of these with the text: red for what went wrong (the words say it too, so colour isn't all
   there is), white once the message is sent. The green --live is for "live" only. */
.form-status--error { color: var(--red); }
.form-status--sent { color: var(--fg); }

/* While a request is in flight contact.js disables the button and relabels it "Sending…". Dimmed, but at .75 the
   label keeps 4.5:1 on the fill, and it stays put on hover. */
.form .btn:disabled { opacity: .75; cursor: progress; transform: none; }

@media (max-width: 820px) {
  .form { grid-template-columns: 1fr; }
}
