/*
 * Sworn Solutions design tokens — the single source of truth for the public site
 * and the client portal. Both apps load this file; neither defines brand values.
 *
 * Layers:
 *   1. Raw palette      --sw-*      brand colors and derived steps. Never used by components directly.
 *   2. Semantic tokens  --color-*   what components use. A theme swaps these, not the components.
 *   3. Scales           type, space, radius, layout, motion, elevation.
 *
 * Brand inputs: #0d1321, #1d2d44 (logo), #3e5c76, #748cab, #f0ebd8.
 * Every text, border and status pairing below is measured by scripts/check-contrast.mjs.
 */

@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/archivo-var-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  /* ---------- 1. Raw palette ---------- */
  --sw-navy-950: #0d1321; /* brand */
  --sw-navy-900: #131c2e; /* derived: card surface */
  --sw-navy-800: #1d2d44; /* brand (logo color): raised surface */
  --sw-navy-700: #2a3f5c; /* derived: hairline borders */
  --sw-steel-600: #3e5c76; /* brand: fills only, never text */
  --sw-steel-400: #748cab; /* brand: strong borders, icons */
  --sw-steel-300: #8fa3bd; /* derived: muted text */
  --sw-steel-200: #bcc7d6; /* derived: secondary text */
  --sw-sky-300: #9fb8d6;   /* derived: links */
  --sw-white: #ffffff;     /* primary text and headings */
  --sw-cream-100: #f0ebd8; /* brand: primary action, focus ring, logo */
  --sw-cream-200: #e0dac3; /* derived: pressed state */
  --sw-cream-50: #f8f4e4;  /* derived: hover state */

  /* ---------- 2. Semantic color ---------- */
  --color-bg: var(--sw-navy-950);
  --color-surface: var(--sw-navy-900);
  --color-surface-raised: var(--sw-navy-800);
  --color-surface-sunken: var(--sw-navy-950); /* form inputs */
  --color-overlay: rgb(5 8 16 / 0.72);

  --color-border: var(--sw-navy-700);          /* decorative hairlines */
  --color-border-strong: var(--sw-steel-400);  /* inputs, interactive outlines (>= 3:1) */

  --color-text: var(--sw-white);
  --color-text-secondary: var(--sw-steel-200);
  --color-text-muted: var(--sw-steel-300);
  --color-text-on-accent: var(--sw-navy-950);

  --color-link: var(--sw-sky-300);
  --color-link-hover: var(--sw-white);

  --color-accent: var(--sw-cream-100);   /* primary actions */
  --color-accent-hover: var(--sw-cream-50);
  --color-accent-active: var(--sw-cream-200);
  --color-fill-brand: var(--sw-steel-600); /* selected/decorative fills; pair with cream text */
  --color-focus: var(--sw-cream-100);
  --color-selected: var(--sw-navy-800);

  /* Feedback (alerts, validation). Text-safe on every surface; always paired with an icon. */
  --color-success: #6fd49a;
  --color-warning: #f2c066;
  --color-danger: #f59a90;
  --color-info: var(--sw-sky-300);

  /* Change request status. Color is never the only carrier: each has an icon and a label. */
  --status-submitted: #a8bbd3;
  --status-needs-info: #f2c066;
  --status-approved: #5fd0c0;
  --status-in-progress: #a3adf7;
  --status-completed: #6fd49a;
  --status-declined: #f59a90;

  /* Priority */
  --priority-low: var(--sw-steel-300);
  --priority-normal: var(--sw-sky-300);
  --priority-high: #f2c066;

  /* Data visualization. Series 1 is the default; order is fixed, never cycled. */
  --chart-1: #3f9be0; /* validated with the dataviz palette checker against --sw-navy-900 (dark band, CVD, contrast) */
  --chart-2: #c2842a;
  --chart-3: #2fa88f;
  --chart-4: #8c78e6;
  --chart-compare: var(--sw-steel-400);
  --chart-grid: #1f2b40;
  --chart-axis: var(--sw-navy-700);

  /* ---------- 3. Scales ---------- */
  /* Type */
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --stretch-text: 100%;
  --stretch-display: 112%; /* headings echo the wide letterforms of the logo */
  --stretch-label: 125%;   /* eyebrow labels echo "SOLUTIONS" */

  --text-xs: 0.8125rem;   /* 13 */
  --text-sm: 0.875rem;    /* 14 */
  --text-base: 1rem;      /* 16 */
  --text-md: 1.125rem;    /* 18 */
  --text-lg: 1.25rem;     /* 20 */
  --text-xl: 1.5rem;      /* 24 */
  --text-2xl: clamp(1.625rem, 1.3rem + 1.2vw, 2rem);
  --text-3xl: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --text-4xl: clamp(2.5rem, 1.6rem + 3.8vw, 4.25rem);
  --text-stat: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-body: 1.6;

  /* Space (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;

  /* Shape */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --border-width: 1px;

  /* Layout. Breakpoints cannot be variables in media queries; they are documented in docs/03-design.md:
     sm 480, md 768, lg 1024, xl 1280. */
  --container-site: 75rem;
  --container-app: 80rem;
  --container-prose: 42rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --sidebar-width: 15.5rem;
  --topbar-height: 3.75rem;
  --target-min: 2.75rem; /* 44px touch target */

  /* Elevation: dark UIs separate with borders; shadow is reserved for floating layers. */
  --shadow-popover: 0 10px 30px rgb(0 0 0 / 0.5), 0 0 0 1px var(--sw-navy-700);

  /* Motion: purposeful, transform and opacity only. All of it is disabled under prefers-reduced-motion. */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 800ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1); /* entrances and reveals */

  /* Breathing room. Section and card spacing scale with the viewport. */
  --space-section: clamp(5.5rem, 4rem + 6vw, 9.5rem);
  --gap-grid: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  --card-pad: clamp(1.5rem, 1.2rem + 1vw, 2.25rem);

  /* Stacking */
  --z-sticky: 100;
  --z-drawer: 200;
  --z-popover: 300;
  --z-toast: 400;
}

/* Base: reset, typography, focus, and a few utilities. Uses tokens only. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + var(--space-4));
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-stretch: var(--stretch-text);
  line-height: var(--leading-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
video {
  display: block;
}

img,
svg,
video {
  max-width: 100%;
}

img {
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  font-stretch: var(--stretch-display);
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); line-height: var(--leading-snug); }
h4 { font-size: var(--text-base); line-height: var(--leading-snug); }

p {
  margin: 0;
  text-wrap: pretty;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
  transition: color var(--duration-fast) var(--ease);
}

a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-border);
  margin: var(--space-5) 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--sw-steel-600);
  color: var(--color-text);
}

/* Keyboard focus: one consistent, high-contrast ring everywhere. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link: first focusable element on every page. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -4rem;
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-4);
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2 * var(--gutter), var(--container-site));
  margin-inline: auto;
}

.prose > * + * {
  margin-top: 1.25rem;
}

/* Vertical rhythm between siblings. */
.stack > * + * { margin-top: var(--space-6); }
.stack--tight > * + * { margin-top: var(--space-4); }

.prose {
  max-width: var(--container-prose);
  color: var(--color-text-secondary);
}

.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.nums { font-variant-numeric: tabular-nums; }

/* Eyebrow: small, wide, uppercase label that echoes the logo lettering. */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  font-stretch: var(--stretch-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows high-contrast / forced colors: keep borders and focus visible. */
@media (forced-colors: active) {
  :focus-visible {
    outline-color: Highlight;
  }
}

/*
 * Shared components. Built on tokens.css + base.css only; no raw color values.
 * Layout shells (marketing page sections, portal sidebar) live in each app, not here.
 *
 * Contents: icons · buttons · forms · cards · badges · alerts · tables · stat tiles ·
 *           segmented control · tabs · avatars · threads · timeline · empty states ·
 *           bar lists · charts
 */

/* ---------- Icons ---------- */
.icon {
  display: inline-block;
  vertical-align: -0.2em;
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm { width: 1rem; height: 1rem; }
.icon--lg { width: 1.75rem; height: 1.75rem; }
.icon--fill { fill: currentColor; stroke-width: 1.25; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--color-text);
  --btn-border: var(--color-border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.5rem;
  padding: 0.5rem 1.125rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: var(--border-width) solid var(--btn-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease),
    color var(--duration-fast) var(--ease);
}
.btn:hover { --btn-bg: var(--color-surface-raised); --btn-border: var(--color-text); color: var(--btn-fg); text-decoration: none; }
.btn:active { --btn-bg: var(--color-border); }

.btn--primary {
  --btn-bg: var(--color-accent);
  --btn-fg: var(--color-text-on-accent);
  --btn-border: var(--color-accent);
}
.btn--primary:hover { --btn-bg: var(--color-accent-hover); --btn-border: var(--color-accent-hover); }
.btn--primary:active { --btn-bg: var(--color-accent-active); --btn-border: var(--color-accent-active); }

.btn--ghost { --btn-border: transparent; --btn-fg: var(--color-text-secondary); }
.btn--ghost:hover { --btn-border: transparent; --btn-fg: var(--color-text); }

.btn--danger { --btn-fg: var(--color-danger); --btn-border: var(--color-danger); }
.btn--danger:hover { --btn-bg: color-mix(in srgb, var(--color-danger) 14%, transparent); --btn-border: var(--color-danger); color: var(--color-danger); }

.btn--sm { min-height: 2rem; padding: 0.25rem 0.75rem; font-size: var(--text-xs); }
.btn--lg { min-height: 3rem; padding: 0.75rem 1.5rem; font-size: var(--text-base); }
.btn--block { display: flex; width: 100%; }

.btn[disabled],
.btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn[aria-busy="true"] { cursor: progress; pointer-events: none; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 1em;
  height: 1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (pointer: coarse) {
  .btn { min-height: var(--target-min); }
  .btn--sm { min-height: 2.5rem; }
}

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- Forms ---------- */
.field { display: grid; gap: var(--space-2); }
.field__label { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); }
.field__label .optional { font-weight: 400; color: var(--color-text-muted); }
.field__hint { font-size: var(--text-xs); color: var(--color-text-muted); }
.field__error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-danger);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  background: var(--color-surface-sunken);
  color: var(--color-text);
  border: var(--border-width) solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  transition: border-color var(--duration-fast) var(--ease);
}
.textarea { min-height: 8rem; resize: vertical; line-height: var(--leading-body); }
.input::placeholder,
.textarea::placeholder { color: var(--color-text-muted); }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--color-text-secondary); }
.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible { border-color: var(--color-focus); outline-offset: 1px; }
.input[aria-invalid="true"],
.select[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--color-danger); }
.input:disabled,
.select:disabled,
.textarea:disabled { opacity: 0.5; cursor: not-allowed; }

.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238fa3bd' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

.input-group { position: relative; }
.input-group .icon { position: absolute; left: 0.875rem; top: 50%; translate: 0 -50%; color: var(--color-text-muted); pointer-events: none; }
.input-group .input { padding-left: 2.625rem; }

.check { display: flex; align-items: flex-start; gap: var(--space-3); font-size: var(--text-sm); }
.check input { width: 1.125rem; height: 1.125rem; margin-top: 0.15rem; accent-color: var(--color-accent); }

.form-grid { display: grid; gap: var(--space-5); }
@media (min-width: 768px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-all { grid-column: 1 / -1; } }

/* Honeypot: invisible to people and assistive tech, attractive to bots. */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.dropzone {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-5);
  text-align: center;
  background: var(--color-surface-sunken);
  border: var(--border-width) dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}
.dropzone .icon { color: var(--color-text-muted); }

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.25rem 0.625rem;
  background: var(--color-surface-raised);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-decoration: none;
}
a.file-chip:hover { color: var(--color-text); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
}
.card--flush { padding: 0; overflow: hidden; }
.card--raised { background: var(--color-surface-raised); }
.card--link { display: block; color: inherit; text-decoration: none; transition: border-color var(--duration-fast) var(--ease); }
.card--link:hover { border-color: var(--color-border-strong); color: inherit; }
.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.card--flush .card__head { margin: 0; padding: var(--space-4) var(--space-5); border-bottom: var(--border-width) solid var(--color-border); }
.card__title { font-size: var(--text-md); }
.card__foot { margin-top: var(--space-4); padding-top: var(--space-4); border-top: var(--border-width) solid var(--color-border); font-size: var(--text-sm); }

.icon-tile {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  background: var(--color-surface-raised);
  border-radius: var(--radius-md);
  color: var(--color-text);
}

/* ---------- Badges ---------- */
.badge {
  --_c: var(--color-text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.15rem 0.625rem 0.15rem 0.5rem;
  color: var(--_c);
  background: color-mix(in srgb, var(--_c) 14%, transparent);
  border: var(--border-width) solid color-mix(in srgb, var(--_c) 30%, transparent);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.badge .icon { width: 0.875rem; height: 0.875rem; }
.badge[data-status="submitted"] { --_c: var(--status-submitted); }
.badge[data-status="needs-info"] { --_c: var(--status-needs-info); }
.badge[data-status="approved"] { --_c: var(--status-approved); }
.badge[data-status="in-progress"] { --_c: var(--status-in-progress); }
.badge[data-status="completed"] { --_c: var(--status-completed); }
.badge[data-status="declined"] { --_c: var(--status-declined); }
.badge[data-tone="success"] { --_c: var(--color-success); }
.badge[data-tone="warning"] { --_c: var(--color-warning); }
.badge[data-tone="danger"] { --_c: var(--color-danger); }
.badge[data-tone="info"] { --_c: var(--color-info); }
.badge[data-priority="low"] { --_c: var(--priority-low); }
.badge[data-priority="normal"] { --_c: var(--priority-normal); }
.badge[data-priority="high"] { --_c: var(--priority-high); }
.badge--plain { padding-left: 0.625rem; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.375rem;
  background: var(--color-accent);
  color: var(--color-text-on-accent);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
}

/* ---------- Alerts ---------- */
.alert {
  --_c: var(--color-info);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--_c) 10%, var(--color-surface));
  border: var(--border-width) solid color-mix(in srgb, var(--_c) 35%, transparent);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}
.alert > .icon { color: var(--_c); margin-top: 0.05rem; }
.alert__title { font-weight: 700; color: var(--color-text); }
.alert__body { color: var(--color-text-secondary); }
.alert[data-tone="success"] { --_c: var(--color-success); }
.alert[data-tone="warning"] { --_c: var(--color-warning); }
.alert[data-tone="danger"] { --_c: var(--color-danger); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  border-bottom: var(--border-width) solid var(--color-border);
}
.table td {
  padding: 1.125rem var(--space-4);
  vertical-align: middle;
  border-bottom: var(--border-width) solid var(--color-border);
  color: var(--color-text-secondary);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-surface-raised) 55%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-primary { color: var(--color-text); font-weight: 600; }
.table a.cell-primary { text-decoration: none; }
.table a.cell-primary:hover { text-decoration: underline; }

/* Below 768px a table becomes a stack of labelled cards. Add data-label to each td. */
@media (max-width: 767px) {
  .table--stack,
  .table--stack tbody { display: block; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { display: grid; gap: var(--space-2); padding: var(--space-4); border-bottom: var(--border-width) solid var(--color-border); }
  .table--stack tbody tr:last-child { border-bottom: 0; }
  .table--stack td { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); min-width: 0; padding: 0; border: 0; }
  .table--stack td::before { content: attr(data-label); flex: none; font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--color-text-muted); }
  .table--stack td:not([data-label])::before { content: none; }
  /* The first cell is the row's title: full width, no label. */
  .table--stack td:first-child { display: block; }
  .table--stack td:first-child::before { content: none; }
  .table--stack .num { text-align: right; }
  /* Wrap a cell's contents in .cell-body when it holds more than one element. */
  .table--stack .cell-body { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); min-width: 0; text-align: right; }
}
.cell-body { display: contents; }
@media (max-width: 767px) { .table--stack .cell-body { display: flex; } }

/* ---------- Stat tiles ---------- */
.stat { display: grid; gap: var(--space-1); align-content: start; }
.stat__label { font-size: var(--text-sm); color: var(--color-text-secondary); }
.stat__value {
  font-size: var(--text-stat);
  font-weight: 700;
  font-stretch: var(--stretch-display);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
}
.stat__delta { display: inline-flex; align-items: center; gap: 0.25rem; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-muted); }
.stat__delta--up { color: var(--color-success); }
.stat__delta--down { color: var(--color-danger); }
.stat__note { font-size: var(--text-xs); color: var(--color-text-muted); }
.stat__spark { width: 100%; height: 2rem; margin-top: var(--space-2); overflow: visible; }
.stat__spark path { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Segmented control (date range, view toggles) ---------- */
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.125rem;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.segmented { max-width: 100%; overflow-x: auto; }
@media (max-width: 479px) { .segmented span { padding-inline: 0.625rem; font-size: var(--text-xs); } }
.segmented label:hover span { color: var(--color-text); }
.segmented input:checked + span { background: var(--color-fill-brand); color: var(--color-text); }
.segmented input:focus-visible + span { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--space-5); border-bottom: var(--border-width) solid var(--color-border); overflow-x: auto; }
.tabs a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--color-text); }
.tabs a[aria-current="page"] { color: var(--color-text); border-bottom-color: var(--color-accent); }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  background: var(--color-fill-brand);
  color: var(--color-text);
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.avatar--admin { background: var(--color-accent); color: var(--color-text-on-accent); }

/* ---------- Discussion thread ---------- */
.thread { display: grid; gap: var(--space-5); }
.message { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3) var(--space-4); }
.message__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.message__author { font-weight: 700; }
.message__time { font-size: var(--text-xs); color: var(--color-text-muted); }
.message__body {
  margin-top: var(--space-2);
  padding: var(--space-4);
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  color: var(--color-text-secondary);
}
.message__body > * + * { margin-top: var(--space-3); }
.message__files { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.message--mine .message__body { background: var(--color-surface-raised); }
.message--internal .message__body {
  background: color-mix(in srgb, var(--color-warning) 8%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-warning) 40%, transparent);
}
.system-note { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-xs); color: var(--color-text-muted); }
.system-note::before,
.system-note::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }

/* ---------- Status timeline ---------- */
.timeline { display: grid; gap: 0; }
.timeline li { position: relative; display: grid; gap: var(--space-1); padding: 0 0 var(--space-5) var(--space-5); }
.timeline li::before { content: ""; position: absolute; left: 0.3125rem; top: 0.6rem; bottom: -0.2rem; width: 1px; background: var(--color-border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 0; top: 0.35rem; width: 0.625rem; height: 0.625rem; border-radius: 50%; background: var(--_c, var(--color-border-strong)); }
.timeline li[data-status="submitted"] { --_c: var(--status-submitted); }
.timeline li[data-status="needs-info"] { --_c: var(--status-needs-info); }
.timeline li[data-status="approved"] { --_c: var(--status-approved); }
.timeline li[data-status="in-progress"] { --_c: var(--status-in-progress); }
.timeline li[data-status="completed"] { --_c: var(--status-completed); }
.timeline li[data-status="declined"] { --_c: var(--status-declined); }
.timeline__meta { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Empty state ---------- */
.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-7) var(--space-5);
  text-align: center;
  color: var(--color-text-secondary);
}
.empty .icon-tile { width: 3.5rem; height: 3.5rem; color: var(--color-text-muted); }
.empty h3 { color: var(--color-text); }
.empty p { max-width: 34rem; font-size: var(--text-sm); }

/* ---------- Bar list (top pages, traffic sources) ---------- */
.barlist { display: grid; gap: var(--space-4); }
.barlist li { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-4); align-items: baseline; font-size: var(--text-sm); }
.barlist__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-text); }
.barlist__value { font-variant-numeric: tabular-nums; font-weight: 600; }
.barlist__bar { grid-column: 1 / -1; height: 0.5rem; border-left: 1px solid var(--chart-axis); }
.barlist__bar i { display: block; height: 100%; background: var(--chart-1); border-radius: 0 4px 4px 0; }

/* ---------- Charts ---------- */
.chart { margin: 0; }
.chart__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.chart__title { font-size: var(--text-md); }
.chart__sub { font-size: var(--text-sm); color: var(--color-text-secondary); }
.chart__plot { position: relative; }
.chart__plot svg { width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart__axis { stroke: var(--chart-axis); stroke-width: 1; }
.chart__tick { fill: var(--color-text-muted); font-family: var(--font-sans); } /* size is set per SVG variant */
/* Each chart ships a wide and a narrow SVG so axis text stays legible; the choice follows the chart's own width. */
.chart__plot { container-type: inline-size; }
.chart__wide { display: none; }
.chart__narrow { display: block; }
@container (min-width: 560px) {
  .chart__wide { display: block; }
  .chart__narrow { display: none; }
}
.chart__line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart__line--compare { stroke: var(--chart-compare); stroke-dasharray: 5 4; }
.chart__area { fill: var(--chart-1); opacity: 0.1; }
.chart__dot { fill: var(--chart-1); stroke: var(--color-surface); stroke-width: 2; }
.chart__crosshair { stroke: var(--color-text-muted); stroke-width: 1; }
.chart__legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin-top: var(--space-3); font-size: var(--text-xs); color: var(--color-text-secondary); }
.chart__legend span { display: inline-flex; align-items: center; gap: var(--space-2); }
.chart__key { width: 1.125rem; height: 0; border-top: 2px solid var(--chart-1); }
.chart__key--compare { border-top: 2px dashed var(--chart-compare); }

.chart__tooltip {
  position: absolute;
  z-index: var(--z-popover);
  min-width: 9.5rem;
  padding: var(--space-3);
  background: var(--color-surface-raised);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-popover);
  font-size: var(--text-xs);
  pointer-events: none;
}
.chart__tooltip[hidden] { display: none; }
.chart__tooltip strong { display: block; font-size: var(--text-base); font-variant-numeric: tabular-nums; }
.chart__tooltip span { color: var(--color-text-secondary); }
.chart__tooltip .row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-1); }

.chart__table { margin-top: var(--space-4); }
.chart__table summary { cursor: pointer; font-size: var(--text-sm); font-weight: 600; color: var(--color-link); width: fit-content; }
.chart__table summary:hover { color: var(--color-link-hover); }
.chart__table .table-wrap { margin-top: var(--space-3); }

/* ---------- Pagination / result summary ---------- */
.result-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); color: var(--color-text-secondary); }

/*
 * Public website layout — marketing and conversion.
 * Lives with the site (will move to site/src/css/ when the site is built).
 * Uses shared tokens and components only.
 *
 * Motion model (all optional, all off under prefers-reduced-motion):
 *   - Hero entrance: CSS animations only, no JavaScript. Content is visible if animations are unavailable.
 *   - Scroll reveals: hidden state applies only when scripting is enabled (@media (scripting: enabled)),
 *     so visitors without JavaScript always see everything.
 *   - Floating dock, scroll reveals and menu: a 3 KB vanilla JavaScript file (see site.js).
 */

/* ---------- Top bar: logo only, over the hero ---------- */
.site-top { position: absolute; inset: 0 0 auto; z-index: 20; }
.site-top__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: 5.5rem; }
.brand { display: inline-flex; flex: none; border-radius: var(--radius-sm); }
.brand img { height: 2.5rem; width: auto; }
.site-top__end { display: flex; align-items: center; gap: var(--space-3); }
.site-top__portal { display: none; }
@media (min-width: 640px) { .site-top__portal { display: inline-flex; } }

/* ---------- Floating dock: fades in after the first scroll, away again near the footer ---------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.5rem;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: var(--border-width) solid var(--color-border);
  border-radius: 1.25rem;
  box-shadow: 0 18px 40px rgb(0 0 0 / 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 0.875rem);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out), visibility 0s linear 0.5s;
}
.dock.is-visible:not(.is-away) {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
.dock__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0 var(--space-4);
  border: var(--border-width) solid transparent;
  border-radius: 0.875rem;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease), background-color var(--duration-fast) var(--ease), border-color var(--duration-fast) var(--ease);
}
.dock__link:hover { color: var(--color-text); background: var(--color-surface-raised); }
.dock__link[aria-current="page"] { color: var(--color-text); border-color: var(--color-border-strong); }
.dock__home { padding: 0; width: 2.75rem; justify-content: center; color: var(--color-text); }
.dock__links { display: none; align-items: center; gap: var(--space-1); }
.dock__menu { display: inline-flex; }
.dock .btn { min-height: 2.75rem; border-radius: 0.875rem; margin-left: var(--space-1); }
@media (min-width: 640px) {
  .dock__links { display: flex; }
  .dock__menu { display: none; }
}

/* ---------- Full-screen menu (native <dialog>: focus trap, Escape and inert background come free) ---------- */
.menu { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; background: var(--color-bg); color: var(--color-text); }
.menu[open] { display: block; animation: menu-in 0.35s var(--ease-out); }
.menu::backdrop { background: var(--color-overlay); }
html:has(dialog[open]) { overflow: hidden; }
.menu__inner { display: grid; align-content: start; gap: var(--space-8); min-height: 100%; padding-block: var(--space-5) var(--space-8); }
.menu__bar { display: flex; align-items: center; justify-content: space-between; min-height: 3.5rem; }
.menu nav { display: grid; }
.menu nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.5em 0;
  border-bottom: var(--border-width) solid var(--color-border);
  color: var(--color-text);
  font-size: var(--text-3xl);
  font-weight: 700;
  font-stretch: var(--stretch-display);
  letter-spacing: -0.015em;
  text-decoration: none;
  animation: rise 0.7s var(--ease-out) both;
  animation-delay: calc(0.1s + var(--i, 0) * 70ms);
}
.menu nav a:hover { color: var(--color-link); }
.menu nav a .icon { color: var(--color-text-muted); }
.menu__foot { display: grid; gap: var(--space-4); font-size: var(--text-sm); color: var(--color-text-secondary); }
.menu__foot a:not(.btn) { color: var(--color-text-secondary); }
@keyframes menu-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Motion primitives ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(1.5rem); } to { opacity: 1; transform: none; } }
@keyframes word-up { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ping { from { transform: scale(0.35); opacity: 0.85; } to { transform: scale(1); opacity: 0; } }

/* Hero entrance (pure CSS). Elements marked data-enter rise in, staggered by --i. */
[data-enter] { animation: rise 1s var(--ease-out) both; animation-delay: calc(0.15s + var(--i, 0) * 110ms); }

/* Headline: each word rises out of a clipped line. Padding/margin keep descenders (g, y, p) unclipped. */
.words .w { display: inline-block; overflow: hidden; vertical-align: top; padding-block: 0.06em 0.16em; margin-block: -0.06em -0.16em; }
.words .w > span { display: inline-block; animation: word-up 1.1s var(--ease-out) both; animation-delay: calc(0.2s + var(--i, 0) * 70ms); }

/* Scroll reveals: only hidden when scripting is on; site.js adds .is-in as items enter the viewport. */
@media (scripting: enabled) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(1.75rem);
    transition: opacity var(--duration-slow) var(--ease-out), transform var(--duration-slow) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 100ms);
  }
  [data-reveal].is-in { opacity: 1; transform: none; }
}

/* Letter-by-letter roll on primary buttons (letters are split at build time; no JavaScript). */
.roll { display: inline-flex; height: 1.25em; overflow: hidden; line-height: 1.25; }
.roll__c { position: relative; display: inline-block; height: 1.25em; white-space: pre; transition: transform 0.5s var(--ease-out); transition-delay: calc(var(--i) * 14ms); }
.roll__c::after { content: attr(data-c); position: absolute; left: 0; top: 100%; }
@media (hover: hover) {
  .btn:hover .roll__c,
  .btn:focus-visible .roll__c { transform: translateY(-100%); }
}
.btn .icon { transition: transform 0.4s var(--ease-out); }
@media (hover: hover) { .btn:hover .icon--nudge { transform: translate(2px, -2px); } }

/* Cards lift slightly on hover. */
.lift { transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-out); }
@media (hover: hover) { .lift:hover { transform: translateY(-6px); border-color: var(--color-border-strong); } }

@media (prefers-reduced-motion: reduce) {
  [data-enter], .words .w > span, .menu nav a, .menu[open], .radar__pulse { animation: none !important; opacity: 1 !important; transform: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .roll__c, .btn .icon, .lift, .dock { transition: none !important; }
  .btn:hover .roll__c, .btn:hover .icon--nudge, .lift:hover { transform: none !important; }
  .dock { transform: translate(-50%, 0) !important; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--space-section); }
.section--tight { padding-block: calc(var(--space-section) * 0.7); }
.section--alt { background: var(--color-surface); border-block: var(--border-width) solid var(--color-border); }
.section__head { display: grid; gap: var(--space-4); max-width: 44rem; margin-bottom: clamp(3rem, 2rem + 3vw, 5.5rem); }
.section__head--center { margin-inline: auto; text-align: center; justify-items: center; }
.lead { font-size: var(--text-md); line-height: 1.65; color: var(--color-text-secondary); }
.rule { width: 3rem; height: 2px; background: var(--color-accent); border: 0; margin: 0; }

/* ---------- Hero: centered, atmospheric, local ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: clamp(9rem, 7rem + 8vw, 13rem);
  text-align: center;
}
/* One soft steel-blue glow and a faint dot grid. Decorative and static; delete either rule to remove it. */
.hero::before {
  content: "";
  position: absolute;
  inset: -25% -10% auto;
  height: 80%;
  z-index: -2;
  background: radial-gradient(ellipse 58% 62% at 50% 0%, color-mix(in srgb, var(--sw-steel-600) 72%, transparent), transparent 74%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, color-mix(in srgb, var(--sw-steel-400) 40%, transparent) 1px, transparent 1.4px);
  background-size: 30px 30px;
  opacity: 0.55;
  -webkit-mask-image: radial-gradient(ellipse 75% 65% at 50% 32%, #000, transparent 78%);
  mask-image: radial-gradient(ellipse 75% 65% at 50% 32%, #000, transparent 78%);
}
.hero__copy { display: grid; justify-items: center; gap: var(--space-6); max-width: 54rem; margin-inline: auto; }
.hero h1 { font-size: var(--text-4xl); letter-spacing: -0.025em; line-height: 1.08; }
.hero .lead { max-width: 40rem; font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); }
.hero__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-4); margin-top: var(--space-2); }
@media (max-width: 479px) { .hero__cta { flex-direction: column; align-items: center; width: 100%; } .hero__cta .btn { width: 100%; max-width: 20rem; } }
.pill { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.375rem 1rem; background: color-mix(in srgb, var(--color-surface-raised) 70%, transparent); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; font-stretch: var(--stretch-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-secondary); }
.pill .icon { color: var(--color-accent); }

/* Device: a browser frame rising from the bottom of the hero and fading out into the page. */
.hero__stage { position: relative; max-width: 66rem; margin: clamp(4rem, 3rem + 5vw, 7.5rem) auto 0; padding-inline: var(--gutter); }
.device {
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border);
  border-bottom: 0;
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 -30px 80px rgb(0 0 0 / 0.35);
  -webkit-mask-image: linear-gradient(#000 52%, transparent 100%);
  mask-image: linear-gradient(#000 52%, transparent 100%);
  text-align: left;
}
.device__bar { display: flex; align-items: center; gap: 6px; padding: 14px 18px; border-bottom: var(--border-width) solid var(--color-border); }
.device__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--color-border); }
.device__bar b { flex: 0 1 18rem; margin-inline: auto; padding: 4px 14px; background: var(--color-bg); border-radius: var(--radius-pill); font-size: 0.6875rem; font-weight: 500; text-align: center; color: var(--color-text-muted); }
.device__body { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); padding: clamp(1.25rem, 3vw, 2.5rem); min-height: 28rem; }
.dv-nav { display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.5rem); }
.dv-nav .sk { height: 8px; width: clamp(2rem, 6vw, 4rem); }
.dv-nav .dv-logo { width: clamp(4rem, 10vw, 6.5rem); height: 16px; background: var(--color-fill-brand); margin-right: auto; }
.dv-hero { display: grid; gap: clamp(1rem, 3vw, 2.5rem); grid-template-columns: 1.1fr 1fr; align-items: center; }
.dv-copy { display: grid; gap: 14px; }
.dv-photo { position: relative; aspect-ratio: 4 / 3; background: var(--color-fill-brand); border-radius: var(--radius-md); overflow: hidden; }
.dv-photo::before { content: ""; position: absolute; inset: auto -10% -35% -10%; height: 70%; background: var(--sw-navy-800); border-radius: 50% 50% 0 0; }
.dv-photo .tag { position: absolute; top: 10px; left: 10px; padding: 3px 10px; background: var(--color-bg); border-radius: var(--radius-pill); font-size: 0.625rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-success); }
.dv-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.75rem, 2vw, 1.25rem); }
.dv-cards div { height: 5rem; background: var(--color-surface-raised); border-radius: var(--radius-md); }
.sk { height: 12px; background: var(--color-surface-raised); border-radius: 6px; }
.sk--lg { height: 22px; background: var(--color-fill-brand); }
.sk--btn { height: 30px; width: 7rem; background: var(--color-accent); border-radius: var(--radius-sm); }
.sk--block { height: 6rem; border-radius: var(--radius-md); }
.mock__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Floating "local search result" card that sits over the device. */
.float-card {
  position: absolute;
  z-index: 2;
  left: clamp(0.5rem, 4vw, 3rem);
  bottom: clamp(1.5rem, 6vw, 5rem);
  display: grid;
  gap: var(--space-3);
  width: min(19rem, 78%);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface-raised);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  text-align: left;
  font-size: var(--text-sm);
}
.float-card__row { display: flex; align-items: center; gap: var(--space-3); }
.float-card__pin { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; background: var(--color-accent); color: var(--color-text-on-accent); border-radius: 50%; }
.float-card strong { display: block; line-height: 1.2; }
.float-card small { color: var(--color-text-secondary); font-size: var(--text-xs); }
.stars { display: inline-flex; gap: 2px; color: var(--color-warning); }
.stars .icon { width: 0.875rem; height: 0.875rem; }
.float-card__meta { display: flex; align-items: center; gap: var(--space-2); color: var(--color-text-secondary); font-size: var(--text-xs); }
.float-card__meta .open { color: var(--color-success); font-weight: 700; }

/* ---------- Cards and grids ---------- */
.grid-services { display: grid; gap: var(--gap-grid); }
.service { display: grid; gap: var(--space-5); align-content: start; }
.service h3 { font-size: var(--text-lg); }
.service p { color: var(--color-text-secondary); font-size: var(--text-sm); line-height: 1.7; }
@media (min-width: 640px) { .grid-services { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-services { grid-template-columns: repeat(3, 1fr); } }

.grid-3 { display: grid; gap: var(--gap-grid); }
@media (min-width: 768px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: var(--space-8); }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--space-9); } }

.pillar { display: grid; gap: var(--space-5); align-content: start; }
.pillar .icon-tile { width: 3.25rem; height: 3.25rem; border-radius: var(--radius-md); }
.pillar h3 { font-size: var(--text-xl); }
.pillar p { color: var(--color-text-secondary); line-height: 1.7; }

.quote { display: grid; gap: var(--space-6); align-content: space-between; }
.quote blockquote { margin: 0; font-size: var(--text-md); line-height: 1.65; }
.quote__by { display: flex; align-items: center; gap: var(--space-3); font-size: var(--text-sm); }
.quote__by strong { display: block; }
.quote__by span { color: var(--color-text-muted); }
.placeholder-flag { justify-self: start; }

/* Placeholder copy marker used on content the owner will replace. */
.placeholder-note {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.125rem 0.625rem;
  background: color-mix(in srgb, var(--color-warning) 14%, transparent);
  border: var(--border-width) solid color-mix(in srgb, var(--color-warning) 35%, transparent);
  border-radius: var(--radius-pill);
  color: var(--color-warning);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Local SEO split: copy on one side, a radar-and-pin illustration on the other. */
.checks { display: grid; gap: var(--space-4); margin-top: var(--space-2); }
.checks li { display: flex; align-items: flex-start; gap: var(--space-3); color: var(--color-text-secondary); }
.checks .icon { color: var(--color-success); margin-top: 0.2em; }
.checks strong { color: var(--color-text); }
.split__text { display: grid; gap: var(--space-5); justify-items: start; }
.split__text .btn { margin-top: var(--space-3); }
.radar-wrap { position: relative; }
.radar { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-width: 30rem; margin-inline: auto; }
.radar > i { position: absolute; inset: calc(var(--k) * 11%); border: var(--border-width) solid color-mix(in srgb, var(--sw-steel-400) 38%, transparent); border-radius: 50%; }
.radar__pin { position: relative; display: grid; place-items: center; width: 4.5rem; height: 4.5rem; background: var(--color-accent); color: var(--color-text-on-accent); border-radius: 50%; box-shadow: 0 0 0 0.875rem color-mix(in srgb, var(--color-accent) 16%, transparent); }
.radar__pin .icon { width: 2rem; height: 2rem; }
.radar__pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--color-accent); opacity: 0; }
.radar-wrap.is-in .radar__pulse,
.radar-wrap:not([data-reveal]) .radar__pulse { animation: ping 1.8s var(--ease-out) 2 both; }
.radar-wrap .float-card { left: auto; right: 0; bottom: 6%; }
.serving { display: grid; justify-items: center; gap: var(--space-5); margin-top: var(--space-8); padding: var(--space-6); background: var(--color-surface-sunken); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); text-align: center; color: var(--color-text-secondary); }
.serving__label { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-2); color: var(--color-text); }
.serving .icon { color: var(--color-accent); }
.serving .chips { justify-content: center; gap: var(--space-3); }
.serving .chip { padding: 0.375rem 1rem; font-size: var(--text-sm); }

.cta-band {
  display: grid;
  justify-items: center;
  gap: var(--space-6);
  padding: clamp(4rem, 3rem + 4vw, 7rem) var(--space-5);
  text-align: center;
  background: var(--color-surface-raised);
  border-radius: 1.75rem;
}
.cta-band h2 { font-size: var(--text-3xl); }
.cta-band p { max-width: 36rem; color: var(--color-text-secondary); font-size: var(--text-md); line-height: 1.65; }
.cta-band__phone { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 600; }

/* ---------- Inner page headers ---------- */
.page-hero { padding-block: clamp(9rem, 7rem + 7vw, 12rem) clamp(4rem, 3rem + 4vw, 6.5rem); border-bottom: var(--border-width) solid var(--color-border); }
.page-hero__inner { display: grid; gap: var(--space-5); justify-items: start; }
.page-hero__inner > * { max-width: 46rem; }
.page-hero h1 { font-size: var(--text-4xl); letter-spacing: -0.025em; line-height: 1.08; }

/* ---------- Portfolio ---------- */
.project-grid { display: grid; gap: clamp(3rem, 2rem + 3vw, 5rem) var(--gap-grid); }
@media (min-width: 768px) { .project-grid { grid-template-columns: 1fr 1fr; } }
.project { display: grid; gap: var(--space-5); align-content: start; }
.shot { position: relative; aspect-ratio: 16 / 10; background: var(--color-surface-raised); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; }
.shot__bar { display: flex; gap: 5px; padding: 9px 11px; border-bottom: var(--border-width) solid var(--color-border); }
.shot__bar i { width: 8px; height: 8px; border-radius: 50%; background: var(--color-border-strong); opacity: 0.5; }
.shot__body { display: grid; gap: 10px; padding: 14px; }
.shot__body .sk { background: var(--color-border); }
.shot__body .sk--lg { background: var(--color-fill-brand); }
.shot__body .sk--btn { height: 22px; width: 5.5rem; background: var(--color-accent); }
.shot__label { position: absolute; right: var(--space-3); bottom: var(--space-3); padding: 0.125rem 0.5rem; background: var(--color-bg); border-radius: var(--radius-sm); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.thumbs .shot { border-radius: var(--radius-sm); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { padding: 0.125rem 0.75rem; background: var(--color-surface-raised); border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; color: var(--color-text-secondary); }
.project h2, .project h3 { font-size: var(--text-xl); }
.project p { color: var(--color-text-secondary); line-height: 1.7; }
.project__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: var(--gap-grid); }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.contact-list { display: grid; gap: var(--space-6); }
.contact-list li { display: flex; gap: var(--space-4); align-items: flex-start; }
.contact-list strong { display: block; }
.contact-list a { color: var(--color-text-secondary); }
.steps { display: grid; gap: var(--space-5); counter-reset: step; }
.steps li { position: relative; padding-left: 2.75rem; color: var(--color-text-secondary); font-size: var(--text-sm); line-height: 1.6; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 1.875rem; height: 1.875rem; background: var(--color-surface-raised); border-radius: 50%; color: var(--color-text); font-weight: 700; }
.steps strong { display: block; color: var(--color-text); }
.turnstile-slot { display: flex; align-items: center; gap: var(--space-3); min-height: 4rem; padding: 0 var(--space-4); background: var(--color-surface-sunken); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-sm); font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; padding-block: var(--space-9) var(--space-6); background: var(--color-surface); border-top: var(--border-width) solid var(--color-border); }
.footer-grid { display: grid; gap: var(--space-8); }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr 1fr; } }
.footer-brand img { height: 2.5rem; width: auto; margin-bottom: var(--space-5); }
.footer-brand p { max-width: 20rem; font-size: var(--text-sm); line-height: 1.7; color: var(--color-text-secondary); }
.footer-col h2 { margin-bottom: var(--space-5); font-size: var(--text-xs); font-weight: 600; font-stretch: var(--stretch-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-muted); }
.footer-col ul { display: grid; gap: var(--space-4); font-size: var(--text-sm); }
.footer-col a { color: var(--color-text-secondary); text-decoration: none; }
.footer-col a:hover { color: var(--color-text); text-decoration: underline; }
.footer-col .is-placeholder { opacity: 0.65; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-8); padding-top: var(--space-6); border-top: var(--border-width) solid var(--color-border); font-size: var(--text-xs); color: var(--color-text-muted); }
.footer-bottom a { color: var(--color-text-muted); }

/* Keep the fixed dock from covering the last lines of content on small screens. */
@media (max-width: 639px) { .site-footer { padding-bottom: 6rem; } }

/* ---------- Production additions ---------- */
/* Inlined icon sprite: present in the DOM so <use> can reference it, but takes no space. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Contact: direct-contact card shown while the online form is off. */
.contact-main { display: grid; gap: var(--space-6); align-content: start; }
.contact-main .lead { max-width: 34rem; }
.contact-main .btn-row { gap: var(--space-4); }

/* Notice for pages with nothing to show yet (an empty portfolio). */
.empty-note { display: grid; justify-items: start; gap: var(--space-5); max-width: 40rem; padding: clamp(2rem, 1rem + 3vw, 3.5rem); background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-lg); }
.empty-note h2 { font-size: var(--text-xl); }
.empty-note p { color: var(--color-text-secondary); line-height: 1.7; }

/* Legal pages: readable long-form text. */
.legal { max-width: var(--container-prose); }
.legal h2 { margin-top: var(--space-8); font-size: var(--text-xl); }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: var(--color-text-secondary); line-height: 1.75; }
.legal p + p, .legal h2 + p, .legal p + ul, .legal ul + p { margin-top: var(--space-4); }
.legal ul { display: grid; gap: var(--space-2); padding-left: 1.25rem; list-style: disc; margin-top: var(--space-4); }
.legal a { color: var(--color-link); }
.legal__meta { color: var(--color-text-muted); font-size: var(--text-sm); }

/* 404 */
.not-found { display: grid; justify-items: start; gap: var(--space-5); min-height: 60vh; align-content: center; }
.not-found .big { font-size: clamp(4rem, 3rem + 8vw, 9rem); font-weight: 800; font-stretch: var(--stretch-label); line-height: 1; letter-spacing: -0.03em; color: var(--color-border-strong); }

/* Portfolio: real project screenshots and the featured layout used when there is a single project. */
.project__media { display: grid; gap: var(--space-4); align-content: start; }
.project__body { display: grid; gap: var(--space-5); align-content: start; }
.project-image { overflow: hidden; background: var(--color-surface); border: var(--border-width) solid var(--color-border); border-radius: var(--radius-md); }
.project-image img { display: block; width: 100%; height: auto; }
.thumbs--images { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); }
.thumbs--images .project-image { flex: none; }
.thumbs--images img { width: auto; height: 13rem; }
/* An odd number of projects would leave one alone in the last grid row, so the first is shown large, image beside the text. */
.project-grid > .project:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .project-grid > .project:first-child:nth-last-child(odd) { grid-template-columns: 1.55fr 1fr; align-items: center; gap: var(--space-8); }
}
