/* ============================================
   AIX / Solo Trillion — Base styles
   Reset + typography + layout primitives
   ============================================ */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: var(--lh-normal);
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  font-size: var(--fs-base);
}

/* ----- Typography ----- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--c-text-strong);
  line-height: var(--lh-snug);
  letter-spacing: var(--tracking-tight);
  font-weight: 700;
}

h1 { font-size: var(--fs-hero); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-4xl); margin-bottom: var(--sp-6); }
h3 { font-size: var(--fs-2xl); margin-bottom: var(--sp-4); }
h4 { font-size: var(--fs-xl); margin-bottom: var(--sp-3); }
h5 { font-size: var(--fs-lg); margin-bottom: var(--sp-3); }
h6 { font-size: var(--fs-base); margin-bottom: var(--sp-2); }

p {
  line-height: var(--lh-relaxed);
  color: var(--c-text);
  margin-bottom: var(--sp-4);
}
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color var(--t-fast);
}
a:hover { color: var(--c-accent-hover); text-decoration: underline; }

strong, b { font-weight: 700; color: var(--c-text-strong); }
em, i { font-style: italic; }

ul, ol { padding-left: var(--sp-6); margin-bottom: var(--sp-4); }
li { line-height: var(--lh-relaxed); margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-12) 0;
}

/* ----- Code ----- */

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

code {
  background: var(--c-code-bg);
  color: var(--c-code-text);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-code-border);
}

pre {
  background: var(--c-code-bg);
  border: 1px solid var(--c-code-border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  overflow-x: auto;
  line-height: var(--lh-normal);
  margin-bottom: var(--sp-6);
  color: var(--c-code-text);
  font-size: var(--fs-sm);
}
pre code {
  background: none;
  border: none;
  padding: 0;
}

/* ----- Tables ----- */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-6);
  font-size: var(--fs-sm);
}
th, td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  vertical-align: top;
}
th {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--c-text-strong);
  background: var(--c-bg-alt);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

/* ----- Layout primitives ----- */

.container {
  width: 100%;
  max-width: var(--max-w-content);
  margin: 0 auto;
  padding: 0 var(--sp-6);
}
.container--prose { max-width: var(--max-w-prose); }
.container--wide { max-width: var(--max-w-wide); }

.section {
  padding: var(--sp-24) 0;
}
.section--tight { padding: var(--sp-16) 0; }
.section--hero { padding: var(--sp-32) 0 var(--sp-24); }

.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-6 > * + * { margin-top: var(--sp-6); }
.stack-8 > * + * { margin-top: var(--sp-8); }

/* ----- Mono accents ----- */

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--c-text-soft);
  margin-bottom: var(--sp-4);
  display: inline-block;
}

/* ----- Utilities ----- */

.text-mute { color: var(--c-text-mute); }
.text-soft { color: var(--c-text-soft); }
.text-strong { color: var(--c-text-strong); }
.text-accent { color: var(--c-accent); }

.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }

.center { text-align: center; }

/* ----- Selection ----- */

::selection {
  background: var(--c-accent);
  color: white;
}

/* ----- Focus ----- */

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ----- Responsive ----- */

@media (max-width: 768px) {
  h2 { font-size: var(--fs-3xl); }
  h3 { font-size: var(--fs-xl); }
  .section { padding: var(--sp-16) 0; }
  .section--hero { padding: var(--sp-20) 0 var(--sp-12); }
}
