/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-hover: #232733;
  --border: #2a2e3a;
  --text: #e4e6ed;
  --text-muted: #8b8fa3;
  --accent: #6c5ce7;
  --accent-hover: #7c6df7;
  --accent-glow: rgba(108, 92, 231, .35);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(0,0,0,.35);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 23, .82);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  border-bottom: 1px solid var(--border);
  padding: 0 clamp(1rem, 4vw, 3rem);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: opacity var(--transition);
}
.logo:hover { opacity: .75; }
.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: .85rem;
}

nav { display: flex; gap: .25rem; }

nav a {
  padding: .45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
nav a:hover, nav a.active {
  background: var(--surface-hover);
  color: var(--text);
}

/* ===== HERO ===== */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem clamp(1rem, 4vw, 3rem) 2.5rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #e4e6ed 30%, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
}

/* ===== CARDS GRID ===== */
.cards {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem clamp(1rem, 4vw, 3rem) 5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,.4), 0 0 0 1px var(--accent);
  border-color: var(--accent);
}

.card-img {
  position: relative;
  height: 190px;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.4,0,.2,1);
}
.card:hover .card-img img { transform: scale(1.07); }

.card-body {
  padding: 1.4rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .25rem .7rem;
  border-radius: 20px;
  background: rgba(108, 92, 231, .15);
  color: var(--accent-hover);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.card-desc {
  font-size: .9rem;
  color: var(--text-muted);
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  align-self: flex-start;
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--border);
  transform: translateY(-2px);
}

/* ===== ARTICLE PAGE ===== */
.article-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem clamp(1rem, 4vw, 3rem) 5rem;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding: .4rem .8rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.article-back:hover { background: var(--surface-hover); color: var(--text); }

.article-hero-img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  aspect-ratio: 16/9;
  object-fit: cover;
  border: 1px solid var(--border);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.article-meta .dot { width: 4px; height: 4px; background: var(--border); border-radius: 50%; }

.article-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.03em;
  margin-bottom: 1.5rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #c0c3d1;
}
.article-content p { margin-bottom: 1.3rem; }
.article-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 1rem;
}
.article-content ul {
  margin: 0 0 1.3rem 1.5rem;
}
.article-content li { margin-bottom: .4rem; }

/* ===== COMMENTS ===== */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.comments-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  margin-bottom: 2rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: .75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .92rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.comment-form textarea { resize: vertical; min-height: 100px; }
.comment-form button { align-self: flex-start; }

.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: .75rem;
  transition: border-color var(--transition);
}
.comment:hover { border-color: #3a3e4a; }

.comment-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .6rem;
}

.comment-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a29bfe);
  display: grid;
  place-items: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-author {
  font-size: .88rem;
  font-weight: 600;
}

.comment-date {
  font-size: .78rem;
  color: var(--text-muted);
  margin-left: auto;
}

.comment-text {
  font-size: .9rem;
  color: #b0b3c5;
  line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 2rem 1rem;
  font-size: .82rem;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
  nav a { padding: .4rem .6rem; font-size: .82rem; }
  .hero { padding-top: 2.5rem; }
  .article-page { padding-top: 2rem; }
}
