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

:root {
  --navy: #0a1628;
  --navy-dark: #060f1c;
  --navy-deep: #030912;
  --navy-light: #162538;
  --accent: #e53935;
  --accent-hover: #ff4f4a;
  --accent-glow: rgba(229, 57, 53, 0.35);
  --blue: #4a90e2;
  --blue-glow: rgba(74, 144, 226, 0.25);
  --cyan: #00d4ff;
  --bg: #f6f8fc;
  --bg-alt: #eef2f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --border-strong: #cbd2dc;
  --text: #0e1c2e;
  --text-muted: #4a5768;
  --text-light: #8b94a3;
  --shadow-sm: 0 1px 3px rgba(8, 20, 33, 0.06);
  --shadow: 0 4px 12px rgba(8, 20, 33, 0.08), 0 2px 4px rgba(8, 20, 33, 0.04);
  --shadow-lg: 0 20px 50px rgba(8, 20, 33, 0.15), 0 8px 16px rgba(8, 20, 33, 0.08);
  --shadow-xl: 0 30px 80px rgba(8, 20, 33, 0.2), 0 12px 24px rgba(8, 20, 33, 0.1);
  --gradient-red: linear-gradient(135deg, #e53935 0%, #ff6b4a 100%);
  --gradient-blue: linear-gradient(135deg, #4a90e2 0%, #00d4ff 100%);
  --gradient-navy: linear-gradient(135deg, #0a1628 0%, #1a2b4a 100%);
  --radius: 10px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main { flex: 1; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

a { transition: color 0.2s, opacity 0.2s; }

/* ─── Header ─── */
.site-header {
  background: rgba(10, 22, 40, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
}
.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-img {
  height: 42px;
  width: auto;
  background: white;
  padding: 5px 9px;
  border-radius: 8px;
  transition: transform 0.3s ease;
}
.logo:hover .logo-img { transform: rotate(-2deg) scale(1.03); }
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand {
  font-size: 15px;
  font-weight: 700;
  color: white;
  letter-spacing: 0.2px;
}
.tag {
  font-size: 11px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 3px;
}
.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}
.nav-links a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  font-size: 14px;
  position: relative;
}
.nav-links a:not(.cta)::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav-links a:not(.cta):hover { color: white; }
.nav-links a:not(.cta):hover::after { width: 100%; }
.nav-links .cta {
  background: var(--gradient-red);
  color: white;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.nav-links .cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--accent-glow);
  color: white;
}

/* ─── Hero ─── */
.hero {
  padding: 100px 0 80px;
  background: var(--navy);
  color: white;
  position: relative;
  overflow: hidden;
}
/* Animated grid background */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(74, 144, 226, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 144, 226, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
  pointer-events: none;
}
/* Ambient glow */
.hero::after {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 30px); }
}

.hero .container { position: relative; z-index: 1; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid rgba(229, 57, 53, 0.25);
  border-radius: 99px;
}
.hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.hero h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -1.8px;
  margin-bottom: 20px;
  line-height: 1.05;
  background: linear-gradient(135deg, #ffffff 0%, #bfd1e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero h1 .accent-line {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 700px;
  margin-bottom: 44px;
  line-height: 1.65;
}

/* Search + category pills */
.search-row {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin-bottom: 28px;
}
.search-wrap {
  flex: 1;
  position: relative;
}
.search-wrap::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' opacity='0.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  pointer-events: none;
}
.search-row input {
  width: 100%;
  padding: 16px 20px 16px 48px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: white;
  font-size: 15px;
  outline: none;
  transition: all 0.25s;
  font-family: inherit;
  backdrop-filter: blur(10px);
}
.search-row input::placeholder { color: rgba(255, 255, 255, 0.45); }
.search-row input:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(229, 57, 53, 0.12);
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  padding: 9px 18px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  letter-spacing: 0.2px;
}
.pill:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
  transform: translateY(-1px);
}
.pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* ─── Posts grid ─── */
.posts-section { padding: 72px 0 96px; position: relative; }
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.section-head h2 {
  font-size: 28px;
  color: var(--navy);
  letter-spacing: -0.6px;
  font-weight: 800;
  position: relative;
  padding-bottom: 10px;
}
.section-head h2::after {
  content: "";
  position: absolute;
  bottom: -19px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-red);
  border-radius: 2px;
}
.section-head .count {
  color: var(--text-light);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
}

.post-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.35s;
}
.post-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--accent) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: transparent;
}
.post-card:hover::before { opacity: 1; }

.post-card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--border);
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.post-card:hover img { transform: scale(1.06); }
.post-card-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(10, 22, 40, 0.4) 100%);
  opacity: 0;
  transition: opacity 0.3s;
}
.post-card:hover .post-card-img-wrap::after { opacity: 1; }

.post-card-body {
  padding: 26px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-cat {
  display: inline-block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  align-self: flex-start;
}
.post-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  line-height: 1.3;
  color: var(--navy);
  letter-spacing: -0.3px;
  font-weight: 700;
  transition: color 0.2s;
}
.post-card:hover h3 { color: var(--accent); }
.post-card p {
  color: var(--text-muted);
  font-size: 14.5px;
  margin-bottom: 18px;
  flex: 1;
  line-height: 1.6;
}
.post-card-meta {
  color: var(--text-light);
  font-size: 12px;
  letter-spacing: 0.3px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-card-meta::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.no-results {
  text-align: center;
  padding: 80px 40px;
  color: var(--text-muted);
  font-size: 16px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
}

/* ─── Post page ─── */
.post { padding: 56px 0 40px; }
.post-container { max-width: 800px; }
.breadcrumb { margin-bottom: 28px; }
.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background 0.2s;
}
.breadcrumb a:hover {
  color: var(--accent);
  background: rgba(229, 57, 53, 0.06);
}
.post-header { margin-bottom: 32px; }
.post-category {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  padding: 6px 14px;
  background: rgba(229, 57, 53, 0.08);
  border-radius: 99px;
  border: 1px solid rgba(229, 57, 53, 0.2);
}
.post-header h1 {
  font-size: 44px;
  line-height: 1.15;
  color: var(--navy);
  letter-spacing: -1px;
  margin-bottom: 18px;
  font-weight: 800;
}
.post-meta {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 500;
}
.post-meta > *:not(:last-child)::after {
  content: "•";
  margin-left: 10px;
  color: var(--text-light);
}
.post-poster {
  margin: 36px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  background: var(--border);
  position: relative;
}
.post-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 100px rgba(10, 22, 40, 0.15);
  pointer-events: none;
  border-radius: var(--radius-lg);
}
.post-poster img {
  width: 100%;
  height: auto;
  display: block;
}
.post-body {
  font-size: 17px;
  line-height: 1.82;
  color: #2b3649;
}
.post-body h2 {
  font-size: 28px;
  margin: 44px 0 16px;
  color: var(--navy);
  letter-spacing: -0.5px;
  font-weight: 700;
  position: relative;
  padding-left: 18px;
}
.post-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: var(--gradient-red);
  border-radius: 2px;
}
.post-body h3 {
  font-size: 22px;
  margin: 32px 0 12px;
  color: var(--navy);
  font-weight: 700;
}
.post-body p { margin-bottom: 20px; }
.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(229, 57, 53, 0.3);
  transition: border-color 0.2s;
}
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body ul, .post-body ol {
  margin: 16px 0 24px 28px;
}
.post-body li { margin-bottom: 10px; }
.post-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 16px 24px;
  margin: 28px 0;
  color: var(--text-muted);
  font-style: italic;
  background: linear-gradient(to right, rgba(229, 57, 53, 0.04), transparent);
  border-radius: 0 8px 8px 0;
}
.post-body code {
  background: #f0f3f7;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "SF Mono", Monaco, monospace;
  color: var(--navy);
  border: 1px solid #e2e5ea;
}
.post-body pre {
  background: var(--navy-dark);
  color: #e2e8f0;
  padding: 22px 24px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 24px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.post-body pre code { background: transparent; padding: 0; color: inherit; border: none; }
.post-body strong { color: var(--navy); font-weight: 700; }

.post-tags {
  margin: 36px 0 24px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.post-tags-label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  margin-right: 10px;
}
.tag-pill {
  display: inline-block;
  background: #eef1f6;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12px;
  margin: 4px 4px 4px 0;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}
.tag-pill:hover {
  background: var(--navy);
  color: white;
}

/* ─── CTA card ─── */
.post-cta {
  background: var(--gradient-navy);
  color: white;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  margin: 48px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow-lg);
}
.post-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 3px;
  background: var(--gradient-red);
  border-radius: 2px;
}
.post-cta::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.post-cta > * { position: relative; z-index: 1; }
.post-cta h3 {
  font-size: 26px;
  margin-bottom: 14px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.post-cta p {
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s;
  border: 2px solid transparent;
  letter-spacing: 0.3px;
}
.btn-primary {
  background: var(--gradient-red);
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}
.btn-outline {
  background: transparent;
  color: white;
  border-color: rgba(255, 255, 255, 0.3);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

/* ─── Related posts ─── */
.related-section {
  padding: 40px 0 60px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.related-section .container { max-width: 1240px; }
.related-header {
  margin-bottom: 32px;
  text-align: center;
}
.related-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}
.related-header h2 {
  font-size: 32px;
  color: var(--navy);
  letter-spacing: -0.6px;
  font-weight: 800;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

/* ─── Footer ─── */
.site-footer {
  background: var(--navy-deep);
  color: #cbd5e1;
  padding: 72px 0 24px;
  margin-top: 0;
  border-top: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
  opacity: 0.6;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  margin-bottom: 48px;
}
.footer-grid h4 {
  color: white;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  padding-bottom: 8px;
}
.footer-grid h4::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--accent);
}
.footer-grid p {
  font-size: 14px;
  margin-bottom: 10px;
  color: #94a3b8;
}
.footer-grid a {
  color: #cbd5e1;
  text-decoration: none;
}
.footer-grid a:hover { color: var(--accent); }
.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #64748b;
  font-size: 12px;
  letter-spacing: 0.3px;
}

/* Card fade-in animation */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.post-card {
  animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }

/* ─── Mobile ─── */
@media (max-width: 768px) {
  .nav { padding: 12px 20px; }
  .nav-links { gap: 14px; font-size: 13px; }
  .nav-links a:not(.cta) { display: none; }
  .nav-links .cta { padding: 8px 16px; font-size: 12px; }
  .hero { padding: 60px 0 48px; }
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .hero-sub { font-size: 15px; }
  .hero-kicker { font-size: 11px; letter-spacing: 1.5px; }
  .search-row { flex-direction: column; }
  .post-header h1 { font-size: 30px; }
  .post { padding: 32px 0; }
  .post-body { font-size: 16px; }
  .posts-section { padding: 48px 0 64px; }
  .section-head h2 { font-size: 22px; }
  .logo-text .brand { font-size: 13px; }
  .logo-text .tag { font-size: 10px; }
  .posts-grid { gap: 20px; }
  .post-cta { padding: 32px 24px; }
  .post-cta h3 { font-size: 22px; }
  .related-header h2 { font-size: 24px; }
}
