/* ═══════════════════════════════════════════════════════════════
   IT BLOG — Base Styles, Resets & Typography
═══════════════════════════════════════════════════════════════ */

/* ─── Reset & Box Model ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-surface); }
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ─── Selection ─── */
::selection {
  background: rgba(79,70,229,0.3);
  color: var(--text-primary);
}

/* ─── Typography Scale ─── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, var(--text-7xl)); font-weight: 800; }
h2 { font-size: clamp(1.875rem, 4vw, var(--text-5xl)); font-weight: 700; }
h3 { font-size: clamp(1.5rem, 3vw, var(--text-4xl)); font-weight: 700; }
h4 { font-size: clamp(1.25rem, 2.5vw, var(--text-3xl)); font-weight: 600; }
h5 { font-size: var(--text-xl); font-weight: 600; }
h6 { font-size: var(--text-lg); font-weight: 600; }

p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--primary); }

strong, b { color: var(--text-primary); font-weight: 600; }
em, i { color: var(--text-secondary); }

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: rgba(79,70,229,0.12);
  color: var(--primary-light);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79,70,229,0.2);
}

pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  position: relative;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: inherit;
}

blockquote {
  border-left: 4px solid var(--primary);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
  background: var(--grad-card);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

blockquote p { margin: 0; }

img, video { max-width: 100%; height: auto; display: block; }

ul, ol {
  padding-left: var(--space-6);
  color: var(--text-secondary);
}
li { margin-bottom: 0; line-height: 1.8; }
/* li { margin-bottom: var(--space-2); line-height: 1.8; } */

table { width: 100%; border-collapse: collapse; }
th, td {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  text-align: left;
}
th {
  background: var(--bg-elevated);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-primary);
}
tr:nth-child(even) { background: var(--grad-card); }

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-8) 0;
}

/* ─── Layout Utilities ─── */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--space-20) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-6); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-accent    { color: var(--accent) !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ─── Section Header ─── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary-light);
  background: rgba(79,70,229,0.1);
  border: 1px solid rgba(79,70,229,0.3);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.75;
}

/* ─── Responsive Base ─── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-12) 0; }
  .section-sm { padding: var(--space-8) 0; }
}

@media (max-width: 480px) {
  .section { padding: var(--space-10) 0; }
}
