/* =========================================================================
   ASSEMBLISTS
   Design language taken from the identity study at logo.assemblists.ai:
   monochrome, monospace UI, Helvetica Neue 800 uppercase display, full-bleed
   panels divided by 1px rules, zero radius, no shadows, no web fonts.
   Night is the default; light is opt-in and simply swaps ink and paper.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ---------------------------------------------------------------------- */

:root {
  --paper: #000;
  --ink:   #fff;

  /* derived tints — the only greys in the system */
  --ink-70: rgba(255, 255, 255, .70);
  --ink-45: rgba(255, 255, 255, .45);
  --ink-12: rgba(255, 255, 255, .12);
  --grid:   rgba(255, 255, 255, .055);

  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --display: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --pad: clamp(16px, 4vw, 56px);
  --rule: 1px solid var(--ink);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --paper: #fff;
  --ink:   #000;
  --ink-70: rgba(0, 0, 0, .70);
  --ink-45: rgba(0, 0, 0, .45);
  --ink-12: rgba(0, 0, 0, .12);
  --grid:   rgba(0, 0, 0, .055);
  color-scheme: light;
}

/* -------------------------------------------------------------------------
   2. Base
   ---------------------------------------------------------------------- */

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
  overflow-x: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
ul { list-style: none; }

::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* -------------------------------------------------------------------------
   3. Type
   ---------------------------------------------------------------------- */

.d1, .d2, .d3 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: condensed;
  letter-spacing: -.03em;
  text-transform: uppercase;
  line-height: .86;
}

.d1 { font-size: clamp(40px, 11vw, 150px); }
.d2 { font-size: clamp(28px, 4.4vw, 56px); line-height: .9; }
.d3 { font-size: clamp(19px, 1.8vw, 25px); line-height: 1; }

.lead { font-size: 16px; line-height: 1.65; max-width: 46ch; }

p { max-width: 62ch; }

/* small uppercase mono label */
.lab {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-45);
}

.num {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 56px);
  letter-spacing: -.03em;
  line-height: .9;
}

.link {
  border-bottom: 1px solid var(--ink-45);
  transition: border-color .15s linear;
}
.link:hover { border-color: var(--ink); }

/* inline bordered chip */
.key { border: var(--rule); padding: 1px 5px; white-space: nowrap; }

/* -------------------------------------------------------------------------
   4. Layout — full bleed, divided by rules
   ---------------------------------------------------------------------- */

.pad { padding-inline: var(--pad); }

.sect { border-bottom: var(--rule); }

/* section head: number + title, tag pushed right */
.chead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  padding: 15px var(--pad);
  border-bottom: var(--rule);
  text-transform: uppercase;
}
.chead .tag {
  margin-left: auto;
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--ink-45);
  text-align: right;
}

.body-pad { padding: clamp(26px, 4vw, 52px) var(--pad); }

/* Auto-fitting column grid with rules between cells. Every cell carries a
   right and bottom rule; the negative margins pull the trailing ones off the
   edge so they collapse into the section boundary at any wrap count. */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0 -1px -1px 0;
}
.cols > * {
  padding: 22px var(--pad);
  border-right: var(--rule);
  border-bottom: var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stack { display: grid; gap: 14px; align-content: start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* -------------------------------------------------------------------------
   5. Components
   ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border: var(--rule);
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s linear, color .12s linear;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn svg { width: 9px; height: 9px; flex: none; }

.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--paper); color: var(--ink); }

.btn--sm { padding: 5px 10px; }

/* bulleted list, mono */
.list { display: grid; }
.list li {
  padding: 7px 0 7px 22px;
  border-bottom: 1px solid var(--ink-12);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-70);
  position: relative;
  max-width: none;
}
.list li::before {
  content: "";
  position: absolute;
  left: 0; top: 13px;
  width: 6px; height: 6px;
  background: var(--ink-45);
}
.list li:hover { color: var(--ink); }
.list li:hover::before { background: var(--ink); }

@media (min-width: 700px) {
  .list--2 { grid-template-columns: 1fr 1fr; column-gap: 40px; }
}

/* numbered process rows */
.steps { border-top: var(--rule); }
.step {
  display: grid;
  gap: 4px 20px;
  padding: 16px var(--pad);
  border-bottom: var(--rule);
  align-items: baseline;
  transition: background .12s linear, color .12s linear;
}
@media (min-width: 760px) {
  .step { grid-template-columns: 64px 200px minmax(0, 1fr); }
}
.step:hover { background: var(--ink); color: var(--paper); }
.step:hover .step__n, .step:hover p { color: inherit; }
.step__n { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; color: var(--ink-45); }
.step h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1;
}
.step p { font-size: 13px; color: var(--ink-70); max-width: 58ch; }

/* -------------------------------------------------------------------------
   6. Header & footer
   ---------------------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  z-index: 200;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
}
.skip:focus { left: 6px; top: 6px; }

.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: var(--rule);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 9px var(--pad);
  text-transform: uppercase;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.03em;
}
.brand__mark { width: 17px; height: auto; flex: none; }

.bar nav { display: none; gap: 14px; margin-left: 22px; }
@media (min-width: 780px) { .bar nav { display: flex; } }
.bar nav a {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  color: var(--ink-45);
  transition: color .12s linear;
}
.bar nav a:hover { color: var(--ink); }

.bar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--paper);
  color: var(--ink);
  border: var(--rule);
  cursor: pointer;
  transition: background .12s linear, color .12s linear;
}
.iconbtn:hover { background: var(--ink); color: var(--paper); }
.iconbtn svg { width: 13px; height: 13px; }

.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  padding: 16px var(--pad);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: .13em;
  color: var(--ink-45);
}
.foot .brand { color: var(--ink); }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; margin-left: auto; }
.foot a:hover { color: var(--ink); }

/* -------------------------------------------------------------------------
   7. Hero & diagram
   ---------------------------------------------------------------------- */

.hero {
  padding: clamp(38px, 8vw, 96px) var(--pad) clamp(26px, 5vw, 58px);
  border-bottom: var(--rule);
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 28px 28px;
}

.hero__grid { display: grid; gap: clamp(28px, 5vw, 56px); }
@media (min-width: 1000px) {
  .hero__grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; }
}

.hero__copy { display: grid; gap: 22px; align-content: start; }
.hero__copy .lead { color: var(--ink-70); }

.hero__art {
  aspect-ratio: 400 / 300;
  width: 100%;
  max-width: 560px;
  border: var(--rule);
  background: var(--paper);
}
@media (max-width: 639px) { .hero__art { display: none; } }
.hero__art svg { width: 100%; height: 100%; }

.hero__art .wire {
  fill: none;
  stroke: var(--ink-45);
  stroke-width: 1;
  transition: stroke .15s linear, stroke-width .15s linear;
}
.hero__art .wire.is-flow { stroke: var(--ink); }
.hero__art .wire.is-hot { stroke: var(--ink); stroke-width: 1.8; }

.hero__art .blk { fill: var(--paper); stroke: var(--ink-45); stroke-width: 1; transition: fill .12s linear, stroke .12s linear; }
.hero__art .blk-ink { fill: var(--ink); stroke: var(--ink); }
.hero__art .lbl {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .14em;
  fill: var(--ink-45);
  transition: fill .12s linear;
}
.hero__art .lbl-on { fill: var(--paper); }
.hero__art .packet { fill: var(--ink); }

/* the four processing squares inside the core read against the inverted block */
.hero__art .ind { fill: var(--paper); opacity: .3; animation: ind 2s steps(1) infinite; }
.hero__art .ind:nth-of-type(2) { animation-delay: 0s }
.hero__art .ind:nth-of-type(3) { animation-delay: .5s }
.hero__art .ind:nth-of-type(4) { animation-delay: 1s }
.hero__art .ind:nth-of-type(5) { animation-delay: 1.5s }
@keyframes ind { 0%, 25% { opacity: 1 } 26%, 100% { opacity: .3 } }

/* interaction */
.hero__art .node { cursor: pointer; }
.hero__art .node.is-hot rect.blk,
.hero__art .node.is-live rect.blk { fill: var(--ink); stroke: var(--ink); }
.hero__art .node.is-hot .lbl,
.hero__art .node.is-live .lbl { fill: var(--paper); }
.hero__art .node--core.is-hot rect.blk-ink,
.hero__art .node--core.is-live rect.blk-ink { fill: var(--ink-70); }

/* -------------------------------------------------------------------------
   8. Form
   ---------------------------------------------------------------------- */

.contact { display: grid; }
@media (min-width: 900px) { .contact { grid-template-columns: 1fr 1fr; } }
.contact > * { padding: clamp(26px, 4vw, 52px) var(--pad); }
@media (min-width: 900px) { .contact > :first-child { border-right: var(--rule); } }

.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; }
@media (min-width: 560px) { .form-row { grid-template-columns: 1fr 1fr; } }

.field { display: grid; gap: 5px; }
.field label { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-45); }

.input, .textarea, .select {
  width: 100%;
  padding: 10px 11px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink-45);
  border-radius: 0;
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color .12s linear;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-45); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--ink); }
.textarea { min-height: 116px; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
                    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field__error { display: none; font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; }
.field[data-invalid] .field__error { display: block; }
.field[data-invalid] .input,
.field[data-invalid] .textarea,
.field[data-invalid] .select { border-color: var(--ink); border-width: 2px; }

.form-note { font-size: 11.5px; line-height: 1.6; color: var(--ink-45); }

.form-fail {
  border: 2px solid var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.form-fail[hidden] { display: none; }

.success { display: none; gap: 12px; border: var(--rule); padding: 22px; }
.success.is-visible { display: grid; }
.success svg { width: 26px; height: 26px; }

/* -------------------------------------------------------------------------
   9. Motion — minimal, and off entirely under reduced motion
   ---------------------------------------------------------------------- */

.js [data-reveal] { opacity: 0; transition: opacity .45s linear; }
.js [data-reveal].is-in { opacity: 1; }
.js [data-stagger] > * { transition-delay: calc(var(--n, 0) * 50ms); }

.js .cols > [data-reveal] { opacity: 1; }
.js .cols > [data-reveal] > * { opacity: 0; transition: opacity .45s linear; transition-delay: calc(var(--n, 0) * 50ms); }
.js .cols > [data-reveal].is-in > * { opacity: 1; }

.brand__mark rect { animation-duration: .5s; animation-timing-function: linear; }
.brand:hover .brand__mark rect { animation-name: shift; }
@keyframes shift { 40% { transform: translateX(-10px); } }

.brand__mark rect:nth-of-type(1)  { animation-delay: .30s }
.brand__mark rect:nth-of-type(2)  { animation-delay: .25s }
.brand__mark rect:nth-of-type(3),
.brand__mark rect:nth-of-type(4)  { animation-delay: .20s }
.brand__mark rect:nth-of-type(5),
.brand__mark rect:nth-of-type(6)  { animation-delay: .15s }
.brand__mark rect:nth-of-type(7)  { animation-delay: .10s }
.brand__mark rect:nth-of-type(8),
.brand__mark rect:nth-of-type(9)  { animation-delay: .05s }
.brand__mark rect:nth-of-type(10),
.brand__mark rect:nth-of-type(11) { animation-delay: 0s }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .js [data-reveal], .js .cols > [data-reveal] > * { opacity: 1; }
  .brand:hover .brand__mark rect { animation-name: none; }
  .hero__art .ind { animation: none; opacity: .6; }
}

@media print {
  .bar, .foot, .hero__art { display: none !important; }
  body { background: #fff; color: #000; }
}
