/* ============================================================
   ServerReclaim — Base styles
   Reset, typography baseline, layout primitives, accessibility.
   ============================================================ */

/* --- Modern reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-void);
  background-image: radial-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--cyan); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--magenta); }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; }
table { border-collapse: collapse; width: 100%; }

/* --- Typography scale --- */
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-primary); }
h1 { font-size: clamp(28px, 5vw, 56px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.5vw, 40px); }
h3 { font-size: clamp(18px, 2.2vw, 26px); }
h4 { font-size: clamp(16px, 1.6vw, 20px); }
p { color: var(--text-secondary); max-width: 70ch; }
strong { color: var(--text-primary); font-weight: 600; }
small { font-size: 0.85em; }
code, kbd, samp { font-family: var(--font-mono); font-size: 0.9em; }

/* --- Section label (mono kicker) --- */
.kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--cyan);
  display: inline-block;
  margin-bottom: var(--space-2);
}

/* --- Layout primitives --- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .container { padding-inline: 32px; } }

.section { padding-block: var(--space-5); }
@media (min-width: 768px) { .section { padding-block: var(--space-6); } }
.section--tight { padding-block: var(--space-4); }

/* Responsive grids */
.grid { display: grid; gap: var(--space-2); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Split layout */
.split { display: grid; gap: var(--space-3); }
@media (min-width: 768px) { .split { grid-template-columns: 1fr 1fr; align-items: center; } }
@media (min-width: 1024px) { .split--wide-left { grid-template-columns: 1.4fr 1fr; } .split--wide-right { grid-template-columns: 1fr 1.4fr; } }

/* --- Accessibility --- */
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.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 {
  position: absolute; left: 16px; top: -100px; z-index: var(--z-drawer);
  background: var(--bg-elevated); color: var(--cyan); padding: 12px 20px;
  font-family: var(--font-mono); font-size: 0.85rem; border: 1px solid var(--border-strong);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: 16px; }

/* --- Helpers --- */
.text-mono { font-family: var(--font-mono); }
.text-cyan { color: var(--cyan); }
.text-magenta { color: var(--magenta); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.lead { font-size: clamp(17px, 2vw, 22px); line-height: 1.5; color: var(--text-secondary); }
.divider { height: 1px; background: var(--border-subtle); border: 0; margin-block: var(--space-4); }

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