/* ==========================================================================
   nezprod — base: reset, document, typography atoms, focus, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--ink);
}

html,
body {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Scroll lock while a modal or sheet is open (js/lib/modal.js). The body
   takes over the width of the vanished scrollbar (--nz-sbw, measured on
   lock), so nothing shifts sideways and the fixed overlay still covers the
   whole viewport. (scrollbar-gutter: stable would leave an uncovered strip.) */
html.nz-lock,
html.nz-lock body {
  overflow: hidden;
}
html.nz-lock body {
  padding-right: var(--nz-sbw, 0px);
}

::selection {
  background: var(--red);
  color: var(--paper);
}
html.theme-light ::selection {
  color: #f4ede2;
}

/* ── Media & form elements ───────────────────────────────────────────── */
img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
[aria-disabled='true'] {
  cursor: not-allowed;
}

/* ── Headings & text ─────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--paper);
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1;
}
h2 {
  font-size: clamp(24px, 2.8vw, 30px);
}
h3 {
  font-size: 20px;
  letter-spacing: -0.02em;
}
h4 {
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* A heading focused by the router is a landmark, not a control. */
h1[tabindex='-1']:focus,
[data-nz-focus-target]:focus {
  outline: none;
}

p {
  margin: 0;
  text-wrap: pretty;
}

small {
  font-size: 0.86em;
}

strong,
b {
  font-weight: 700;
}

hr {
  height: 0;
  margin: var(--s-5) 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

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

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
}

/* Links: quiet underline in the rule colour; red on hover. */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-hover) ease, text-decoration-color var(--dur-hover) ease;
}
a:hover {
  color: var(--red-text);
  text-decoration-color: currentColor;
}

/* Numbers that line up in columns */
.nz-num {
  font-variant-numeric: tabular-nums lining-nums;
}

/* ── Focus: the one red, sharp corners ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
/* Underline fields signal focus with their red underline instead. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
}

/* ── Scrollbars: narrow, brand-tinted ────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: var(--rule);
  border-radius: var(--radius-soft);
  border: 2px solid var(--ink);
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

/* ── Utilities ───────────────────────────────────────────────────────── */
.nz-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.nz-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.nz-dim {
  color: var(--text-dim);
}
.nz-red {
  color: var(--red-text);
}
.nz-nowrap {
  white-space: nowrap;
}

/* Screen-only / print-only helpers (print.css flips them). */
.nz-print-only {
  display: none !important;
}

[hidden] {
  display: none !important;
}

/* ── Reduced motion: no movement; at most an 80ms fade ───────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
