/* ==========================================================================
   StakeBonusHub — Base / Reset
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* для anchor-links под sticky-header */
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1, 'ss01' 1;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Subtle grain texture для глубины */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--grain-bg);
  opacity: 0.03;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
}

/* Hero gradient вверху страницы */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 800px;
  background: var(--gradient-hero);
  pointer-events: none;
  z-index: 0;
}

main, header, footer, section, article, aside, nav {
  position: relative;
  z-index: 2;
}

/* Headings ---------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 4.5vw, var(--fs-5xl));
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--tracking-tighter);
  margin-bottom: var(--space-6);
}

h2 {
  font-size: clamp(1.5rem, 3vw, var(--fs-3xl));
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
}

h3 {
  font-size: clamp(1.25rem, 2.2vw, var(--fs-2xl));
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

h4 {
  font-size: var(--fs-xl);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

h5 { font-size: var(--fs-lg); margin-top: var(--space-6); margin-bottom: var(--space-3); }
h6 { font-size: var(--fs-md); margin-top: var(--space-5); margin-bottom: var(--space-2); }

/* Article body specifics */
.prose h2 { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.prose h2:first-of-type { border-top: none; padding-top: 0; }

/* Paragraphs / text ------------------------------------------------------- */

p {
  margin-bottom: var(--space-5);
  color: var(--text-primary);
  text-wrap: pretty;
  max-width: 75ch;
}

.lead {
  font-size: var(--fs-lg);
  color: var(--text-secondary);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-8);
}

small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary  { color: var(--text-tertiary); }
.text-brand     { color: var(--brand); }
.text-gold      { color: var(--gold); }

strong, b { font-weight: var(--fw-semibold); color: var(--text-primary); }

/* Links ------------------------------------------------------------------- */

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(0, 224, 122, 0.4);
}
.prose a:hover { text-decoration-color: var(--brand); }

/* Lists ------------------------------------------------------------------- */

ul, ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
}

ul li, ol li {
  margin-bottom: var(--space-2);
}

ul ul, ol ol, ul ol, ol ul {
  margin-top: var(--space-2);
  margin-bottom: 0;
}

ul.list-clean { list-style: none; padding-left: 0; }
ul.list-checks { list-style: none; padding-left: 0; }
ul.list-checks li {
  position: relative;
  padding-left: var(--space-6);
}
ul.list-checks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: var(--fw-bold);
}

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

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

code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  color: var(--brand);
}

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  margin-bottom: var(--space-6);
}
pre code { background: transparent; border: none; padding: 0; color: inherit; }

/* Images ------------------------------------------------------------------ */

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

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

table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: var(--space-8);
  font-size: var(--fs-sm);
}

th, td {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--surface);
  color: var(--text-secondary);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

td.numeric, th.numeric {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
  text-align: right;
}

tr:hover td { background: rgba(255, 255, 255, 0.02); }

/* Forms / inputs ---------------------------------------------------------- */

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

input[type="text"],
input[type="email"],
input[type="number"],
input[type="search"],
textarea,
select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}

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

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

::selection {
  background: var(--brand);
  color: var(--text-inverse);
}

/* Focus visible global ---------------------------------------------------- */

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Skip-to-content (accessibility) ---------------------------------------- */

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--brand);
  color: var(--text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  z-index: var(--z-modal);
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus {
  top: var(--space-4);
}

/* Container --------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* HR ---------------------------------------------------------------------- */

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

/* Utility ----------------------------------------------------------------- */

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.flex { display: flex; }
.grid { display: grid; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
