/* =====================================================
   IncMarketry — shared primitives for the v8 public site (stage A, 2026-10-09)

   The vocabulary the new homepage (stage C), the header on all eight public pages (stage B)
   and, later, the inner pages (stage F) are built from. Every name carries the im- prefix:
   .btn and .glass already exist in styles.css / glass-primitives.css with other looks and are
   used on eleven pages, so nothing here may redefine an unprefixed name.

   Colours: brand-tokens.css only (var(--brand-*)). No hex value lives in this file —
   verify-brand-colors fails if one appears. The --im-* aliases below are names, not values.

   Responsive: viewport units and media queries, never container units. A container query
   needs container-type on an ancestor, and that ancestor then becomes the containing block
   for every position:fixed element inside it (the Get Access modal, the chat button, the
   scroll-progress bar) — they would position against the page frame instead of the screen.

   Motion: everything that moves stops under prefers-reduced-motion and shows its final state.
   ===================================================== */

:root {
  --im-plum: var(--brand-navy);
  --im-plum-d: var(--brand-plum-deep);
  --im-plum-dd: var(--brand-plum-deepest);
  --im-muted: var(--brand-muted);
  --im-ink: var(--brand-plum-deepest);
  --im-sand: var(--brand-cream);
  --im-sand-2: var(--brand-sand-panel);
  --im-sand-deep: var(--brand-sand-deep);
  --im-card: var(--brand-card);
  --im-terra: var(--brand-terracotta);
  --im-terra-d: var(--brand-terracotta-deep);
  --im-tint: var(--brand-terracotta-tint);
  --im-tint-wash: var(--brand-terracotta-wash);
  --im-teal: var(--brand-teal-bright);
  --im-teal-d: var(--brand-teal-deep);
  --im-teal-wash: var(--brand-teal-wash);
  --im-plum-wash: var(--brand-plum-wash);
  --im-line: rgba(var(--brand-navy-rgb), .14);
  --im-line-dk: rgba(var(--brand-cream-rgb), .16);
  --im-glass-bg: rgba(var(--brand-cream-rgb), .10);
  --im-glass-b: rgba(var(--brand-cream-rgb), .28);
  --im-r: 24px;
  --im-rs: 16px;
  --im-gut: 16px;
  --im-pad: clamp(20px, 4vw, 56px);
  --im-max: 1440px;
}
@media (max-width: 640px) {
  :root { --im-r: 20px; --im-gut: 12px; }
}

/* ---- the canvas: full-width sand, content centred at 1440 (decision 11) ---- */
.im-canvas { background: var(--im-sand); color: var(--im-ink); }
.im-wrap { max-width: var(--im-max); margin: 0 auto; position: relative; }

/* ---- panels: rounded, inset by the gutter, clipped ---- */
.im-panel { border-radius: var(--im-r); position: relative; overflow: hidden; }
.im-panel--dark { background: var(--im-plum-dd); color: var(--im-sand); }
.im-panel--plum { background: linear-gradient(160deg, var(--im-plum), var(--im-plum-dd)); color: var(--im-sand); }
.im-panel--wash { background: var(--im-tint-wash); color: var(--im-ink); }
.im-panel--tealwash { background: var(--im-teal-wash); color: var(--im-ink); }
.im-inset { margin-left: var(--im-gut); margin-right: var(--im-gut); }

/* ---- label pills (eyebrows). Bricolage 500, uppercase, letter-spaced, tabular figures: the
   replacement for every mono label in the mockups (decision 7; JetBrains Mono is retired). The
   font shorthand resets font-variant-numeric, so tabular-nums is restated after it (row 308). ---- */
.im-eyebrow {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px;
  border: 1px solid currentColor; border-radius: 999px;
  font: 500 11px/1 'Bricolage Grotesque', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.im-on-dark .im-eyebrow, .im-panel--dark .im-eyebrow, .im-panel--plum .im-eyebrow {
  background: var(--im-glass-bg); border-color: var(--im-glass-b);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
/* Small uppercase labels that are not pills (step numbers, tile kickers, card counters). */
.im-label {
  font: 500 12px/1.2 'Bricolage Grotesque', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: .14em; text-transform: uppercase;
}

/* ---- type ---- */
.im-h-display { font-weight: 300; letter-spacing: -.025em; line-height: 1.02; font-size: clamp(38px, 5.4vw, 74px); }
.im-h-section { font-weight: 300; letter-spacing: -.02em; line-height: 1.08; font-size: clamp(30px, 3.8vw, 54px); }
.im-h-mid { font-weight: 300; letter-spacing: -.02em; line-height: 1.1; font-size: clamp(26px, 3vw, 40px); }
.im-lead { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; max-width: 56ch; }
.im-small { font-size: 14px; line-height: 1.5; }

/* ---- buttons. 46px tall: above the 44px tap floor (row 171). ---- */
.im-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-sizing: border-box; height: 46px; padding: 0 20px; border-radius: 999px;
  font-family: inherit; font-weight: 600; font-size: 14.5px; line-height: 1;
  border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.im-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.im-btn--fill { background: var(--im-tint); color: var(--im-plum-dd); }
.im-btn--fill:hover { background: var(--brand-terracotta-tint-hover); }
.im-btn--ink { background: var(--im-plum-dd); color: var(--im-sand); }
.im-btn--ink:hover { background: var(--im-plum); }
.im-btn--sand { background: var(--im-sand); color: var(--im-plum-dd); }
.im-btn--line { border-color: currentColor; background: transparent; color: inherit; }
.im-btn--glass {
  background: var(--im-glass-bg); border-color: var(--im-glass-b); color: inherit;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.im-btn--glass:hover { background: rgba(var(--brand-cream-rgb), .18); }
.im-btn:focus-visible { outline: 2px solid var(--im-terra); outline-offset: 3px; }

/* ---- icon chip and hairline ---- */
.im-chip {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px; background: var(--im-tint); color: var(--im-plum-dd);
}
.im-chip svg { width: 20px; height: 20px; }
.im-hair { height: 1px; background: var(--im-line); }
.im-on-dark .im-hair, .im-panel--dark .im-hair, .im-panel--plum .im-hair { background: var(--im-line-dk); }

/* ---- glass. --dark sits on plum or a photo; --light sits on sand. ---- */
.im-glass {
  background: var(--im-glass-bg); border: 1px solid var(--im-glass-b);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.im-glass--light {
  background: rgba(var(--brand-card-rgb), .55); border: 1px solid rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 30px 60px -36px rgba(var(--brand-plum-deepest-rgb), .35), inset 0 1px 0 #fff;
}

/* ---- the ring symbol (assets/brand-ring.svg). Four arcs; the lead arc takes `color`, the
   other three take `stroke`, both inherited into the <use> clone — no style attribute and no
   var() inside the sprite, so it survives a strict CSP and an external <use>.
   Markup: <svg class="im-ring" aria-hidden="true"><use href="assets/brand-ring.svg#ring"/></svg> ---- */
.im-ring { width: 28px; height: 28px; flex-shrink: 0; color: var(--im-terra); stroke: var(--im-sand); }
.im-ring--on-light { stroke: var(--im-plum); }
@media (max-width: 640px) { .im-ring { width: 24px; height: 24px; } }

/* ---- reveal on scroll (the page script adds .is-in). Without JS, or under reduced motion,
   the content is simply there. ---- */
.js-im .im-reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2, .6, .2, 1), transform .7s cubic-bezier(.2, .6, .2, 1); }
.js-im .im-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js-im .im-reveal { opacity: 1; transform: none; transition: none; }
  .im-btn, .im-btn--glass { transition: none; }
}

/* =====================================================
   The Get Access window (access_v1.html; lane 2, 2026-10-22). One source of truth for all eight
   public pages that carry it (index, about, services, resources, blog-press, help, legal,
   contact); the old .access-* rules were removed from styles.css, not left behind.
   Desktop: two columns, the choices on sand at the left and "Why IncMarketry" on plum at the right.
   760px and below: a bottom sheet with the choices FIRST (the title is never cut off), the plum
   panel below as an inset card, 26px top corners, scrolling inside when taller than the screen.
   The markup keeps the plum panel first in source order; the `order` rules below put the
   choices first on every width (verify-get-access proves the phone rule with a forced failure).
   Colours are brand tokens; the tile tints are brand colours mixed with white.
   ===================================================== */
.access-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility 0s linear .22s;
}
/* visible at once on open (a transitioning visibility is still hidden at its first frame, which would
   refuse the focus the script moves onto the window); on close it waits for the fade */
.access-modal.is-open { opacity: 1; visibility: visible; transition: opacity .22s ease, visibility 0s; }
.access-modal[hidden] { display: none; }
.access-modal.is-open[hidden] { display: flex; }
.access-modal-backdrop {
  position: absolute; inset: 0; background: rgba(var(--brand-plum-deepest-rgb), .5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.access-modal-panel {
  position: relative; width: min(940px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain;
  background: var(--im-sand); color: var(--im-ink); border-radius: 28px;
  box-shadow: 0 0 0 1px rgba(var(--brand-plum-deepest-rgb), .06), 0 40px 90px -30px rgba(var(--brand-plum-deepest-rgb), .6);
  transform: translateY(10px) scale(.985); transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.access-modal.is-open .access-modal-panel { transform: none; }
.access-modal-panel:focus { outline: none; }
.access-modal-columns { display: grid; grid-template-columns: 1.05fr 1fr; }
.access-options { padding: 44px 40px 40px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 761px) { .access-options { order: -1; } }

/* The round close button: glass over the plum panel on desktop, a quiet disc on sand in the sheet.
   Drawn 42px (the mockup); the ::after ring makes the tap area 44px (row 171). */
.access-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 42px; height: 42px; padding: 0; border-radius: 50%;
  border: 1px solid var(--im-glass-b); background: var(--im-glass-bg); color: var(--im-sand);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  display: grid; place-items: center; cursor: pointer;
}
.access-modal-close::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; }
.access-modal-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.access-modal-close:hover { background: rgba(var(--brand-cream-rgb), .2); }
.access-modal-close:focus-visible, .access-option-row:focus-visible { outline: 2.5px solid var(--im-tint); outline-offset: 3px; }

.access-modal-title {
  margin: 0; font-weight: 300; letter-spacing: -.025em; line-height: 1.05;
  font-size: clamp(34px, 3.4vw, 46px); color: var(--im-plum-dd);
}
.access-modal-lead { margin: 2px 0 14px; font-size: 16px; line-height: 1.5; color: var(--im-muted); }

/* the two choices */
.access-option-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  padding: 18px; border-radius: 20px; background: #fff; border: 1px solid var(--im-line);
  color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.access-option-row:hover {
  transform: translateY(-2px); border-color: rgba(var(--brand-navy-rgb), .24);
  box-shadow: 0 14px 30px -18px rgba(var(--brand-plum-deepest-rgb), .4);
}
.access-option-text h3 { margin: 0; line-height: 1.2; font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--im-plum-dd); }
.access-option-text p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; color: var(--im-muted); }
.access-option-arrow {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--im-sand) 70%, var(--im-sand-deep)); color: var(--im-plum);
  transition: background .2s, color .2s;
}
.access-option-arrow svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.access-option-row:hover .access-option-arrow { background: var(--im-plum-dd); color: var(--im-sand); }

/* the option and benefit icons are the shared .im-tile (im-tile.css) since ICON TILES A */

/* "Why IncMarketry" on plum */
.access-value-panel {
  position: relative; overflow: hidden; padding: 44px 40px 40px; border-radius: 0 28px 28px 0;
  background: linear-gradient(160deg, var(--im-plum), var(--im-plum-dd)); color: var(--im-sand);
}
.access-value-panel::after {
  content: ""; position: absolute; width: 320px; height: 320px; right: -120px; bottom: -140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--brand-terracotta-tint-rgb), .35), transparent 65%); pointer-events: none;
}
/* The eyebrow: the mockup's terracotta tint on a glass fill measured 3.6:1 on the plum (verify-contrast,
   2026-10-22). The glass border stays; the fill is dropped and the text takes the lighter tint (5.3:1). */
.access-value-panel .im-eyebrow { color: var(--brand-terracotta-tint-light); background: transparent; border-color: var(--im-glass-b); }
.access-value-heading {
  margin: 18px 0 26px; max-width: 22ch; font-weight: 300; letter-spacing: -.02em; line-height: 1.15;
  font-size: clamp(22px, 2vw, 28px); color: var(--im-sand);
}
.access-value-benefits { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 20px; margin: 0; padding: 0; list-style: none; }
.access-value-benefit { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; }
.access-value-benefit h4 { margin: 0; line-height: 1.2; font-size: 15.5px; font-weight: 600; color: var(--im-sand); }
.access-value-benefit p { margin: 3px 0 0; font-size: 14px; line-height: 1.5; color: rgba(var(--brand-cream-rgb), .78); }

/* The chat button would otherwise sit over the window's text (it is above the page, not above this layer). */
body:has(.access-modal.is-open) #chat-widget-root { visibility: hidden; }

/* 760px and below: the bottom sheet, choices first */
@media (max-width: 760px) {
  .access-modal { padding: 0; align-items: flex-end; }
  .access-modal-panel { border-radius: 26px 26px 0 0; max-height: calc(100% - 24px); }
  .access-modal-columns { grid-template-columns: 1fr; }
  .access-options { order: -1; padding: 30px 20px 18px; }
  .access-modal-close { background: rgba(var(--brand-plum-deepest-rgb), .06); border-color: var(--im-line); color: var(--im-plum-dd); }
  .access-value-panel { border-radius: 22px; margin: 0 12px 12px; padding: 26px 20px; }
  .access-value-heading { margin: 14px 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .access-modal, .access-modal-panel, .access-option-row, .access-option-arrow { transition: none; }
  .access-modal-panel { transform: none; }
  .access-option-row:hover { transform: none; }
}

/* ---- MOBILE POLISH (lane 2, 2026-11-07, MOBILE-MARKS "MARKS — lane 2"): one rule per pattern for the public site ----
   P1 finger targets: a small text link gets an invisible, centred 44px tap box (the header's .im-hdr-hit technique),
   so nothing moves or changes to the eye. The links that measured under 44px on a phone: login's "Forgot password?"
   (118x23), demo's "Go to the home page" (154x19). (reset-password.html loads styles.css, which carries the same rule.) */
body.au-login .gate-row a, #demo-home a { position: relative; }
body.au-login .gate-row a::after, #demo-home a::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
/* P2 the chat launcher never covers the end of a page: the footer (the last thing on every page that has the launcher)
   gets bottom room equal to the launcher (56px) + its offset from the edge (24px) + a 16px gap, plus the home
   indicator. Phones and tablets only: on a desktop the launcher sits beside the footer's columns, not over them. */
@media (max-width: 1023.98px) {
  footer.site-footer, footer.ih-foot { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
/* P3 an in-page link (#section) stops below the sticky 72px header, not under it. */
html:has(.im-hdr) { scroll-padding-top: 88px; }
/* P6 symmetry: on a phone a button in an inner page's content is full width, so it never sits flush left with a wide
   empty gutter on its right (services measured 20px left, 119px right). buttons_ledger_v1: one pill, one size. */
@media (max-width: 640px) {
  body.ip-page main .im-btn { width: 100%; }
}
