/* ==========================================================================
   Kovachnitsa za skinove — независима база от стилове.
   Токени: числова скала (не семантични имена), BEM-подобни компоненти.
   Визията пази същата тема (ковачница/жарава), кодът е самостоятелен.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=PT+Sans:wght@400;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --ink-950: #17120e;
  --ink-900: #100c09;
  --ink-800: #221b15;
  --ink-700: #2c2318;
  --ink-600: #3c2f22;
  --ink-650: #2f251b;

  --paper-100: #f2ece3;
  --paper-300: #c2b3a2;
  --paper-500: #8a7a68;

  --brand: #e2823a;
  --brand-2: #ef9750;

  --r-mil: #4b69ff;
  --r-restr: #9067ff;
  --r-class: #e14fd1;
  --r-covert: #e14b4b;
  --r-gold: #d4af37;

  --wear-1: #6fcf7d;
  --wear-2: #a6d15a;
  --wear-3: #e0c542;
  --wear-4: #e2913a;
  --wear-5: #d9534f;

  --rad-s: 3px;
  --rad-m: 7px;

  --f-head: 'Oswald', sans-serif;
  --f-body: 'PT Sans', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --measure: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body { margin: 0; background: var(--ink-950); color: var(--paper-100); font-family: var(--f-body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { padding-left: 1.2em; }
h1, h2 { font-family: var(--f-head); font-weight: 700; line-height: 1.12; margin: 0 0 0.5em; letter-spacing: 0.01em; text-transform: uppercase; }
h3, h4 { font-family: var(--f-head); font-weight: 600; line-height: 1.2; margin: 0 0 0.5em; }
p { margin: 0 0 1.1em; }
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 20px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* ---------- tag (малък надпис-етикет) ---------- */
.tag {
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--brand); display: inline-flex; align-items: center; gap: 0.5em; margin-bottom: 0.9em;
}
.tag::before { content: "//"; opacity: 0.7; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(23,18,14,0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ink-650); }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; position: relative; }

.brand { font-family: var(--f-head); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.02em; display: flex; align-items: baseline; gap: 0.4em; white-space: nowrap; text-transform: uppercase; }
.brand__mark { color: var(--brand); font-size: 0.85em; }
.brand__sub { font-family: var(--f-body); font-weight: 400; font-size: 0.62rem; color: var(--paper-500); letter-spacing: 0.06em; text-transform: uppercase; }

/* ---------- меню: CSS-only чрез скрит checkbox (без JS) ---------- */
.menu-switch { position: absolute; opacity: 0; pointer-events: none; }
.burger {
  display: none; width: 42px; height: 38px; border: 1px solid var(--ink-600); border-radius: var(--rad-s);
  cursor: pointer; position: relative; align-items: center; justify-content: center;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; position: absolute; left: 9px; right: 9px; height: 2px; background: var(--paper-100);
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease;
}
.burger span { top: 18px; }
.burger span::before { top: -7px; }
.burger span::after { top: 7px; }

.menu { display: flex; gap: 6px; align-items: center; }
.menu__link { font-family: var(--f-head); font-size: 0.86rem; font-weight: 500; letter-spacing: 0.01em; text-transform: uppercase; color: var(--paper-300); padding: 8px 14px; border-radius: var(--rad-s); transition: color 0.15s ease, background 0.15s ease; }
.menu__link:hover { color: var(--paper-100); background: var(--ink-700); }
.menu__link.is-active { color: var(--paper-100); box-shadow: inset 0 -2px 0 var(--brand); }

@media (max-width: 860px) {
  .burger { display: flex; }
  .menu {
    position: fixed; inset: 68px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink-900); border-bottom: 1px solid var(--ink-650); padding: 8px 20px 18px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: transform 0.18s ease, opacity 0.18s ease, visibility 0.18s ease;
  }
  .menu__link { padding: 13px 6px; border-bottom: 1px solid var(--ink-650); border-radius: 0; }
  .menu__link.is-active { box-shadow: inset 3px 0 0 var(--brand); }

  .menu-switch:checked ~ .menu { transform: translateY(0); opacity: 1; visibility: visible; }
  .menu-switch:checked ~ .burger span { background: transparent; }
  .menu-switch:checked ~ .burger span::before { top: 0; transform: rotate(45deg); }
  .menu-switch:checked ~ .burger span::after { top: 0; transform: rotate(-45deg); }
}

/* ---------- бутони ---------- */
.action {
  display: inline-flex; align-items: center; gap: 0.5em; font-family: var(--f-head); font-weight: 600;
  font-size: 0.92rem; letter-spacing: 0.03em; text-transform: uppercase; padding: 12px 22px;
  border-radius: var(--rad-s); border: 1px solid transparent; cursor: pointer;
}
.action--solid { background: var(--brand); color: #201208; }
.action--solid:hover { background: var(--brand-2); }
.action--ghost { border-color: var(--ink-600); color: var(--paper-100); }
.action--ghost:hover { border-color: var(--paper-300); background: var(--ink-800); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- intro (hero) ---------- */
.intro {
  padding: 60px 0 40px;
  background: radial-gradient(1000px 400px at 12% -10%, rgba(226,130,58,0.16), transparent 60%),
              radial-gradient(900px 360px at 92% 0%, rgba(212,175,55,0.09), transparent 55%);
}
.intro h1 { font-size: clamp(2rem, 5vw, 3rem); max-width: 16ch; }
.intro__lede { color: var(--paper-300); font-size: 1.06rem; max-width: 58ch; margin-bottom: 1.5em; }

/* ---------- metrics (статистика лента) ---------- */
.metrics { display: flex; flex-wrap: wrap; gap: 20px; border-top: 1px solid var(--ink-650); border-bottom: 1px solid var(--ink-650); padding: 22px 0; }
.metrics__item { flex: 1 1 130px; text-align: center; }
.metrics__num { font-family: var(--f-mono); font-size: 1.5rem; color: var(--brand); }
.metrics__label { font-size: 0.78rem; color: var(--paper-300); margin-top: 2px; }

/* ---------- gauge (скала на износване) ---------- */
.gauge-block { margin: 30px 0 8px; }
.gauge {
  position: relative; height: 14px; border-radius: 999px;
  background: linear-gradient(to right,
    var(--wear-1) 0%, var(--wear-1) 7%, var(--wear-2) 7%, var(--wear-2) 15%,
    var(--wear-3) 15%, var(--wear-3) 38%, var(--wear-4) 38%, var(--wear-4) 45%,
    var(--wear-5) 45%, var(--wear-5) 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3);
}
.gauge__tick { position: absolute; top: -4px; width: 2px; height: 22px; background: rgba(23,18,14,0.6); }
.gauge__pin { position: absolute; top: -7px; width: 3px; height: 28px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 8px rgba(255,255,255,0.6); left: var(--pin-at, 24%); transform: translateX(-50%); }
.gauge__scale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 0.68rem; color: var(--paper-500); margin-top: 8px; }
.gauge__scale span { flex: 1; text-align: center; }
.gauge__scale span:first-child { text-align: left; }
.gauge__scale span:last-child { text-align: right; }

/* ---------- секции ---------- */
section { padding: 54px 0; }
.section--tight { padding: 38px 0; }
.section-lead { max-width: 62ch; margin-bottom: 2em; }
.section-lead h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
.section-lead p { color: var(--paper-300); text-transform: none; }
.rule { border: none; height: 1px; background: var(--ink-650); margin: 0; }

/* ---------- timeline (механики като лента от редове) ---------- */
.timeline { border-top: 1px solid var(--ink-650); }
.timeline__row { display: flex; gap: 22px; padding: 30px 0; border-bottom: 1px solid var(--ink-650); }
.timeline__index { flex: 0 0 90px; font-family: var(--f-head); font-weight: 700; font-size: 2.6rem; color: var(--row-tone, var(--brand)); line-height: 1; }
.timeline__row h3 { font-size: 1.28rem; margin-bottom: 0.3em; }
.timeline__row p { color: var(--paper-300); margin-bottom: 0.6em; }
.timeline__row a { font-family: var(--f-head); font-weight: 600; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--paper-100); }
.timeline__row a:hover { color: var(--row-tone, var(--brand)); }
@media (max-width: 600px) { .timeline__index { flex-basis: 52px; font-size: 1.6rem; } }

/* ---------- guide (мини стъпки "Как да започнеш") ---------- */
.guide { display: grid; grid-template-columns: 1fr; gap: 16px; counter-reset: g; }
@media (min-width: 760px) { .guide { grid-template-columns: repeat(4, 1fr); } }
.guide__step { border: 1px solid var(--ink-650); border-radius: var(--rad-m); padding: 20px 18px; background: var(--ink-800); }
.guide__step::before {
  counter-increment: g; content: counter(g); font-family: var(--f-mono); font-weight: 600; font-size: 0.78rem;
  color: var(--ink-900); background: var(--brand); width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.guide__step h4 { font-size: 0.98rem; margin-bottom: 0.4em; }
.guide__step p { font-size: 0.86rem; color: var(--paper-300); margin-bottom: 0; }

/* ---------- cards (auto-fit решетка, без фиксирани breakpoints) ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.card { background: var(--ink-800); border: 1px solid var(--ink-650); border-radius: var(--rad-m); overflow: hidden; display: flex; flex-direction: column; }
.card__media { aspect-ratio: 16/9; background: var(--ink-700); position: relative; }
.card__media svg { width: 100%; height: 100%; }
.card__media-tag { position: absolute; bottom: 8px; left: 8px; font-family: var(--f-mono); font-size: 0.6rem; background: rgba(16,12,9,0.78); color: var(--paper-500); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--ink-650); }
.card__content { padding: 20px 22px 22px; flex: 1; display: flex; flex-direction: column; }
.card__kicker { font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.04em; color: var(--tone, var(--brand)); text-transform: uppercase; margin-bottom: 0.6em; }
.card__content h3 { font-size: 1.1rem; margin-bottom: 0.5em; }
.card__content p { color: var(--paper-300); font-size: 0.92rem; flex: 1; }
.card__link { font-family: var(--f-head); font-size: 0.84rem; font-weight: 600; text-transform: uppercase; margin-top: 0.6em; }
.card__link::after { content: " →"; }

/* ---------- banner (CTA лента) ---------- */
.banner { background: linear-gradient(135deg, rgba(226,130,58,0.15), rgba(212,175,55,0.07)); border-top: 1px solid var(--ink-650); border-bottom: 1px solid var(--ink-650); padding: 54px 0; text-align: center; }
.banner h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: 0.4em; }
.banner p { color: var(--paper-300); max-width: 54ch; margin: 0 auto 1.4em; text-transform: none; }
.banner .actions { justify-content: center; }

/* ---------- page-top ---------- */
.page-top { padding: 42px 0 26px; border-bottom: 1px solid var(--ink-650); }
.page-top h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); max-width: 24ch; }
.page-top__lede { color: var(--paper-300); max-width: 62ch; font-size: 1rem; text-transform: none; }
.crumbs { font-family: var(--f-mono); font-size: 0.78rem; color: var(--paper-500); margin-bottom: 1.2em; }
.crumbs a { color: var(--paper-300); }
.crumbs a:hover { color: var(--paper-100); }

/* ---------- chapters (хоризонтална навигация по глави) ---------- */
.chapters { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0; border-bottom: 1px solid var(--ink-650); }
.chapters a { font-family: var(--f-mono); font-size: 0.76rem; padding: 7px 14px; border: 1px solid var(--ink-650); border-radius: 999px; color: var(--paper-300); background: var(--ink-800); }
.chapters a:hover { color: var(--paper-100); border-color: var(--brand); }

/* ---------- content (дълъг текст) ---------- */
.content { max-width: 760px; margin: 0 auto; padding: 36px 0 60px; }
.content h2 { font-size: 1.4rem; margin-top: 1.6em; padding-top: 0.4em; scroll-margin-top: 90px; text-transform: none; }
.content h3 { font-size: 1.12rem; margin-top: 1.3em; scroll-margin-top: 90px; }
.content p, .content li { color: var(--paper-300); font-size: 0.98rem; }
.content strong { color: var(--paper-100); }
.content ul, .content ol { margin-bottom: 1.2em; }

/* ---------- note (callout) ---------- */
.note { border: 1px solid var(--ink-650); border-left: 3px solid var(--tone, var(--brand)); background: var(--ink-800); border-radius: var(--rad-m); padding: 18px 20px; margin: 1.6em 0; }
.note__tag { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--tone, var(--brand)); margin-bottom: 0.5em; display: block; }
.note p:last-child { margin-bottom: 0; }
.note--warn { --tone: var(--r-covert); }
.note--info { --tone: var(--r-mil); }

/* ---------- calc (пресметнат пример) ---------- */
.calc { background: var(--ink-900); border: 1px solid var(--ink-650); border-radius: var(--rad-m); padding: 22px 24px; margin: 1.8em 0; }
.calc h4 { font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--paper-500); margin-bottom: 1em; }
.calc__row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; padding: 9px 0; border-bottom: 1px dashed var(--ink-650); }
.calc__row:last-child { border-bottom: none; }
.calc__value { font-family: var(--f-mono); color: var(--brand); }
.calc__row--total .calc__value { color: var(--paper-100); font-weight: 600; }

/* ---------- matrix (таблица) ---------- */
.matrix-scroll { overflow-x: auto; }
.matrix { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.9rem; }
.matrix th, .matrix td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--ink-650); }
.matrix th { font-family: var(--f-head); font-weight: 600; color: var(--paper-500); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; }
.matrix td { color: var(--paper-300); }
.matrix td.mono, .matrix th.mono { font-family: var(--f-mono); }
.matrix tr td:first-child { color: var(--paper-100); font-weight: 500; }
.matrix .dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 8px; }

/* ---------- slider-widget (демо на Float) ---------- */
.slider-widget { background: var(--ink-800); border: 1px solid var(--ink-650); border-radius: var(--rad-m); padding: 26px 26px 22px; margin: 1.8em 0; }
.slider-widget__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; flex-wrap: wrap; gap: 8px; }
.slider-widget__value { font-family: var(--f-mono); font-size: 1.4rem; color: var(--brand); }
.slider-widget__tier { font-family: var(--f-head); font-weight: 600; }
.slider-widget__tier[data-tier="fn"] { color: var(--wear-1); }
.slider-widget__tier[data-tier="mw"] { color: var(--wear-2); }
.slider-widget__tier[data-tier="ft"] { color: var(--wear-3); }
.slider-widget__tier[data-tier="ww"] { color: var(--wear-4); }
.slider-widget__tier[data-tier="bs"] { color: var(--wear-5); }
.slider-widget input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; height: 14px; margin: 10px 0 6px; border-radius: 999px;
  background: linear-gradient(to right, var(--wear-1) 0%, var(--wear-1) 7%, var(--wear-2) 7%, var(--wear-2) 15%,
    var(--wear-3) 15%, var(--wear-3) 38%, var(--wear-4) 38%, var(--wear-4) 45%, var(--wear-5) 45%, var(--wear-5) 100%);
}
.slider-widget input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ink-900); box-shadow: 0 0 0 1px rgba(0,0,0,0.3); cursor: pointer; margin-top: -3px; }
.slider-widget input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--ink-900); cursor: pointer; }
.slider-widget__hint { font-size: 0.85rem; color: var(--paper-500); margin-top: 10px; margin-bottom: 0; }

/* ---------- badges (кръгли значки за стикери) ---------- */
.badges { display: flex; gap: 14px; flex-wrap: wrap; margin: 1.6em 0; }
.badge { width: 76px; height: 76px; border-radius: 50%; border: 2px dashed var(--ink-600); display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 0.62rem; color: var(--paper-500); text-align: center; background: var(--ink-800); padding: 4px; }
.badge--filled { border-style: solid; }

/* ---------- faq (native details/summary) ---------- */
.faq { border-bottom: 1px solid var(--ink-650); padding: 14px 0; }
.faq summary {
  cursor: pointer; font-family: var(--f-head); font-weight: 600; font-size: 1.02rem; color: var(--paper-100);
  list-style: none; position: relative; padding-right: 26px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 0; color: var(--brand); font-size: 1.2rem; }
.faq[open] summary::after { content: "\2212"; }
.faq p { margin-top: 10px; margin-bottom: 0; color: var(--paper-300); font-size: 0.98rem; }

/* ---------- pager (prev/next) ---------- */
.pager { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 30px 0 10px; }
@media (min-width: 700px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a { display: block; border: 1px solid var(--ink-650); border-radius: var(--rad-m); padding: 18px 20px; background: var(--ink-800); }
.pager a:hover { border-color: var(--brand); }
.pager__dir { font-family: var(--f-mono); font-size: 0.7rem; color: var(--paper-500); text-transform: uppercase; }
.pager__title { font-family: var(--f-head); font-weight: 600; margin-top: 4px; }
.pager__next { text-align: right; }

/* ---------- форма за контакт ---------- */
.field-group { display: grid; grid-template-columns: 1fr; gap: 16px; max-width: 560px; }
.control label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--paper-300); }
.control input, .control textarea, .control select {
  width: 100%; background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--rad-s);
  padding: 11px 13px; color: var(--paper-100); font-family: var(--f-body); font-size: 0.95rem;
}
.control textarea { resize: vertical; min-height: 130px; }
.control input::placeholder, .control textarea::placeholder { color: var(--paper-500); }
.fine-print { font-size: 0.82rem; color: var(--paper-500); }

.info-cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 2em; }
@media (min-width: 700px) { .info-cards { grid-template-columns: repeat(3, 1fr); } }
.info-card { border: 1px solid var(--ink-650); border-radius: var(--rad-m); padding: 18px 20px; background: var(--ink-800); }
.info-card__key { font-family: var(--f-mono); font-size: 0.68rem; color: var(--paper-500); text-transform: uppercase; letter-spacing: 0.04em; }
.info-card__val { font-family: var(--f-head); font-weight: 600; margin-top: 6px; font-size: 1.02rem; }

/* ---------- foot ---------- */
.foot { border-top: 1px solid var(--ink-650); background: var(--ink-900); padding: 42px 0 26px; }
.foot__grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-bottom: 30px; }
@media (min-width: 700px) { .foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot__grid h4 { font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--paper-500); margin-bottom: 14px; }
.foot__grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.foot__grid a { color: var(--paper-300); font-size: 0.92rem; }
.foot__grid a:hover { color: var(--paper-100); }
.foot__about { color: var(--paper-300); font-size: 0.9rem; max-width: 42ch; }
.foot__bottom { border-top: 1px solid var(--ink-650); padding-top: 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 0.8rem; color: var(--paper-500); }
.foot__bottom a { color: var(--paper-500); }
.foot__bottom a:hover { color: var(--paper-300); }
