/* KernelStats motion system (spec 190).
   One easing and three durations. Transform and opacity only, so nothing moves the layout.
   Rules that hide content before it animates exist only under html.motion, a class that
   assets/motion.js adds after marking what is already on screen; without the script every
   element keeps its static, finished state. Everything is still under reduced motion. */
:root{--m-ease:cubic-bezier(.2,.7,.2,1);--m-fast:160ms;--m-mid:420ms;--m-slow:700ms;--m-rise:16px;--m-step:6s}

/* 7 · Page transitions: a short cross-fade between pages, with the header and Oobi held still. */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:var(--m-mid);animation-timing-function:var(--m-ease)}
.site-header{view-transition-name:site-header}
.kernel-guide{view-transition-name:oobi-guide}
::view-transition-old(site-header),::view-transition-old(oobi-guide){animation:none;opacity:0}
::view-transition-new(site-header),::view-transition-new(oobi-guide){animation:none}

/* 3 · Screenshots: a soft shadow is part of the finished look; it grows in as the frame lifts. */
.project-figure>.product-shot,.biz-window,.intro-video-frame{box-shadow:0 18px 40px -26px #122f7347}

/* The pause control the tour stepper adds (motion.js); without the script it does not exist. */
.m-stepper-toggle{position:absolute;right:0;top:4px;z-index:1;display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 2px;border:0;background:none;color:var(--muted);font-size:12px;font-weight:550}
.m-stepper-toggle:hover{color:var(--navy)}
.m-stepper-toggle>svg{width:12px;height:12px;flex:none;fill:currentColor}
.m-stepper-toggle .m-icon-play{display:none}.m-stepper-toggle[aria-pressed=true] .m-icon-play{display:block}.m-stepper-toggle[aria-pressed=true] .m-icon-pause{display:none}
.m-has-stepper{position:relative}
.m-tab-progress{position:absolute;left:0;right:0;bottom:-2px;height:2px;background:var(--cyan);transform:scaleX(0);transform-origin:left center;pointer-events:none}
.m-scrollspy>a{position:relative}
.m-scrollspy>a::after{content:"";position:absolute;left:0;right:0;bottom:2px;height:2px;background:var(--cyan);transform:scaleX(0);transform-origin:left center}
.m-scrollspy>a[aria-current=location]{color:var(--navy)}
.m-scrollspy>a[aria-current=location]::after{transform:scaleX(1)}

/* Room for the tour's pause control, reserved from the first paint so adding it moves nothing. */
@media(scripting:enabled) and (prefers-reduced-motion:no-preference){.project-step{padding-right:112px}}

/* 5 · Numbers keep their final width while they count, so the line never reflows. */
.m-count{font-variant-numeric:tabular-nums}

/* Invisible sentinel the header observer watches (added by motion.js). */
.m-sentinel{position:absolute;top:0;left:0;width:1px;height:24px;pointer-events:none;visibility:hidden}

@media(prefers-reduced-motion:no-preference){
  /* 1 · Reveal: rise 16px and fade in once; stagger classes are given in entry order. */
  .motion .m-reveal{transition:opacity var(--m-mid) var(--m-ease),transform var(--m-mid) var(--m-ease)}
  .motion .m-reveal:not(.is-in){opacity:0;transform:translateY(var(--m-rise))}
  .motion .m-reveal.m-now,.motion .m-now .m-shot{transition:none}.motion .m-d1{transition-delay:60ms}.motion .m-d2{transition-delay:120ms}.motion .m-d3{transition-delay:180ms}.motion .m-d4{transition-delay:240ms}

  /* 3 · Screenshots lift a little further and their shadow grows in. */
  .motion .m-reveal .m-shot{transition:transform var(--m-slow) var(--m-ease),box-shadow var(--m-slow) var(--m-ease)}
  .motion .m-reveal:not(.is-in) .m-shot{transform:translateY(8px);box-shadow:0 0 0 0 #122f7300}

  /* 4 · Stepper progress: one bar under the active step fills in var(--m-step). */
  .m-tab-progress.is-running{animation:m-fill var(--m-step) linear both}
  .m-tab-progress.is-paused{animation-play-state:paused}
  .m-scrollspy>a::after{transition:transform var(--m-mid) var(--m-ease)}

  /* 6 · Micro-interactions. */
  .button,.nav-cta,.biz-sketch,.biz-cchip,.biz-preset,.zoom-button,.m-stepper-toggle,.text-button{transition:background-color var(--m-fast),color var(--m-fast),border-color var(--m-fast),transform var(--m-fast) var(--m-ease)}
  :is(.button,.nav-cta,.biz-sketch,.biz-cchip,.biz-preset,.zoom-button,.text-button):active{transform:scale(.98)}
  :is(.button,.text-link,.nav-cta,.footer-contact,.zoom-button)>span[aria-hidden=true]{display:inline-block;transition:transform var(--m-fast) var(--m-ease)}
  :is(.button,.text-link,.nav-cta,.footer-contact,.zoom-button):is(:hover,:focus-visible)>span[aria-hidden=true]{transform:translate(2px,-2px)}
  :is(.button,.text-link)[href^="#"]:is(:hover,:focus-visible)>span[aria-hidden=true]{transform:translateY(2px)}
  :is(.tool-entry,.guide-item,.product-overview-row,.document-list>a,.coursebook-list>a,.learn-links>a,.biz-example,.trust-principles article,.edition-grid article,.working-modes-grid article){transition:transform var(--m-fast) var(--m-ease),border-color var(--m-fast)}
  :is(.tool-entry,.guide-item,.product-overview-row,.document-list>a,.coursebook-list>a,.learn-links>a,.biz-example):hover{transform:translateY(-2px);border-color:#9fcbe6}
  .product-menu>summary>span{display:inline-block;transition:transform var(--m-fast) var(--m-ease)}
  .product-menu[open]>summary>span{transform:rotate(180deg)}
  .motion .site-header{transition:border-color var(--m-mid) var(--m-ease),background-color var(--m-mid) var(--m-ease)}
  @media(max-width:900px){.main-nav.is-open{animation:m-menu var(--m-mid) var(--m-ease) both}}

  /* 2 · Hero entrance: pure CSS from the first paint (no wait for a script, so no flash):
     eyebrow, headline lines, lead and actions in sequence, all settled by about 800ms.
     It runs only where scripting is on, matching the rest of the motion. */
  @media(scripting:enabled){
    :is(.hero .eyebrow,.page-intro>.eyebrow,.pricing-intro>.eyebrow,.book-hero .book-kicker,.book-entry-intro>.book-kicker,.oobi-story .eyebrow,.not-found>.eyebrow,.breadcrumb,.book-crumb){animation:m-enter var(--m-mid) var(--m-ease) both}
    :is(.hero h1>span:first-child,.page-intro>h1,.pricing-intro>h1,.book-hero h1,.book-entry-intro>h1,.oobi-story h1,.not-found>h1){animation:m-enter var(--m-mid) var(--m-ease) 70ms both}
    .hero h1>span:last-child:not(:first-child){animation:m-enter var(--m-mid) var(--m-ease) 150ms both}
    :is(.page-intro>.lead,.pricing-intro>p:not(.eyebrow),.biz-hero-lead,.book-hero h1~p,.book-entry-intro>.book-answer,.oobi-story .lead,.not-found>p:not(.eyebrow)){animation:m-enter var(--m-mid) var(--m-ease) 230ms both}
    :is(.page-intro>.text-link,.biz-hero-actions,.biz-hero .release-note,.book-hero-links,.book-lesson-location,.oobi-story .prose,.oobi-story-links,.not-found>div){animation:m-enter var(--m-mid) var(--m-ease) 310ms both}
    :is(.biz-hero-art,.book-hero-art,.oobi-story-art,.not-found>.character){animation:m-art var(--m-slow) var(--m-ease) 120ms both}
  }

  /* 8 · Oobi moves through his own rig (oobi.css, spec 196); nothing here moves him. */

  /* 9 · Business art: paused while it is off screen (motion.js toggles .m-offscreen). */
  .m-offscreen,.m-offscreen *{animation-play-state:paused!important}
}

@keyframes m-enter{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes m-art{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
@keyframes m-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@keyframes m-menu{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

/* 7 · Nav links draw their underline (wide header only; the phone menu lists links full width). */
@media(min-width:901px){
  .main-nav>a,.product-menu>summary{position:relative}
  .main-nav>a::after,.product-menu>summary::after{content:"";position:absolute;left:0;right:0;bottom:8px;height:1.5px;background:currentColor;transform:scaleX(0);transform-origin:left center}
  .main-nav>a:is(:hover,[aria-current=page],.current)::after,.product-menu>summary:is(:hover,.current)::after{transform:scaleX(1)}
  @media(prefers-reduced-motion:no-preference){.main-nav>a::after,.product-menu>summary::after{transition:transform var(--m-mid) var(--m-ease)}}
}
/* The header gains its hairline and a light blur once the page has scrolled. */
.motion .site-header:not(.is-scrolled){border-bottom-color:transparent}
.motion .site-header.is-scrolled{background-color:#ffffffe6;-webkit-backdrop-filter:saturate(1.4) blur(10px);backdrop-filter:saturate(1.4) blur(10px)}

/* Reduced motion: every element in its final state; no transitions, no loops, no page fade. */
@media(prefers-reduced-motion:reduce){
  @view-transition{navigation:none}
  .m-reveal,.m-reveal *,.m-shot,.m-tab-progress,.m-scrollspy>a::after,.main-nav.is-open,.site-header,.main-nav>a::after,.product-menu>summary::after,.product-menu>summary>span{animation:none!important;transition:none!important}
  .m-reveal{opacity:1!important;transform:none!important}
  .m-tab-progress{display:none}
}
@media print{.m-reveal{opacity:1!important;transform:none!important}.m-stepper-toggle,.m-tab-progress{display:none!important}}
