/* AIM Consulting Associates Inc. — tokens follow DESIGN.md (derived from BUILD_PLAN.md v2). */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --bg: #0B0C0D;
  --surface: #131517;
  --line: #25292D;
  --line-strong: #636A72;
  --text: #ECEEEF;
  --muted: #A9AFB5;
  --dim: #8D939A;
  --accent: #E8A33D;
  --on-accent: #0B0C0D;
  --focus: #F2C46D;
  --fluid: #86D3E6;

  --sans: "IBM Plex Sans", ui-sans-serif, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --f-display: clamp(2.5rem, 1.35rem + 4.3vw, 5.25rem);
  --f-h2: clamp(2rem, 1.3rem + 2.6vw, 3.4rem);
  --f-h3: 1.25rem;
  --f-body: 1.0625rem;
  --f-small: 0.9375rem;
  --f-label: 0.8125rem;

  --s-1: .25rem; --s-2: .5rem; --s-3: .75rem; --s-4: 1rem; --s-5: 1.5rem; --s-6: 2rem;
  --s-7: 3rem; --s-8: 4rem; --s-9: 6rem; --s-10: 10rem;
  --section: clamp(5rem, 12vw, 10rem);
  --container: 1240px;
  --gutter: clamp(1rem, 3vw, 2rem);
  --radius: 2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 4rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans);
  font-size: var(--f-body); line-height: 1.62; font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, figure { margin: 0; }
a { color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.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 { position: absolute; left: var(--s-4); top: -10rem; z-index: 100; padding: var(--s-3) var(--s-4);
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none; border-radius: var(--radius); }
.skip:focus { top: var(--s-3); }

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

/* Type */
.label { font-family: var(--mono); font-size: var(--f-label); font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--dim); }
h1, .display { font-size: var(--f-display); line-height: 1.02; letter-spacing: -.028em; font-weight: 500; }
h2 { font-size: var(--f-h2); line-height: 1.06; letter-spacing: -.022em; font-weight: 500; }
h3 { font-size: var(--f-h3); line-height: 1.3; font-weight: 600; letter-spacing: -.005em; }
.lede { font-size: clamp(1.125rem, 1rem + .45vw, 1.375rem); line-height: 1.5; color: var(--muted); max-width: 40ch; }
.prose p { max-width: 64ch; color: var(--muted); }
.prose p + p { margin-top: var(--s-4); }
.small { font-size: var(--f-small); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgb(11 12 13 / .92); border-bottom: 1px solid var(--line); }
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: rgb(11 12 13 / .78); backdrop-filter: blur(10px); }
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: var(--s-6); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); text-decoration: none; font-weight: 500;
  letter-spacing: -.005em; min-height: 44px; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand-name { white-space: nowrap; }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s-5); }
.nav a { text-decoration: none; color: var(--muted); font-size: var(--f-small); min-height: 44px;
  display: inline-flex; align-items: center; }
.nav a:hover { color: var(--text); }
.nav .nav-cta { color: var(--text); border: 1px solid var(--line-strong); padding: 0 var(--s-4); border-radius: var(--radius); }
.nav .nav-cta:hover { border-color: var(--accent); }
@media (max-width: 47.99rem) {
  .nav .nav-section { display: none; }
  .brand-name .brand-long { display: none; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4) var(--s-6); }
.button { display: inline-flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: .625rem var(--s-5); line-height: 1.3;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
  border-radius: var(--radius); border: 1px solid var(--accent); transition: background-color .16s var(--ease), transform .16s var(--ease); }
.button:hover { background: #F0B455; }
.button:active { transform: translateY(1px); }
.button .arrow { font-family: var(--mono); font-weight: 500; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .3em; }
.text-link:hover { text-decoration-color: var(--accent); }

/* Sections */
.section { padding-block: var(--section); border-top: 1px solid var(--line); }
.rail { display: grid; gap: var(--s-6); }
@media (min-width: 56rem) {
  .rail { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s-7); }
}
.rail-head { display: grid; gap: var(--s-4); align-content: start; }

/* Hero */
.hero { padding-block: clamp(3rem, 8vw, 7rem) clamp(4rem, 9vw, 8rem); }
.hero-grid { display: grid; gap: var(--s-7); align-items: center; }
.hero-copy { display: grid; gap: var(--s-5); }
.hero-copy h1 { max-width: 14ch; }
.hero .fact { color: var(--dim); }
.hero-figure { position: relative; }
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .hero-figure { margin-right: calc(-1 * max(var(--gutter), (100vw - var(--container)) / 2)); }
}

/* Scene host (poster first, canvas when ready) */
.scene-host { position: relative; aspect-ratio: 4 / 3; width: 100%; outline-offset: -2px; }
.scene-host > img, .scene-host > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene-host > canvas { opacity: 0; transition: opacity .5s var(--ease); touch-action: pan-y; cursor: grab; }
.scene-host.is-live > canvas { opacity: 1; }
.scene-host.is-live > img { visibility: hidden; transition: visibility 0s .5s; }
.scene-host:active > canvas { cursor: grabbing; }
.figure-caption { margin-top: var(--s-3); color: var(--dim); font-size: var(--f-small); max-width: 60ch; }
.scene-hint { display: none; }
.js .scene-host.is-live + .figure-caption .scene-hint { display: inline; }

/* What we do */
.capabilities { list-style: none; padding: 0; display: grid; }
.capability { display: grid; gap: var(--s-3); padding-block: var(--s-6); border-top: 1px solid var(--line); }
.capability:last-child { border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) {
  .capability { grid-template-columns: 4.5rem minmax(0, 15rem) minmax(0, 1fr); gap: var(--s-5); align-items: baseline; }
}
.capability .label { color: var(--accent); }
.capability p { color: var(--muted); max-width: 58ch; }

/* Demonstration */
.demo-intro { display: grid; gap: var(--s-4); margin-bottom: var(--s-8); }
.demo-intro p { max-width: 58ch; color: var(--muted); }
.demo { display: grid; gap: var(--s-6); }
.demo-stage { display: grid; gap: var(--s-4); }
.demo-stage .scene-host { aspect-ratio: 4 / 3; background: var(--surface); border: 1px solid var(--line); }
.demo-steps { list-style: none; padding: 0; display: grid; gap: var(--s-5); counter-reset: step; }
.demo-step { border-top: 1px solid var(--line); padding-top: var(--s-4); display: grid; gap: var(--s-2); }
.demo-step p { color: var(--muted); max-width: 46ch; }
.demo-step .label { color: var(--dim); }
.demo-step.is-current .label { color: var(--accent); }
@media (min-width: 56rem) {
  .demo { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--s-8); align-items: start; }
  .demo-stage { position: sticky; top: calc(var(--header-h) + 3vh); grid-column: 2; grid-row: 1; }
  .demo-stage .scene-host { aspect-ratio: auto; height: min(68vh, 44rem); }
  .demo-steps { grid-column: 1; grid-row: 1; gap: 0; }
  .demo-step { min-height: 62vh; align-content: start; padding-top: var(--s-5); }
  .demo-step:last-child { min-height: 40vh; }
}

.controls { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); align-items: center; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.segmented button, .toggle { font: inherit; font-size: var(--f-small); color: var(--muted); background: transparent;
  border: 0; min-height: 44px; padding: 0 var(--s-4); cursor: pointer; border-radius: 0; }
.segmented button + button { border-left: 1px solid var(--line-strong); }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.segmented button:hover:not([aria-pressed="true"]), .toggle:hover { color: var(--text); }
.toggle { border: 1px solid var(--line-strong); border-radius: var(--radius); display: inline-flex; align-items: center; gap: var(--s-2); }
.toggle[aria-pressed="true"] { border-color: var(--fluid); color: var(--text); }
.toggle .swatch { width: .75rem; height: .75rem; border-radius: 50%; border: 1px solid var(--fluid); }
.toggle[aria-pressed="true"] .swatch { background: var(--fluid); }
.controls[hidden] { display: none; }

.colorbar { display: grid; gap: var(--s-2); max-width: 26rem; }
.colorbar-ramp { height: 10px; border-radius: 1px;
  background: linear-gradient(90deg, #24384A, #4C4466 25%, #9A4A5E 50%, #D9733C 75%, #F4C25B); }
.colorbar-ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: var(--f-label); color: var(--dim); }
.legend-opening { display: none; align-items: center; gap: var(--s-2); font-size: var(--f-small); color: var(--muted); }
.legend-opening.is-visible { display: inline-flex; }
.legend-opening .swatch { width: .9rem; height: .9rem; background: var(--fluid); border-radius: 1px; }

.synthetic { display: inline-flex; align-items: center; gap: var(--s-2); font-family: var(--mono); font-size: var(--f-label);
  letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.synthetic::before { content: ""; width: .5rem; height: .5rem; background: var(--accent); }

.demo-notes { margin-top: var(--s-8); display: grid; gap: var(--s-6); }
@media (min-width: 56rem) { .demo-notes { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: var(--s-8); } }
.inputs { border: 1px solid var(--line); border-radius: var(--radius); }
.inputs summary { cursor: pointer; padding: var(--s-4); min-height: 44px; list-style-position: inside; color: var(--text); }
.inputs dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); padding: 0 var(--s-4) var(--s-4); font-size: var(--f-small); }
.inputs dt { color: var(--dim); }
.inputs dd { margin: 0; }

/* How we work */
.steps { list-style: none; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { display: grid; gap: var(--s-2); padding-block: var(--s-5); border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps .label { color: var(--accent); }
.steps p { color: var(--muted); max-width: 52ch; }
@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
  .steps li { border: 0; border-left: 1px solid var(--line); padding: var(--s-5) var(--s-5) var(--s-2); align-content: start; }
  .steps li:last-child { border-bottom: 0; border-right: 1px solid var(--line); }
}

/* Contact */
.contact-grid { display: grid; gap: var(--s-7); }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s-8); } }
.contact-copy { display: grid; gap: var(--s-5); align-content: start; }
.contact-copy .email { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); font-weight: 500; letter-spacing: -.01em; overflow-wrap: anywhere; }
.contact-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2.5rem); display: grid; gap: var(--s-5); }
.contact-panel ul { padding-left: 1.1rem; color: var(--muted); display: grid; gap: var(--s-2); }
.contact-panel iframe { width: 100%; min-height: 600px; border: 0; }
.privacy-note { font-size: var(--f-small); color: var(--dim); max-width: 56ch; }
.privacy-note a { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: var(--s-8) var(--s-7); font-size: var(--f-small); color: var(--muted); }
.footer-grid { display: grid; gap: var(--s-6); }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: var(--s-1); }
.site-footer a { color: var(--muted); text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.site-footer a:hover { color: var(--text); text-decoration: underline; text-underline-offset: .25em; }
.site-footer .legal-name { color: var(--text); font-weight: 500; }
.footer-base { margin-top: var(--s-7); color: var(--dim); display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }

/* Simple pages */
.page { padding-block: clamp(3rem, 8vw, 6rem) var(--section); }
.page .prose { display: grid; gap: var(--s-4); }
.page h1 { font-size: var(--f-h2); margin-bottom: var(--s-5); }
.page h2 { font-size: 1.375rem; letter-spacing: -.01em; margin-top: var(--s-6); }
.page .prose ul { color: var(--muted); max-width: 64ch; padding-left: 1.2rem; display: grid; gap: var(--s-2); }
.page .prose a:not(.button) { color: var(--text); text-underline-offset: .2em; }
.page .prose code { font-family: var(--mono); font-size: .9em; }

/* Motion: progressive, meaning-bearing, and off under reduced motion */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal-load > * { opacity: 0; transform: translateY(12px); animation: rise .7s var(--ease) forwards; }
  .js .reveal-load > *:nth-child(2) { animation-delay: .06s; }
  .js .reveal-load > *:nth-child(3) { animation-delay: .12s; }
  .js .reveal-load > *:nth-child(4) { animation-delay: .18s; }
  .js .reveal-load > *:nth-child(5) { animation-delay: .24s; }
  .js .hero-figure { opacity: 0; animation: fade 1s var(--ease) .15s forwards; }

  @supports (animation-timeline: view()) {
    .js .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  }
  @supports not (animation-timeline: view()) {
    .js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
    .js .reveal.is-in { opacity: 1; transform: none; }
  }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

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

@media (forced-colors: active) {
  .button { border: 2px solid ButtonText; }
  .segmented button[aria-pressed="true"] { outline: 2px solid Highlight; }
  .colorbar-ramp, .synthetic::before, .legend-opening .swatch { forced-color-adjust: none; }
}

@media print {
  .site-header, .scene-host canvas, .controls { display: none; }
  body { background: #fff; color: #000; }
}

/* Section-specific spacing (no inline styles: the content security policy forbids them) */
.steps { margin-top: var(--s-8); }
.contact-panel .small { color: var(--muted); }
