/* ============================================================================
   Human Workday — site stylesheet
   HWW/000 · v0.1 · 2026-08 · PUBLIC SITE FOUNDATION

   Requires css/tokens.css to be loaded first. No hex colour literals may
   appear in this file — every colour is a var() from tokens.css, or a
   color-mix() of those tokens. The check script enforces this.

   The register: the cover sheet and general-notes sheets of an architectural
   drawing set. Futurism through precision — drafting grid, registration
   ticks, mono field codes, protected margins — never through sci-fi tropes.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   0 · BASE
   ---------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--hw-ground);
  color: var(--hw-graphite);
  font-family: var(--hw-font-serif);
  font-size: var(--hw-text-body);
  line-height: var(--hw-leading-body);
  font-variant-numeric: lining-nums;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1,
h2,
h3,
h4 {
  font-family: var(--hw-font-sans);
  line-height: var(--hw-leading-head);
  margin: 0 0 var(--hw-space-3);
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--hw-text-h1);
  line-height: var(--hw-leading-tight);
  font-weight: 700;
}
h2 {
  font-size: var(--hw-text-h2);
  font-weight: 650;
}
h3 {
  font-size: var(--hw-text-h3);
  font-weight: 600;
}

p {
  margin: 0 0 var(--hw-space-3);
  max-width: var(--hw-measure);
}

.lead {
  font-size: var(--hw-text-lead);
  line-height: 1.5;
}

.caption,
figcaption {
  font-family: var(--hw-font-sans);
  font-size: var(--hw-text-caption);
  color: var(--hw-field-grey);
}

/* Data is set in Archivo with tabular figures (Territory B). */
.data,
table td.num {
  font-family: var(--hw-font-sans);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Accessible focus — visible everywhere, never removed. */
:focus-visible {
  outline: 2px solid var(--hw-plan-blue);
  outline-offset: 2px;
}

::selection {
  background: var(--hw-plan-blue);
  color: var(--hw-paper);
}

/* ----------------------------------------------------------------------------
   1 · LINKS & BUTTONS
   Terracotta is reserved for true stopping conditions and deliberate human
   emphasis — the primary action, the current location. Working links are
   Plan Blue.
   ---------------------------------------------------------------------------- */

a {
  color: var(--hw-plan-blue);
  text-decoration: underline;
  text-decoration-thickness: var(--hw-hairline-w);
  text-underline-offset: 0.2em;
  transition: color var(--hw-duration-ui) var(--hw-ease);
}
a:hover {
  color: var(--hw-terracotta);
}

.btn {
  display: inline-block;
  font-family: var(--hw-font-sans);
  font-size: var(--hw-text-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  /* Padding raised from 0.65em to clear a 44px effective hit area (line-height
     22.03px + 2×11.56px padding + 2px border ≈ 47.15px); the matching
     negative block margin folds the added height back out of the flow so
     the visual footprint (≈41.71px) is unchanged (touch-target fix, no
     font-size change). */
  padding: 0.85em 1.4em;
  margin-block: -0.2em;
  border: var(--hw-hairline-w) solid var(--hw-graphite);
  color: var(--hw-graphite);
  background: transparent;
  transition:
    background var(--hw-duration-ui) var(--hw-ease),
    color var(--hw-duration-ui) var(--hw-ease);
}
.btn:hover {
  background: var(--hw-graphite);
  color: var(--hw-paper);
}

/* The one emphatic action on a page — terracotta, used sparingly. */
.btn-emphasis {
  border-color: var(--hw-terracotta);
  background: var(--hw-terracotta);
  color: var(--hw-paper);
}
.btn-emphasis:hover {
  background: var(--hw-graphite);
  border-color: var(--hw-graphite);
  color: var(--hw-paper);
}

/* ----------------------------------------------------------------------------
   2 · SITE HEADER
   Wordmark is supplied artwork — never typeset. Paper ground so the artwork
   field disappears into the surface; a single hairline underneath.
   ---------------------------------------------------------------------------- */

.site-header {
  background: var(--hw-paper);
  border-bottom: var(--hw-hairline-w) solid var(--hw-hairline);
}

.site-header .header-inner {
  max-width: var(--hw-sheet-max);
  margin-inline: auto;
  padding: var(--hw-space-3) var(--hw-margin-sheet);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hw-space-4);
  flex-wrap: wrap;
}

.site-header .brand {
  display: inline-flex;
  align-items: center;
}
.site-header .brand img {
  width: clamp(150px, 16vw, 210px); /* horizontal lockup minimum is 80px */
  min-width: 80px;
  height: auto;
}

/* ----------------------------------------------------------------------------
   3 · NAVIGATION
   Archivo labels. The current sheet is marked with a terracotta underline
   via aria-current="page" — a deliberate human emphasis, not decoration.
   ---------------------------------------------------------------------------- */

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--hw-space-2) var(--hw-space-4);
}

.site-nav a {
  font-family: var(--hw-font-sans);
  font-size: var(--hw-text-caption);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--hw-graphite);
  text-decoration: none;
  /* Touch-target fix: inline anchors keep the default 'inline' box, so
     block-direction padding grows the clickable/measurable box (line-height
     22.03px + 2×16px padding + 2px border ≈ 56.03px) without adding a single
     pixel to line height or row spacing — vertical padding/margin on inline
     non-replaced boxes never displaces surrounding lines. The inline-direction
     padding (2×8px) is offset by an equal negative margin so the reserved
     flex-gap footprint is unchanged; only the hit area widens (e.g. "Home"
     clears 44px). No font-size change. */
  padding: var(--hw-space-3) var(--hw-space-2);
  margin-inline: calc(-1 * var(--hw-space-2));
  border-bottom: 2px solid transparent;
  transition:
    border-color var(--hw-duration-ui) var(--hw-ease),
    color var(--hw-duration-ui) var(--hw-ease);
}

.site-nav a:hover {
  border-bottom-color: var(--hw-hairline);
}

.site-nav a[aria-current="page"] {
  color: var(--hw-graphite);
  border-bottom-color: var(--hw-terracotta);
}

/* ----------------------------------------------------------------------------
   4 · DECLARATION STRIP
   Everything declares itself (Territory B rule 1). One per page, directly
   under the header: identifier · version · date · layer, in mono, with
   registration ticks at both ends.
   Format: HWW/001 · v0.1 · 2026-08 · PUBLIC SITE
   ---------------------------------------------------------------------------- */

.declaration-strip {
  max-width: var(--hw-sheet-max);
  margin-inline: auto;
  padding: var(--hw-space-2) var(--hw-margin-sheet);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--hw-space-3);
  font-family: var(--hw-font-mono);
  font-size: var(--hw-text-code);
  letter-spacing: var(--hw-tracking-caps);
  text-transform: uppercase;
  color: var(--hw-field-grey);
  border-bottom: var(--hw-hairline-w) solid
    color-mix(in srgb, var(--hw-hairline) 55%, var(--hw-ground));
}

/* Each declared field is one token (sheet code, version, date, layer). It may
   never break internally — wrapping, if it happens at all on a narrow
   viewport, only ever occurs between tokens (the flex-wrap above), never
   inside one (e.g. "2026-08" or "PUBLIC SITE" splitting across lines). */
.declaration-strip > span {
  white-space: nowrap;
}

.declaration-strip .decl-id {
  color: var(--hw-graphite);
  font-weight: 600;
}

/* Middle-dot separators between declaration fields, drawn by the system so
   the markup stays clean: HWW/001 · v0.1 · 2026-08 · PUBLIC SITE */
.declaration-strip > span + span::before {
  content: "\00B7";
  margin-right: var(--hw-space-3);
  color: var(--hw-field-grey);
}

/* Registration ticks bracketing the declaration. */
.declaration-strip::before,
.declaration-strip::after {
  content: "";
  flex: 0 0 auto;
  width: 0.85em;
  height: 0.85em;
  background:
    linear-gradient(var(--hw-hairline), var(--hw-hairline)) center / 100%
      var(--hw-hairline-w) no-repeat,
    linear-gradient(var(--hw-hairline), var(--hw-hairline)) center /
      var(--hw-hairline-w) 100% no-repeat;
}

/* ----------------------------------------------------------------------------
   5 · DRAFTING GRID
   A very subtle hairline grid on the ground — texture, not information.
   Deliberately far below 3:1 so it can never be mistaken for a meaningful
   rule. Apply to a section, not to the whole page.
   ---------------------------------------------------------------------------- */

.plan-grid {
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--hw-hairline) 22%, transparent)
        var(--hw-hairline-w),
      transparent var(--hw-hairline-w)
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--hw-hairline) 22%, transparent)
        var(--hw-hairline-w),
      transparent var(--hw-hairline-w)
    );
  background-size: 2.5rem 2.5rem;
}

/* ----------------------------------------------------------------------------
   6 · SHEET & SECTION
   The page is a sheet in a drawing set. Protected margins are allocations
   (rule 2): generous, and never filled.
   ---------------------------------------------------------------------------- */

.sheet {
  max-width: var(--hw-sheet-max);
  margin-inline: auto;
  padding-inline: var(--hw-margin-sheet);
}

.section {
  padding-block: var(--hw-space-7);
}

.section + .section {
  border-top: var(--hw-hairline-w) solid
    color-mix(in srgb, var(--hw-hairline) 55%, var(--hw-ground));
}

/* A field label above a section — mono field code register. */
.field-code {
  display: block;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-text-code);
  letter-spacing: var(--hw-tracking-caps);
  text-transform: uppercase;
  color: var(--hw-field-grey);
  margin-bottom: var(--hw-space-3);
}

/* Raised working surface — Paper on Cream, hairline edge, no shadows. */
.card {
  background: var(--hw-paper);
  border: var(--hw-hairline-w) solid
    color-mix(in srgb, var(--hw-hairline) 55%, var(--hw-ground));
  padding: var(--hw-space-5);
}

/* ----------------------------------------------------------------------------
   7 · LANDMARK
   The full-colour moment (Brand v1.2 §12): Plan Blue ground, warm-cream
   display type. One per page, never more than two. Carries display text
   only — never data, never a metric.
   ---------------------------------------------------------------------------- */

.landmark {
  background: var(--hw-plan-blue);
  color: var(--hw-ground);
  padding: var(--hw-space-8) var(--hw-margin-sheet);
}

.landmark-inner {
  max-width: var(--hw-sheet-max);
  margin-inline: auto;
}

.landmark .display,
.landmark h1,
.landmark h2 {
  font-family: var(--hw-font-sans);
  font-size: var(--hw-text-display);
  line-height: var(--hw-leading-tight);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--hw-ground);
  margin: 0;
  max-width: 24ch;
}

.landmark .landmark-serif {
  font-family: var(--hw-font-serif);
  font-size: var(--hw-text-lead);
  color: color-mix(in srgb, var(--hw-ground) 88%, var(--hw-plan-blue));
  max-width: var(--hw-measure);
  margin-top: var(--hw-space-4);
}

.landmark .field-code {
  color: color-mix(in srgb, var(--hw-ground) 75%, var(--hw-plan-blue));
}

/* ----------------------------------------------------------------------------
   8 · STATE CHIP
   Honest states in mono — IN PREPARATION, DRAFT, RATIFIED. A hairline box,
   never a coloured pill. Pre-publication work is shown as exactly that.
   ---------------------------------------------------------------------------- */

.state-chip {
  display: inline-block;
  font-family: var(--hw-font-mono);
  font-size: var(--hw-text-code);
  letter-spacing: var(--hw-tracking-caps);
  text-transform: uppercase;
  color: var(--hw-field-grey);
  border: var(--hw-hairline-w) solid var(--hw-hairline);
  padding: 0.2em 0.7em;
  white-space: nowrap;
}

/* ----------------------------------------------------------------------------
   9 · TICK ORNAMENTS
   Registration marks for a declared surface: hairline corner brackets,
   top-left and bottom-right. Notation, not decoration — use on surfaces
   that declare something (a landmark, a specimen, a figure).
   ---------------------------------------------------------------------------- */

.ticks {
  position: relative;
}

.ticks::before,
.ticks::after {
  content: "";
  position: absolute;
  width: 0.75rem;
  height: 0.75rem;
  pointer-events: none;
}
.ticks::before {
  top: 0;
  left: 0;
  border-top: var(--hw-hairline-w) solid var(--hw-hairline);
  border-left: var(--hw-hairline-w) solid var(--hw-hairline);
}
.ticks::after {
  bottom: 0;
  right: 0;
  border-bottom: var(--hw-hairline-w) solid var(--hw-hairline);
  border-right: var(--hw-hairline-w) solid var(--hw-hairline);
}

/* On a Plan Blue ground the ticks lighten to stay visible. */
.landmark.ticks::before,
.landmark.ticks::after {
  border-color: color-mix(in srgb, var(--hw-ground) 55%, var(--hw-plan-blue));
}

/* ----------------------------------------------------------------------------
   10 · FOOTER
   Icon mark (supplied artwork) + closing declaration. Graphite ground,
   reversed to Paper ink.
   ---------------------------------------------------------------------------- */

.site-footer {
  background: var(--hw-graphite);
  color: var(--hw-ground);
  margin-top: var(--hw-space-8);
}

.site-footer .footer-inner {
  max-width: var(--hw-sheet-max);
  margin-inline: auto;
  padding: var(--hw-space-6) var(--hw-margin-sheet);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hw-space-4);
  flex-wrap: wrap;
}

.site-footer .footer-mark img {
  width: 40px;
  height: auto;
}

.site-footer .footer-decl {
  font-family: var(--hw-font-mono);
  font-size: var(--hw-text-code);
  letter-spacing: var(--hw-tracking-caps);
  text-transform: uppercase;
  color: color-mix(in srgb, var(--hw-ground) 80%, var(--hw-graphite));
}

/* Touch-target fix: footer anchors get an explicit >=44px effective hit
   area via inline-flex + min-height (font-size-independent, no line-height
   guesswork) rather than font inflation. No footer anchor currently renders
   on a shipped page, so there is no existing visual footprint to preserve
   and no negative-margin offset is needed. */
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: var(--hw-space-2);
  margin-inline: calc(-1 * var(--hw-space-2));
  color: var(--hw-ground);
}
.site-footer a:hover {
  color: color-mix(in srgb, var(--hw-ground) 75%, var(--hw-graphite));
}
.site-footer :focus-visible {
  outline-color: var(--hw-ground);
}

/* ----------------------------------------------------------------------------
   11 · SCROLL REVEAL
   CSS-only, via scroll-driven animations where supported; elsewhere the
   content is simply present — no JavaScript, no IntersectionObserver.
   Measured: a short rise, once, on entry.
   ---------------------------------------------------------------------------- */

@supports (animation-timeline: view()) {
  .reveal {
    animation: hw-reveal var(--hw-duration) var(--hw-ease) both;
    animation-timeline: view();
    animation-range: entry 0% entry 45%;
  }
  @keyframes hw-reveal {
    from {
      opacity: 0;
      transform: translateY(0.75rem);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

/* ----------------------------------------------------------------------------
   12 · MOTION KILL SWITCH
   Under prefers-reduced-motion every animation and transition in the
   system is disabled, without exception.
   ---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----------------------------------------------------------------------------
   13 · NARROW VIEWPORTS (max-width: 767px — see tokens.css breakpoints)
   ---------------------------------------------------------------------------- */

@media (max-width: 47.9375rem) {
  .site-header .header-inner {
    justify-content: center;
    text-align: center;
  }
  .section {
    padding-block: var(--hw-space-6);
  }
  .landmark {
    padding-block: var(--hw-space-7);
  }
  .site-footer .footer-inner {
    justify-content: center;
    text-align: center;
  }
  /* Declaration strip: tokens still never break internally (see the
     white-space: nowrap rule above); tighten the row/column gap and drop
     letter-spacing a touch so the four tokens sit closer together and wrap
     between fields — never inside one — before the sheet runs out of
     width. */
  .declaration-strip {
    row-gap: var(--hw-space-2);
    column-gap: var(--hw-space-2);
    letter-spacing: 0.06em;
  }
  .declaration-strip > span + span::before {
    margin-right: var(--hw-space-2);
  }
}
