/* AXIMA AI — Guides styles
   Theme: light by default, [data-theme="dark"] for dark.
   Brand: Royal Blue (#1E40AF → #1E3A8A). Fonts: Inter Tight + Inter. */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --bg2: #FAFAF7;
  --bg3: #F4F3EE;
  --ink: #0B0D17;
  --ink2: #3D4252;
  --dim: #8A8FA3;
  --border: #E7E9F1;
  --border2: #EFECE4;
  --brand: #1E40AF;
  --brand-deep: #1E3A8A;
  --brand-soft: #DBEAFE;
  --brand-on-soft: #1E3A8A;
  --accent: #4F3BFF;
  --header-bg-rgb: 255, 255, 255;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D17;
  --bg2: #11141F;
  --bg3: #161A28;
  --ink: #F4F5F8;
  --ink2: #B8BCC8;
  --dim: #6E7385;
  --border: #1F2333;
  --border2: #262A3B;
  --brand: #5B82F5;
  --brand-deep: #3B5FE0;
  --brand-soft: rgba(91, 130, 245, 0.14);
  --brand-on-soft: #8FA8F7;
  --accent: #7D6CFF;
  --header-bg-rgb: 11, 13, 23;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Inter Tight', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

/* HEADER */
header.site {
  position: sticky; top: 0; z-index: 100;
  background: rgba(var(--header-bg-rgb), 0.94);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}
header.site .row {
  display: flex; align-items: center; justify-content: space-between; height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo .mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-family: 'Inter Tight', sans-serif; letter-spacing: -0.02em;
}
.logo .name { font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
nav.main { display: flex; gap: 28px; }
nav.main a { color: var(--ink2); text-decoration: none; font-weight: 500; font-size: 15px; transition: color 0.15s; }
nav.main a:hover { color: var(--brand); }
nav.main a.current { color: var(--brand); font-weight: 700; }
.right-actions { display: flex; align-items: center; gap: 14px; position: relative; }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); display: grid; place-items: center; cursor: pointer;
  color: var(--ink2); transition: border-color 0.15s, color 0.15s, transform 0.1s;
  font-family: inherit;
}
.theme-toggle:hover { border-color: var(--brand); color: var(--brand); }
.theme-toggle:active { transform: scale(0.96); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.btn-bot {
  background: var(--ink); color: var(--bg); text-decoration: none;
  padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px;
  transition: opacity 0.15s;
}
.btn-bot:hover { opacity: 0.9; }
[data-theme="dark"] .btn-bot { background: var(--brand); color: #fff; }

/* THEME HINT TOOLTIP (one-time, native, light + dark adaptive) */
.theme-hint {
  position: absolute;
  top: calc(100% + 14px);
  right: 88px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px 14px 16px;
  font-size: 13px; line-height: 1.45;
  color: var(--ink2);
  box-shadow: 0 12px 28px rgba(11, 13, 23, 0.14), 0 2px 6px rgba(11, 13, 23, 0.06);
  display: flex; gap: 10px; align-items: flex-start;
  width: 290px; max-width: calc(100vw - 32px);
  opacity: 0; transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 110;
}
.theme-hint.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.theme-hint::before {
  content: ''; position: absolute; top: -6px; right: 96px;
  width: 12px; height: 12px;
  background: var(--bg); border-left: 1px solid var(--border); border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
/* Soft pulse on the toggle itself while the hint is visible, so the eye finds it. */
@keyframes themePulse {
  0%   { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(30, 64, 175, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}
.theme-toggle.pulse { animation: themePulse 1.6s ease-out 2; }
[data-theme="dark"] .theme-toggle.pulse { animation-name: themePulseDark; }
@keyframes themePulseDark {
  0%   { box-shadow: 0 0 0 0 rgba(91, 130, 245, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(91, 130, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(91, 130, 245, 0); }
}
.theme-hint-icon {
  width: 28px; height: 28px; border-radius: 8px; background: var(--brand-soft);
  display: grid; place-items: center; color: var(--brand); flex-shrink: 0;
}
.theme-hint-icon svg { width: 16px; height: 16px; }
.theme-hint-text { flex: 1; padding-top: 2px; font-family: 'Inter', sans-serif; }
.theme-hint-text b { color: var(--ink); font-weight: 700; }
.theme-hint-close {
  background: transparent; border: none; cursor: pointer;
  color: var(--dim); padding: 2px; margin: -2px -2px 0 0;
  display: grid; place-items: center; font-family: inherit;
}
.theme-hint-close:hover { color: var(--ink); }
.theme-hint-close svg { width: 14px; height: 14px; }

/* LISTING HERO */
.hero { padding: 64px 0 40px; background: var(--bg2); }
.hero h1 {
  font-family: 'Inter Tight', sans-serif; font-size: 52px; font-weight: 800;
  line-height: 1.05; letter-spacing: -0.025em; max-width: 820px; color: var(--ink);
}
.hero .lead { color: var(--ink2); font-size: 18px; line-height: 1.5; max-width: 680px; margin-top: 18px; }
.breadcrumb { display: flex; gap: 8px; color: var(--dim); font-size: 13px; margin-bottom: 18px; }
.breadcrumb a { color: var(--dim); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink2); }

/* FILTERS */
.filters { padding: 24px 0 16px; border-bottom: 1px solid var(--border); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.filter-label {
  font-size: 12px; color: var(--dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; margin-right: 8px;
}
.chip {
  border: 1px solid var(--border); background: var(--bg);
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  color: var(--ink2); cursor: pointer; font-family: inherit;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.tag { font-size: 12px; padding: 6px 12px; color: var(--dim); }
.chip.tag:hover { color: var(--brand); }
.chip.tag.active { background: var(--brand-soft); color: var(--brand-on-soft); border-color: var(--brand-soft); }

/* GRID */
.grid-section { padding: 36px 0 80px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(11, 13, 23, 0.06), 0 2px 6px rgba(11, 13, 23, 0.04);
  border-color: var(--brand-soft);
}
.cover {
  aspect-ratio: 1200 / 630;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 22px; color: #fff;
}
.cover-cat { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; opacity: 0.85; font-family: 'Inter Tight', sans-serif; }
.cover-title { font-family: 'Inter Tight', sans-serif; font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; max-width: 90%; }
.cover-foot { display: flex; justify-content: space-between; align-items: center; }
.cover-axima { font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 13px; letter-spacing: 0.05em; opacity: 0.9; }
.cover-deco { position: absolute; right: -30px; bottom: -30px; width: 140px; height: 140px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.12); }

.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--dim); flex-wrap: wrap; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.card-level { font-size: 11px; font-weight: 600; color: var(--brand-on-soft); background: var(--brand-soft); padding: 3px 8px; border-radius: 6px; }
.card-title { font-family: 'Inter Tight', sans-serif; font-size: 19px; font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; color: var(--ink); }
.card-desc { color: var(--ink2); font-size: 14px; line-height: 1.5; flex: 1; }
.card-author { display: flex; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); margin-top: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 13px; }
.avatar.av-anton { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .avatar.av-anton { background: #FFFFFF; color: #0B0D17; }
.author-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.author-role { font-size: 11px; color: var(--dim); }

/* ARTICLE */
.article-head { padding: 48px 0 24px; background: var(--bg2); border-bottom: 1px solid var(--border); }
.cat-pill {
  display: inline-block; background: var(--brand-soft); color: var(--brand-on-soft);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 18px; text-decoration: none;
}
h1.article-title {
  font-family: 'Inter Tight', sans-serif; font-size: 44px; font-weight: 800;
  line-height: 1.1; letter-spacing: -0.025em; max-width: 840px; color: var(--ink);
}
.article-meta { display: flex; gap: 18px; align-items: center; margin-top: 24px; color: var(--dim); font-size: 14px; flex-wrap: wrap; }
.article-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.level-pill { background: var(--bg); border: 1px solid var(--border); padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--ink2); }
[data-theme="dark"] .level-pill { background: var(--bg3); }
.article-author { display: flex; align-items: center; gap: 10px; }
.article-author .avatar { width: 34px; height: 34px; font-size: 14px; }
.author-block .name { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.author-block .role { font-size: 11px; color: var(--dim); }

.cover-wide {
  aspect-ratio: 1200 / 420;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  margin: 32px 0 40px; border-radius: 20px; padding: 40px 48px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.cover-wide .cover-cat { font-size: 12px; }
.cover-wide .cover-h { font-family: 'Inter Tight', sans-serif; font-size: 42px; font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; max-width: 80%; }
.cover-wide .cover-axima { font-family: 'Inter Tight', sans-serif; font-weight: 800; font-size: 15px; letter-spacing: 0.05em; opacity: 0.9; }
.cover-wide::after { content: ''; position: absolute; right: -80px; bottom: -80px; width: 280px; height: 280px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.10); }
.cover-wide::before { content: ''; position: absolute; right: -40px; bottom: -40px; width: 200px; height: 200px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.14); }

.article-body { padding: 0 0 80px; }
.tldr {
  background: var(--brand-soft); border-left: 4px solid var(--brand);
  padding: 20px 24px; border-radius: 0 12px 12px 0; margin-bottom: 36px;
}
.tldr .label { font-family: 'Inter Tight', sans-serif; font-size: 12px; font-weight: 800; color: var(--brand-on-soft); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.tldr p { font-size: 16px; color: var(--ink); line-height: 1.55; }

.article-body p { font-size: 17px; line-height: 1.7; color: var(--ink2); margin-bottom: 18px; }
.article-body h2 { font-family: 'Inter Tight', sans-serif; font-size: 28px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); margin: 40px 0 16px; }
.article-body h3 { font-family: 'Inter Tight', sans-serif; font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--ink); margin: 28px 0 12px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body table {
  width: 100%; border-collapse: collapse; margin: 24px 0;
  font-size: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.article-body th { background: var(--bg2); text-align: left; padding: 12px 14px; font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--border); }
.article-body td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--ink2); }
.article-body tr:last-child td { border-bottom: none; }
.article-body td.money { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); white-space: nowrap; }
.article-body ul, .article-body ol { margin: 14px 0 18px 22px; }
.article-body li { font-size: 17px; line-height: 1.65; color: var(--ink2); margin-bottom: 8px; }
.article-body blockquote { border-left: 3px solid var(--brand); padding: 4px 0 4px 20px; margin: 20px 0; color: var(--ink); font-style: italic; }
.article-body code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.92em; color: var(--ink); }

.callout {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 18px 22px; border-radius: 12px; margin: 24px 0;
}
.callout .label { font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: 13px; color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.callout .formula { margin: 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; color: var(--ink); line-height: 1.6; }

.cta-box {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff; padding: 36px 40px; border-radius: 20px; margin: 48px 0;
}
.cta-box h3 { font-family: 'Inter Tight', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.015em; margin-bottom: 10px; color: #fff; }
.cta-box p { color: rgba(255, 255, 255, 0.85); font-size: 16px; line-height: 1.5; margin-bottom: 20px; }
.cta-box .btn { display: inline-block; background: #fff; color: var(--brand-deep); padding: 12px 22px; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 15px; transition: transform 0.1s; }
.cta-box .btn:hover { transform: translateY(-1px); }

/* RELATED */
.related { padding: 48px 0 80px; background: var(--bg2); border-top: 1px solid var(--border); }
.related h2 { font-family: 'Inter Tight', sans-serif; font-size: 24px; font-weight: 800; margin-bottom: 24px; letter-spacing: -0.015em; color: var(--ink); }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rel-card { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px; text-decoration: none; color: inherit; transition: border-color 0.15s, transform 0.15s; }
.rel-card:hover { border-color: var(--brand-soft); transform: translateY(-2px); }
[data-theme="dark"] .rel-card { background: var(--bg3); }
.rel-card .rel-cat { font-size: 11px; color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.rel-card h4 { font-family: 'Inter Tight', sans-serif; font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.rel-card .rel-meta { font-size: 12px; color: var(--dim); margin-top: 10px; }

/* FOOTER */
footer { padding: 48px 0; background: var(--bg3); border-top: 1px solid var(--border2); }
[data-theme="dark"] footer { background: #070811; }
footer .row { display: flex; justify-content: space-between; color: var(--dim); font-size: 13px; flex-wrap: wrap; gap: 12px; }
footer .footer-legal { line-height: 1.6; }
footer a { color: var(--dim); text-decoration: none; }
footer a:hover { color: var(--ink2); }

/* MOBILE */
@media (max-width: 900px) {
  nav.main { display: none; }
  .hero h1 { font-size: 38px; }
  h1.article-title { font-size: 32px; }
  .grid, .related-grid { grid-template-columns: 1fr; }
  .container, .narrow { padding: 0 20px; }
  .cover-wide { padding: 24px 28px; }
  .cover-wide .cover-h { font-size: 26px; }
  .cta-box { padding: 24px 24px; }
  .theme-hint { right: 60px; max-width: calc(100vw - 80px); }
  .theme-hint::before { right: 76px; }
}
