/* ============================================================
   Baldwin Digital — Engineering Ledger
   ------------------------------------------------------------
   The site's identity is editorial: cream stock, forest ink,
   Newsreader. This layer pushes that toward a *technical
   monograph* — the apparatus of engineering documentation laid
   over the same paper. Mono spec labels, hairline ruling with
   figure numbers, blueprint grids in the dark bands, and a
   build manifest.

   It exists so the site can read as a software studio without
   throwing away a design system that already works. Nothing in
   here changes a colour or a face that was already set; it adds
   a register.

   Loaded globally after components.css. Page CSS may override.
   ============================================================ */

/* ------------------------------------------------------------
   1. THE MONO REGISTER
   The spec label. Small, tracked, uppercase, forest. This is the
   single most load-bearing piece of the whole layer — it is what
   makes a paragraph of marketing copy read as documentation.
   ------------------------------------------------------------ */

.eng-label {
  font-family: var(--font-mono);
  font-size: var(--type-mono-label);
  font-weight: 600;
  letter-spacing: var(--track-mono-label);
  text-transform: uppercase;
  color: var(--accent-forest-green);
  line-height: 1;
  margin: 0;
}

.eng-label--signal { color: var(--signal); }
.eng-label--muted  { color: var(--text-muted); }

/* Inside forest-dark bands the ink inverts. */
.home-forest .eng-label,
.eng-invert .eng-label {
  color: var(--bg-cream-deep);
}
.home-forest .eng-label--signal,
.eng-invert .eng-label--signal {
  /* Rust goes muddy on deep forest. Lift it toward the amber end so it
     still reads as "signal" rather than as a dark smudge. */
  color: #E08A62;
}

/* A label with a leading tick — used where the label is doing the job
   of a figure caption rather than a section heading. */
.eng-label--tick {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.eng-label--tick::before {
  content: "";
  width: 14px;
  height: 1px;
  background: currentColor;
  flex: none;
  opacity: 0.7;
}

/* ------------------------------------------------------------
   3. BLUEPRINT GRID
   Drafting-paper texture. Only ever inside the forest-dark
   bands — on cream it turns the page into graph paper and
   fights the editorial feel. Opacity is deliberately near the
   threshold of visibility: it should register as texture, not
   as a grid you can count.
   ------------------------------------------------------------ */

.eng-blueprint {
  position: relative;
  isolation: isolate;
}

.eng-blueprint::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(to right,  var(--rule-invert) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-invert) 1px, transparent 1px);
  background-size: 88px 88px;
  /* Fade the grid out at the edges so it never collides with the band
     boundary as a hard rectangle. */
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 40%, #000 0%, transparent 78%);
          mask-image: radial-gradient(ellipse 80% 65% at 50% 40%, #000 0%, transparent 78%);
  opacity: 0.5;
}

/* Denser sub-grid, for the one band that should feel most like a drawing. */
.eng-blueprint--fine::before {
  background-size: 44px 44px;
  opacity: 0.4;
}

/* ------------------------------------------------------------
   4. BUILD MANIFEST
   The hero device. A ruled, mono, two-column list of what the
   studio actually ships — read as a bill of materials rather
   than a feature list. Replaces the typed-text carousel, which
   was the single most generic element on the homepage.
   ------------------------------------------------------------ */

.eng-manifest {
  --manifest-gap: clamp(1rem, 2.4vw, 2.75rem);
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0 var(--manifest-gap);
}

.eng-manifest-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.85rem;
  padding: 0.72rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-soft);
}

.eng-manifest-key {
  color: var(--signal);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.eng-manifest-val { color: var(--text); }

/* ------------------------------------------------------------
   5. SPEC TABLE
   Key/value ruling for anywhere the page wants to state facts
   rather than sell. Deliberately austere.
   ------------------------------------------------------------ */

.eng-spec {
  margin: 0;
}

/* One rule direction only: a hairline between rows, none above the group and
   none under the last row. Ruling every row top and bottom is the spec-table
   tell. */
.eng-spec-row:last-child { border-bottom: 0; }

.eng-spec-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.32fr) 1fr;
  gap: 0.75rem 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}

.eng-spec-key {
  font-family: var(--font-mono);
  font-size: var(--type-mono-label);
  font-weight: 600;
  letter-spacing: var(--track-mono-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}

.eng-spec-val {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  line-height: 1.55;
}

@media (max-width: 560px) {
  .eng-spec-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ------------------------------------------------------------
   6. STACK TOKENS
   The "under the hood" chips. Mono, hairline, no fill — they
   should look catalogued, not badged.
   ------------------------------------------------------------ */

.eng-tokens {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.eng-token {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.42rem 0.68rem;
  background: transparent;
  transition: border-color var(--transition), color var(--transition);
}

.eng-token:hover {
  border-color: var(--rule-strong);
  color: var(--accent-forest-green);
}

.eng-invert .eng-token,
.home-forest .eng-token {
  color: var(--bg-cream-deep);
  border-color: var(--rule-invert);
}
.eng-invert .eng-token:hover,
.home-forest .eng-token:hover {
  border-color: var(--rule-invert-strong);
  color: var(--bg-cream);
}

/* ------------------------------------------------------------
   8. LOAD CHOREOGRAPHY
   One orchestrated reveal on the hero rather than micro-
   interactions scattered down the page. Opt-in via
   [data-eng-stagger] so it never fires on content that is
   already visible below the fold.
   ------------------------------------------------------------ */

[data-eng-stagger] > * {
  animation: eng-rise 720ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

[data-eng-stagger] > :nth-child(1) { animation-delay: 60ms; }
[data-eng-stagger] > :nth-child(2) { animation-delay: 150ms; }
[data-eng-stagger] > :nth-child(3) { animation-delay: 240ms; }
[data-eng-stagger] > :nth-child(4) { animation-delay: 330ms; }
[data-eng-stagger] > :nth-child(5) { animation-delay: 420ms; }
[data-eng-stagger] > :nth-child(6) { animation-delay: 510ms; }
[data-eng-stagger] > :nth-child(7) { animation-delay: 600ms; }

@keyframes eng-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  [data-eng-stagger] > * { animation: none; }
}

/* ------------------------------------------------------------
   9. WORDMARK
   The subtitle under "Baldwin Digital" moves into the mono
   register. Smallest possible change, and it means the identity
   itself carries the engineering signal before you read a word
   of copy. Hidden on the narrowest screens rather than allowed
   to wrap under the brand name.
   ------------------------------------------------------------ */

.site-header .brand-subtitle,
.site-footer .brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  white-space: nowrap;
}

@media (max-width: 430px) {
  .site-header .brand-subtitle { display: none; }
}
