/* ============================================================================
   Base — modern minimal reset + typography baseline
   ============================================================================ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-0);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

/* Typography baseline ------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 { font-size: var(--fs-6); }
h2 { font-size: var(--fs-5); }
h3 { font-size: var(--fs-4); }
h4 { font-size: var(--fs-3); }
h5 { font-size: var(--fs-2); }
h6 { font-size: var(--fs-1); font-weight: var(--fw-medium); }

p {
  font-size: var(--fs-0);
  line-height: var(--lh-normal);
}

small {
  font-size: var(--fs--1);
  color: var(--color-muted);
}

strong { font-weight: var(--fw-semibold); }

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

code {
  padding: 0.15em 0.4em;
  background: var(--color-surface-2);
  border-radius: var(--radius-sm);
}

pre {
  padding: var(--space-4);
  background: var(--color-surface-2);
  border-radius: var(--radius);
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: transparent;
}

hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-5) 0;
}

ul, ol {
  padding-left: var(--space-5);
}

li + li {
  margin-top: var(--space-2);
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Focus visible — WCAG AA, keyboard-only ----------------------------------- */
:focus { outline: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-radius: var(--radius-sm);
}

/* Selection ---------------------------------------------------------------- */
::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

/* Scrollbar — sober ------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--color-border-strong);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--color-muted);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* Visually hidden but accessible to AT ------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
