/* =========================================================================
   Alpha Oak Partners — Global micro-interactions
   Loaded after main.css. Subtle hover, focus, scroll; respects reduced motion.
   ========================================================================= */

:root {
  /* Micro-interaction tokens (align with main.css --t-* / --ease-smooth) */
  --ao-motion-fast:   150ms;
  --ao-motion-base:   220ms;
  --ao-motion-slow:   380ms;
  --ao-motion-ease:   cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ao-motion-ease-out: cubic-bezier(0.33, 1, 0.68, 1);
  --ao-lift-xs:       -1px;
  --ao-lift-sm:       -2px;
  --ao-lift-md:       -3px;
  --ao-scale-hover:   1.02;
  --ao-scale-media:   1.03;
  --ao-reveal-distance: 14px;
  --ao-focus-ring:    0 0 0 3px rgba(235, 0, 27, 0.14);
  --ao-heading-accent: var(--c-brand-orange);
  --ao-heading-accent-soft: rgba(255, 95, 0, 0.42);
  --ao-heading-underline-w: 2.75rem;
}

/* ── Reduced motion: instant state, no decorative motion ─────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ao-header__inner,
  .ao-btn,
  .ao-card,
  .ao-post-card,
  .ao-link,
  .ao-nav__link,
  [data-ao-reveal],
  .ao-heading--accent,
  [data-ao-heading-accent],
  .ao-page-hero__title,
  .ao-home-hero__headline,
  .ao-hero__title,
  .ao-section-header .ao-h2,
  .ao-lead,
  .ao-cta-section .ao-h2,
  .ao-text-hover,
  .ao-country-subpage__hiw-headline,
  .ao-mc-opp-pullquote,
  .ao-section-header .ao-h2,
  .ao-cta-section .ao-h2,
  .ao-home-statement__headline,
  .ao-home-white-card__heading,
  .ao-image-quote blockquote {
    transition-duration: 0.01ms !important;
  }

  .ao-header--is-scrolled .ao-header__inner {
    transform: none;
  }

  [data-ao-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .ao-heading--accent::after,
  [data-ao-heading-accent]::after,
  .ao-page-hero__title::after,
  .ao-home-hero__headline::after,
  .ao-hero__title::after {
    filter: none;
    box-shadow: none;
  }
}

/* ── Calm overrides: tone down heavy hovers from main.css (pointer only) ─── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-prose p:hover,
  .ao-section > .ao-container:hover,
  .ao-section-intro:hover,
  .ao-lead:hover,
  .ao-page-hero__title:hover,
  .ao-page-hero__sub:hover,
  .ao-hero__sub:hover,
  .ao-section .ao-h2:hover,
  .ao-section .ao-h3:hover,
  .ao-cta-section .ao-h2:hover,
  .ao-cta-section__sub:hover,
  .ao-testimonial__quote:hover,
  .ao-image-quote blockquote:hover {
    transform: none;
  }

  .ao-section-header:hover {
    transform: none;
  }

  .ao-card:hover .ao-card__icon,
  .ao-trust-item:hover .ao-trust-item__icon,
  .ao-step:hover .ao-step__badge--icon,
  .ao-step:hover .ao-step__badge--num,
  .ao-office-card:hover .ao-office-card__flag,
  .ao-faq-cta-icon:hover {
    transform: scale(1.04);
  }

  /* Homepage tiles + diff cards: keep bespoke hovers from home.css only */
  .ao-home-tile:hover,
  .ao-home-diff__item:hover {
    transform: none;
    box-shadow: none;
  }

  .ao-btn {
    transform: none;
  }

  .ao-btn:hover {
    transform: translateY(var(--ao-lift-xs));
  }

  .ao-btn:active {
    transform: translateY(0);
  }
}

/* ── Header: subtle compact on scroll (class from animations.js) ─────────── */

@media (prefers-reduced-motion: no-preference) {
  .ao-header__inner {
    transition:
      background var(--ao-motion-base) var(--ao-motion-ease),
      border-color var(--ao-motion-base) var(--ao-motion-ease),
      box-shadow var(--ao-motion-base) var(--ao-motion-ease),
      transform var(--ao-motion-slow) var(--ao-motion-ease-out);
  }

  .ao-header--is-scrolled .ao-header__inner {
    transform: scale(0.992);
  }
}

/* ── Links: underline grow + colour (content + footer) ─────────────────────── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-link,
  .ao-prose a:not(.ao-btn):not(.ao-card__link),
  .ao-accordion__content a {
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
    transition:
      color var(--ao-motion-fast) var(--ao-motion-ease),
      text-decoration-color var(--ao-motion-base) var(--ao-motion-ease);
  }

  .ao-link:hover,
  .ao-prose a:not(.ao-btn):not(.ao-card__link):hover,
  .ao-accordion__content a:hover {
    color: var(--c-brand-red);
    text-decoration-color: var(--c-brand-red);
  }

  .ao-card__link {
    transition: gap var(--ao-motion-base) var(--ao-motion-ease), color var(--ao-motion-fast) ease;
  }
}

/* ── Buttons & CTAs: consistent lift + shadow (not header pill CTA) ───────── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-btn:not(.ao-header__cta),
  .ao-home-btn {
    transition:
      transform var(--ao-motion-base) var(--ao-motion-ease-out),
      box-shadow var(--ao-motion-base) var(--ao-motion-ease),
      background var(--ao-motion-fast) ease,
      color var(--ao-motion-fast) ease,
      border-color var(--ao-motion-fast) ease;
  }

  .ao-btn:not(.ao-header__cta):hover,
  .ao-home-btn:hover {
    transform: translateY(var(--ao-lift-sm));
    box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.16);
  }

  .ao-btn--primary:hover {
    box-shadow: 0 6px 20px -6px rgba(235, 0, 27, 0.28);
  }
}

.ao-btn:focus-visible,
.ao-home-btn:focus-visible {
  outline: 2px solid var(--c-brand-red);
  outline-offset: 3px;
  box-shadow: var(--ao-focus-ring);
}

/* ── Cards & tiles: lift + shadow (interactive surfaces) ─────────────────── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-card,
  .ao-post-card,
  .ao-team-card,
  .ao-office-card,
  .ao-country-hub__pillar,
  .ao-mc-opp-related__link,
  .ao-country-subpage__panel-card {
    transition:
      transform var(--ao-motion-slow) var(--ao-motion-ease-out),
      box-shadow var(--ao-motion-slow) var(--ao-motion-ease),
      border-color var(--ao-motion-base) var(--ao-motion-ease);
  }

  .ao-card:hover,
  .ao-post-card:hover,
  .ao-team-card:hover,
  .ao-office-card:hover,
  .ao-country-hub__pillar:hover,
  .ao-mc-opp-related__link:hover,
  .ao-country-subpage__panel-card:hover {
    transform: translateY(var(--ao-lift-md));
    box-shadow: var(--shadow-card-hover);
  }

  .ao-card__media img,
  .ao-card__image img,
  .ao-post-card__thumb img,
  .ao-team-card__photo img,
  .ao-guidance-photo img,
  .ao-feature-block__media img,
  .ao-sectors-row__image img {
    transition: transform var(--ao-motion-slow) var(--ao-motion-ease-out);
  }

  .ao-card:hover .ao-card__media img,
  .ao-card:hover .ao-card__image img,
  .ao-post-card:hover .ao-post-card__thumb img,
  .ao-team-card:hover .ao-team-card__photo img,
  .ao-guidance-photo:hover img,
  .ao-feature-block__media:hover img,
  .ao-sectors-row__image:hover img {
    transform: scale(var(--ao-scale-media));
  }
}

/* ── Nav: desktop links + mobile drawer rows ───────────────────────────────── */

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-nav__link:not(.ao-nav__link--flyout):not(.ao-nav__link--solutions) {
    transition: color var(--ao-motion-fast) ease, opacity var(--ao-motion-fast) ease;
  }

  .ao-mobile-menu__link,
  .ao-mobile-menu__sub-link {
    transition:
      background var(--ao-motion-fast) ease,
      color var(--ao-motion-fast) ease,
      padding-left var(--ao-motion-base) var(--ao-motion-ease);
  }

  .ao-mobile-menu__link:hover,
  .ao-mobile-menu__sub-link:hover {
    padding-left: calc(var(--sp-4) + 2px);
  }

  .ao-footer__link-row {
    transition:
      color var(--ao-motion-fast) ease,
      transform var(--ao-motion-base) var(--ao-motion-ease);
  }

  .ao-footer__link-row:hover {
    transform: translateX(3px);
  }
}

/* ── Forms: hover border hint + focus ring ─────────────────────────────────── */

.ao-form-field input,
.ao-form-field select,
.ao-form-field textarea {
  transition:
    border-color var(--ao-motion-fast) ease,
    box-shadow var(--ao-motion-base) var(--ao-motion-ease),
    background var(--ao-motion-fast) ease;
}

@media (hover: hover) {
  .ao-form-field input:hover:not(:focus),
  .ao-form-field select:hover:not(:focus),
  .ao-form-field textarea:hover:not(:focus) {
    border-color: var(--c-primary-300);
  }
}

.ao-form-field input:focus,
.ao-form-field select:focus,
.ao-form-field textarea:focus {
  border-color: var(--c-brand-red);
  box-shadow: var(--ao-focus-ring);
}

.ao-accordion__trigger {
  transition:
    background var(--ao-motion-fast) ease,
    color var(--ao-motion-fast) ease;
}

.ao-accordion__trigger[aria-expanded="true"] .ao-accordion__icon::after {
  transition: transform var(--ao-motion-base) var(--ao-motion-ease-out);
}

/* ── FAQ tabs ─────────────────────────────────────────────────────────────── */

.ao-faq-tab {
  transition:
    color var(--ao-motion-fast) ease,
    border-color var(--ao-motion-base) ease,
    background var(--ao-motion-fast) ease;
}

/* ── Scroll reveal utility ([data-ao-reveal] + animations.js) ─────────────── */

[data-ao-reveal] {
  opacity: 0;
  transform: translateY(var(--ao-reveal-distance));
  transition:
    opacity var(--anim-duration-base) var(--anim-ease-out),
    transform var(--anim-duration-base) var(--anim-ease-out-strong);
}

[data-ao-reveal].ao-reveal--visible,
[data-ao-reveal].is-revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-ao-reveal="fade"] {
  transform: none;
}

[data-ao-reveal="scale"] {
  transform: scale(0.985);
}

[data-ao-reveal="scale"].ao-reveal--visible,
[data-ao-reveal="scale"].is-revealed {
  transform: scale(1);
}

/* Staggered children (.ao-stagger from animations.js) */
.ao-stagger > * {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--anim-duration-base) var(--anim-ease-out),
    transform var(--anim-duration-base) var(--anim-ease-out);
}

.ao-stagger.ao-stagger--ready > * {
  opacity: 1;
  transform: translateY(0);
}

.ao-stagger.ao-stagger--ready > *:nth-child(1)  { transition-delay: 0s; }
.ao-stagger.ao-stagger--ready > *:nth-child(2)  { transition-delay: 0.05s; }
.ao-stagger.ao-stagger--ready > *:nth-child(3)  { transition-delay: 0.1s; }
.ao-stagger.ao-stagger--ready > *:nth-child(4)  { transition-delay: 0.15s; }
.ao-stagger.ao-stagger--ready > *:nth-child(5)  { transition-delay: 0.2s; }
.ao-stagger.ao-stagger--ready > *:nth-child(6)  { transition-delay: 0.25s; }
.ao-stagger.ao-stagger--ready > *:nth-child(7)  { transition-delay: 0.3s; }
.ao-stagger.ao-stagger--ready > *:nth-child(8)  { transition-delay: 0.35s; }
.ao-stagger.ao-stagger--ready > *:nth-child(n+9) { transition-delay: 0.4s; }

/* Text selection accent */
::selection {
  background: rgba(255, 95, 0, 0.18);
  color: var(--c-ink);
}

/* ── Heading accents: glow underline, click-orange, subtle text hover ───── */

.ao-heading--accent,
[data-ao-heading-accent],
.ao-page-hero__title,
.ao-home-hero__headline,
.ao-hero__title {
  position: relative;
  display: inline-block;
  max-width: 100%;
  padding-bottom: 0.14em;
  cursor: default;
  -webkit-tap-highlight-color: transparent;
  transition:
    color var(--ao-motion-base) var(--ao-motion-ease),
    transform var(--ao-motion-base) var(--ao-motion-ease-out),
    letter-spacing var(--ao-motion-slow) var(--ao-motion-ease);
}

/* Soft orange blur underline — hero + opt-in section titles only */
.ao-heading--accent::after,
[data-ao-heading-accent]::after,
.ao-page-hero__title::after,
.ao-home-hero__headline::after,
.ao-hero__title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0.06em;
  width: var(--ao-heading-underline-w);
  height: 3px;
  border-radius: var(--r-full);
  background: linear-gradient(
    90deg,
    var(--ao-heading-accent) 0%,
    var(--c-brand-red) 100%
  );
  opacity: 0.72;
  filter: blur(1.5px);
  box-shadow:
    0 2px 14px var(--ao-heading-accent-soft),
    0 0 20px rgba(255, 95, 0, 0.22);
  pointer-events: none;
  transition:
    width var(--ao-motion-slow) var(--ao-motion-ease-out),
    opacity var(--ao-motion-base) var(--ao-motion-ease);
}

.ao-heading--accent.is-active::after,
[data-ao-heading-accent].is-active::after,
.ao-page-hero__title.is-active::after,
.ao-home-hero__headline.is-active::after,
.ao-hero__title.is-active::after,
.ao-heading--accent:active::after,
[data-ao-heading-accent]:active::after,
.ao-page-hero__title:active::after,
.ao-home-hero__headline:active::after,
.ao-hero__title:active::after {
  width: calc(var(--ao-heading-underline-w) + 1.25rem);
  opacity: 0.95;
}

/* Click / selected: brand orange (persists via .is-active from animations.js) */
.ao-heading--accent.is-active,
[data-ao-heading-accent].is-active,
.ao-page-hero__title.is-active,
.ao-home-hero__headline.is-active,
.ao-hero__title.is-active,
.ao-heading--accent:active,
[data-ao-heading-accent]:active,
.ao-page-hero__title:active,
.ao-home-hero__headline:active,
.ao-hero__title:active {
  color: var(--ao-heading-accent);
}

.ao-page-hero__title.is-active em,
.ao-page-hero__title:active em,
.ao-home-hero__headline.is-active em,
.ao-home-hero__headline:active em,
.ao-hero__title.is-active em,
.ao-hero__title:active em,
.ao-heading--accent.is-active em,
.ao-heading--accent:active em,
[data-ao-heading-accent].is-active em,
[data-ao-heading-accent]:active em {
  color: var(--ao-heading-accent);
}

.ao-page-hero--dark .ao-page-hero__title.is-active strong,
.ao-page-hero--dark .ao-page-hero__title:active strong {
  color: var(--ao-heading-accent);
}

/* Subtle “alive” text hover — accent headings + section titles + leads */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-heading--accent:hover,
  [data-ao-heading-accent]:hover,
  .ao-page-hero__title:hover,
  .ao-home-hero__headline:hover,
  .ao-hero__title:hover {
    transform: translateY(var(--ao-lift-xs));
    letter-spacing: 0.008em;
  }

  .ao-page-hero__title:hover {
    color: rgba(255, 255, 255, 0.98);
  }

  .ao-page-hero__title.is-active:hover,
  .ao-page-hero__title:active:hover {
    color: var(--ao-heading-accent);
  }

  .ao-section-header .ao-h2 {
    transition:
      color var(--ao-motion-base) var(--ao-motion-ease),
      transform var(--ao-motion-base) var(--ao-motion-ease-out),
      letter-spacing var(--ao-motion-slow) var(--ao-motion-ease);
  }

  .ao-section-header .ao-h2:hover {
    transform: translateY(var(--ao-lift-xs));
    letter-spacing: 0.006em;
  }

  .ao-section--dark .ao-section-header .ao-h2:hover {
    color: rgba(255, 255, 255, 0.96);
  }

  .ao-lead,
  .ao-page-hero__sub,
  .ao-cta-section__sub {
    transition:
      color var(--ao-motion-base) var(--ao-motion-ease),
      transform var(--ao-motion-base) var(--ao-motion-ease-out),
      letter-spacing var(--ao-motion-slow) var(--ao-motion-ease);
  }

  .ao-lead:hover,
  .ao-page-hero__sub:hover,
  .ao-cta-section__sub:hover {
    transform: translateY(var(--ao-lift-xs));
    letter-spacing: 0.004em;
  }
}

/* Centered heroes: keep underline aligned */
.ao-text-center .ao-heading--accent::after,
.ao-text-center [data-ao-heading-accent]::after,
.ao-page-hero--center .ao-page-hero__title::after {
  left: 50%;
  transform: translateX(-50%);
}

.ao-heading--accent:focus-visible,
[data-ao-heading-accent]:focus-visible,
.ao-page-hero__title:focus-visible,
.ao-home-hero__headline:focus-visible,
.ao-hero__title:focus-visible {
  outline: 2px solid var(--ao-heading-accent);
  outline-offset: 6px;
  border-radius: var(--r-sm);
}

/* ── Emphasis copy: alive hover motion (major headlines + pull quotes) ───── */

.ao-text-hover,
.ao-country-subpage__hiw-headline,
.ao-mc-opp-pullquote,
.ao-country-subpage__poster-headline,
.ao-country-subpage__imgfeat-headline,
.ao-country-subpage__imageband-headline,
.ao-country-subpage__panel-headline,
.ao-country-subpage__circles-headline,
.ao-country-subpage__ekgp-headline,
.ao-country-hub__sechead-title,
.ao-section-header .ao-h2,
.ao-cta-section .ao-h2,
.ao-home-statement__headline,
.ao-home-white-card__heading,
.ao-home-experience__headline,
.ao-home-how-we__title,
.ao-home-stats__title,
.ao-home-insights__title,
.ao-home-opp-venn__intro-title,
.ao-feature-block__title,
.ao-hww-rhythm__title,
.ao-image-quote blockquote,
.ao-testimonial__quote {
  cursor: default;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .ao-text-hover,
  .ao-country-subpage__hiw-headline,
  .ao-mc-opp-pullquote,
  .ao-country-subpage__poster-headline,
  .ao-country-subpage__imgfeat-headline,
  .ao-country-subpage__imageband-headline,
  .ao-country-subpage__panel-headline,
  .ao-country-subpage__circles-headline,
  .ao-country-subpage__ekgp-headline,
  .ao-country-hub__sechead-title,
  .ao-section-header .ao-h2,
  .ao-cta-section .ao-h2,
  .ao-home-statement__headline,
  .ao-home-white-card__heading,
  .ao-home-experience__headline,
  .ao-home-how-we__title,
  .ao-home-stats__title,
  .ao-home-insights__title,
  .ao-home-opp-venn__intro-title,
  .ao-feature-block__title,
  .ao-hww-rhythm__title,
  .ao-image-quote blockquote,
  .ao-testimonial__quote {
    transition:
      transform var(--ao-motion-base) var(--ao-motion-ease-out),
      letter-spacing var(--ao-motion-slow) var(--ao-motion-ease),
      color var(--ao-motion-base) var(--ao-motion-ease);
  }

  /* Default emphasis shift — beats calm overrides + scroll-reveal transform */
  .ao-text-hover:hover,
  .ao-country-subpage__poster-headline:hover,
  .ao-country-subpage__imgfeat-headline:hover,
  .ao-country-subpage__panel-headline:hover,
  .ao-country-subpage__circles-headline:hover,
  .ao-country-subpage__ekgp-headline:hover,
  .ao-country-hub__sechead-title:hover,
  .ao-section-header .ao-h2:hover,
  .ao-cta-section .ao-h2:hover,
  .ao-home-statement__headline:hover,
  .ao-home-white-card__heading:hover,
  .ao-home-experience__headline:hover,
  .ao-home-how-we__title:hover,
  .ao-home-stats__title:hover,
  .ao-home-insights__title:hover,
  .ao-home-opp-venn__intro-title:hover,
  .ao-feature-block__title:hover,
  .ao-hww-rhythm__title:hover,
  .ao-text-hover.ao-reveal--visible:hover,
  .ao-mc-opp-pullquote.ao-reveal.ao-reveal--visible.ao-reveal--text:hover,
  .ao-country-subpage__poster-headline.ao-reveal.ao-reveal--visible:hover {
    transform: translate3d(3px, -5px, 0);
    letter-spacing: -0.01em;
    color: #141414;
  }

  /* How-it-works column headline */
  .ao-country-subpage__hiw-headline:hover,
  .ao-text-hover.ao-country-subpage__hiw-headline:hover {
    transform: translate3d(2px, -4px, 0);
    letter-spacing: -0.025em;
    color: #141414;
  }

  /* Large pull quotes */
  .ao-mc-opp-pullquote:hover,
  .ao-text-hover.ao-mc-opp-pullquote:hover {
    transform: translate3d(4px, -5px, 0);
    letter-spacing: -0.02em;
    color: #141414;
  }

  /* Light text on dark bands / quote sections */
  .ao-image-quote blockquote:hover,
  .ao-testimonial__quote:hover,
  .ao-country-subpage__imageband-headline:hover {
    transform: translate3d(3px, -5px, 0);
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 1);
  }

  .ao-section-header--light .ao-h2:hover,
  .ao-section--dark .ao-section-header .ao-h2:hover {
    color: rgba(255, 255, 255, 0.98);
  }

  .ao-cta-section.ao-section--dark .ao-h2:hover {
    color: rgba(255, 255, 255, 0.98);
  }
}

/* ── Scroll progress — site-wide, low-contrast top cue ─────────────────────── */

:root {
  --ao-scroll-progress-h: 1.5px;
}

@media (min-width: 1024px) {
  :root {
    --ao-scroll-progress-h: 2px;
  }
}

.ao-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10002;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 0;
  height: calc(var(--ao-scroll-progress-h) + env(safe-area-inset-top, 0px));
  pointer-events: none;
  background: transparent;
  overflow: hidden;
  opacity: 0;
  transition: opacity 280ms var(--ao-motion-ease-out);
}

.ao-scroll-progress--ready.ao-scroll-progress--active {
  opacity: 1;
}

.ao-scroll-progress__fill {
  display: block;
  width: 100%;
  height: var(--ao-scroll-progress-h);
  transform: scaleX(0);
  transform-origin: left center;
  background: rgba(235, 0, 27, 0.42);
  will-change: transform;
}

@media (min-width: 1024px) {
  .ao-scroll-progress__fill {
    background: rgba(235, 0, 27, 0.5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ao-scroll-progress {
    transition: none;
  }
}
