/* ============================================================
   Iván Martanov — личный блог. Палитра navy/gold (АМОР-семья).
   Все цвета и радиусы — токены ниже. Никаких inline-стилей.
   ============================================================ */

:root{
  /* navy */
  --navy-950:#061428;
  --navy-900:#0B1D3A;
  --navy-800:#102548;
  --navy-700:#16315C;

  /* brand / акцент */
  --brand:#0591F9;
  --brand-600:#0478D3;
  --brand-100:#E6F3FE;

  /* gold — основной CTA и подсветка в заголовках */
  --gold:#E8A73C;
  --gold-600:#D2902A;
  --gold-100:#FFF3D9;

  /* нейтрали */
  --ink:#0E1A2B;
  --ink-soft:#1E2B41;
  --muted:#5A6B82;
  --muted-2:#8092AB;

  --paper:#FAFBFD;
  --paper-2:#F2F5FA;
  --line:#E3E9F1;
  --line-strong:#D6DEEA;

  /* радиусы и тени */
  --radius:14px;
  --radius-lg:22px;
  --shadow-sm:0 6px 18px rgba(7,21,46,.06);
  --shadow-md:0 14px 34px rgba(7,21,46,.09);
  --shadow-lg:0 22px 60px rgba(5,25,60,.16);

  /* контейнер */
  --gutter:clamp(20px, 4vw, 36px);
}

/* ---------- сброс и база ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  font-family:-apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
  font-size:16px; line-height:1.55;
  color:var(--ink);
  background:var(--paper);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
img,svg{display:block; max-width:100%}
a{color:inherit; text-decoration:none}
button{font:inherit; cursor:pointer; border:none; background:none; color:inherit}
h1,h2,h3,h4{margin:0; line-height:1.2; letter-spacing:-.01em}
p{margin:0}

::selection{background:var(--gold-100); color:var(--ink)}

/* ---------- SVG icons (из amor-style) ---------- */
.ic{display:inline-flex; align-items:center; justify-content:center; line-height:0; color:var(--brand-600)}
.ic > svg{
  width:1em; height:1em; display:block;
  fill:none; stroke:currentColor; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round;
  transition:transform .35s cubic-bezier(.4,1.4,.5,1), filter .25s ease;
}
.ic-emerald{color:#16A37B}
.ic-sky    {color:#0E80F4}
.ic-rose   {color:#E1486D}
.ic-amber  {color:#E8A73C}
.ic-violet {color:#7A5CD9}
.ic-teal   {color:#0CA3A3}
.ic-coral  {color:#F26B4F}

@keyframes ic-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes ic-pulse{0%,100%{filter:drop-shadow(0 0 0 transparent)}50%{filter:drop-shadow(0 0 4px currentColor)}}

/* ---------- layout: sidebar + main ---------- */
.shell{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:48px;
  max-width:1180px;
  margin:0 auto;
  padding:40px var(--gutter) 80px;
  align-items:start;
}

/* ---------- sidebar ---------- */
.side{
  position:sticky; top:32px;
  display:flex; flex-direction:column; gap:22px;
}
.side-card{
  background:var(--navy-900);
  color:#E9EEF8;
  border-radius:var(--radius-lg);
  padding:28px 24px;
  box-shadow:var(--shadow-md);
  position:relative; overflow:hidden;
}
.side-card::before{
  content:""; position:absolute; inset:-30% -30% auto auto;
  width:240px; height:240px; border-radius:50%;
  background:radial-gradient(circle, rgba(232,167,60,.18), transparent 70%);
  pointer-events:none;
}
.side-avatar{
  width:110px; height:110px; border-radius:50%;
  object-fit:cover; object-position:center top;
  border:3px solid var(--gold);
  box-shadow:0 8px 24px rgba(0,0,0,.25);
  margin-bottom:16px;
}
.side-name{
  font-size:22px; font-weight:800; color:#fff;
  letter-spacing:-.01em;
}
.side-role{
  font-size:13.5px; color:var(--gold);
  font-weight:600; text-transform:uppercase; letter-spacing:.06em;
  margin-top:4px;
}
.side-bio{
  font-size:14.5px; line-height:1.55;
  color:rgba(233,238,248,.78);
  margin-top:14px;
}
.side-links{
  display:flex; gap:10px; margin-top:18px; flex-wrap:wrap;
}
.side-link{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600;
  padding:7px 12px; border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  color:#E9EEF8;
  transition:.15s ease;
}
.side-link:hover{background:rgba(232,167,60,.15); border-color:var(--gold)}
.side-link .ic{font-size:14px}

/* категории */
.cats-block{
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:22px 20px;
  box-shadow:var(--shadow-sm);
}
.cats-title{
  font-size:11.5px; font-weight:700;
  color:var(--muted);
  text-transform:uppercase; letter-spacing:.08em;
  margin-bottom:14px;
}
.cats{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:2px }
.cat{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px; border-radius:10px;
  font-size:14.5px; font-weight:500; color:var(--ink);
  transition:.15s ease;
  cursor:pointer;
}
.cat:hover{background:var(--paper-2)}
.cat.is-active{background:var(--paper-2); font-weight:700}
.cat .ic{font-size:18px; flex-shrink:0}
.cat-name{flex:1}
.cat-count{
  font-size:12px; font-weight:600; color:var(--muted-2);
  background:var(--paper-2);
  padding:2px 8px; border-radius:999px;
  min-width:24px; text-align:center;
}
.cat.is-active .cat-count{background:var(--gold-100); color:var(--gold-600)}

/* ---------- main ---------- */
.main{ min-width:0 }
.page-head{
  margin-bottom:32px;
  padding-bottom:24px;
  border-bottom:1px solid var(--line);
}
.kicker{
  display:inline-block;
  font-size:12px; font-weight:700;
  color:var(--gold-600);
  text-transform:uppercase; letter-spacing:.08em;
  margin-bottom:10px;
}
.page-title{
  font-size:clamp(28px, 4vw, 40px); font-weight:800;
  color:var(--ink);
}
.page-title .accent{ color:var(--gold-600) }
.page-lead{
  font-size:17px; color:var(--muted);
  margin-top:10px;
  max-width:60ch;
}

/* фильтр-чипы (мобила) */
.filter-bar{
  display:none;
  flex-wrap:wrap; gap:8px;
  margin-bottom:24px;
}
.chip{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13px; font-weight:600;
  padding:7px 12px; border-radius:999px;
  background:#fff; border:1px solid var(--line);
  color:var(--ink);
}
.chip.is-active{background:var(--ink); color:#fff; border-color:var(--ink)}
.chip .ic{font-size:14px}

/* ---------- posts list ---------- */
.posts{ display:flex; flex-direction:column; gap:18px }

.post-card{
  display:block;
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:26px 28px;
  box-shadow:var(--shadow-sm);
  transition:transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.post-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:var(--line-strong);
}

.post-meta{
  display:flex; align-items:center; gap:10px;
  font-size:13px; color:var(--muted);
  margin-bottom:12px; flex-wrap:wrap;
}
.post-meta time{color:var(--muted)}
.post-meta .dot{
  width:3px; height:3px; border-radius:50%;
  background:var(--muted-2);
}
.tag{
  display:inline-flex; align-items:center; gap:6px;
  font-size:12px; font-weight:700;
  padding:4px 10px; border-radius:999px;
  letter-spacing:.01em;
}
.tag .ic{font-size:13px}

.tag-startup    {background:#FFE9EF; color:#B83056}
.tag-telecom    {background:#E1EFFD; color:#0A5BA3}
.tag-philosophy {background:#EFE9FB; color:#5B3CC4}
.tag-happening  {background:#DEF6EC; color:#0A7C58}

.post-title{
  font-size:22px; font-weight:800; color:var(--ink);
  letter-spacing:-.01em;
  margin-bottom:10px;
}
.post-card:hover .post-title{color:var(--brand-600)}
.post-lead{
  font-size:15.5px; color:var(--muted);
  line-height:1.6;
}
.post-foot{
  display:flex; align-items:center; gap:14px;
  margin-top:18px;
  font-size:13px; color:var(--muted-2);
}
.read-more{
  display:inline-flex; align-items:center; gap:6px;
  color:var(--brand-600); font-weight:700;
}
.read-more .ic{font-size:14px; transition:transform .15s ease}
.post-card:hover .read-more .ic{transform:translateX(3px)}

/* пустое состояние при фильтре */
.empty{
  background:#fff; border:1px dashed var(--line-strong);
  border-radius:var(--radius-lg);
  padding:48px 28px; text-align:center;
  color:var(--muted);
}
.empty .ic{font-size:36px; color:var(--muted-2); margin:0 auto 12px}
.empty-sub{margin-top:4px; font-size:13px}

/* ---------- article (страница поста) ---------- */
.article-shell{
  max-width:760px;
  margin:0 auto;
  padding:40px var(--gutter) 80px;
}
.back-link{
  display:inline-flex; align-items:center; gap:8px;
  font-size:14px; font-weight:600; color:var(--muted);
  margin-bottom:24px;
}
.back-link:hover{color:var(--brand-600)}
.back-link .ic{font-size:16px}

.article-head{
  border-bottom:1px solid var(--line);
  padding-bottom:24px; margin-bottom:32px;
}
.article-meta{
  display:flex; align-items:center; gap:10px;
  font-size:13.5px; color:var(--muted);
  margin-bottom:16px; flex-wrap:wrap;
}
.article-meta .dot{
  width:3px; height:3px; border-radius:50%;
  background:var(--muted-2); display:inline-block;
}
.article-title{
  font-size:clamp(28px, 4vw, 42px); font-weight:800;
  color:var(--ink); letter-spacing:-.015em;
}
.article-lead{
  font-size:18px; color:var(--muted);
  margin-top:14px; line-height:1.55;
}

.article-body{
  font-size:17px; line-height:1.7; color:var(--ink-soft);
}
.article-body h2{
  font-size:24px; font-weight:800; color:var(--ink);
  margin:36px 0 14px;
}
.article-body h3{
  font-size:19px; font-weight:700; color:var(--ink);
  margin:28px 0 10px;
}
.article-body p{ margin:16px 0 }
.article-body ul,
.article-body ol{ margin:16px 0; padding-left:22px }
.article-body li{ margin:6px 0 }
.article-body blockquote{
  margin:24px 0;
  padding:16px 22px;
  border-left:3px solid var(--gold);
  background:var(--gold-100);
  border-radius:0 14px 14px 0;
  color:var(--ink-soft);
  font-style:italic;
}
.article-body a{ color:var(--brand-600); border-bottom:1px solid var(--brand-100) }
.article-body a:hover{ border-bottom-color:var(--brand) }
.article-body code{
  background:var(--paper-2); padding:2px 6px;
  border-radius:6px; font-size:.92em;
  font-family:"SF Mono", Menlo, Consolas, monospace;
}
.article-body img{
  border-radius:var(--radius-lg);
  margin:24px 0;
  box-shadow:var(--shadow-sm);
}
.article-body .formula{
  display:block; text-align:center;
  font-size:17.5px; font-weight:600; color:var(--ink);
  background:linear-gradient(140deg, var(--paper-2) 0%, var(--gold-100) 100%);
  border:1px solid var(--line);
  padding:22px 18px; border-radius:var(--radius-lg);
  margin:28px 0; line-height:1.8;
}
.article-body .formula .arr{
  color:var(--gold-600); margin:0 6px;
  font-weight:800; display:inline-block;
}
.article-body .formula b{color:var(--gold-600); font-weight:800}

.article-foot{
  margin-top:48px; padding-top:28px;
  border-top:1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between; gap:18px;
  flex-wrap:wrap;
}
.article-foot .back-link{margin:0}
.author-row{
  display:flex; align-items:center; gap:14px;
}
.author-row img{
  width:48px; height:48px; border-radius:50%;
  object-fit:cover; object-position:center top;
  border:2px solid var(--gold);
}
.author-name{font-weight:700; color:var(--ink); font-size:15px}
.author-sub{font-size:13px; color:var(--muted); margin-top:2px}

/* ---------- footer ---------- */
.foot{
  border-top:1px solid var(--line);
  padding:32px var(--gutter);
  text-align:center;
  font-size:13px; color:var(--muted-2);
}
.foot a{color:var(--muted); border-bottom:1px solid transparent}
.foot a:hover{color:var(--brand-600); border-bottom-color:var(--brand-100)}

/* ---------- адаптив ---------- */
@media (max-width:1000px){
  .shell{
    grid-template-columns:1fr;
    gap:24px;
    padding-top:24px;
  }
  .side{
    position:static;
    flex-direction:row;
    gap:18px;
    align-items:stretch;
  }
  .side-card{flex:1; min-width:0}
  .cats-block{flex:1; min-width:0}
}

@media (max-width:720px){
  .side{flex-direction:column}
  .filter-bar{display:flex}
  .cats-block{display:none}
  .post-card{padding:22px}
  .post-title{font-size:20px}
}

@media (max-width:600px){
  .side-card{padding:22px 20px}
  .side-avatar{width:90px; height:90px}
  .side-name{font-size:20px}
  .article-shell{padding:24px var(--gutter) 60px}
  .article-body{font-size:16px}
  .article-body h2{font-size:21px}
}

@media (prefers-reduced-motion:reduce){
  .ic > svg{animation:none !important; transition:none !important}
  .post-card{transition:none}
}
