/* archbotics.com root page (English, night ground) and 404.
   Composition only. Identity, tokens, type, the label voice, buttons and the mark
   live in assets/brand.css, which is linked before this file. Nothing here
   redefines a brand token; page-level measurements are declared once below. */

:root {
  /* Chrome above the first screen. The hero subtracts these so the fold lands
     on a section boundary rather than mid-composition. Measured, not guessed:
     tools/shots.js prints the hero box and the next section's top. */
  --head-h: 3.5rem;
  --strip-h: 5.25rem;   /* the Finnish door wraps to three lines in a phone column */

  /* The drawing's three weights, in device pixels (non-scaling), so the gate stays
     an engineering drawing at every size instead of thickening with scale. The mark
     itself sits in the ink ramp and the construction layer in the hairline colour:
     at thumbnail size the arch has to be the first thing seen after the headline. */
  --dwg-w: 1px;      /* construction: datums, projection, centrelines */
  --dwg-w-2: 1.5px;  /* the mark drawn to size */
  --dwg-w-3: 2px;    /* the rung, the one accent detail */
}

/* The door is one line once the column is wide enough to hold the sentence. */
@media (min-width: 46rem) { :root { --strip-h: 3.75rem; } }
@media (min-width: 60rem) { :root { --strip-h: 2.875rem; } }

/* A 44px target once it is focused. */
.skip-link:focus { padding: .75rem 1rem; }

/* ---------- header ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--head-h);
  display: flex;
  align-items: center;
  background: var(--bg);   /* fallback where color-mix is unsupported */
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head > .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.site-head .brand { font-size: 1.0625rem; white-space: nowrap; min-height: 2.75rem; }
.site-head .mark { width: 1.375rem; height: 1.375rem; }

.head-nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.head-nav a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  white-space: nowrap;
}
.head-nav a:hover { color: var(--ink); }
/* Mobile header law: the wordmark and one other element, and nothing wraps. */
.head-nav .head-only-wide { display: none; }
@media (min-width: 46rem) {
  .head-nav .head-only-wide { display: inline-flex; }
}

/* ---------- the Finnish door ---------- */

.strip {
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
}
.strip > .container {
  min-height: var(--strip-h);
  display: flex;
  align-items: center;
  padding-block: .5rem;
}
.strip p {
  font-size: .9375rem;
  line-height: 1.5;
  color: var(--ink-mute);
  overflow: visible;
}
.strip a {
  color: var(--ink);
  white-space: nowrap;
  text-decoration-color: var(--line-2);
  /* Inline padding grows the hit area to 44px without moving the line box. */
  padding-block: .85rem;
}
.strip a:hover { text-decoration-color: currentColor; }

/* ---------- the hero: the one signature move ---------- */

.hero {
  position: relative;
  /* The first screen is exactly one composition. The two hairline borders above it
     are the 2px; tools/shots.js prints the arithmetic as the fold check. */
  padding-block: 0;
  min-height: calc(100svh - var(--head-h) - var(--strip-h) - 2px);
  display: grid;
  grid-template-rows: 1fr auto;
  isolation: isolate;
}
.hero > .container { position: relative; z-index: 1; display: grid; align-content: center; }

/* The gate drawn at architectural size. Hairline colours, one ember detail,
   cropped by the first screen the way a drawing is cropped by its sheet. */
.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.hero-art .gate-frame {
  position: absolute;
  width: min(100% - 2 * var(--pad), var(--max));
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  bottom: 0;
}
/* The drawing's width is driven by the CONTENT COLUMN, capped by the hero's height.
   Before 2026-09-04 it was height-driven only, so on a tall window it grew leftwards
   into the headline (measured: the AGENTS label sat 170px INSIDE the text column at
   1000x1080). --art-w is the single source of truth: the drawing takes it, and the
   text column takes everything left over minus --art-gap, so the clear gap between
   them is a constant of the layout rather than a coincidence of two unrelated units. */
.hero {
  --art-w: min(calc(0.9 * (100svh - var(--head-h) - var(--strip-h) - 2px)), 46%);
  --art-gap: clamp(3.5rem, 4vw, 5rem);
}
.gate {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 0;
  width: var(--art-w);
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
}

.gate [fill] { fill: none; }
.gate .g-cons path, .gate .g-cons circle {
  fill: none;
  stroke: var(--line);
  stroke-width: var(--dwg-w);
  vector-effect: non-scaling-stroke;
}
.gate .dash { stroke-dasharray: 2.5 2.5; }
.gate .g-mark path {
  fill: none;
  stroke: var(--ink-mute);
  stroke-width: var(--dwg-w-2);
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.gate .g-rung path {
  fill: none;
  stroke: var(--accent);
  stroke-width: var(--dwg-w-3);
  vector-effect: non-scaling-stroke;
}
.gate .g-tick path {
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: var(--dwg-w);
  vector-effect: non-scaling-stroke;
}
.gate text {
  font-family: var(--label);
  font-size: 1.15px;      /* user units: a fine annotation, not a caption */
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  fill: var(--ink-mute);
}
/* BRAND.md 3: at architectural size the rung is the ONLY accent detail,
   so the annotations stay in the ink ramp. Mute, not dim: they are small. */
/* Below the label floor once the drawing shrinks: the drawing speaks alone,
   and it moves down and out so the type owns the top of a phone screen. */
@media (max-width: 60rem) {
  .gate .g-annot { display: none; }
}
/* Below 64rem the drawing leaves the text layer entirely and takes a band of its own
   between the buttons and the fact line, cropped top and bottom the way a drawing is
   cropped by its sheet. It never crosses a word or a button at this width, so it needs
   no gutter: it is height-driven here, and every part of the two-column rule above
   (the width, the centring transform, the bottom anchor) is explicitly undone. */
@media (max-width: 63.99rem) {
  .hero { grid-template-rows: auto minmax(9rem, 1fr) auto; }
  .hero > .container { grid-row: 1; align-content: start; }
  .hero-art { position: relative; inset: auto; grid-row: 2; }
  .hero-facts { grid-row: 3; }
  .gate {
    top: -16%; bottom: auto; right: -6%;
    width: auto; height: 152%;
    transform: none;
  }
}

.hero-body {
  display: grid;
  align-content: center;
  gap: clamp(1.25rem, 2.2vw, 1.75rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  max-width: 100%;
}
@media (max-width: 63.99rem) { .hero-body { padding-block: 2rem 1.75rem; } }
@media (min-width: 64rem) {
  /* Whatever the drawing does not take, minus the gutter. */
  .hero-body { max-width: calc(100% - var(--art-w) - var(--art-gap)); }
}
/* Page composition, not a new brand step: the display sits a size below the brand
   ceiling because it shares the screen with the drawing instead of owning it. */
.hero h1 { font-size: clamp(2.5rem, 1rem + 4.6vw, 4.5rem); max-width: 20ch; }
.hero .lede { color: var(--ink-body); max-width: 34ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .25rem; }
/* On a phone the pair fills the column rather than sitting in the left corner, and a
   label never breaks mid-button: if both will not fit, they stack full width instead. */
.btn { white-space: nowrap; }
.hero-actions .btn { flex: 1 1 auto; }
@media (min-width: 52rem) { .hero-actions .btn { flex: 0 0 auto; } }

/* The bottom beat: one label-voice fact line holding the last band of the screen. */
.hero-facts { border-top: 1px solid var(--line); position: relative; z-index: 1; }
.hero-facts > .container { padding-block: 1.125rem; }

/* ---------- sections ---------- */

main > section { padding-block: var(--sec-pad); }
.band { background: var(--bg-1); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.sec-head { display: grid; gap: .75rem; margin-bottom: var(--head-gap); max-width: 44rem; }
.sec-head .lede { color: var(--ink-mute); }
.eyebrow { display: flex; align-items: baseline; gap: .6rem; }
.eyebrow::before {
  content: "";
  width: .625rem;
  height: 1px;
  background: var(--accent);
  flex: none;
  transform: translateY(-.25em);
}

/* ---------- index rows: the recurring motif ---------- */

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { border-bottom: 1px solid var(--line); transition: background-color .18s ease; }
.row:hover { background: var(--bg-1); }
.row-in {
  display: grid;
  gap: .5rem 2.5rem;
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  align-items: start;
}
@media (min-width: 52rem) {
  .row-in { grid-template-columns: 7.5rem minmax(0, 1fr) minmax(0, 21rem); }
}
.row-idx { display: grid; gap: .5rem; align-content: start; }
.row-num {
  font-family: var(--label);
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--ink-dim);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.row-body { display: grid; gap: .5rem; }
.row-body h3 { color: var(--ink); }
.row-body h3 .mono { font-family: var(--label); font-weight: 500; letter-spacing: -.01em; }
/* The product lockup (BRAND.md 2): the product word carries the accent. It is the
   page's one line of accent text; every other accent use here is a mark or the rung. */
.row-body h3 .product { color: var(--accent-text); font-weight: 500; }
.row-body p { color: var(--ink-body); max-width: 60ch; }
.row-body code {
  font-family: var(--label);
  font-size: .875em;
  color: var(--ink);
}
.row-link { margin-top: .375rem; }
.row-link a {
  font-family: var(--label);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border-bottom: 1px solid var(--line-2);
}
.row-link a:hover { border-bottom-color: var(--ink); }
/* The name is the same link as the row's label, so the whole row is clickable.
   Inline padding grows the hit area past 44px without moving the line box. */
.row-body h3 a { color: inherit; text-decoration: none; padding-block: .55rem; }
.row-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--line-2); }

/* The evidence column: one real artefact per row, never a mock. */
.evidence { margin: 0; display: grid; gap: .5rem; align-content: start; }
.evidence img { width: 100%; height: auto; border: 1px solid var(--line-2); }
.evidence figcaption { color: var(--ink-mute); }
.term {
  margin: 0;
  padding: .75rem .875rem;
  border: 1px solid var(--line-2);
  background: var(--bg-1);
  font-family: var(--label);
  font-size: .6875rem;
  line-height: 1.55;
  color: var(--ink-body);
  /* Wraps rather than clips: a clipped transcript reads as broken, and nothing
     here may make the page itself scroll sideways. */
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  tab-size: 2;
}
.term code { font: inherit; color: inherit; }
.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Principles are the same index row in its three-beat form: index, claim, meaning. */
.rows-plain .row-in > h3 { color: var(--ink); }
.rows-plain .row-in > p { color: var(--ink-body); max-width: 56ch; }
@media (min-width: 52rem) {
  .rows-plain .row-in { grid-template-columns: 7.5rem minmax(0, 20rem) minmax(0, 1fr); }
}

/* No rule of its own: the last index row already drew one, and two hairlines a
   line apart read as an empty row. */
.closing-note { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.closing-note p { color: var(--ink-body); max-width: 54ch; }

/* ---------- direction and contact ---------- */

.contact-grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 52rem) {
  .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .contact-grid .sec-head { margin-bottom: 0; }
}
.contact-body { display: grid; align-content: start; }
.contact-mail {
  display: inline-block;
  justify-self: start;
  font-size: clamp(1.375rem, 1rem + 1.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration-color: var(--line-2);
  padding-block: .5rem;
  min-height: 2.75rem;
}
.contact-mail:hover { text-decoration-color: currentColor; }
.contact-meta { display: grid; gap: .5rem; margin-top: 1.25rem; }
.contact-meta a { color: var(--ink-mute); display: inline-block; padding-block: .75rem; }
.contact-meta a:hover { color: var(--ink); }

/* ---------- footer ---------- */

.site-foot { border-top: 1px solid var(--line); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.foot-top { display: grid; gap: clamp(2rem, 4vw, 3rem); }
@media (min-width: 52rem) {
  .foot-top { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
}
.foot-brand { display: grid; gap: .875rem; align-content: start; }
.foot-brand p { color: var(--ink-mute); max-width: 30ch; }
.foot-col { display: grid; gap: .875rem; align-content: start; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.foot-col a {
  color: var(--ink-body);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}
.foot-col a:hover { color: var(--ink); text-decoration: underline; }
.foot-note {
  border-top: 1px solid var(--line);
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: 1.5rem;
  display: grid;
  gap: .75rem;
}
.foot-note p { overflow: visible; }

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

/* The error page is one screen too: its footer band is subtracted from the hero
   the way the header and the door strip are (3.375rem is that band's own height). */
.hero-404 { min-height: calc(100svh - var(--head-h) - var(--strip-h) - 3.375rem - 3px); }
/* On a phone the type takes the top and the drawing takes the rest. */
@media (max-width: 52rem) { .hero-404 > .container { align-content: start; } }
.site-foot-min { border-top: 1px solid var(--line); }
.site-foot-min > .container { padding-block: 1.125rem; }


/* The 404 reuses the hero shell, so the screen height is already set there. */
.oops {
  display: grid;
  align-content: center;
  gap: clamp(1.25rem, 2.4vw, 1.75rem);
  padding-block: clamp(3rem, 8vw, 6rem);
  max-width: 36rem;
}
.oops .lede { color: var(--ink-body); }
