/* ═══════════════════════════════════════════
   ВЫБОР ТЕХНИКИ — Editorial Tech Magazine
   Fonts: Outfit (UI) + Source Serif 4 (body)
   ═══════════════════════════════════════════ */

:root {
  --font-ui: 'Outfit', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;

  --ink: #0f0f12;
  --ink-light: #4a4a58;
  --ink-muted: #8a8a9a;
  --bg: #fafaf8;
  --bg-warm: #f4f3ef;
  --surface: #ffffff;
  --border: #e8e7e3;
  --border-light: #f0efeb;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-bg: #eff4ff;
  --market-yellow: #ffc107;
  --market-yellow-hover: #e5ad06;
  --green: #16a34a;
  --green-bg: #f0fdf4;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 24px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);

  --max-w: 760px;
  --max-w-wide: 1120px;
}

/* ─── RESET ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; transition: all 0.2s ease; }

.container { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 24px; }
.section { padding: 48px 0; }

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
}

.logo-bolt {
  font-size: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--ink);
  color: var(--market-yellow);
  border-radius: 10px;
  font-style: normal;
}

.logo-text {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.logo-accent { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-light);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--bg-warm);
}

.burger {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  cursor: pointer;
  padding: 8px;
}

/* ═══════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════ */
.hero {
  position: relative;
  padding: 72px 0 56px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 193, 7, 0.06) 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='1' cy='1' r='0.6' fill='%23d0d0c8' /%3E%3C/svg%3E");
  background-size: 40px 40px;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  max-width: 680px;
}

.hero-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
  margin-bottom: 16px;
  padding: 6px 14px;
  background: var(--accent-bg);
  border-radius: 100px;
}

.hero h1 {
  font-family: var(--font-ui);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 19px;
  color: var(--ink-light);
  line-height: 1.6;
  max-width: 520px;
}

/* ═══════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════ */
.section-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 36px;
}

.section-header h2 {
  font-family: var(--font-ui);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ═══════════════════════════════════════════
   FEATURED POST
   ═══════════════════════════════════════════ */
.featured-post {
  margin-bottom: 40px;
}

.featured-link {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: box-shadow 0.3s, transform 0.3s;
}

.featured-link:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.featured-img {
  position: relative;
  overflow: hidden;
}

.featured-img img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  transition: transform 0.5s;
}

.featured-link:hover .featured-img img {
  transform: scale(1.03);
}

.featured-body {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-body h3 {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 12px 0;
}

.featured-body p {
  color: var(--ink-light);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

/* ═══════════════════════════════════════════
   POST CARDS GRID
   ═══════════════════════════════════════════ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.card-img-link {
  display: block;
  position: relative;
  overflow: hidden;
}

.card-img-link img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .card-img-link img {
  transform: scale(1.05);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: white;
  background: var(--ink);
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: capitalize;
}

.card-body {
  padding: 20px;
}

.card-body h2 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
  margin-bottom: 8px;
}

.card-body h2 a {
  color: var(--ink);
  text-decoration: none;
}

.card-body h2 a:hover { color: var(--accent); }

.card-body > p {
  font-size: 14px;
  color: var(--ink-light);
  line-height: 1.5;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.card-footer time {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink-muted);
}

.read-more {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

/* ═══════════════════════════════════════════
   POST ARTICLE
   ═══════════════════════════════════════════ */
.post-hero {
  padding: 48px 0 32px;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
    var(--bg);
}

.post-hero-content {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.post-category-badge a {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 5px 14px;
  border-radius: 100px;
  display: inline-block;
  margin-bottom: 16px;
}

.post-hero h1 {
  font-family: var(--font-ui);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  color: var(--ink);
  margin-bottom: 16px;
}

.post-meta {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-sep { opacity: 0.4; }

.post-cover-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
}

.post-cover {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.post-body {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 0;
}

/* ─── TOC ─── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 32px;
}

.toc-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  display: block;
}

.toc ul { list-style: none; }
.toc li { margin: 6px 0; }
.toc a {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-light);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1px;
}
.toc a:hover { color: var(--accent); border-color: var(--accent); }

/* ─── POST CONTENT ─── */
.post-content h2 {
  font-family: var(--font-ui);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 40px 0 16px;
  padding-top: 20px;
  color: var(--ink);
}

.post-content h3 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.post-content p { margin-bottom: 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 24px; }
.post-content li { margin-bottom: 6px; }

.post-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.post-content strong { color: var(--ink); }

.post-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-content th {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--ink);
  color: white;
  padding: 12px 16px;
  text-align: left;
}

.post-content td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 15px;
}

.post-content tr:last-child td { border-bottom: none; }
.post-content tr:nth-child(even) td { background: var(--bg-warm); }

.post-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--ink-light);
}

.post-content code {
  font-size: 0.9em;
  background: var(--bg-warm);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.post-content pre {
  background: var(--ink);
  color: #e4e4e7;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 24px 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* ═══════════════════════════════════════════
   REFERRAL PRODUCT CARDS
   ═══════════════════════════════════════════ */
.ref-products {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 36px 0;
}

.ref-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.ref-icon { font-size: 24px; }

.ref-header h3 {
  font-family: var(--font-ui);
  font-size: 20px;
  font-weight: 700;
}

.ref-grid { display: grid; gap: 12px; }

.ref-card {
  background: white;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: box-shadow 0.2s;
}

.ref-card:hover { box-shadow: var(--shadow-sm); }

.ref-card-info strong {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}

.ref-card-prices { display: flex; align-items: baseline; gap: 8px; }
.ref-price { font-family: var(--font-ui); font-weight: 700; font-size: 18px; color: var(--ink); }
.ref-old-price { font-size: 14px; text-decoration: line-through; color: var(--ink-muted); }

.ref-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--market-yellow);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(255,193,7,0.3);
}

.ref-btn:hover {
  background: var(--market-yellow-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255,193,7,0.4);
  color: var(--ink);
}

.ref-disclosure {
  display: block;
  margin-top: 16px;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════
   YANDEX SERVICES
   ═══════════════════════════════════════════ */
.services-block {
  margin: 36px 0;
}

.services-block h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
}

.services-grid { display: grid; gap: 10px; }

.service-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
}

.service-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
}

.service-icon { font-size: 28px; flex-shrink: 0; }
.service-info { flex: 1; }
.service-info strong { font-family: var(--font-ui); font-size: 15px; font-weight: 600; display: block; }
.service-info span { font-size: 13px; color: var(--ink-muted); }

.service-arrow {
  flex-shrink: 0;
  color: var(--ink-muted);
  transition: transform 0.2s, color 0.2s;
}
.service-card:hover .service-arrow { transform: translateX(3px); color: var(--accent); }

/* ═══════════════════════════════════════════
   RELATED POSTS
   ═══════════════════════════════════════════ */
.related-section {
  margin-top: 56px;
  padding: 48px 0;
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
}

.related-title {
  font-family: var(--font-ui);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.related-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.related-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--ink);
}

.related-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.related-card-body {
  padding: 16px;
}

.related-card-body h4 {
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}

.related-card-body time {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-muted);
}

/* ═══════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════ */
.site-footer {
  background: var(--ink);
  color: #a1a1b0;
  padding: 48px 0 32px;
}

.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo-bolt {
  background: rgba(255,255,255,0.1);
  color: var(--market-yellow);
}

.footer-brand .logo-text { color: white; }
.footer-brand .logo-accent { color: var(--accent); }

.footer-brand p {
  margin-top: 10px;
  font-size: 14px;
  max-width: 280px;
  line-height: 1.5;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-nav strong {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 4px;
}

.footer-nav a {
  font-family: var(--font-ui);
  font-size: 14px;
  color: #a1a1b0;
  transition: color 0.2s;
}

.footer-nav a:hover { color: white; }

.footer-bottom {
  padding-top: 24px;
  text-align: center;
}

.footer-bottom p {
  font-family: var(--font-ui);
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}

/* ═══════════════════════════════════════════
   CATEGORY PAGE
   ═══════════════════════════════════════════ */
.category-hero {
  padding: 48px 0 32px;
}

.category-hero h1 {
  font-family: var(--font-ui);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -1px;
  text-transform: capitalize;
}

.category-hero p {
  color: var(--ink-light);
  font-size: 17px;
  margin-top: 8px;
}

/* ═══════════════════════════════════════════
   MOBILE
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .header-inner { height: 56px; }

  .main-nav {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    box-shadow: var(--shadow);
  }

  .main-nav.open { display: flex; }

  .main-nav a {
    padding: 12px 16px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .burger { display: block; }

  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 32px; }

  .featured-link {
    grid-template-columns: 1fr;
  }

  .featured-img img { min-height: 200px; }

  .featured-body {
    padding: 24px;
  }

  .featured-body h3 { font-size: 22px; }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-hero h1 { font-size: 26px; }

  .ref-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ref-btn { text-align: center; justify-content: center; }

  .footer-top {
    flex-direction: column;
    gap: 32px;
  }

  .related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-content {
  animation: fadeUp 0.6s ease-out;
}

.card, .featured-post, .related-card {
  animation: fadeUp 0.5s ease-out both;
}

.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4) { animation-delay: 0.15s; }
.card:nth-child(5) { animation-delay: 0.2s; }
.card:nth-child(6) { animation-delay: 0.25s; }
