/* =========================================================
   Ninety Utilities Ltd — site styles
   Implements the Ninety Utilities brand guidelines v1.0 (Aug 2026).
   Two ninety-degree corners frame the name: top-left ink,
   bottom-right orange — fixed pair, never a full box.
   No external fonts or CDNs: Hanken Grotesk / IBM Plex Mono are
   self-hosted from /assets/fonts (system fallbacks until added).
   ========================================================= */

/* ---- Fonts (self-hosted; safe fallbacks while files are absent) ---- */
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/HankenGrotesk-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  /* Brand palette — guidelines §3. Orange is an emphasis budget:
     the corner, the primary button, a live status. Orange used AS TEXT
     or as a button fill is always Action (#C25E00), which passes AA. */
  --ink: #1d1d1f;
  --orange: #ee7d00;      /* mark + non-text accents only */
  --action: #c25e00;      /* buttons, orange text */
  --action-hover: #9a4a00;
  --text-2: #6e6e73;      /* secondary text */
  --page: #f5f5f7;        /* page background */
  --line: #ececee;        /* card borders, rules */
  --outline: #d6d6db;     /* secondary button outline */
  --card: #ffffff;
  --ink-text-2: #86868b;  /* secondary text on ink */

  --font-sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas,
    monospace;

  --max: 1200px;
  --radius: 16px;
  --ease-mark: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  -webkit-text-size-adjust: 100%;
}

/* ---- Type scale — guidelines §4 ---- */
h1, h2, h3 { margin: 0 0 0.6em; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: 700; }
p  { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

/* Body copy never wider than 34em, left-aligned, never justified. */
.measure { max-width: 34em; text-align: left; }

/* The tracked-uppercase label — the one typographic signature. */
.label {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 0.9rem;
}
.on-ink .label { color: var(--ink-text-2); }

/* Data treatment: anything referenced or measured is mono. */
.data { font-family: var(--font-mono); font-size: 13px; }

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
.on-ink a { color: #fff; }

/* Visible focus ring in brand orange — never removed. */
:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 30;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Layout ---- */
.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: 24px;
}

/* =========================================================
   The mark. Corners are built in CSS: fixed pair, top-left
   ink and bottom-right orange. Never add the other two.
   ========================================================= */
.lockup {
  position: relative;
  display: inline-block;
  text-decoration: none;
  padding: 8px 12px 8px 10px;
  white-space: nowrap;
}
.lockup .n { font-weight: 800; font-size: 19px; letter-spacing: -0.01em; color: var(--ink); }
.lockup .u { font-weight: 400; font-size: 19px; color: var(--text-2); margin-left: 0.35em; }
.lockup::before,
.lockup::after { content: ""; position: absolute; width: 12px; height: 12px; }
.lockup::before {
  top: 0; left: 0;
  border-top: 4px solid var(--ink);
  border-left: 4px solid var(--ink);
}
.lockup::after {
  bottom: 0; right: 0;
  border-bottom: 4px solid var(--orange);
  border-right: 4px solid var(--orange);
}
/* Reversed lockup on ink: top-left corner white, Utilities mid grey,
   orange unchanged. */
.on-ink .lockup .n { color: #fff; }
.on-ink .lockup .u { color: var(--ink-text-2); }
.on-ink .lockup::before { border-color: #fff; }

/* Stacked lockup (footer). */
.lockup.stacked { white-space: normal; text-align: left; padding: 10px 14px; }
.lockup.stacked .n { display: block; font-size: 26px; line-height: 1; }
.lockup.stacked .u {
  display: block; margin: 2px 0 0;
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.26em; text-transform: uppercase;
}

/* The corner device as a framing element — at most twice per page. */
.corner-frame { position: relative; padding: 20px 24px; }
.corner-frame::before,
.corner-frame::after { content: ""; position: absolute; width: 22px; height: 22px; }
.corner-frame::before {
  top: 0; left: 0;
  border-top: 5px solid var(--ink);
  border-left: 5px solid var(--ink);
}
.corner-frame::after {
  bottom: 0; right: 0;
  border-bottom: 5px solid var(--orange);
  border-right: 5px solid var(--orange);
}
.on-ink .corner-frame::before { border-color: #fff; }

/* =========================================================
   Header — 72px, white, horizontal lockup left, links + one
   Action button right. Solid ink on scroll (no transparency).
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  transition: background 120ms linear;
}
.site-header .wrap {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  padding-block: 6px;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: var(--outline); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--orange); }
.site-nav .btn { margin-left: 8px; }

/* Ink header once scrolled — toggled by /assets/site.js. */
.site-header.scrolled { background: var(--ink); border-bottom-color: var(--ink); }
.site-header.scrolled .site-nav a { color: #fff; }
.site-header.scrolled .lockup .n { color: #fff; }
.site-header.scrolled .lockup .u { color: var(--ink-text-2); }
.site-header.scrolled .lockup::before { border-color: #fff; }

/* ---- Sections: alternate white and page grey; at most one ink. ---- */
section { padding-block: 56px; }
section.white { background: var(--card); }
section.ink, .on-ink { background: var(--ink); color: #fff; }
section.ink .measure, .page-intro p { color: rgba(255, 255, 255, 0.92); }

.page-intro { background: var(--ink); color: #fff; padding-block: 48px 56px; }
.page-intro h1 { color: #fff; margin-bottom: 0.3em; }
.page-intro p { max-width: 34em; margin: 0; }
.page-intro .label { color: var(--ink-text-2); }

/* ---- Hero — the only place type runs above 24px. ---- */
.hero { padding-block: 72px 80px; background: var(--card); }
.hero .corner-frame { max-width: 24em; }
.hero h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.015em;
  margin: 0;
}
.hero .lead { margin-top: 20px; color: var(--text-2); font-size: 16px; }

/* ---- Cards ---- */
.grid { display: grid; gap: 24px; margin-top: 24px; }
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px)  { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--text-2); }
.card .cta { display: inline-block; margin-top: 8px; font-weight: 700; }

/* Capability figure: numeral in 800, unit/label in mono beneath.
   Figures must be real and dated — no rounded-up marketing numbers. */
.figure .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.figure .unit { display: block; margin-top: 4px; font-family: var(--font-mono); font-size: 13px; color: var(--text-2); }

/* ---- Buttons — one primary per view. ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--action);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 120ms linear;
}
.btn:hover { background: var(--action-hover); }
.btn.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--outline);
}
.btn.secondary:hover { background: var(--page); }
.on-ink .btn.secondary, .site-header.scrolled .btn.secondary,
.page-intro .btn.secondary {
  color: #fff; border-color: rgba(255, 255, 255, 0.4);
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---- Fact lists (safety page, contact details) ---- */
.fact-list { margin: 24px 0 0; }
.fact-list > div { border-top: 1px solid var(--line); padding: 16px 0; }
.fact-list dt { font-weight: 700; margin-bottom: 4px; }
.fact-list dd { margin: 0; color: var(--text-2); max-width: 34em; }
.on-ink .fact-list > div { border-top-color: #3a3a3f; }
.on-ink .fact-list dd { color: var(--ink-text-2); }

/* ---- Accreditations placeholder slots ---- */
.accreditations { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.accreditation-slot {
  flex: 1 1 150px;
  min-height: 90px;
  border: 1px dashed var(--outline);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 13px;
  text-align: center;
  padding: 8px;
}

/* ---- Emergency block (the one ink section per page that uses it) ---- */
.emergency .num {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  text-decoration: none;
}
.emergency .num:hover { text-decoration: underline; }

/* ---- Forms — one column, labels above, errors under fields. ---- */
form { max-width: 34em; }
.field { margin-bottom: 20px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { display: block; font-weight: 400; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
  width: 100%;
  min-height: 44px;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: 10px;
  padding: 10px 14px;
}
textarea { min-height: 150px; resize: vertical; }

/* Honeypot — off-canvas, humans never see it. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Form status messages (revealed via :target — works without JS). */
.form-status { display: none; border: 1px solid; border-radius: 10px; padding: 16px 20px; margin-bottom: 24px; }
.form-status:target { display: block; }
.form-status.ok  { border-color: #2e7d32; background: #cfeeda; color: #1e4620; }
.form-status.err { border-color: #c0301a; background: #fbd8cf; color: #5f1a16; }

/* ---- Footer — ink, reversed lockup, escape line, link columns. ---- */
.site-footer { padding-block: 48px 40px; font-size: 14px; }
.site-footer .cols {
  display: grid;
  gap: 32px;
  padding-top: 32px;
}
@media (min-width: 768px) {
  .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.site-footer h2 {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-text-2);
  margin-bottom: 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #fff; }
.site-footer .escape {
  border-bottom: 1px solid #3a3a3f;
  padding-bottom: 24px;
}
.statutory {
  border-top: 1px solid #3a3a3f;
  margin-top: 32px;
  padding-top: 20px;
  color: var(--ink-text-2);
  font-size: 13px;
}

/* ---- Tables (careers, works) ---- */
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 16px; }
th, td { text-align: left; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; font-weight: 500; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-2); }

/* ---- 404 ---- */
.error-page { padding-block: 80px; background: var(--card); }

@media print {
  .site-header, .site-footer, .btn-row { display: none; }
  body { background: #fff; color: #000; }
}
