/* ==========================================================================
   Calder & Vane Plumbing Co. (Demo) — design tokens and base styles
   Direction: "The Spec Sheet" — luxury automotive meets precision engineering
   ========================================================================== */

/* ---------- Self-hosted fonts (SIL Open Font License, see /assets/fonts) ---------- */
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-500.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
/* Headline face: Archivo Expanded (the 125% width of Archivo), self-hosted */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-expanded-800.woff") format("woff");
  font-weight: 800;
  font-stretch: 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-expanded-900.woff") format("woff");
  font-weight: 900;
  font-stretch: 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-400.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
  /* Colour */
  --navy-900: #060a16;
  --navy-800: #0a1022;
  --graphite: #1c2333;
  --graphite-2: #252d40;
  --steel: #8a93a6;
  --steel-soft: rgba(138, 147, 166, 0.28);
  --hairline: rgba(244, 240, 232, 0.12);
  --white: #f4f0e8;
  --white-dim: rgba(244, 240, 232, 0.72);
  --orange: #ff5a1f;
  --orange-hot: #ff7a45;
  --orange-glow: rgba(255, 90, 31, 0.35);
  --safety: #ffb020;
  --safety-bg: #2a1d08;

  /* Type */
  --font-display: "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Layout */
  --page-max: 1360px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 14px;
  --radius-lg: 22px;
  --nav-h: 76px;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur: 420ms;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
body {
  margin: 0;
  background: var(--navy-800);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
p {
  margin: 0;
}
::selection {
  background: var(--orange);
  color: var(--navy-900);
}

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--orange);
  color: var(--navy-900);
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
}
.skip-link:focus {
  top: 1rem;
}
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Shared components ---------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--steel);
}
.spec-label strong {
  color: var(--white);
  font-weight: 400;
}

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--white);
  --btn-border: var(--steel-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--btn-border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease,
    transform var(--dur-fast) ease, box-shadow var(--dur) var(--ease-out);
}
.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.btn:hover {
  border-color: var(--white-dim);
}
.btn--primary {
  --btn-bg: var(--orange);
  --btn-fg: var(--navy-900);
  --btn-border: var(--orange);
}
.btn--primary:hover {
  --btn-bg: var(--orange-hot);
  --btn-border: var(--orange-hot);
  box-shadow: 0 10px 40px -10px var(--orange-glow);
}
.btn:active {
  transform: translateY(1px);
}
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Amber safety button (gas guidance only) */
.btn--safety {
  --btn-bg: var(--safety);
  --btn-fg: var(--navy-900);
  --btn-border: var(--safety);
}
.btn--safety:hover {
  --btn-bg: #ffc04d;
  --btn-border: #ffc04d;
}
/* Low-emphasis button */
.btn--quiet {
  --btn-border: var(--steel-soft);
  --btn-fg: var(--white-dim);
}
/* Button that looks like a text link */
.link-btn {
  display: inline;
  min-height: 0;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--white);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1.5px;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--orange-hot);
}

/* ---------- Gas safety mode ----------
   main.js adds .is-safety to <html> while "I smell gas" is selected.
   Every plumbing sales action is marked data-sales; safety controls are data-safety-only. */
html.is-safety [data-sales] {
  display: none !important;
}
html:not(.is-safety) [data-safety-only] {
  display: none !important;
}

/* ---------- Demo notice bar ---------- */
.demo-bar {
  position: relative;
  z-index: 60;
  background: var(--orange);
  color: var(--navy-900);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
  padding: 0.5rem var(--gutter);
}
.demo-bar strong {
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 0.5rem;
}

/* ---------- Reduced motion: switch everything off ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
