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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-text);
  background-color: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: var(--step-0);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0;
  margin-bottom: var(--space-s);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-3); }
h4 { font-size: var(--step-2); }
h5 { font-size: var(--step-1); }

p {
  margin-top: 0;
  margin-bottom: var(--space-m);
}

a {
  color: var(--c-accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

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

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

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-m);
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* Header */
.site-header {
  background: var(--c-surface);
  border-bottom: var(--border-width) solid var(--c-border);
  padding: var(--space-s) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-s);
}

.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  text-decoration: none;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  letter-spacing: 0.05em;
}

.logo svg {
  color: var(--c-accent);
}

.site-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-m);
}

.site-nav a {
  text-decoration: none;
  color: var(--c-text-muted);
  font-family: var(--font-display);
  font-weight: 500;
  text-transform: uppercase;
  font-size: var(--step--1);
  letter-spacing: 0.05em;
  padding: var(--space-2xs) 0;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--c-text);
  border-bottom: 2px solid var(--c-accent);
}

/* Footer */
.site-footer {
  background: var(--c-text);
  color: var(--c-surface);
  padding: var(--space-2xl) 0 var(--space-l);
  margin-top: var(--space-3xl);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-l);
}

@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

.footer-col .logo {
  color: var(--c-surface);
  margin-bottom: var(--space-s);
}

.footer-col h3 {
  color: var(--c-surface);
  font-size: var(--step-0);
  margin-bottom: var(--space-s);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col a {
  color: var(--c-border);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--c-surface);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: var(--step--1);
  color: var(--c-border);
}

/* Components */
.hero {
  padding: var(--space-3xl) 0;
  background: var(--c-surface);
  border-bottom: var(--border-width) solid var(--c-border);
}

.hero-inner {
  max-width: 800px;
}

.hero h1 {
  font-size: var(--step-6);
  margin-bottom: var(--space-m);
}

.hero p {
  font-size: var(--step-1);
  color: var(--c-text-muted);
  max-width: 600px;
}

.section {
  padding: var(--space-2xl) 0;
}

.card {
  background: var(--c-surface);
  border: var(--border-width) solid var(--c-border);
  padding: var(--space-m);
}

.card-title {
  font-size: var(--step-1);
  margin-bottom: var(--space-2xs);
}

.card-title a {
  text-decoration: none;
  color: inherit;
}

.card-title a:hover {
  color: var(--c-accent);
}

.tag {
  display: inline-block;
  background: var(--c-surface-alt);
  padding: var(--space-3xs) var(--space-2xs);
  font-size: var(--step--2);
  font-family: var(--font-mono);
  text-transform: uppercase;
  border: 1px solid var(--c-border);
  margin-bottom: var(--space-2xs);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-m);
  background: var(--c-surface);
}

th, td {
  padding: var(--space-s);
  border: 1px solid var(--c-border);
  text-align: left;
}

th {
  background: var(--c-surface-alt);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: var(--step--1);
}

/* Technical text */
code {
  font-family: var(--font-mono);
  background: var(--c-surface-alt);
  padding: 0.1em 0.3em;
  font-size: 0.9em;
  border: 1px solid var(--c-border);
}

pre {
  background: var(--c-text);
  color: var(--c-surface);
  padding: var(--space-m);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

/* Utilities */
.text-mono { font-family: var(--font-mono); }
.text-accent { color: var(--c-accent); }
.bg-surface { background: var(--c-surface); }
.border-t { border-top: var(--border-width) solid var(--c-border); }
.border-b { border-bottom: var(--border-width) solid var(--c-border); }

/* Editorial asymmetry */
.editorial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-l);
}

@media (min-width: 1024px) {
  .editorial-grid {
    grid-template-columns: 3fr 5fr;
    align-items: start;
  }

  .editorial-sidebar {
    position: sticky;
    top: calc(var(--space-2xl) + 60px);
  }
}

.stat-block {
  border-left: 4px solid var(--c-accent);
  padding-left: var(--space-m);
  margin: var(--space-m) 0;
}

.stat-number {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--c-text-muted);
  text-transform: uppercase;
}

/* Forms / Tools */
.tool-container {
  background: var(--c-surface);
  border: var(--border-width) solid var(--c-border);
  padding: var(--space-l);
  margin: var(--space-xl) 0;
  box-shadow: 4px 4px 0 var(--c-border);
}

.form-group {
  margin-bottom: var(--space-m);
}

label {
  display: block;
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--space-3xs);
  text-transform: uppercase;
  font-size: var(--step--1);
}

input, select {
  width: 100%;
  padding: var(--space-s);
  border: 1px solid var(--c-border);
  font-family: var(--font-text);
  font-size: var(--step-0);
  background: var(--c-bg);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px var(--c-accent-subtle);
}

.btn {
  display: inline-block;
  background: var(--c-accent);
  color: white;
  padding: var(--space-s) var(--space-l);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: var(--step-0);
  transition: background 0.2s;
}

.btn:hover {
  background: var(--c-accent-dark);
}

.result-box {
  margin-top: var(--space-m);
  padding: var(--space-m);
  background: var(--c-surface-alt);
  border-left: 4px solid var(--c-accent);
}

/* FAQ */
.faq-list {
  list-style: none;
  padding: 0;
}

.faq-item {
  border-bottom: 1px solid var(--c-border);
  padding: var(--space-m) 0;
}

.faq-q {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--step-1);
  margin-bottom: var(--space-s);
}
