/*
 * The kit's structure that is no value: the layer order the lobes open
 * with, and the tokens that move with the page's room, the pointer, the
 * reader's motion and a dense region. Every value at the root is data, in
 * tokens/, laid in the tokens layer under this one; what stands here only
 * remaps some of them where a condition holds, as the kit wrote it.
 */

@layer nv.tokens, nv.reset, nv.base, nv.components;

@layer nv.tokens {
  /* The shell's own tier, set by an app that runs before its content does.
     A website never sets it: a page must be complete before its script, and
     a tier written by a script is a layout that arrives late. */
  :root[data-tier='tablet'],
  :root[data-tier='desktop'] {
    --nv-page-gutter: 1.5rem;
  }

  /* The same step, asked of the page's own room instead of the window, so a
     surface with no script gets it too. `.nv-viewport` in components.css is
     the container this names. */
  @container nv-page (min-width: 48rem) {
    .nv-page {
      --nv-page-gutter: 1.5rem;
    }
  }

  @media (pointer: coarse) {
    :is(:host, .nv-viewport) {
      --nv-tap-target: 44px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    :is(:host, .nv-viewport) {
      --nv-motion: 0;
    }
  }

  /* Density: one mode, unpinned, so any subtree hosts it and a dense region
     such as a table scopes it to itself. --nv-text-input and --nv-tap-target
     stay out: a field never falls under 16px, and the coarse floor still
     wins through max(). */
  [data-density='compact'] {
    --nv-text-sm: 0.8125rem;
    --nv-text-base: 0.9375rem;
    --nv-text-lg: 1.0625rem;
    --nv-control-sm: 1.75rem;
    --nv-control-md: 2.25rem;
    --nv-card-pad: 0.75rem;
    --nv-stack-gap: 0.75rem;
    --nv-form-gap: 0.5rem;
    --nv-section-gap: 1.5rem;
  }
}
