/* ============================================================================
   Burton v7 — Base
   ----------------------------------------------------------------------------
   Reset + default typography for body, headings, links, media.
   Design tokens must already be imported before this file.
   ========================================================================= */

/* ── Modern reset ────────────────────────────────────────────────────────── */

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

* {
  margin: 0;
}

html,
body {
  min-height: 100%;
  overflow-x: clip;
  max-width: 100vw;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--color-ink);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

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

ul,
ol {
  list-style: none;
  padding: 0;
}

/* Default hyperlink — overridden in components where needed */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-accent);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* ── Typography defaults ─────────────────────────────────────────────────── */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--color-ink);
}

h1 { font-size: var(--fs-4xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  line-height: var(--lh-normal);
  color: var(--color-ink);
}

/* Editorial body — opt in via .editorial class on the article container.
   Switches to serif, wider line-height, narrower measure. */
.editorial,
.editorial p,
.editorial li,
.editorial blockquote {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--color-editorial-ink);
}

.editorial h1,
.editorial h2,
.editorial h3,
.editorial h4 {
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-tight);
}

.editorial h1 {
  font-family: var(--font-serif);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
}

/* Eyebrow label — catalogued/numbered tech style.
   Monospace + accent marker signals "this is a technical publication,"
   not a lifestyle blog. Every section now reads like an instrument panel
   label. Use .eyebrow--plain to opt out when a quieter eyebrow is wanted. */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-ink-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow::before {
  content: "◆";
  color: var(--color-accent);
  font-size: 0.75em;
  line-height: 1;
}

/* Plain variant — no marker, sans-serif. For use where the tick is too busy. */
.eyebrow--plain {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
}

.eyebrow--plain::before {
  content: none;
}

/* Code */
code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

code {
  background: var(--color-surface-2);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-xs);
}

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

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

/* Selection — translucent accent so text color is preserved under the
   highlight. Solid-color selection on dark surfaces was creating
   unreadable 'cyan boxes' where the selected text disappeared. */
::selection {
  background: rgba(6, 182, 212, 0.28);
  color: inherit;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: var(--space-8) 0;
}

/* Accessibility: visually hidden but screen-reader accessible */
.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;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: var(--z-header);
  background: var(--color-ink);
  color: var(--color-surface);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  transition: top var(--duration-base) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-4);
}
