/**
 * NOXEN CSS FRAMEWORK v2.1.2
 * Layer 3 — Base Reset + Typography
 */

/* ── Modern CSS Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: var(--nx-leading-normal);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  background-color: var(--nx-color-bg);
  color: var(--nx-color-text);
  font-family: var(--nx-font-body);
  font-size: var(--nx-text-base);
  line-height: var(--nx-leading-normal);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Images ── */
img,
svg,
video {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ── Typography defaults ── */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--nx-font-display);
  font-weight: 700;
  line-height: var(--nx-leading-tight);
  letter-spacing: var(--nx-tracking-tight);
  color: var(--nx-color-text);
}

h1 {
  font-size: var(--nx-fluid-3xl);
}

h2 {
  font-size: var(--nx-fluid-2xl);
}

h3 {
  font-size: var(--nx-fluid-xl);
}

h4 {
  font-size: var(--nx-text-xl);
}

h5 {
  font-size: var(--nx-text-lg);
}

h6 {
  font-size: var(--nx-text-md);
}

p {
  line-height: var(--nx-leading-relaxed);
  color: var(--nx-color-text-2);
  margin-bottom: var(--nx-space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--nx-color-accent);
  text-decoration: none;
  transition: opacity var(--nx-duration-fast);
}

a:hover {
  opacity: 0.8;
}

strong,
b {
  font-weight: 700;
  color: var(--nx-color-text);
}

em,
i {
  font-style: italic;
}

code,
kbd,
samp,
pre {
  font-family: var(--nx-font-mono);
  font-size: 0.9em;
}

code {
  background: var(--nx-color-surface-3);
  color: var(--nx-color-accent);
  padding: 2px 6px;
  border-radius: var(--nx-radius-xs);
  font-size: var(--nx-text-sm);
}

pre {
  background: var(--nx-color-surface-2);
  border: 1px solid var(--nx-color-border);
  border-radius: var(--nx-radius-md);
  padding: var(--nx-space-5);
  overflow-x: auto;
  line-height: var(--nx-leading-relaxed);
}

pre code {
  background: none;
  padding: 0;
  color: var(--nx-color-text);
}

hr {
  border: none;
  border-top: 1px solid var(--nx-color-border);
  margin: var(--nx-space-6) 0;
}

/* ── Lists ── */
ul,
ol {
  padding-left: var(--nx-space-5);
  color: var(--nx-color-text-2);
  line-height: var(--nx-leading-relaxed);
}

li {
  margin-bottom: var(--nx-space-1);
}

/* ── Forms global reset ── */
button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

[disabled] {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ── Focus visible (keyboard navigation) ── */
:focus-visible {
  outline: 2px solid var(--nx-color-accent);
  outline-offset: 2px;
  border-radius: var(--nx-radius-xs);
}

/* ── Selection ── */
::selection {
  background: var(--nx-color-accent-md);
  color: var(--nx-color-accent);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--nx-color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--nx-color-surface-3);
  border-radius: var(--nx-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--nx-color-accent-md);
}

/* ── Skip to main (a11y) ── */
.nx-skip-link {
  position: absolute;
  top: -100%;
  left: var(--nx-space-4);
  background: var(--nx-color-accent);
  color: var(--nx-color-text-inv);
  padding: var(--nx-space-2) var(--nx-space-4);
  border-radius: 0 0 var(--nx-radius-md) var(--nx-radius-md);
  font-family: var(--nx-font-display);
  font-size: var(--nx-text-sm);
  font-weight: 700;
  z-index: var(--nx-z-top);
  transition: top var(--nx-duration-fast);
}

.nx-skip-link:focus {
  top: 0;
}

/* ── Print base ── */
@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  body {
    background: white !important;
    color: black !important;
  }

  nav,
  [nx-print-hide],
  [data-nx-print="hide"] {
    display: none !important;
  }

  [nx-print-only],
  [data-nx-print="only"] {
    display: block !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  h1,
  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }

  p,
  blockquote {
    orphans: 3;
    widows: 3;
  }

  [nx-print-break-before] {
    page-break-before: always;
  }

  [nx-print-break-after] {
    page-break-after: always;
  }

  [nx-print-break-avoid] {
    page-break-inside: avoid;
  }
}