/* ==========================================================================
   Jackson Group — Design System v1
   Shared tokens + primitives for the 5 group websites.
   Each site overrides the brand tokens (--brand-*) and keeps everything else.
   ========================================================================== */

:root {
  /* Ink (navy) scale — from the current JGC palette */
  --ink-950: #060a16;
  --ink-900: #0a1122;
  --ink-800: #111b33;
  --ink-700: #1c2848;

  /* JGC logo blues */
  --indigo: #312e81;
  --blue-800: #1e3a8a;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-300: #93c5fd;
  --sky-500: #0ea5e9;
  --sky-300: #7dd3fc;

  /* Accent — site-safety amber, used sparingly (markers, dots, highlights) */
  --amber: #f5a524;

  /* Neutrals */
  --concrete: #edeae3;
  --paper: #f7f6f2;
  --white: #ffffff;
  --text: var(--ink-900);
  --text-2: #4a5468;
  --text-3: #7a8296;
  --line: rgba(10, 17, 34, 0.12);
  --line-inv: rgba(255, 255, 255, 0.13);

  /* Brand slots (override per site) */
  --brand: var(--blue-600);
  --brand-hover: var(--blue-800);
  --brand-light: var(--sky-300);

  /* Type */
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --fs-display: clamp(2.75rem, 7vw, 7.25rem);
  --fs-h2: clamp(2.15rem, 4.4vw, 4.1rem);
  --fs-h3: clamp(1.25rem, 1.5vw, 1.5rem);
  --fs-lead: clamp(1.0625rem, 1.25vw, 1.25rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-label: 0.75rem;

  /* Space & shape */
  --container: 1320px;
  --gutter: clamp(16px, 4vw, 48px);
  --section: clamp(88px, 11vw, 160px);
  --radius-sm: 6px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.9s;

  --shadow-lg: 0 30px 60px -20px rgba(6, 10, 22, 0.35);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; /* Android Chrome sizes fixed elements to any horizontal overflow */ -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
address { font-style: normal; }

:focus-visible { outline: 2px solid var(--sky-500); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 1000;
  background: var(--white); color: var(--ink-900); padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); position: relative; }
.section--paper { background: var(--paper); }
.section--concrete { background: var(--concrete); }
.section--ink { background: var(--ink-950); color: var(--white); }

/* ---------- Typography ---------- */
.display, .h2, .h3 { font-family: var(--font-display); color: inherit; }
.display {
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.93;
  letter-spacing: -0.045em;
}
.h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h3 { font-size: var(--fs-h3); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.lead { font-size: var(--fs-lead); line-height: 1.6; color: var(--text-2); text-wrap: pretty; }
.section--ink .lead { color: rgba(255, 255, 255, 0.68); }
.label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.text-grad {
  background: linear-gradient(100deg, var(--sky-300) 0%, var(--blue-500) 55%, var(--blue-600) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  /* background-clip:text only paints inside the box; tight line-heights cut descenders (g, p) */
  padding: 0 .06em .34em 0; margin: 0 -.06em -.34em 0;
}

/* Pill eyebrow (Spaciaz-style tag) */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono); font-size: var(--fs-label); font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }
.pill--inv { border-color: var(--line-inv); color: rgba(255, 255, 255, 0.78); background: rgba(255, 255, 255, 0.05); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--brand); --btn-fg: var(--white); --chip-bg: rgba(255, 255, 255, 0.16);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 54px; padding: 6px 6px 6px 24px;
  border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 600; font-size: 0.975rem; letter-spacing: -0.005em;
  transition: color 0.4s var(--ease), background-color 0.4s var(--ease), transform 0.4s var(--ease);
  white-space: nowrap;
}
.btn::after { /* fill sweep */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--btn-hover, var(--brand-hover));
  transform: translateY(101%); transition: transform 0.55s var(--ease-out);
  border-radius: inherit;
}
.btn:hover::after { transform: translateY(0); }
.btn__chip {
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--chip-bg);
  transition: transform 0.55s var(--ease-out);
}
.btn__chip svg { width: 16px; height: 16px; }
.btn:hover .btn__chip { transform: rotate(-45deg); }
/* Wide buttons: centre the label in the space left of the chip */
.btn__label { flex: 1; text-align: center; }
.btn:has(.btn__label) { padding-left: 14px; } /* match the label-to-chip gap so the label is truly centred */
.btn--light { --btn-bg: var(--white); --btn-fg: var(--ink-900); --chip-bg: var(--ink-900); --btn-hover: var(--sky-300); }
.btn--light .btn__chip { color: var(--white); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--white); --chip-bg: rgba(255,255,255,0.12); --btn-hover: rgba(255,255,255,0.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
.btn--dark { --btn-bg: var(--ink-900); --btn-hover: var(--blue-600); }
.btn--plain { padding: 0 26px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 600; color: var(--brand);
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.5s var(--ease-out);
  padding-bottom: 2px;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform 0.5s var(--ease-out); }
.link-arrow:hover { background-size: 100% 1px; }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Brand mark separator (three logo strokes) ---------- */
.mark { display: inline-block; width: 1.1em; height: 1.1em; }
.mark svg { width: 100%; height: 100%; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* Image reveal (clip from bottom). Clip the child img: an observed element
   with its own clip-path never reports as intersecting. */
[data-reveal="clip"] { opacity: 1; transform: none; }
[data-reveal="clip"] > img { clip-path: inset(100% 0 0 0); transition: clip-path 1.2s var(--ease-out), transform 1.4s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
[data-reveal="clip"].is-in > img { clip-path: inset(0 0 0 0); }

.no-js [data-reveal], .no-js [data-reveal] > img { opacity: 1; transform: none; clip-path: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  [data-reveal], [data-reveal] > img { opacity: 1; transform: none; clip-path: none; }
}
