:root{
  /* Calm light palette (lower contrast) */
  --bg:#eceff5;                  /* общий фон */
  --bg2:#e7ebf2;                 /* мягкий слой */
  --panel:#ffffff;               /* карточки */
  --panel2:#f6f8fc;              /* внутренние блоки */
  --panel3:#eef3fb;              /* hover внутри списков */
  --text:#0f172a;
  --muted:#64748b;
  --line:rgba(15, 23, 42, .10);

  --accent:#2b6ff0;              /* спокойный синий */
  --accent2:#245fd0;

  --shadow: 0 16px 36px rgba(15, 23, 42, .08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, .06);

  color-scheme: light;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;

  /* Очень мягкий фон без “грязных” полос */
  background:
    radial-gradient(1000px 560px at 18% -12%, rgba(43,111,240,.08), transparent 62%),
    radial-gradient(900px 520px at 100% 0%, rgba(43,111,240,.06), transparent 58%),
    linear-gradient(180deg, var(--bg), var(--bg2));

  color:var(--text);
  line-height:1.6;

  min-height:100vh;
  display:flex;
  flex-direction:column;
}

a{color:var(--accent); text-decoration:none}
a:hover{color:var(--accent2)}
.container{max-width:1120px; margin:0 auto; padding:0 16px}

/* Header */
.site-header{
  position:sticky; top:0; z-index:10;
  backdrop-filter:saturate(140%) blur(12px);
  background: rgba(247,248,251,.86);
  border-bottom:1px solid var(--line);
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
}

.header-row{
  display:flex; align-items:center; justify-content:space-between;
  height:64px;
}

.brand{
  display:flex; align-items:center; gap:10px;
  font-weight:900;
  letter-spacing:.15px;
  color:var(--text);
}
.brand-badge{
  width:34px; height:34px; border-radius:10px;
  display:grid; place-items:center;
  background: linear-gradient(135deg, rgba(43,111,240,.16), rgba(43,111,240,.05));
  border:1px solid rgba(43,111,240,.20);
  color:var(--accent);
}
.brand small{
  display:block;
  font-weight:650;
  color:var(--muted);
  margin-top:-2px;
}

.nav{display:flex; align-items:center; gap:16px;}
.nav a{
  color:var(--muted);
  padding:8px 10px;
  border-radius:10px;
}
.nav a.active, .nav a:hover{
  color:var(--text);
  background: rgba(15,23,42,.04);
}

.burger{
  display:none;
  width:40px; height:40px;
  border:1px solid var(--line);
  border-radius:12px;
  background: rgba(15,23,42,.02);
  color:var(--text);
}

/* Hero */
.hero{padding:28px 0 10px;}
.hero h1{
  margin:0;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing:-.35px;
}
.hero p{
  margin:10px 0 0;
  color:var(--muted);
  max-width:76ch;
}

/* Layout */
.two-cols{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
  padding: 14px 0 34px;
  align-items:start;
}

.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
  padding:0;
}

/* Card */
.card{
  border:1px solid var(--line);
  border-radius:18px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-inner{padding:16px 16px 14px}

.meta{
  display:flex; flex-wrap:wrap; gap:10px;
  color:var(--muted);
  font-size:13px;
}

.badge{
  display:inline-flex; align-items:center;
  gap:6px;
  border:1px solid rgba(43,111,240,.20);
  background: rgba(43,111,240,.08);
  color: var(--text);
  padding:2px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
}

.list-title{
  margin:8px 0 0;
  font-size:18px;
  letter-spacing:-.2px;
  line-height:1.2;
}
.list-title a{color:var(--text)}
.list-title a:hover{color:var(--accent)}

.list-desc{
  margin:8px 0 0;
  color:var(--muted);

  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

/* Preview media */
.post-card-link{display:block; width:100%}

.post-media{
  border-top:1px solid var(--line);
  background: var(--panel2);
  overflow:hidden;
  width:100%;
}
.post-media img{
  display:block;
  width:100%;
  height: 150px;
  object-fit:cover;
  object-position:center;
  transform: scale(1.02);
}

/* Sidebar */
.sidebar{align-self:start;}
.sidebar .card{
  box-shadow: var(--shadow-soft);
}
.sidebar .card-inner{padding:12px 14px 14px;}
.sidebar h3{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.22px;
  text-transform:uppercase;
}

.side-list a{
  display:block;
  padding:10px 11px;
  border-radius:14px;
  color:var(--text);
  border:1px solid rgba(15,23,42,.08);
  background: var(--panel2);
}
.side-list a + a{margin-top:10px;}
.side-list a:hover{
  background: var(--panel3);
  border-color: rgba(43,111,240,.20);
}
.side-list .muted{color:var(--muted); font-size:13px}

/* Topic page layout */
.article-layout{
  display:grid;
  grid-template-columns: 1fr;
  gap:18px;
  padding: 14px 0 10px;
  align-items:start;
}

.article-card{
  border:1px solid var(--line);
  border-radius:20px;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.article-head{
  padding:18px 18px 14px;
  border-bottom:1px solid var(--line);
  background: linear-gradient(180deg, rgba(43,111,240,.05), transparent 60%);
}
.article-head h1{
  margin:0;
  font-size: clamp(22px, 3.2vw, 40px);
  letter-spacing:-.4px;
  line-height:1.12;
}
.article-meta{
  margin-top:10px;
  color:var(--muted);
  font-size:13px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.article-hero{
  width:100%;
  overflow:hidden;
  background: var(--panel2);
  border-bottom:1px solid var(--line);
}
.article-hero img{
  width:100%;
  height: 420px;
  object-fit:cover;
  display:block;
}

.article-body{
  padding:18px;
  overflow-wrap:anywhere;
  word-break: break-word;
}
.article-body p{margin:0 0 12px}
.article-body p:last-child{margin-bottom:0}
.article-body a{font-weight:800}
.article-body img{
  max-width:100%;
  height:auto;
  border-radius:16px;
  border:1px solid var(--line);
  background: var(--panel2);
}

.article-gallery{
  padding:0 18px 18px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:10px;
}
.article-gallery img{
  width:100%;
  aspect-ratio: 4/3;
  object-fit:cover;
  border-radius:16px;
  border:1px solid var(--line);
  background: var(--panel2);
}

/* Topic sidebar */
.article-aside{align-self:start;}
.article-aside .card{box-shadow: var(--shadow-soft);}
.article-aside .card-inner{padding:12px 14px 14px;}
.article-aside h3{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.22px;
  text-transform:uppercase;
}

/* Recommendations section */
.reco-section{padding: 0 0 34px;}
.reco-section .card{
  border-radius:20px;
  box-shadow: var(--shadow-soft);
}
.reco-section .card-inner{padding:14px 16px 16px;}
.reco-title{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
  font-weight:900;
  letter-spacing:.22px;
  text-transform:uppercase;
}

.reco-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

.reco-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px;
  border:1px solid rgba(15,23,42,.10);
  border-radius:16px;
  background: var(--panel2);
}
.reco-item:hover{
  border-color: rgba(43,111,240,.20);
  background: var(--panel3);
}

.reco-thumb{
  width:56px; height:56px;
  flex: 0 0 56px;
  border-radius:16px;
  overflow:hidden;
  border:1px solid rgba(15,23,42,.10);
  background: #fff;
  display:grid;
  place-items:center;
}
.reco-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.reco-fallback{
  color: rgba(43,111,240,.85);
  font-weight:900;
  font-size:16px;
}
.reco-text .t{
  font-weight:950;
  letter-spacing:-.18px;
  line-height:1.15;
  color:var(--text);
}
.reco-text .d{
  margin-top:6px;
  color:var(--muted);
  font-size:13px;
}

/* Notice */
.notice{
  border:1px solid rgba(43,111,240,.18);
  background: rgba(43,111,240,.08);
  padding:12px 14px;
  border-radius:16px;
  color: var(--text);
}

/* Footer — убираем “серую плашку” снизу */
.footer{
  border-top:1px solid var(--line);
  padding:18px 0;
  color:var(--muted);
  font-size:13px;
  margin-top:auto;
  background: transparent; /* ключевое: больше нет серого низа */
}
.footer-row{display:flex; flex-direction:column; gap:10px;}
.footer a{color:var(--muted)}
.footer a:hover{color:var(--text)}
.footer-links{display:flex; flex-wrap:wrap; gap:12px}

/* Forms */
input, select, textarea, button{font: inherit;}
select{
  color-scheme: light;
  background-color: #fff;
  color: var(--text);
  border:1px solid rgba(15,23,42,.14);
  border-radius:14px;
  padding:10px 12px;
}
option{
  background-color: #ffffff;
  color: #0f172a;
}

main { flex: 1 0 auto; }

@media (min-width: 980px){
  .two-cols{grid-template-columns: 1.35fr .65fr}
  .article-layout{grid-template-columns: 1.35fr .65fr}
  .article-gallery{grid-template-columns: repeat(3, 1fr)}
  .reco-grid{grid-template-columns: repeat(2, 1fr)}
  .footer-row{flex-direction:row; justify-content:space-between; align-items:center}
}

@media (max-width: 780px){
  .nav{display:none}
  .nav.open{
    display:flex;
    position:absolute;
    top:64px; left:0; right:0;
    padding:12px 16px;
    background: rgba(247,248,251,.98);
    border-bottom:1px solid var(--line);
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }
  .burger{display:inline-flex; align-items:center; justify-content:center}

  .post-media img{height: 182px;}
  .article-hero img{height: 290px;}
}
