/* Annata redesign: Home template (roadmap step 5; Ideal Version 3.1, Home template). Design tokens only.
   Shares module.css, pillar.css, industry.css and solutions.css (cards, figures, quotes, split heads, the
   journey screen). Added 2 Dec 2026. */

.an-home [id^="an-home-"] { scroll-margin-top: calc(var(--header-h) + var(--sp-6)); }
.an-home__hero .an-mod__h1 strong { font-weight: inherit; color: var(--action); }

/* ---------- Hero: the live stack (A365's layers on Dynamics 365's), as isometric plates ---------- */
.an-tower {
  --cx: 40%;            /* the stack's centre, across */
  --side-a: 36%;        /* A365 plate side (before the isometric turn) */
  --side-d: 42%;        /* Dynamics 365 plate side */
  --y0: 19%;            /* the top plate's centre, down */
  --gap: 3.3%;          /* between A365 plates */
  --y0d: 63%;           /* the top Dynamics 365 plate's centre */
  --gapd: 4.6%;         /* between Dynamics 365 plates */
  position: relative; width: 100%; aspect-ratio: 10 / 11; margin: 0; min-width: 0;
  font-family: var(--font-sans);
}
.an-tower__layers { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; }
.an-tower__layers--d365 { z-index: 0; }
.an-tower__layers--a365 { z-index: 1; }
.an-tower__layer { position: absolute; inset: 0; }
/* The highlight: the plate lifts (its own translate, so the isometric transform stays), the label changes colour */
.an-tower__layers--a365 .an-tower__layer { z-index: calc(var(--na) - var(--i)); }
.an-tower__layers--d365 .an-tower__layer { z-index: calc(var(--nd) - var(--i)); }
.an-tower__plate {
  position: absolute; left: var(--cx); top: calc(var(--y0) + var(--i) * var(--gap));
  width: var(--side-a); aspect-ratio: 1; border-radius: var(--sp-4);
  background: linear-gradient(135deg, color-mix(in srgb, var(--a-red) 72%, var(--a-white)), var(--a-red));
  box-shadow: var(--sp-2) var(--sp-2) 0 color-mix(in srgb, var(--a-red) 62%, var(--a-black));
  transform: translate(-50%, -50%) scaleY(0.577) rotate(45deg);
  animation: an-tower-lift calc(var(--total) * 0.45s) var(--ease) infinite; animation-delay: calc(var(--k) * 0.45s);
}
.an-tower__layers--d365 .an-tower__plate {
  top: calc(var(--y0d) + var(--i) * var(--gapd)); width: var(--side-d);
  background: linear-gradient(135deg, var(--a-marine), color-mix(in srgb, var(--a-lilac) 70%, var(--a-marine)));
  box-shadow: var(--sp-2) var(--sp-2) 0 color-mix(in srgb, var(--a-marine) 60%, var(--a-black));
}
.an-tower__logo { position: absolute; left: 50%; top: 50%; width: 42%; height: auto; transform: translate(-50%, -50%) rotate(-45deg); filter: brightness(0) invert(1); opacity: 0.92; }
.an-tower__label {
  position: absolute; top: calc(var(--y0) + var(--i) * var(--gap)); left: calc(var(--cx) + var(--side-a) * 0.7071 + var(--sp-6));
  display: flex; align-items: center; color: var(--text); font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: 1; white-space: nowrap;
  transform: translateY(-50%); animation: an-tower-label calc(var(--total) * 0.45s) var(--ease) infinite; animation-delay: calc(var(--k) * 0.45s);
}
.an-tower__label::before { content: ""; position: absolute; right: calc(100% + var(--sp-2)); top: 50%; width: var(--sp-5); border-top: 2px dotted var(--text-muted); }
.an-tower__label::after { content: ""; position: absolute; right: calc(100% + var(--sp-5) + var(--sp-2)); top: calc(50% - var(--sp-1) / 2); width: var(--sp-1); height: var(--sp-1); border-radius: var(--r-full); background: var(--text); }
.an-tower__layers--d365 .an-tower__label { top: calc(var(--y0d) + var(--i) * var(--gapd)); left: calc(var(--cx) + var(--side-d) * 0.7071 + var(--sp-6)); color: var(--a-marine); }
.an-tower__brand { position: absolute; display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--eyebrow); font-size: var(--fs-eyebrow); font-weight: var(--fw-semibold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.an-tower__brand--a365 { top: 0; left: calc(var(--cx) + var(--side-a) * 0.7071 + var(--sp-6)); }
.an-tower__brand--d365 { left: 0; bottom: 0; color: var(--a-marine); }
.an-tower__brand img { width: var(--sp-6); height: auto; }
@keyframes an-tower-lift { 0%, 7%, 100% { translate: 0 0; } 3.5% { translate: 0 calc(-1 * var(--sp-2)); } }
@keyframes an-tower-label { 0%, 7%, 100% { color: inherit; } 3.5% { color: var(--action); } }

/* ---------- Hero: the video button and its dialog ---------- */
.an-home__play { display: inline-flex; align-items: center; gap: var(--sp-2); }
.an-home__play-icon { width: var(--sp-5); height: var(--sp-5); flex: none; }
.an-video { width: min(calc(100% - 2 * var(--side)), calc(var(--container) * 3 / 4)); max-width: none; padding: 0; border: 0; border-radius: var(--r-20); background: var(--a-black); overflow: visible; }
.an-video::backdrop { background: color-mix(in srgb, var(--a-black) 82%, transparent); }
.an-video__frame { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r-20); }
.an-video__frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.an-video form { position: absolute; top: calc(-1 * (var(--sp-7) + var(--sp-2))); right: 0; margin: 0; }
:root .an-video__close { display: grid; place-items: center; width: var(--sp-7); height: var(--sp-7); padding: 0; border: 0; border-radius: var(--r-full); background: var(--a-white); color: var(--a-black); font-size: var(--fs-h3); line-height: 1; cursor: pointer; }
:root .an-video__close:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.an-video .an-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; }

/* ---------- One vehicle's journey: the dark section, the screen held while the stages scroll ---------- */
.an-home__dark { background: var(--surface); color: var(--text); --eyebrow: var(--a-red); }
.an-home__dark .an-mod__h2 { color: var(--text); }
.an-home__dark .an-mod__lead { color: var(--text-muted); }
/* The product screen keeps its light colours on the dark section */
.an-home__dark .an-ind__screens { --surface: var(--a-white); --surface-muted: var(--a-grey-05); --text: var(--a-black); --text-muted: var(--a-dark-grey); --hairline: color-mix(in srgb, var(--a-black) 12%, transparent); color: var(--text); }
/* The machine on the screens in the equipment yellow (Raymond, 2 Dec 2026); the rest of the screen keeps the page red */
.an-home__dark .an-ind__vehicle-icon .an-car { --accent: var(--a-yellow); }
.an-jr { display: grid; gap: var(--sp-6); }
/* The screen's column runs the full height of the stages, so the screen can stay in view while they scroll */
.an-jr__aside { align-self: stretch; }
.an-jr > * { min-width: 0; }
.an-jr__sticky { display: grid; gap: var(--sp-5); }
.an-jr__line { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.an-jr__line::before { content: ""; position: absolute; left: var(--sp-2); right: var(--sp-2); top: calc(var(--sp-2) - 1px); height: 2px; background: color-mix(in srgb, var(--a-white) 30%, transparent); }
.an-jr__dot { position: relative; min-width: 0; }
:root .an-jr__dot a { display: grid; justify-items: start; gap: var(--sp-3); color: var(--text-muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: var(--lh-small); text-decoration: none; }
:root .an-jr__dot a:hover { color: var(--text); }
:root .an-jr__dot a:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); border-radius: var(--sp-1); }
.an-jr__mark { position: relative; z-index: 1; width: var(--sp-4); height: var(--sp-4); border: 2px solid color-mix(in srgb, var(--a-white) 55%, transparent); border-radius: var(--r-full); background: var(--a-black); transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.an-jr__dot.is-done .an-jr__mark { border-color: var(--a-white); background: var(--a-white); }
.an-jr__dot.is-now .an-jr__mark { border-color: var(--a-red); background: var(--a-red); box-shadow: 0 0 0 var(--sp-1) color-mix(in srgb, var(--a-red) 35%, transparent); }
.an-jr__dot.is-now a { color: var(--text); }
.an-jr__status { margin: 0; color: var(--text-muted); font-size: var(--fs-small); }
.an-jr__stages { display: grid; gap: var(--sp-5); margin: 0; padding: 0; list-style: none; }
.an-jr__stage { display: grid; gap: var(--sp-3); align-content: center; padding: var(--sp-6); border: 1px solid color-mix(in srgb, var(--a-white) 16%, transparent); border-radius: var(--r-24); background: color-mix(in srgb, var(--a-white) 7%, var(--a-black)); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
/* Cards stop below whatever is pinned at the top ([id] outweighs the page's general anchor offset) */
.an-home .an-jr__stage[id] { scroll-margin-top: calc(var(--jr-offset, var(--header-h)) + var(--sp-4)); }
/* Narrower screens: each card's copy of its screen (added by home.js), in the screen's light colours */
.an-jr__shot { display: none; --surface: var(--a-white); --surface-muted: var(--a-grey-05); --text: var(--a-black); --text-muted: var(--a-dark-grey); --hairline: var(--a-grey-18); color: var(--text); }
.an-jr__shot .an-ind__screen { display: grid; }
.an-jr__stage.is-active { border-color: var(--a-red); box-shadow: inset var(--accent-rule-h) 0 0 var(--a-red); }
.an-jr__stage p { margin: 0; }
.an-jr__n { color: var(--text-muted); font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: var(--ls-eyebrow); }
:root .an-jr__title { margin: 0; color: var(--text); font-size: var(--fs-h3); font-weight: var(--fw-bold); line-height: var(--lh-h3); }
.an-jr__pill { justify-self: start; padding: var(--sp-1) var(--sp-3); border-radius: var(--r-full); background: color-mix(in srgb, var(--a-white) 16%, transparent); color: var(--text); font-size: var(--fs-small); font-weight: var(--fw-bold); }
.an-jr__caption { color: var(--text-muted); max-width: var(--measure); }
.an-jr__mods { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-5); }
:root .an-jr__mods a { color: var(--text); font-weight: var(--fw-bold); text-decoration: underline; text-underline-offset: 0.2em; }
.an-jr__rail { --surface: color-mix(in srgb, var(--a-white) 7%, var(--a-black)); border-color: color-mix(in srgb, var(--a-white) 30%, transparent); }
:root .an-jr__rail a { color: var(--text); }
.an-home__dark .an-life__rail-label { color: var(--a-red); }

/* ---------- Built to connect: the three blocks ---------- */
.an-home__blocks { display: grid; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.an-home__block { display: grid; gap: var(--sp-3); align-content: start; padding: var(--sp-4); border: 1px solid var(--hairline); border-radius: var(--r-20); background: var(--surface); }
.an-home__block p { margin: 0; color: var(--text-muted); }
.an-home__block-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-16); }
.an-home__block .an-link { justify-self: start; }

/* ---------- Customer stories: the industry chips ---------- */
.an-home__chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
:root .an-home__chip { margin: 0; padding: var(--sp-2) var(--sp-4); border: 1px solid var(--hairline-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: var(--lh-small); cursor: pointer; }
:root .an-home__chip[aria-pressed="true"] { border-color: var(--a-red-700); background: var(--a-red-700); color: var(--a-white); }
:root .an-home__chip:focus { outline: none; }
:root .an-home__chip:focus-visible { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
.an-home .an-story { transition: opacity var(--dur-2) var(--ease); }
.an-home .an-story.is-dim { opacity: 0.35; }

/* ---------- Partners: figures, the scrolling logos, quotes ---------- */
.an-home__proof .an-mod__in { gap: var(--sp-7); }
.an-logos { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, var(--a-black) 8%, var(--a-black) 92%, transparent); mask-image: linear-gradient(90deg, transparent, var(--a-black) 8%, var(--a-black) 92%, transparent); }
.an-logos__track { display: flex; align-items: center; gap: var(--sp-6); width: max-content; margin: 0; padding: 0; list-style: none; animation: an-marquee 120s linear infinite; }
.an-logos:hover .an-logos__track, .an-logos:focus-within .an-logos__track { animation-play-state: paused; }
.an-logos__track img { display: block; width: auto; height: var(--sp-9); }
@keyframes an-marquee { to { transform: translateX(-50%); } }

/* ---------- Layout by width ---------- */
@media (max-width: 599px) {
  .an-tower { --cx: 34%; }
  .an-tower__label { font-size: calc(var(--fs-small) * 0.78); }
  .an-tower__label::before { width: var(--sp-3); }
  .an-tower__label::after { right: calc(100% + var(--sp-3) + var(--sp-2)); }
  .an-tower__label, .an-tower__brand--a365 { left: calc(var(--cx) + var(--side-a) * 0.7071 + var(--sp-5)); }
  .an-tower__layers--d365 .an-tower__label { left: calc(var(--cx) + var(--side-d) * 0.7071 + var(--sp-5)); }
  .an-logos__track img { height: var(--sp-8); }
}
@media (min-width: 768px) {
  .an-home__blocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  /* Narrower screens: each card shows its own screen, and only the progress line stays pinned at the top (the
     column steps aside, so the line is held by the whole journey). Without the script, the screen stays above. */
  .an-jr__aside { display: contents; }
  .an-jr__sticky { position: sticky; top: var(--header-h); z-index: 2; padding: var(--sp-3) 0; background: var(--a-black); }
  .an-jr.is-ready .an-jr__sticky .an-ind__visual, .an-jr__status { display: none; }
  .an-jr.is-ready .an-jr__shot { display: block; }
  .an-jr__shot .an-app { font-size: calc(var(--fs-small) * 0.9); box-shadow: none; }
  .an-jr__shot .an-app__fields { display: none; }
  .an-jr__shot .an-ind__vehicle { grid-template-columns: var(--sp-8) minmax(0, 1fr); }
  .an-jr__shot .an-ind__vehicle > em { display: none; }
  .an-jr__dot-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .an-jr__stage { padding: var(--sp-5); }
}
@media (min-width: 1024px) {
  .an-jr { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: var(--sp-8); }
  .an-jr__sticky { position: sticky; top: calc(var(--header-h) + var(--sp-7)); }
  .an-jr__stage { min-height: calc(var(--sp-9) * 4); }
}
@media (prefers-reduced-motion: reduce) {
  .an-tower__plate, .an-tower__label { animation: none; }
  .an-logos { -webkit-mask-image: none; mask-image: none; }
  .an-logos__track { flex-wrap: wrap; justify-content: center; width: auto; animation: none; }
  .an-logos__track li[aria-hidden="true"] { display: none; }
  .an-home .an-story, .an-jr__stage, .an-jr__mark { transition: none; }
}
