/* Onixa — system tokens + primitives · v0.6 charcoal */

:root {
  /* Backgrounds */
  --bg: #0b0d10;
  --bg-primary: #0b0d10;
  --bg-secondary: #0f1216;
  --bg-tertiary: #13161a;
  --surface: #13161a;
  --surface-2: #1a1e23;
  --bg-content: #0f1216;

  /* Borders · hairlines */
  --border: #1e232a;
  --border-active: #2a2f36;

  /* Text */
  --text-primary: #e8ebef;
  --text-secondary: #94a7b1;
  --text-tertiary: #6b7884;

  /* Onixa tokens · aligned with forge/rails HUD */
  --fg: #e8ebef;
  --muted: #6b7884;
  --cool: #94a7b1;
  --mark: #c8d0d8;
  --ember: #d46a4f;
  --ember-bright: #e78765;
  --ember-dim: rgba(212, 106, 79, 0.10);
  --ember-glow: rgba(212, 106, 79, 0.05);
  --ok: #84a98c;
  --error: #c36d5e;
  --accent-2: #b7a98a;

  /* Legacy accent aliases — re-tinted to ember so existing classes render correctly */
  --accent: var(--cool);
  --accent-bright: var(--mark);
  --accent-dim: rgba(148, 167, 177, 0.08);
  --accent-glow: rgba(148, 167, 177, 0.04);

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: var(--font-sans);
  --mono: var(--font-mono);

  /* Sizing */
  --container-max: 1440px;
  --container-pad: 80px;
  --reading-max: 680px;
  --section-pad: 200px;
  --section-pad-narrow: 120px;
  --radius: 0;
}

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

html {
  background: var(--bg);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

::selection {
  background: var(--ember-dim);
  color: var(--ember-bright);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

/* Typography primitives */

.t-hero {
  font-family: var(--font-sans);
  font-size: clamp(48px, 6.6vw, 80px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.0;
  color: var(--text-primary);
}

.t-display {
  font-family: var(--font-sans);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--text-primary);
}

.t-heading-lg {
  font-family: var(--font-sans);
  font-size: clamp(40px, 4.5vw, 56px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--text-primary);
}

.t-heading-md {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.012em;
  line-height: 1.22;
  color: var(--text-primary);
}

.t-body-lg {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.t-body-md {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}

.t-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cool);
}

.t-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.t-mono-sm {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.accent {
  color: var(--ember);
}

/* Layout primitives */

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: var(--section-pad);
  position: relative;
}

.section--narrow {
  padding-block: var(--section-pad-narrow);
}

.section--alt {
  background: var(--bg-secondary);
}

/* HUD corner-bracket frame — applied via .hud-frame (four 10px ticks) */
.hud-frame { position: relative; }
.hud-frame::before, .hud-frame::after,
.hud-frame > .hud-tr, .hud-frame > .hud-bl {
  content: ""; position: absolute; width: 10px; height: 10px;
  border: 0 solid var(--cool); pointer-events: none; z-index: 2;
}
.hud-frame::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.hud-frame::after  { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }
.hud-frame > .hud-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.hud-frame > .hud-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }

/* Coordinate badge — top-left corner of a framed element */
.coord-badge {
  position: absolute; top: 10px; left: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--cool); text-transform: uppercase; z-index: 3;
}
.coord-badge .ember { color: var(--ember); }
.coord-badge .mut { color: var(--muted); }
.coord-tr {
  position: absolute; top: 10px; right: 14px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em;
  color: var(--muted); text-transform: uppercase; z-index: 3;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--cool);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.eyebrow::before {
  content: "◢";
  color: var(--ember);
  font-size: 10px;
  line-height: 1;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  border: 0;
}

.divider--active {
  background: var(--border-active);
}

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

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border-active);
  border-radius: 0;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cool);
}
