/* mycve.io base: reset, document defaults and the page frame.
   Depends on tokens.css. Component styles live in components.css. */

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, pre { margin: 0; }

/* :where keeps the reset at zero specificity, so a component's own list
   margins and paddings (.hero__points, .site-wrap lists) win */
:where(ul[class], ol[class]) { margin: 0; padding: 0; list-style: none; }

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

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

button { cursor: pointer; }
button:disabled,
[aria-disabled="true"] { cursor: default; }

table { border-collapse: collapse; border-spacing: 0; }

[hidden] { display: none !important; }

/* ---------- Document ---------- */
html { background: var(--bg); color-scheme: dark light; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 22px;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); text-wrap: balance; }

p { text-wrap: pretty; }

strong, b { font-weight: 600; }

a { color: var(--grape); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

::selection { background: var(--grape-wash); color: var(--ink); }

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Code ---------- */
code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
}

code {
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 1px 6px;
  overflow-wrap: anywhere;
}

pre {
  background: var(--surface-raised);
  color: var(--ink);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  overflow-x: auto;
}
pre code { background: none; padding: 0; border-radius: 0; }

kbd {
  font-size: 12px;
  line-height: 16px;
  color: var(--ink-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}

/* ---------- Page frame ---------- */
/* One 1200px container; gutters match the header (--gutter, shell.css). */
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-6) var(--gutter, var(--space-6)) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0;
}

/* Title row: title (and lede) on the left, actions on the right. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
}
.page-head > :first-child { min-width: 0; flex: 1 1 240px; }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.page-lede {
  margin-top: var(--space-1);
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-muted);
  max-width: 68ch;
}

/* ---------- Layout helpers ---------- */
.stack { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-8); }

.grid { display: grid; gap: var(--space-4); min-width: 0; }
.grid > * { min-width: 0; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Auto-filling columns, each at least 280px (or the full width when narrower). */
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }

@media (max-width: 960px) {
  .grid--3,
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .page { padding-top: var(--space-4); gap: var(--space-4); }
  .page-title { font-size: 22px; line-height: 28px; }
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
