/* ==========================================================================
   Design Token Engine & CSS Variables
   ========================================================================== */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;

  /* Light Theme Palette */
  --bg-body: #f1f5f9;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.9);
  --bg-glass-nav: rgba(255, 255, 255, 0.85);
  --border-color: rgba(226, 232, 240, 0.8);
  --border-accent: rgba(99, 102, 241, 0.3);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.25);
  --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
  --accent-gradient-hover: linear-gradient(135deg, #4338ca 0%, #0891b2 100%);

  /* Indicator Colors */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;

  /* Glassmorphism Specs */
  --backdrop-blur: blur(16px);
  --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.07);
  --radius-sm: 0.375rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --bg-body: #090d16;
  --bg-card: rgba(17, 24, 39, 0.65);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass-nav: rgba(15, 23, 42, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(129, 140, 248, 0.3);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #94a3b8;

  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-glow: rgba(99, 102, 241, 0.35);
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 30px -10px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Global Reset & Layout Foundations
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Glassmorphism Component Library
   ========================================================================== */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 2.25rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-accent);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--accent-gradient);
  color: #ffffff;
  border: none;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  opacity: 0.95;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  color: var(--primary);
}

/* ==========================================================================
   Header & Navigation Module
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass-nav);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Mobile Drawer Overlay */
@media (max-width: 868px) {
  .mobile-menu-btn { display: block; }
  .nav-links {
    position: fixed;
    top: 65px;
    left: 0;
    right: 0;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.25rem;
    transform: translateY(-150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .nav-links.active { transform: translateY(0); }
}

/* ==========================================================================
   Hero & Tool Workspace Section
   ========================================================================== */
.hero-section {
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

.checker-wrapper {
  max-width: 800px;
  margin: 0 auto;
}

.checker-form {
  display: flex;
  gap: 0.75rem;
}

.checker-form input {
  flex: 1;
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.checker-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

@media (max-width: 640px) {
  .checker-form { flex-direction: column; }
}

/* Results UI Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.score-card {
  text-align: center;
  padding: 1.75rem 1rem;
}

.score-circle {
  width: 95px;
  height: 95px;
  border-radius: var(--radius-full);
  border: 7px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0 auto 1rem;
  background: var(--bg-card);
}

.score-circle.pass { border-color: var(--color-success); color: var(--color-success); }
.score-circle.warn { border-color: var(--color-warning); color: var(--color-warning); }
.score-circle.fail { border-color: var(--color-danger); color: var(--color-danger); }

/* ==========================================================================
   Article Grid & Content Layout
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin: 2.5rem 0;
}

.blog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.blog-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.blog-card h3 a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card h3 a:hover {
  color: var(--primary);
}

.blog-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.meta-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: 0.875rem;
  color: var(--text-subtle);
  margin-bottom: 1.5rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--primary); }
.breadcrumb li::after { content: "/"; margin-left: 0.5rem; }
.breadcrumb li:last-child::after { content: ""; }

/* Accordion FAQ Component */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.faq-item {
  cursor: pointer;
  padding: 1.25rem 1.5rem;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin-top 0.3s ease;
  color: var(--text-muted);
  font-size: 0.975rem;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  margin-top: 0.85rem;
}

.faq-icon {
  transition: transform 0.3s ease;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
}

/* ==========================================================================
   Footer Component
   ========================================================================== */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 3.5rem 0 2rem;
  color: var(--text-muted);
  font-size: 0.925rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-col h4 {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.85rem;
}
