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

body {
  background-color: #0b0f19;
  color: #f3f4f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

/* Шапка */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 80px;
  background-color: #0b0f19;
  border-bottom: 1px solid #1f2937;
}

.logo {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.logo span {
  color: #38bdf8;
}

nav a {
  color: #9ca3af;
  text-decoration: none;
  margin-left: 24px;
  font-size: 0.95rem;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: #38bdf8;
}

/* Контейнер */
main {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Hero заголовок */
.hero {
  text-align: center;
  margin-bottom: 36px;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 8px;
}

.hero p {
  color: #9ca3af;
  font-size: 0.95rem;
}

/* Поиск и фильтры */
.search-container {
  margin-bottom: 20px;
}

.search-box {
  width: 100%;
  padding: 12px 18px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  outline: none;
}

.search-box:focus {
  border-color: #38bdf8;
}

.filter-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tab-btn {
  background: #111827;
  border: 1px solid #1f2937;
  color: #9ca3af;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.tab-btn.active, .tab-btn:hover {
  background: #38bdf8;
  color: #0b0f19;
  border-color: #38bdf8;
  font-weight: 600;
}

/* Сетка карточек */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
}

.read-time {
  font-size: 0.75rem;
  color: #6b7280;
}

.card h3 {
  font-size: 1.15rem;
  color: #ffffff;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.875rem;
  color: #9ca3af;
  line-height: 1.5;
  margin-bottom: 16px;
}

.card-link {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.card-link:hover {
  color: #7dd3fc;
}

.hidden {
  display: none !important;
}

/* Сборки (stacks.html) */
.build-card {
  margin-bottom: 24px;
}

.build-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.build-header h2 {
  font-size: 1.25rem;
  color: #ffffff;
}

.build-price {
  background: #065f46;
  color: #34d399;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.875rem;
}

.build-desc {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.spec-box {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-family: monospace;
  color: #38bdf8;
  font-size: 0.875rem;
}

.build-specs p {
  margin-bottom: 8px;
  color: #ffffff;
}

.build-specs ul {
  list-style: none;
  padding: 0;
}

.build-specs li {
  margin-bottom: 6px;
  color: #9ca3af;
  font-size: 0.875rem;
}

.build-specs li strong {
  color: #ffffff;
}

/* Калькулятор (calculator.html) */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.card-title {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  color: #9ca3af;
  margin-bottom: 6px;
}

.input-group input {
  width: 100%;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #38bdf8;
}

.result-box {
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.result-box:last-child {
  margin-bottom: 0;
}

.result-label {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 4px;
}

.result-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
}

.result-value.accent {
  color: #38bdf8;
}

.calculator-description h3 {
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.calculator-description > p {
  color: #9ca3af;
  font-size: 0.9rem;
  line-height: 1.5;
}

.desc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.desc-card {
  background: #1f2937;
  padding: 16px 18px;
  border-radius: 8px;
  border: 1px solid #374151;
}

.desc-card h4 {
  color: #38bdf8;
  font-size: 0.95rem;
  margin-bottom: 6px;
  font-weight: 600;
}

.desc-card p {
  font-size: 0.85rem;
  color: #9ca3af;
  margin: 0;
  line-height: 1.45;
}

/* Медиа (media.html) */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.media-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  transition: border-color 0.2s, transform 0.2s;
}

.media-card:hover {
  border-color: #374151;
  transform: translateY(-2px);
}

.media-card h3 {
  font-size: 1.05rem;
  color: #ffffff;
  font-weight: 600;
  margin: 0;
}

.media-link {
  display: inline-flex;
  align-items: center;
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s;
}

.media-link:hover {
  color: #7dd3fc;
}

/* Подвал */
footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid #1f2937;
  color: #6b7280;
  font-size: 0.85rem;
  margin-top: 40px;
}

@media (max-width: 768px) {
  header {
    padding: 16px 20px;
    flex-direction: column;
    gap: 12px;
  }
  nav a {
    margin: 0 8px;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
}