/* =====================================================================
   Илко Василев — дизайн система „черно и злато“
   Шрифтове: Cormorant Garamond (заглавия), Golos Text (текст), JetBrains Mono (етикети). SIL OFL.
   ===================================================================== */
@font-face { font-family: "Cormorant"; src: url("fonts/cormorant-lat.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; src: url("fonts/cormorant-cyr.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Cormorant"; src: url("fonts/cormorant-lat-i.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Cormorant"; src: url("fonts/cormorant-cyr-i.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; src: url("fonts/golos.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/jbmono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  --bg: #08080a; --bg-2: #0c0c0f; --bg-3: #121216;
  --glass: rgba(255, 255, 255, .026); --glass-2: rgba(255, 255, 255, .05);
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .15);
  --gold: #c8a75e; --gold-hi: #e7d09a; --gold-lo: #8a6f34;
  --gold-soft: rgba(200, 167, 94, .1); --gold-line: rgba(200, 167, 94, .34);
  --gold-grad: linear-gradient(118deg, #f1dfaa 0%, #c8a75e 42%, #8a6f34 100%);
  --ink: #eeeae1; --ink-2: #c6c0b3; --muted: #8f8a80;
  --pos: #3987e5; --neg: #e66767;
  --serif: "Cormorant", "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --max: 1180px; --r: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: clip;
  font-feature-settings: "locl" 0, "lnum" 1; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(1100px 560px at 78% -8%, rgba(200, 167, 94, .09), transparent 62%),
              radial-gradient(800px 500px at -10% 30%, rgba(200, 167, 94, .035), transparent 60%); }
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); text-decoration-color: var(--gold-line); text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--gold); }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 500; letter-spacing: -.005em; color: var(--ink); }
h1 { font-size: clamp(2.25rem, 4.3vw, 3.4rem); line-height: 1.08; }
h2 { font-size: clamp(1.75rem, 2.9vw, 2.45rem); line-height: 1.12; }
h3 { font: 600 1.08rem/1.35 var(--sans); }
h1 em, h2 em { font-style: italic; color: var(--gold-hi); }
p { max-width: 68ch; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
::selection { background: rgba(200, 167, 94, .35); color: #fff; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .wrap { padding: 0 32px; } }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Етикети и разделители ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font: 500 .72rem/1.4 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
.rule { position: relative; height: 1px; border: 0; margin: 0; background: linear-gradient(90deg, transparent, var(--gold-line) 18%, var(--gold-line) 82%, transparent); }
.rule::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg); background: var(--bg); border: 1px solid var(--gold); }

/* ---------- Хедър ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(8, 8, 10, .74); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 28px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 .8rem/1 var(--sans); letter-spacing: .24em; text-transform: uppercase; color: var(--ink); text-decoration: none; margin-right: auto; padding: 6px 0; }
.brand::before { content: ""; width: 9px; height: 9px; transform: rotate(45deg); background: var(--gold-grad); }
.brand span { display: none; }
.nav { display: flex; gap: 22px; width: 100%; overflow-x: auto; scrollbar-width: none; order: 3; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; flex: none; color: var(--muted); text-decoration: none; font-size: .9rem; letter-spacing: .02em; padding: 6px 0; transition: color .25s; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); }
.nav a:hover { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a[aria-current="page"] { color: var(--gold-hi); }
@media (min-width: 760px) { .nav { width: auto; order: 0; gap: 30px; overflow: visible; } }

/* ---------- Бутони ---------- */
.btns { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.btn { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 13px 22px; border-radius: 999px; cursor: pointer;
  font: 500 .95rem/1 var(--sans); letter-spacing: .02em; text-decoration: none; color: var(--gold-hi); background: transparent; border: 0; isolation: isolate;
  transition: color .35s var(--ease), box-shadow .35s var(--ease); }
.btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: var(--gold-grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; z-index: -1; }
.btn::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--gold-grad); opacity: 0; transition: opacity .35s var(--ease); z-index: -2; }
.btn:hover, .btn:focus-visible { color: #120f08; box-shadow: 0 10px 34px -12px rgba(200, 167, 94, .55); }
.btn:hover::after, .btn:focus-visible::after { opacity: 1; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-solid { color: #120f08; }
.btn-solid::after { opacity: 1; }
.btn-solid:hover { box-shadow: 0 12px 40px -10px rgba(200, 167, 94, .7); }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.link-arrow::after { content: "→"; color: var(--gold); transition: transform .3s var(--ease); }
.link-arrow:hover { color: var(--ink); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Секции ---------- */
.sec { padding: 96px 0; }
.sec-tight { padding: 64px 0; }
.sec-head { display: grid; gap: 16px; margin-bottom: 48px; max-width: 720px; }
.sec-head p { color: var(--ink-2); font-size: 1.05rem; }
.split { display: grid; gap: 28px; }
@media (min-width: 900px) { .split { grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; } .split > :first-child { position: sticky; top: 110px; } }

/* ---------- Стъкло ---------- */
.glass { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015)); border: 1px solid var(--line);
  border-radius: var(--r); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.glass::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(231, 208, 154, .45), transparent 32%, transparent 70%, rgba(200, 167, 94, .18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* ---------- Книга с факти (вместо кутии с цифри) ---------- */
.ledger { list-style: none; margin: 0; padding: 0; display: grid; }
.ledger li { display: grid; grid-template-columns: minmax(96px, auto) 1fr; gap: 18px; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--line); }
.ledger li:last-child { border-bottom: 1px solid var(--line); }
.ledger b { font: 400 1.65rem/1 var(--sans); letter-spacing: -.02em; color: var(--gold-hi); white-space: nowrap; }
.ledger b small { font-size: .55em; color: var(--gold); margin-left: 2px; }
.ledger span { font-size: .92rem; color: var(--ink-2); line-height: 1.45; }

/* ---------- Етикети ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 0; padding: 0; }
.tags li { font: 500 .74rem/1.3 var(--mono); letter-spacing: .06em; color: var(--muted); }
.tags li::before { content: "◆"; font-size: .55em; color: var(--gold-lo); margin-right: 7px; vertical-align: .25em; }

/* ---------- Появяване при скрол ---------- */
.js .reveal { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Снимки на екрани ---------- */
.frame { margin: 0; display: grid; gap: 14px; align-content: start; }
.frame-win { position: relative; border-radius: 12px; overflow: hidden; background: #0b0b0d; border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(200, 167, 94, .06); }
.frame-bar { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-bottom: 1px solid var(--line); background: #111114; }
.frame-bar i { width: 8px; height: 8px; border-radius: 50%; background: #2a2a30; }
.frame-bar span { margin-left: 10px; font: 500 .68rem/1 var(--mono); letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.frame-win img { width: 100%; height: auto; }
.frame figcaption { font-size: .93rem; color: var(--ink-2); max-width: 64ch; }
.frame figcaption b { color: var(--gold-hi); font-weight: 600; }

/* ---------- Проектна страница: общи части ---------- */
.p-hero { padding: 72px 0 80px; position: relative; }
.p-meta { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 26px; font-size: .9rem; color: var(--muted); }
.p-meta b { color: var(--ink); font-weight: 500; }
.back { display: flex; width: fit-content; gap: 8px; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: 26px; }
.back:hover { color: var(--gold-hi); }
.lead { font-size: 1.16rem; color: var(--ink-2); line-height: 1.65; }
.note { font-size: .86rem; color: var(--muted); }
.lessons { display: grid; gap: 0; }
.lessons li { list-style: none; display: grid; gap: 6px; padding: 22px 0 22px 26px; border-top: 1px solid var(--line); position: relative; }
.lessons li::before { content: ""; position: absolute; left: 0; top: 31px; width: 9px; height: 9px; transform: rotate(45deg); border: 1px solid var(--gold); }
.lessons { margin: 0; padding: 0; }
.lessons p { color: var(--ink-2); }
.beyond { display: grid; gap: 18px; padding: 34px; }
@media (min-width: 760px) { .beyond { grid-template-columns: 1fr auto; align-items: center; padding: 40px 44px; } }

/* ---------- Прозорец „Покажи на живо“ ---------- */
dialog.demo { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: #0f0f12;
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .95), 0 0 0 1px var(--gold-line); }
dialog.demo::backdrop { background: rgba(4, 4, 6, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.demo[open] { animation: pop .45s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.demo-in { display: grid; gap: 16px; padding: 30px 28px 26px; }
.demo-in h2 { font-size: 1.8rem; }
.demo-in p { color: var(--ink-2); font-size: .98rem; }
.demo-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink-2); cursor: pointer; font-size: 1.1rem; }
.demo-x:hover { color: var(--gold-hi); border-color: var(--gold-line); }

/* ---------- Подсказка за графики ---------- */
.tip { position: fixed; z-index: 60; pointer-events: none; max-width: 260px; padding: 9px 12px; border-radius: 10px; font-size: .84rem; line-height: 1.45;
  background: rgba(18, 18, 22, .96); color: var(--ink); border: 1px solid var(--gold-line); box-shadow: 0 18px 40px -16px #000; opacity: 0; transition: opacity .15s; }
.tip.on { opacity: 1; }
.tip b { color: var(--gold-hi); font-weight: 600; }

/* ---------- Футър ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 44px; color: var(--muted); font-size: .88rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--gold-hi); }
