/* Declare the five cascade layers once for the complete site. */
@layer tokens, primitives, surfaces, scenes, pages;

@layer primitives {
  *,*::before,*::after{box-sizing:border-box;}
  html{min-width:320px;background:var(--ix-canvas);}
  @media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth;}}
  body{
    margin:0;min-width:320px;overflow-x:hidden;
    min-height:100vh;min-height:100svh;display:flex;flex-direction:column;
    background:var(--ix-canvas);color:var(--ix-t-body);
    font:var(--ix-w-body) var(--ix-body-size)/var(--ix-body-lh) var(--ix-sans);
    letter-spacing:var(--ix-body-ls);
    -webkit-font-smoothing:antialiased;
  }
  /* A short page (404, a short article) fills the window, so the footer ends at its bottom edge. */
  main{flex:1 0 auto;}
  h1,h2,h3,h4,p{margin:0;}
  button{font:inherit;}
  img,svg{max-width:100%;}

  /* Text hierarchy. */
  .ix-display{font:var(--ix-w-display) var(--ix-display)/var(--ix-display-lh) var(--ix-sans);
              letter-spacing:var(--ix-display-ls);color:var(--ix-t-title);}
  .ix-heading{font:var(--ix-w-display) var(--ix-heading)/var(--ix-heading-lh) var(--ix-sans);
              letter-spacing:var(--ix-heading-ls);color:var(--ix-t-heading);}
  .ix-section-title{font-size:var(--ix-section-type);line-height:1.3;letter-spacing:.01em;font-weight:500;color:var(--ix-t-title);}

  /* Product names use the AFH-LR blue-to-teal heading gradient. */
  .ix-display__accent{background-image:var(--ix-title-sheen);
                      -webkit-background-clip:text;background-clip:text;
                      -webkit-text-fill-color:transparent;color:transparent;}

  .ix-body{font:var(--ix-w-body) var(--ix-body-size)/var(--ix-body-lh) var(--ix-sans);
           letter-spacing:var(--ix-body-ls);color:var(--ix-t-body);}
  .ix-meta{font:var(--ix-w-body) var(--ix-meta)/var(--ix-meta-lh) var(--ix-sans);
           letter-spacing:var(--ix-meta-ls);color:var(--ix-t-meta);}

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

@layer scenes {
  /* Sections join in the page base color in any order (Riley, 2026-10-21): each section after the first fades in
     from --ix-deep, and every section fades out to it. :where() lets a section's own overlay, such as the Home hero shade, win. */
  :where(main>.ix-section,main>.ix-scene)::after{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
    background:linear-gradient(to bottom,var(--ix-deep),color-mix(in srgb,var(--ix-deep) 55%,transparent) calc(var(--ix-edge-fade) * .35),transparent var(--ix-edge-fade),
      transparent calc(100% - var(--ix-edge-fade)),color-mix(in srgb,var(--ix-deep) 55%,transparent) calc(100% - var(--ix-edge-fade) * .35),var(--ix-deep));}
  :where(main>.ix-section:first-child,main>.ix-scene:first-child)::after{
    background:linear-gradient(to bottom,transparent calc(100% - var(--ix-edge-fade)),color-mix(in srgb,var(--ix-deep) 55%,transparent) calc(100% - var(--ix-edge-fade) * .35),var(--ix-deep));}
}

@layer pages {
  /* Each section fills one window and centers its content; the first leaves room for the header (Riley, 2026-10-21).
     :where() keeps these rules weaker than any section's own layout. */
  :where(.ix-home-round,.ix-product-page,.ix-company-round,.ix-technology-round) main>section{min-height:100svh;display:flex;flex-direction:column;justify-content:center;}
  :where(.ix-home-round,.ix-product-page,.ix-company-round,.ix-technology-round) main>section:first-child{min-height:calc(100svh - var(--ix-nav-height));}
  .ix-round-page main h1{font-size:var(--ix-hero-type);}
  .ix-round-page main h3{font-size:var(--ix-card-type);font-weight:500;}
  .ix-round-page .ix-section-head .ix-copy{font-size:var(--ix-section-type);line-height:1.4;color:var(--ix-t-meta);}
  @media(max-width:520px){
    .ix-round-page main h1{font-size:var(--ix-hero-mobile);}
  }
}
