 /* ----- RESET & VARIABLES ----- */
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    :root {
      --bg: #f8fafc;
      --surface: #ffffff;
      --primary: #2563eb;
      --primary-dark: #1d4ed8;
      --text: #0f172a;
      --text-light: #475569;
      --border: #e2e8f0;
      --border-light: #f0f4f9;
      --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
      --hover-shadow: 0 20px 30px -10px rgba(37, 99, 235, 0.15);
      --radius-card: 2rem;
      --radius-item: 1.5rem;
      --transition: 0.2s ease;
    }

    body {
      background-color: var(--bg);
      font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
      color: var(--text);
      line-height: 1.6;
      display: flex;
      flex-direction: column;
      min-height: 100vh;
    }

    /* fallback smooth fonts */
    h1, h2, h3, h4, .logo, .nav-links a {
      font-weight: 600;
      letter-spacing: -0.02em;
    }

    /* ----- UTILS & LAYOUT ----- */
    .wrapper {
      width: min(1280px, 100% - 3rem);
      margin-inline: auto;
    }

    /* ----- HEADER (fully responsive) ----- */
    header {
      background-color: rgba(255, 255, 255, 0.85);
      backdrop-filter: blur(8px);
      border-bottom: 1px solid var(--border);
      padding: 0.8rem 0;
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .header-content {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 1rem;
    }

    .logo-area {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      gap: 0.5rem 0.8rem;
    }

    .logo-icon {
      font-size: 2.2rem;
      color: var(--primary);
    }

    .logo-text {
      font-size: 1.8rem;
      font-weight: 700;
      background: linear-gradient(145deg, #1e293b, var(--primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    .logo-tagline {
      font-size: 0.9rem;
      color: var(--text-light);
      border-left: 2px solid var(--border);
      padding-left: 1rem;
    }

    /* navigation (mobile first) */
    .nav-links {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem 1.2rem;
      font-weight: 500;
    }

    .nav-links a {
      text-decoration: none;
      color: var(--text-light);
      padding: 0.4rem 0.2rem;
      transition: color var(--transition);
      font-size: 1rem;
      white-space: nowrap;
    }

    .nav-links a:hover,
    .nav-links a.active {
      color: var(--primary);
      border-bottom: 2px solid var(--primary);
    }

    .search-icon {
      background: #f1f5f9;
      padding: 0.5rem 1.2rem;
      border-radius: 40px;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      color: var(--text-light);
      font-size: 0.9rem;
      cursor: default;
      white-space: nowrap;
    }

    /* ----- MAIN GRID (fully responsive) ----- */
    .main-grid {
      display: grid;
      grid-template-columns: 2.5fr 1.2fr;
      gap: 2.5rem;
      margin: 3rem 0;
    }

    /* page header (for static pages) */
    .page-header {
      margin: 2rem 0 2rem;
      text-align: center;
    }
    .page-header h1 {
      font-size: clamp(2rem, 8vw, 3.5rem);
      background: linear-gradient(to right, #1e293b, var(--primary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }
    .page-header p {
      color: var(--text-light);
      font-size: 1.2rem;
    }

    /* ----- CARDS & POSTS (mobile ready) ----- */
    .featured-card {
      background: var(--surface);
      border-radius: var(--radius-card);
      box-shadow: var(--card-shadow);
      border: 1px solid var(--border-light);
      overflow: hidden;
      margin-bottom: 2.5rem;
    }

    .featured-image {
      height: 240px;
      background: linear-gradient(135deg, #0b1e33, #1e3a5f);
      display: flex;
      align-items: flex-end;
      padding: 2rem;
      color: white;
      position: relative;
    }
    .featured-image > div {
      position: relative;
      z-index: 2;
    }
    .featured-label {
      background: rgba(255,255,255,0.15);
      backdrop-filter: blur(4px);
      padding: 0.3rem 1.2rem;
      border-radius: 60px;
      font-size: 0.8rem;
      display: inline-block;
      border: 1px solid rgba(255,255,255,0.2);
    }
    .featured-title {
      font-size: clamp(1.5rem, 5vw, 2.2rem);
      font-weight: 700;
      line-height: 1.3;
      margin: 0.8rem 0 0.5rem;
    }
    .featured-meta {
      display: flex;
      gap: 2rem;
      font-size: 0.9rem;
      opacity: 0.9;
    }

    /* regular posts */
    .post-item {
      display: flex;
      gap: 1.5rem;
      background: var(--surface);
      border-radius: var(--radius-item);
      padding: 1.5rem;
      margin-bottom: 1.8rem;
      border: 1px solid var(--border-light);
      transition: box-shadow var(--transition), border-color var(--transition);
    }
    .post-item:hover {
      border-color: #b9d0f0;
      box-shadow: var(--hover-shadow);
    }

    .post-thumb {
      width: 100px;
      height: 100px;
      background: #dbeafe;
      border-radius: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.4rem;
      color: var(--primary);
      flex-shrink: 0;
    }

    .post-content {
      flex: 1;
    }

    .post-category {
      font-size: 0.75rem;
      text-transform: uppercase;
      background: #e2f0fa;
      display: inline-block;
      padding: 0.2rem 1rem;
      border-radius: 30px;
      color: #0369a1;
      font-weight: 600;
      margin-bottom: 0.6rem;
    }

    .post-title {
      font-size: clamp(1.1rem, 4vw, 1.4rem);
      margin-bottom: 0.4rem;
    }
    .post-title a {
      text-decoration: none;
      color: var(--text);
    }
    .post-title a:hover {
      color: var(--primary);
    }

    .post-excerpt {
      color: var(--text-light);
      font-size: 0.9rem;
      margin-bottom: 0.8rem;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .post-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 1.5rem;
      font-size: 0.8rem;
      color: #64748b;
    }
    .post-meta i {
      color: var(--primary);
      width: 1rem;
      margin-right: 0.2rem;
    }

    /* ----- SIDEBAR (mobile stacking) ----- */
    .sidebar-card {
      background: var(--surface);
      border-radius: 2rem;
      padding: 1.8rem 1.5rem;
      margin-bottom: 2rem;
      border: 1px solid var(--border-light);
      box-shadow: 0 6px 14px rgba(0,0,0,0.02);
    }

    .sidebar-title {
      font-size: 1.3rem;
      display: flex;
      align-items: center;
      gap: 0.6rem;
      margin-bottom: 1.2rem;
      padding-bottom: 0.6rem;
      border-bottom: 2px solid var(--border-light);
    }

    .author-avatar {
      font-size: 4rem;
      color: var(--primary);
      text-align: center;
    }
    .tech-stack {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin: 1.2rem 0;
    }
    .tech-badge {
      background: #eef2ff;
      color: #1e40af;
      padding: 0.3rem 1rem;
      border-radius: 60px;
      font-size: 0.8rem;
    }

    .popular-item {
      display: flex;
      gap: 1rem;
      margin-bottom: 1.4rem;
      align-items: center;
    }
    .popular-icon {
      width: 48px;
      height: 48px;
      background: #e6edfa;
      border-radius: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      font-size: 1.3rem;
      flex-shrink: 0;
    }

    .newsletter {
      background: #f0f6ff;
      border-radius: 2rem;
      padding: 1.8rem 1.2rem;
      text-align: center;
    }
    .newsletter-input {
      display: flex;
      background: white;
      border-radius: 60px;
      border: 1px solid #cfdfef;
      overflow: hidden;
      margin: 1rem 0 0.5rem;
    }
    .newsletter-input input {
      flex: 1;
      border: none;
      padding: 0.8rem 1rem;
      outline: none;
      min-width: 0; /* important for flex */
    }
    .newsletter-input button {
      background: var(--primary);
      border: none;
      color: white;
      padding: 0 1.4rem;
      font-weight: 600;
      cursor: pointer;
    }

    /* ----- FOOTER (responsive) ----- */
    footer {
      border-top: 1px solid var(--border);
      padding: 2rem 0;
      margin-top: auto;
      color: var(--text-light);
    }
    .footer-flex {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 1.5rem;
    }
    .social-links {
      display: flex;
      gap: 1.8rem;
    }
    .social-links a {
      color: var(--text-light);
      font-size: 1.3rem;
      transition: color var(--transition);
    }
    .social-links a:hover {
      color: var(--primary);
    }

    /* ----- RESPONSIVE BREAKPOINTS (fine tuned) ----- */
    @media (max-width: 900px) {
      .main-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
      }
      .header-content {
        flex-direction: column;
        align-items: stretch;
      }
      .nav-links {
        justify-content: center;
      }
      .search-icon {
        align-self: center;
        width: fit-content;
      }
    }

    @media (max-width: 640px) {
      .wrapper {
        width: 100% - 2rem;
      }
      .post-item {
        flex-direction: column;
      }
      .post-thumb {
        width: 100%;
        height: 150px;
        border-radius: 24px;
      }
      .featured-image {
        padding: 1.5rem;
      }
      .logo-tagline {
        display: none; /* save space */
      }
      .footer-flex {
        flex-direction: column;
        text-align: center;
      }
    }

    @media (max-width: 480px) {
      .nav-links {
        gap: 0.6rem;
      }
      .nav-links a {
        font-size: 0.9rem;
        white-space: nowrap;
      }
      .sidebar-card {
        padding: 1.4rem 1rem;
      }
    }

    /* hide/show demo pages (simple tab simulation) */
    .page-content {
      display: none;
    }
    .page-content.active-page {
      display: block;
    }
    /* indicator for active page (through JS later) */
    .nav-links a.active {
      border-bottom: 2px solid var(--primary);
    }