/* ============================================================
   NOORD — engineering-sheet design system
   8px grid · 0–2px radii · visible hairlines
   ============================================================ */

:root {
  --base: #0B0D0E;
  --surface: #16191B;
  --hairline: #2A2F33;
  --paper: #EDEDEA;
  --steel: #7C8A91;
  --signal: #FF4D14;

  --paper-hairline: #C9CBC4;
  --paper-steel: #5A666D;

  --font-display: "Archivo", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --container: 1184px;
  --gutter: 32px;

  --ease-mech: cubic-bezier(0.3, 0, 0, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  background: var(--base);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--paper); color: var(--base); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--paper);
  outline-offset: 2px;
}
.paper :focus-visible { outline-color: var(--base); }

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--paper);
  color: var(--base);
  font-family: var(--font-mono);
  font-size: 12px;
}
.skip-link:focus { top: 8px; }

/* max() rather than a plain gutter: on a notched phone held sideways the inset
   is wider than the gutter, and the sheet's left rule must clear it. */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left));
  padding-right: max(var(--gutter), env(safe-area-inset-right));
}

/* Full-height drawing rails */
.rails {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  max-width: var(--container);
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  pointer-events: none;
  z-index: 0;
}

/* ============ Section rail (LineSidebar) ============ */

/* A standing index of the five sheet sections, parked in the margin outside the
   drawing rails and kept in step with scroll position (see script.js). It needs
   ~200px of clear margin, so it only appears once the viewport can hold it
   without crowding the container — the header nav covers everything narrower.
   Accent is paper, not signal: the four static orange uses are already spent. */
.section-rail { display: none; }

@media (min-width: 1648px) {
  .section-rail {
    display: block;
    position: fixed;
    top: 50%;
    left: calc(50% - var(--container) / 2 - 200px);
    transform: translateY(-50%);
    z-index: 40;
  }
}

.section-rail .line-sidebar__list { padding: 0; }

.section-rail .line-sidebar__label {
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Sheet numbering: same size and rhythm as the section labels, not a subscript */
.section-rail .line-sidebar__index {
  font-family: var(--font-mono);
  font-size: 1em;
  margin-right: 8px;
}

/* Hairline ticks read at full strength here; the registry halves them against a
   lighter marker colour than this palette uses. */
.section-rail .line-sidebar__item:not(:last-child)::after { opacity: 1; }

/* Crossing section 05, the rail swaps to the paper-side palette (see script.js).
   The focus ring is on the page's default outline colour, so it has to come too. */
.section-rail--paper :focus-visible { outline-color: var(--base); }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.num { font-variant-numeric: tabular-nums; }

/* ============ Wordmark ============ */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.needle { width: 10px; height: 20px; flex: none; }

.wordmark-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.wordmark-text .o {
  display: inline-block;
  transform: scaleX(0.8);
  margin: 0 -0.02em;
}

/* ============ Header ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 14, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.site-nav { display: flex; gap: 32px; }

.site-nav a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  transition: color 80ms linear;
}
.site-nav a:hover { color: var(--paper); }

.section-indicator {
  font-size: 11px;
  color: var(--steel);
}
.section-indicator [data-section-index] { color: var(--paper); }

/* ============ Sheet index (narrow screens) ============ */

/* Below the nav's breakpoint the counter becomes the handle for a dropped
   index of the same five sections. Shown by the responsive block at the foot
   of this sheet; hidden furniture everywhere else. */
.sheet-toggle {
  display: none;
  appearance: none;
  background: none;
  border: 0;
  border-radius: 0;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0;
  margin-right: -8px;
  padding-right: 8px;
  color: var(--steel);
  font-size: 11px;
  cursor: pointer;
}
.sheet-toggle [data-section-index] { color: var(--paper); }

/* Named for assistive tech; the readout carries the meaning on screen. */
.sheet-toggle-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sheet-toggle-mark {
  width: 12px;
  height: 12px;
  flex: none;
  transition: transform 120ms var(--ease-mech);
}
.sheet-toggle[aria-expanded="true"] .sheet-toggle-mark { transform: scaleY(-1); }

.sheet-index {
  border-top: 1px solid var(--hairline);
  background: var(--base);
}
.sheet-index[hidden] { display: none; }

.sheet-index ul { list-style: none; }

.sheet-index li + li { border-top: 1px solid var(--hairline); }

.sheet-index a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}
.sheet-index a[aria-current="true"] { color: var(--paper); }

.sheet-index-num { color: var(--paper); }

/* ============ Sections & labels ============ */

.section {
  position: relative;
  z-index: 1;
  padding: 112px 0;
  border-bottom: 1px solid var(--hairline);
}

.label {
  font-size: 11px;
  color: var(--steel);
  margin-bottom: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.label::before {
  content: "";
  width: 8px;
  height: 8px;
  border: 1px solid var(--steel);
  flex: none;
}
.label-num { color: var(--paper); }

h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(56px, 7.5vw, 96px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}

h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ============ Cursor-lit field (sections 01–04) ============ */

/* One CursorGrid canvas behind sections 01–04. The sections themselves are
   transparent and already sit at z-index 1, so they read over it without any
   per-section stacking rules. Section 05 is outside the wrapper — it has its own
   paper ground. The canvas never intercepts clicks; pointer tracking is bound to
   the wrapper instead (see script.js). */
.lit-field { position: relative; }

.lit-field-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ============ Hero ============ */

.hero { padding-top: 96px; padding-bottom: 0; }

.hero-grid {
  display: grid;
  /* Copy narrows to give the figure column room: the render carries callouts
     to the right of the appliance and needs the width more than the text does. */
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
  padding-bottom: 80px;
}

.sub {
  color: var(--steel);
  font-size: 18px;
  max-width: 52ch;
  margin-bottom: 48px;
}

.cta-row {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 0;
}

.btn-primary {
  background: var(--signal);
  color: var(--base);
  transition: background 80ms linear;
}
.btn-primary:hover { background: #E04310; }

.btn-link {
  font-size: 12px;
  color: var(--paper);
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 4px;
  transition: color 80ms linear, border-color 80ms linear;
}
.btn-link:hover { color: var(--signal); border-color: var(--signal); }

/* Hero figure */

.hero-figure { position: relative; }

.framed { padding: 16px; position: relative; }
.framed::before,
.framed::after,
.framed .fig-caption::before,
.framed .fig-caption::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0 solid var(--steel);
}
.framed::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.framed::after { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.framed .fig-caption::before { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.framed .fig-caption::after { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }

.exploded { width: 100%; height: auto; display: block; }

.fig-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  fill: var(--steel);
}

.fig-caption {
  font-size: 10px;
  color: var(--steel);
  margin-top: 8px;
}

/* Carries the callout text where the projected labels are dropped — see the
   phone block at the foot of this sheet, which is the only place it shows. */
.fig-legend {
  display: none;
  list-style: none;
  margin-top: 16px;
  border-top: 1px solid var(--hairline);
}
.fig-legend li {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.fig-legend-num { color: var(--paper); flex: none; }

/* Exploded layers: collapse → explode on reveal */
.layer {
  transition: transform 240ms var(--ease-mech);
}
[data-reveal]:not(.in) .layer[data-layer="1"] { transform: translateY(352px); }
[data-reveal]:not(.in) .layer[data-layer="2"] { transform: translateY(276px); }
[data-reveal]:not(.in) .layer[data-layer="3"] { transform: translateY(190px); }
[data-reveal]:not(.in) .layer[data-layer="4"] { transform: translateY(88px); }
.in .layer[data-layer="1"] { transition-delay: 160ms; }
.in .layer[data-layer="2"] { transition-delay: 120ms; }
.in .layer[data-layer="3"] { transition-delay: 80ms; }
.in .layer[data-layer="4"] { transition-delay: 40ms; }

/* ============ Ticker strips ============ */

.ticker {
  border-top: 1px solid var(--hairline);
}

.ticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.ticker-grid p {
  font-size: 12px;
  color: var(--steel);
  padding: 24px;
  border-left: 1px solid var(--hairline);
}
.ticker-grid p:first-child { border-left: 0; padding-left: 0; }
.ticker-grid .num { color: var(--paper); }

.proof { border-bottom: 0; margin-top: 96px; }

/* ============ 02 — constraint ============ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.body-col p {
  color: var(--steel);
  max-width: 56ch;
}
.body-col p + p { margin-top: 24px; }

.accent-line { color: var(--paper); }

.stat-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 80px;
}

.stat-cards li {
  border: 1px solid var(--hairline);
  margin-left: -1px;
  padding: 32px;
}
.stat-cards li:first-child { margin-left: 0; }

.stat {
  font-size: 40px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  color: var(--paper);
  margin-bottom: 16px;
}

.stat-unit {
  font-size: 16px;
  color: var(--steel);
  margin-left: 8px;
  letter-spacing: 0.08em;
}

.stat-caption {
  font-size: 14px;
  color: var(--steel);
  max-width: 34ch;
}

/* ============ 03 — spec table ============ */

.spec-block { margin-top: 80px; }

.spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.spec-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--paper);
}

/* The 1px padding pays back the pull each button takes on both axes, so the
   first button of every wrapped row still lands on the container's rule —
   without it the second row sits a pixel outside the sheet. */
.spec-filters { display: flex; flex-wrap: wrap; padding-top: 1px; padding-left: 1px; }

.filter {
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  margin-left: -1px;
  margin-top: -1px;
  color: var(--steel);
  font-size: 11px;
  height: 40px;
  padding: 0 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 0;
  transition: color 80ms linear, background 80ms linear;
}
.filter:hover { color: var(--paper); }
.filter[aria-pressed="true"] {
  color: var(--paper);
  background: var(--surface);
}
.filter[aria-pressed="true"]::before {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--signal);
  flex: none;
}

.spec-table {
  border-top: 1px solid var(--hairline);
}

.spec-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  position: relative;
  padding: 16px 0;
}

.spec-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--hairline);
  transform-origin: left;
}

.spec-row [role="rowheader"] {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  padding-top: 4px;
}

.spec-row [role="cell"] {
  font-size: 16px;
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}

.spec-row[hidden] { display: none; }

.spec-row.redraw::after {
  animation: drawline 180ms var(--ease-mech) backwards;
  animation-delay: var(--d, 0ms);
}
.spec-row.redraw [role="rowheader"],
.spec-row.redraw [role="cell"] {
  animation: rowfade 180ms var(--ease-mech) backwards;
  animation-delay: var(--d, 0ms);
}

@keyframes drawline {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes rowfade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spec-row-load [role="cell"] { color: var(--steel); }

.spec-note {
  margin-top: 24px;
  font-size: 14px;
  color: var(--steel);
  max-width: 64ch;
}

/* ============ 04 — deployments ============ */

/* Same 1px repayment as the spec filters: the cards pull left and up to share
   one hairline with their neighbour, and the outermost of them would otherwise
   hang a pixel off the container's rule — in either column count. */
.deploy-cards {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 64px;
  padding: 1px 0 0 1px;
}

.deploy-cards li {
  position: relative;
  border: 1px solid var(--hairline);
  margin-left: -1px;
  margin-top: -1px;
  padding: 32px;
  min-height: 224px;
  transition: background 80ms linear;
}
.deploy-cards li:hover { background: var(--surface); }

.card-index {
  font-size: 11px;
  color: var(--steel);
  margin-bottom: 40px;
}

.card-icon {
  position: absolute;
  top: 32px;
  right: 32px;
  width: 32px;
  height: 32px;
}

.deploy-cards h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

.card-body {
  font-size: 14px;
  color: var(--steel);
  max-width: 44ch;
  margin-bottom: 24px;
}

.card-sites {
  font-size: 10px;
  color: var(--steel);
}

/* ============ 05 — close (paper) ============ */

.paper {
  background: var(--paper);
  color: var(--base);
  border-bottom: 0;
}

/* DotField backdrop — the same arrangement as the hero grid: absolute, under the
   content, never intercepting clicks; pointer tracking is bound to the section
   itself (see script.js). */
.close-dotfield {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.paper > .container { position: relative; z-index: 1; }

.paper .label { color: var(--paper-steel); }
.paper .label::before { border-color: var(--paper-steel); }
.paper .label-num { color: var(--base); }

.close-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.paper .body-col p { color: var(--paper-steel); }

.paper .cta-row { margin-top: 40px; }

.contact-line {
  margin-top: 32px;
  font-size: 12px;
  color: var(--paper-steel);
  display: flex;
  align-items: center;
  gap: 16px;
}
.contact-line a { color: var(--base); }
.contact-line a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.contact-line .sep {
  width: 24px;
  height: 1px;
  background: var(--paper-hairline);
}

/* ============ Footer / title block ============ */

.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--hairline);
  background: var(--base);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 0.6fr;
}

.footer-cell {
  padding: 40px 32px 40px 0;
  border-left: 1px solid var(--hairline);
  padding-left: 32px;
}
.footer-cell:first-child { border-left: 0; padding-left: 0; }

.footer-tag {
  font-size: 10px;
  color: var(--steel);
  margin-top: 16px;
}

.footer-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  align-content: start;
}
.footer-links a {
  font-size: 11px;
  color: var(--steel);
  transition: color 80ms linear;
}
.footer-links a:hover { color: var(--paper); }

.footer-address {
  font-style: normal;
  font-size: 11px;
  color: var(--steel);
  line-height: 2;
}

.footer-lang {
  font-size: 11px;
  color: var(--steel);
}
.footer-lang .lang-active { color: var(--paper); }

.footer-strip {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  padding-bottom: 24px;
}
.footer-strip p {
  font-size: 10px;
  color: var(--steel);
}

/* ============ Reveal motion ============ */

[data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 240ms var(--ease-mech), transform 240ms var(--ease-mech);
  transition-delay: var(--d, 0ms);
}
[data-reveal].in {
  opacity: 1;
  transform: none;
}

/* Section top hairlines draw in */
.section { border-bottom-color: var(--hairline); }

/* ============ Responsive ============ */

@media (max-width: 1247px) {
  .rails { display: none; }
}

@media (max-width: 960px) {
  .section { padding: 64px 0; }
  .hero { padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; padding-bottom: 48px; }
  .split, .close-grid { grid-template-columns: 1fr; gap: 32px; }
  .stat-cards { grid-template-columns: 1fr; margin-top: 48px; }
  .stat-cards li { margin-left: 0; margin-top: -1px; }
  .deploy-cards { grid-template-columns: 1fr; }
  .ticker-grid { grid-template-columns: 1fr 1fr; }
  .ticker-grid p:nth-child(odd) { border-left: 0; padding-left: 0; }
  .ticker-grid p:nth-child(-n+2) { border-bottom: 1px solid var(--hairline); }
  .spec-row { grid-template-columns: 1fr; gap: 4px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-cell { border-left: 0; padding-left: 0; }
  .footer-cell:nth-child(even) { border-left: 1px solid var(--hairline); padding-left: 32px; }
}

/* The nav costs less width than the hero does, so it outlives the two-column
   layout; the sheet index takes over only once it genuinely will not fit. */
@media (max-width: 760px) {
  .site-nav { display: none; }
  .section-indicator { display: none; }
  .sheet-toggle { display: inline-flex; }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cell:nth-child(even) { border-left: 0; padding-left: 0; }
  .footer-cell { padding-top: 24px; padding-bottom: 24px; }
}

/* ---- Phone: the figure keeps the frame, the callouts hand over ---- */

@media (max-width: 560px) {
  .hero-labels { display: none; }
  .fig-legend { display: block; }
}

/* ---- Landscape phones: the figure must not out-scale the screen ---- */

@media (orientation: landscape) and (max-height: 560px) {
  .hero-stage { aspect-ratio: auto; height: 62vh; }
}

/* ---- Touch: hairline type is fine to read, not to hit ---- */

/* Hit areas only — nothing here moves a rule or changes the type. Where a
   target has room to grow it grows on the 8px grid; where growing it would
   shift the drawing, an overlay carries the extra reach instead. */
@media (pointer: coarse) {
  .skip-link { min-height: 44px; display: inline-flex; align-items: center; }

  .wordmark { min-height: 44px; }

  .filter { height: 48px; }

  .footer-links { gap: 0 24px; }
  .footer-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }

  .contact-line { gap: 12px; }
  .contact-line a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .btn-link { position: relative; }
  .btn-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 44px;
    transform: translateY(-50%);
  }
}

/* ============ Reduced motion ============ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .layer { transition: none; }
  [data-reveal]:not(.in) .layer[data-layer="1"],
  [data-reveal]:not(.in) .layer[data-layer="2"],
  [data-reveal]:not(.in) .layer[data-layer="3"],
  [data-reveal]:not(.in) .layer[data-layer="4"] { transform: none; }
  .spec-row.redraw::after,
  .spec-row.redraw [role="rowheader"],
  .spec-row.redraw [role="cell"] { animation: none; }
}
