/* Reset + base + shell layers. Owned by Package A. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--navy-900);
  scrollbar-color: var(--charcoal-600) var(--navy-900);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--room-bg);
  background-color: var(--navy-900);
  background-attachment: fixed;
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* While the stage surface is shown, the document itself does not scroll. */
body[data-surface='stage'] {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd,
ul,
ol {
  margin: 0;
}
ul[role='list'],
ol[role='list'] {
  list-style: none;
  padding: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}
p {
  text-wrap: pretty;
}
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
::selection {
  background: rgb(255 122 31 / 0.35);
  color: var(--text-1);
}
[hidden] {
  display: none !important;
}

/* ---- Focus: always visible for keyboard users ---- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--led-core);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}
/* Elements focused programmatically for screen readers (view roots, headings). */
[tabindex='-1']:focus-visible {
  outline: none;
}

/* ---- Utilities (k- prefix = foundation) ---- */
.k-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.k-chamfer {
  clip-path: polygon(
    var(--chamfer) 0,
    100% 0,
    100% calc(100% - var(--chamfer)),
    calc(100% - var(--chamfer)) 100%,
    0 100%,
    0 var(--chamfer)
  );
}
.k-container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.k-skip {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: var(--z-skip);
  padding: var(--space-2) var(--space-4);
  background: var(--navy-800);
  color: var(--text-1);
  border: 1px solid var(--led-core);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
  transition: transform var(--dur-fast) var(--ease-standard);
}
.k-skip:focus-visible {
  transform: none;
}

/* ---- Shell layers ---- */
#k-app {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
}

/* [B] stage: full viewport, stays mounted for home + product routes. */
#k-stage {
  position: fixed;
  inset: 0;
  z-index: var(--z-stage);
  overflow: hidden;
}

/* [A/D] pages: normal document flow below the nav. */
#k-pages {
  position: relative;
  z-index: var(--z-pages);
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.k-page {
  flex: 1 0 auto;
  padding-top: var(--nav-h);
}
.k-page:focus {
  outline: none;
}

/* [C] detail panel layer: transparent to the pointer except C's own children. */
#k-detail {
  position: fixed;
  inset: 0;
  z-index: var(--z-detail);
  pointer-events: none;
}

/* [C] cart drawer layer. */
#k-cart {
  position: relative;
  z-index: var(--z-cart);
}

/* Shell-owned surface cross-fade. Views animate their own content inside. */
.k-surface {
  transition:
    opacity var(--dur-page) var(--ease-standard),
    visibility 0s linear 0s;
}
.k-surface[data-surface-state='out'] {
  opacity: 0;
}
.k-surface[data-surface-state='hidden'] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.k-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

noscript .k-noscript,
.k-noscript {
  display: block;
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--z-skip);
  padding: var(--space-4) var(--gutter);
  background: var(--navy-800);
  color: var(--text-1);
  text-align: center;
}

/* ---- Global reduced motion: no movement, only short fades. ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: min(var(--dur-base), 160ms) !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
}
