/* asmblr website.
   Colours, type, spacing and component styles come from the asmblr design system.
   Change a value in "Tokens" and it changes everywhere. */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "Geist";
  src: url("assets/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("assets/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --surface: #0a0a0a;
  --surface-raised: #161616;
  --ink: #f2f2f2;
  --ink-muted: #a3a3a3;
  --ink-faint: #8a8a8a;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: #606060;
  --grid: rgba(255, 255, 255, 0.08);
  --accent: #f5d90a;
  --on-accent: #0a0a0a;
  --signal: #ff6b57;
  --scrim: rgba(10, 10, 10, 0.92);

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, Menlo, Consolas, monospace;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 120px;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --margin: var(--space-4);      /* page side margin */
  --section-pad: var(--space-6); /* top and bottom of a section */
}

[data-theme="light"] {
  color-scheme: light;

  --surface: #ededeb;
  --surface-raised: #f8f8f6;
  --ink: #0a0a0a;
  --ink-muted: #55554f;
  --ink-faint: #6b6b65;
  --line: rgba(0, 0, 0, 0.14);
  --line-strong: #828281;
  --grid: rgba(0, 0, 0, 0.07);
  --signal: #c2311d;
}

@media (max-width: 760px) {
  :root {
    --margin: 20px;
    --section-pad: 88px;
  }
}

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

html {
  scroll-behavior: smooth;
  scrollbar-color: var(--line-strong) var(--surface);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 26px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, video, svg { display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="light"] :focus-visible { outline-color: var(--ink); }

.icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Type ---------- */
.heading-1 {
  font-size: clamp(40px, 1.9vw + 32.6px, 60px);
  line-height: 1;
  font-weight: 400;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.heading-2 {
  font-size: clamp(28px, 0.76vw + 25px, 36px);
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.prose {
  max-width: 34em;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* ---------- Layout ---------- */
.section {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  scroll-margin-top: 0;
}

/* The frame holds the side margins and the grid lines. It stops growing on very wide screens. */
.frame {
  position: relative;
  width: 100%;
  max-width: 1760px;
  margin-inline: auto;
  padding-inline: var(--margin);
}
.section > .frame { padding-block: var(--section-pad); }
.frame > * { position: relative; z-index: 1; }

/* Full-height column edges, part of the look */
.frame > .ds-gridlines { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ds-gridlines span { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--grid); }
.ds-gridlines span:nth-child(1) { left: 25%; }
.ds-gridlines span:nth-child(2) { left: 50%; }
.ds-gridlines span:nth-child(3) { left: 75%; }

/* Two halves that meet on the centre line. Content in the right half sits 24px in from it. */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split__right { padding-left: var(--space-3); }

@media (max-width: 760px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split__right { padding-left: 0; }
}

/* ---------- Mono labels ---------- */
.ds-label,
.ds-eyebrow,
.ds-status,
.ds-link {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ds-label { color: var(--ink-faint); }
.keep-case { text-transform: none; } /* the name is always lowercase, even inside a capitals label */

.ds-eyebrow { display: flex; gap: var(--space-1); color: var(--ink-muted); }
.ds-eyebrow__hatch { color: var(--accent); }
[data-theme="light"] .ds-eyebrow__hatch { color: var(--ink); }
.ds-eyebrow + .heading-1 { margin-top: var(--space-2); }

.ds-status { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink-muted); }
.ds-status::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.ds-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.ds-link .icon { width: 14px; height: 14px; color: var(--accent); transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
[data-theme="light"] .ds-link .icon { color: var(--ink); }
.ds-link:hover .icon { transform: translateX(3px); }

/* ---------- Button ---------- */
.ds-btn {
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 20px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.ds-btn__icon { display: flex; align-items: center; justify-content: center; width: 44px; background: var(--accent); color: var(--on-accent); }
.ds-btn__icon .icon { width: 18px; height: 18px; transition: transform 160ms cubic-bezier(0.16, 1, 0.3, 1); }
.ds-btn__text { padding: 12px 18px; }
.ds-btn:hover .ds-btn__text { text-decoration: underline; text-underline-offset: 3px; }
.ds-btn:hover .ds-btn__icon .icon { transform: translateX(2px); }
.ds-btn:disabled { opacity: 0.6; cursor: progress; }
.ds-btn:disabled .ds-btn__text { text-decoration: none; }
.ds-btn:disabled .ds-btn__icon .icon { transform: none; }

/* ---------- Wordmark ---------- */
.ds-wordmark {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 26px;
  line-height: 32px;
  letter-spacing: -0.05em;
  color: var(--ink);
  text-decoration: none;
}

/* ---------- Hero ---------- */
.ds-hero { position: relative; overflow: hidden; background: var(--surface); color: var(--ink); }
.ds-hero__media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center right; }
.ds-hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 10, 10, 0.55) 0%, rgba(10, 10, 10, 0) 22%, rgba(10, 10, 10, 0) 78%, rgba(10, 10, 10, 0.6) 100%),
    linear-gradient(90deg, var(--scrim) 0%, rgba(10, 10, 10, 0.6) 45%, rgba(10, 10, 10, 0.1) 100%);
}

.ds-hero__frame {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding-block: 28px 32px;
}

.ds-hero__nav { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.ds-hero__links { display: flex; gap: 28px; }
.ds-hero__links a,
.ds-hero__foot a,
.footer__links a { padding-block: 8px; color: var(--ink-muted); text-decoration: none; transition: color 120ms ease-out; }
.ds-hero__links a:hover,
.ds-hero__foot a:hover,
.footer__links a:hover { color: var(--ink); }
.ds-hero__links a.is-key { color: var(--accent); }

.ds-hero__main { display: grid; padding-block: 60px 48px; }
.ds-hero__copy { align-self: end; max-width: 640px; }

.ds-hero__title {
  margin: 20px 0 22px;
  font-weight: 300;
  /* 104px on a full desktop; shrinks to fit the left half and short screens */
  font-size: clamp(56px, min((100vw - 80px) / 11.5, 13.5vh), 104px);
  line-height: 0.95;
  letter-spacing: -0.055em;
  margin-left: -0.04em; /* lines the first letter up with the page margin */
}
.ds-hero__intro { max-width: 440px; font-size: 17px; line-height: 1.55; color: var(--ink-muted); text-wrap: pretty; }
.ds-hero__cta { margin-top: 30px; }

.ds-hero__foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-1) var(--space-3); }
.ds-hero__foot a { padding-block: 0; }

@media (max-width: 760px) {
  /* on phones the image sits in the top part and the text sits on solid black below it */
  .ds-hero__media { height: 64%; object-position: 72% center; }
  .ds-hero__scrim {
    background: linear-gradient(180deg, rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.15) 20%, rgba(10, 10, 10, 0.3) 38%, var(--surface) 64%);
  }
  .ds-hero__main { padding-block: 48px 40px; }
  .ds-hero__title { font-size: clamp(44px, 14.6vw, 56px); }
  .ds-hero__links a:not(.is-key),
  .ds-hero__scroll { display: none; }
}

/* The loop is hidden for people who ask for less motion; the still shows instead. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ds-hero video.ds-hero__media { display: none; }
}

/* Gentle parallax: the hero image moves a little slower than the page. */
@keyframes hero-drift { to { transform: translateY(10%); } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .ds-hero__media {
      animation: hero-drift linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 100vh;
    }
  }
}

/* ---------- What we think ---------- */
/* the header runs the full width, one sentence per line; the statement sits below it in the right half */
.mission__head { grid-column: 1 / -1; }
.mission .split__right { grid-column: 2; margin-top: var(--space-4); }
.lede { max-width: 26em; font-size: 24px; line-height: 32px; letter-spacing: -0.02em; text-wrap: pretty; }

@media (max-width: 760px) {
  .mission .split__right { grid-column: auto; margin-top: var(--space-3); }
  .lede { font-size: 20px; line-height: 28px; }
}

/* ---------- How we work ---------- */
.ds-rows { margin-top: var(--space-4); border-bottom: 1px solid var(--line); }
.ds-row {
  display: grid;
  /* the description starts 24px right of the centre line, like the other right-half content */
  grid-template-columns: 96px minmax(0, 1fr) calc(50% - 24px);
  gap: var(--space-3);
  align-items: baseline;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.ds-row__index { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-faint); }
.ds-row__title { font-size: 20px; line-height: 26px; font-weight: 500; letter-spacing: -0.01em; }
.ds-row__desc { font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink-muted); }

@media (max-width: 760px) {
  .ds-row { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 20px 0; }
  .ds-row__desc { margin-top: 4px; }
}

/* ---------- Contact ---------- */
.contact__copy { padding-right: var(--space-4); }
.contact__copy .prose { margin-top: var(--space-3); }

.form { display: grid; gap: var(--space-3); }
.form__pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); }
.field { display: grid; gap: var(--space-1); align-content: start; }
.field label { color: var(--ink-muted); }
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--ink);
  font: inherit;
  line-height: 24px;
  caret-color: var(--ink);
  transition: border-color 120ms ease-out;
}
.field textarea { min-height: 148px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--ink-faint); opacity: 1; }
.field input:hover,
.field textarea:hover,
.field input:focus,
.field textarea:focus { border-color: var(--ink); }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--signal); }

.field__error,
.form__status { display: flex; align-items: flex-start; gap: 6px; font-size: 14px; line-height: 22px; color: var(--signal); }
.field__error::before,
.form__status::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 4px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* A field people can't see. Automated spam fills it in, which tells us to ignore the entry. */
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-1); }

.form-done { display: grid; gap: var(--space-2); justify-items: start; padding: var(--space-4) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); }
.form-done:focus { outline: none; }
.form-done .ds-link { margin-top: var(--space-2); }

@media (max-width: 760px) {
  .contact__copy { padding-right: 0; }
  .contact .split__right { margin-top: var(--space-4); }
}
@media (max-width: 1023px) {
  .form__pair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Footer ---------- */
.footer > .frame { padding-block: var(--space-5) var(--space-4); }
.footer__name { margin-left: -0.04em; font-weight: 300; font-size: clamp(88px, 15vw, 216px); line-height: 0.92; letter-spacing: -0.055em; }
.footer__tagline { margin-top: var(--space-3); max-width: 24em; color: var(--ink-muted); text-wrap: balance; }
.footer__bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2) var(--space-3); margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.footer__links { display: flex; flex-wrap: wrap; gap: 28px; }
.footer__links a { padding-block: 0; }
