/* ============================================================
   screenresolutionsize.com — Production CSS
   Design fixes over competitors:
   ✅ No layout shifts on mobile
   ✅ Proper contrast ratios (WCAG AA)
   ✅ Consistent card heights via CSS Grid
   ✅ No overflow / horizontal scroll on any viewport
   ✅ Accessible focus rings
   ✅ Smooth animations (prefers-reduced-motion aware)
   Domain: screenresolutionsize.com
============================================================ */

/* ── RESET / BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-primary: #6366f1;
  --brand-secondary: #8b5cf6;
  --brand-accent: #22d3ee;
  --brand-green: #10b981;
  --brand-orange: #f59e0b;
  --brand-red: #ef4444;

  --bg-base: #0f0f17;
  --bg-card: #16161f;
  --bg-card-hover: #1e1e2d;
  --bg-dark: #0a0a12;
  --bg-gray: #12121a;

  --text-primary: #f1f1f9;
  --text-secondary: #a3a3c2;
  --text-muted: #6b6b8a;

  --border: rgba(99, 102, 241, 0.15);
  --border-active: rgba(99, 102, 241, 0.5);

  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;

  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --nav-h: 68px;
  --transition: 0.2s ease;
}

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--brand-primary); border-radius: 3px; }

/* ── SELECTION ───────────────────────────────────────── */
::selection { background: rgba(99, 102, 241, 0.3); color: #fff; }

/* ── FOCUS ───────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 3px; border-radius: 4px; }

/* ── CONTAINER ───────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
  width: 100%;
}

/* ── NAVBAR ──────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: rgba(15, 15, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 5vw, 2rem);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  white-space: nowrap;
}
.brand-icon { font-size: 1.5rem; }
.brand-accent { color: var(--brand-primary); }
.nav-links {
  display: flex;
  list-style: none;
  gap: 0.25rem;
}
.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}
.nav-links a:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s; }

/* ── HERO ────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(5rem, 12vw, 9rem) 0 clamp(3rem, 8vw, 6rem);
  text-align: center;
  overflow: hidden;
}
.hero-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 80vw;
  height: 80vw;
  max-width: 800px;
  max-height: 800px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--brand-primary);
  padding: 0.3rem 1rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}
.hero-title {
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 3rem;
}

/* ── HERO RESULT CARD ────────────────────────────────── */
.result-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 5vw, 3rem);
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 0 80px rgba(99, 102, 241, 0.15), var(--shadow);
  position: relative;
}
.res-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.res-number {
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
}
.res-sep {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  color: var(--brand-primary);
  font-weight: 300;
}
.res-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 0.5rem;
}
.res-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.dot { color: var(--text-muted); }

.btn-copy {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--brand-primary);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.btn-copy:hover { background: rgba(99, 102, 241, 0.25); transform: translateY(-1px); }
.copy-toast {
  position: absolute;
  bottom: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-green);
  color: #fff;
  padding: 0.3rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.3s;
  white-space: nowrap;
  pointer-events: none;
}
.copy-toast.show { opacity: 1; }

/* ── SECTIONS ────────────────────────────────────────── */
.section { padding: clamp(4rem, 8vw, 7rem) 0; }
.section-dark { background: var(--bg-dark); }
.section-gray { background: var(--bg-gray); }
.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.section-sub {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 3rem;
}

/* ── METRICS GRID ────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.metric-card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.metric-card.highlight {
  border-color: rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, var(--bg-card) 100%);
}
.metric-icon { font-size: 1.8rem; }
.metric-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.metric-value { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.metric-note { font-size: 0.78rem; color: var(--text-muted); }
.live-badge { color: var(--brand-red); font-weight: 600; }

/* ── PPI CARD ────────────────────────────────────────── */
.ppi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-top: 2rem;
}
.ppi-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.ppi-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1.5rem; }
.ppi-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.ppi-field { display: flex; flex-direction: column; gap: 0.4rem; }
.ppi-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.ppi-field input {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 0.6rem 0.9rem;
  font-size: 1rem;
  font-family: var(--font-mono);
  width: 160px;
  transition: border-color var(--transition);
}
.ppi-field input:focus { border-color: var(--brand-primary); outline: none; }
.ppi-result-box {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.2rem;
  text-align: center;
  min-width: 100px;
}
.ppi-result-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.ppi-result-value { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 700; color: var(--brand-primary); }
.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.6rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover { background: #4f46e5; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4); }

/* ── BREAKPOINTS ─────────────────────────────────────── */
.breakpoint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}
.bp-pill {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all 0.2s;
}
.bp-pill.active {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

.breakpoint-table-wrap, .device-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.bp-table, .dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.bp-table th, .dev-table th {
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.bp-table td, .dev-table td {
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}
.bp-table tr:hover td, .dev-table tr:hover td { background: var(--bg-card-hover); }
.dev-table tr.match-row td { background: rgba(99, 102, 241, 0.1); color: var(--text-primary); }
.dev-table tr.match-row td:first-child { font-weight: 700; color: var(--brand-primary); }
.match-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--brand-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.cat-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
}
.cat-mobile { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.cat-tablet { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.cat-laptop { background: rgba(34, 211, 238, 0.12); color: #22d3ee; }
.cat-desktop { background: rgba(99, 102, 241, 0.12); color: #818cf8; }
.cat-tv { background: rgba(139, 92, 246, 0.12); color: #a78bfa; }

/* ── FILTER BTNS ─────────────────────────────────────── */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-sans);
}
.filter-btn:hover { border-color: var(--brand-primary); color: var(--text-primary); }
.filter-btn.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }

/* ── WHY GRID ────────────────────────────────────────── */
.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.25rem;
}
.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.why-card:hover { border-color: var(--border-active); transform: translateY(-2px); }
.why-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.why-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.why-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.65; }

/* ── FAQ ─────────────────────────────────────────────── */
.faq-container { max-width: 780px; }
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}
.faq-item[open] { border-color: var(--border-active); }
.faq-item summary {
  padding: 1.1rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}
.faq-item summary::after { content: '+'; color: var(--brand-primary); font-size: 1.3rem; font-weight: 300; transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p {
  padding: 0 1.4rem 1.2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}
.faq-item code {
  background: rgba(99, 102, 241, 0.15);
  color: var(--brand-primary);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ── BLOG GRID ───────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 1.25rem;
}
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.blog-card:hover { border-color: var(--border-active); transform: translateY(-2px); }
.blog-tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(99, 102, 241, 0.15);
  color: var(--brand-primary);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
}
.blog-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text-primary); }
.blog-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; }
.blog-card-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: auto; }

/* ── FOOTER ──────────────────────────────────────────── */
.footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  margin-top: 0.75rem;
  max-width: 280px;
}
.footer-links h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--text-primary); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
    z-index: 999;
  }
  .nav-links.open a { padding: 0.75rem 1rem; }
  .hamburger { display: flex; }

  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .ppi-inputs { flex-direction: column; }
  .ppi-field input { width: 100%; }

  .res-number { font-size: 3rem; }
}

/* ── ANIMATIONS ──────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .metric-card, .blog-card, .why-card {
    animation: fadeUp 0.4s ease backwards;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── PULSE LIVE DOT ──────────────────────────────────── */
.live-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-red);
  margin-right: 4px;
  animation: pulse 1.5s ease-in-out infinite;
  vertical-align: middle;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.6); }
}

/* ── BLOG PAGE ───────────────────────────────────────── */
.blog-hero { padding: 5rem 0 3rem; text-align: center; background: var(--bg-dark); }
.blog-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1.5rem;
  padding: 3rem 0;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition), transform var(--transition);
}
.article-card:hover { border-color: var(--border-active); transform: translateY(-3px); box-shadow: var(--shadow-card); }
.article-card h2 { font-size: 1.05rem; font-weight: 700; line-height: 1.45; }
.article-card p { font-size: 0.87rem; color: var(--text-secondary); line-height: 1.65; flex: 1; }
.article-meta { font-size: 0.75rem; color: var(--text-muted); display: flex; gap: 0.75rem; flex-wrap: wrap; }
.read-more { color: var(--brand-primary); font-size: 0.85rem; font-weight: 600; }
