/* ============================================
   Engineer Career Lab - Main Stylesheet
   ITエンジニア向けアフィリエイトサイト
   ============================================ */

:root {
  --primary: #00d4ff;
  --primary-dark: #0099cc;
  --accent: #00ff88;
  --accent-dark: #00cc6a;
  --bg-dark: #0a0e1a;
  --bg-card: #111827;
  --bg-card2: #1a2235;
  --text-primary: #f0f4ff;
  --text-secondary: #8b9ab8;
  --text-muted: #556080;
  --border: #1e2d4a;
  --warning: #ffb800;
  --danger: #ff4466;
  --success: #00ff88;
  --gradient-1: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
  --gradient-2: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
  --gradient-hero: linear-gradient(180deg, #0a0e1a 0%, #0d1525 50%, #0a1020 100%);
  --shadow-card: 0 4px 24px rgba(0, 212, 255, 0.08);
  --shadow-hover: 0 8px 40px rgba(0, 212, 255, 0.2);
  --radius: 12px;
  --radius-lg: 20px;
  --font-main: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --bg-section: #0d1525;
}

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

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: break-word;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
}

/* ============ Typography ============ */
h1, h2, h3, h4, h5 {
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--accent); }

p { margin-bottom: 1em; }

/* ============ Layout ============ */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 16px;
}

.section-title h2 {
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gradient-1);
  margin: 12px auto 0;
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 48px;
}

/* ============ Header / Nav ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.logo span { color: var(--primary); }

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav a {
  color: var(--text-secondary);
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-cta {
  background: var(--gradient-1) !important;
  color: var(--bg-dark) !important;
  font-weight: 700 !important;
  font-size: 0.85rem !important;
  padding: 8px 14px !important;
  white-space: nowrap;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
  z-index: 1003;
  position: relative;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  display: block;
}

/* ============ Hero ============ */
.hero {
  position: relative;
  padding: 100px 0 80px;
  background: var(--gradient-hero);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.04) 1px, transparent 1px);
  background-size: 50px 50px;
}

.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -100px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-badge::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  margin-bottom: 24px;
  color: var(--text-primary);
}

.hero h1 .highlight {
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  line-height: 1.8;
}

.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: left;
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.hero-stat .num span {
  font-size: 1.2rem;
  color: var(--accent);
}

.hero-stat .label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 0.3s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-1);
  color: var(--bg-dark);
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.5);
  color: var(--bg-dark);
}

.btn-accent {
  background: var(--gradient-2);
  color: var(--bg-dark);
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.3);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 255, 136, 0.5);
  color: var(--bg-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: rgba(0, 212, 255, 0.1);
  transform: translateY(-2px);
  color: var(--primary);
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

/* ============ Cards ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s;
}

.card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* ============ Ranking Cards ============ */
.ranking-section { background: var(--bg-card2); }

.rank-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
}

.rank-card:hover {
  border-color: rgba(0, 212, 255, 0.4);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.rank-card.rank-1 { border-color: rgba(255, 184, 0, 0.4); }
.rank-card.rank-1:hover { border-color: var(--warning); box-shadow: 0 8px 40px rgba(255, 184, 0, 0.2); }
.rank-card.rank-2 { border-color: rgba(192, 192, 192, 0.4); }
.rank-card.rank-3 { border-color: rgba(205, 127, 50, 0.4); }

.rank-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.rank-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
}

.rank-1 .rank-badge { background: rgba(255, 184, 0, 0.15); color: var(--warning); }
.rank-2 .rank-badge { background: rgba(192, 192, 192, 0.15); color: #c0c0c0; }
.rank-3 .rank-badge { background: rgba(205, 127, 50, 0.15); color: #cd7f32; }

.rank-number {
  font-size: 2rem;
  font-weight: 900;
  font-family: var(--font-mono);
}

.rank-reward {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(0, 255, 136, 0.1);
  color: var(--accent);
  border-radius: 6px;
}

.rank-body {
  padding: 20px 24px;
}

.rank-service {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.rank-logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  flex-shrink: 0;
}

.rank-info h3 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.rank-info .tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stars {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
}

.stars .star {
  color: var(--warning);
  font-size: 0.9rem;
}

.stars .rating-num {
  margin-left: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.stars .review-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

.rank-points {
  list-style: none;
  margin-bottom: 20px;
}

.rank-points li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 4px 0;
}

.rank-points li::before {
  content: '✓';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.rank-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.rank-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

/* ============ Comparison Table ============ */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.comparison-table th {
  background: var(--bg-card2);
  padding: 16px 20px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: middle;
}

.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table tr:hover td {
  background: rgba(0, 212, 255, 0.03);
}

.comparison-table .highlight-row td {
  background: rgba(255, 184, 0, 0.05);
}

.check { color: var(--accent); font-weight: 700; }
.cross { color: var(--danger); }

/* ============ Feature Boxes ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s;
}

.feature-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* ============ CTA Section ============ */
.cta-section {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.15) 0%, rgba(0, 212, 255, 0.1) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cta-inner {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.cta-inner h2 {
  margin-bottom: 16px;
}

.cta-inner p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ Testimonials ============ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.testimonial-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 4rem;
  color: var(--primary);
  opacity: 0.2;
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gradient-1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--bg-dark);
  margin-bottom: 16px;
}

.testimonial-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.testimonial-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.testimonial-meta strong {
  color: var(--text-primary);
  font-weight: 600;
  display: block;
}

/* ============ Tags / Badges ============ */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-new { background: rgba(0, 255, 136, 0.15); color: var(--accent); }
.tag-hot { background: rgba(255, 68, 102, 0.15); color: var(--danger); }
.tag-rec { background: rgba(0, 212, 255, 0.15); color: var(--primary); }
.tag-free { background: rgba(255, 184, 0, 0.15); color: var(--warning); }

/* ============ Article List ============ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}

.article-thumb {
  width: 100%;
  height: 160px;
  background: var(--bg-card2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.article-thumb-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-1);
  opacity: 0.08;
}

.article-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.article-card h3 {
  font-size: 1rem;
  margin-bottom: 10px;
  line-height: 1.5;
  color: var(--text-primary);
}

.article-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  flex: 1;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============ Breadcrumb ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 16px 0;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--text-secondary); }

/* ============ FAQ ============ */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-weight: 600;
  transition: background 0.2s;
}

.faq-question:hover { background: rgba(0, 212, 255, 0.05); }

.faq-question .q-icon {
  color: var(--primary);
  font-weight: 800;
  flex-shrink: 0;
}

.faq-toggle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 212, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s;
  color: var(--primary);
  font-size: 1.2rem;
}

.faq-item.open .faq-toggle { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 24px 20px 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.faq-item.open .faq-answer { display: block; }

/* ============ Footer ============ */
.footer {
  background: #060a14;
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.footer-brand h3 span { color: var(--primary); }

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

.footer-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.affiliate-disclosure {
  background: rgba(255, 184, 0, 0.06);
  border: 1px solid rgba(255, 184, 0, 0.2);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 32px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.affiliate-disclosure strong { color: var(--warning); }

/* ============ Sidebar Layout ============ */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-widget h4 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  border-bottom: 1px solid var(--border);
}

.toc-list li:last-child { border-bottom: none; }

.toc-list li a {
  display: block;
  padding: 10px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.toc-list li a:hover { color: var(--primary); }

/* ============ Notice Box ============ */
.notice-box {
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 24px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.notice-box.info {
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.notice-box.warning {
  background: rgba(255, 184, 0, 0.08);
  border: 1px solid rgba(255, 184, 0, 0.2);
}

.notice-box.success {
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.notice-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.notice-content { font-size: 0.9rem; line-height: 1.7; }
.notice-content p { margin: 0; }

/* ============ Progress Bar ============ */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--gradient-1);
  z-index: 9999;
  transition: width 0.1s;
}

/* ============ Scroll to top ============ */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--gradient-1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
  border: none;
  color: var(--bg-dark);
  font-size: 1.1rem;
}

.scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Mobile Menu ============ */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-dark);
  z-index: 1002;
  flex-direction: column;
  padding: 72px 24px 40px;
  gap: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-menu.open { display: flex; }

.mobile-menu a {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 500;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
}

.mobile-menu a:hover { color: var(--primary); }

.mobile-menu a:last-of-type { border-bottom: none; }

.mobile-menu .btn {
  margin-top: 24px;
  width: 100%;
  justify-content: center;
  font-size: 1rem;
}

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .hero-stats { gap: 24px; }
  .article-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 600px) {
  html { font-size: 15px; }
  .section { padding: 48px 0; }
  .hero { padding: 56px 0 48px; }
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
  .hero-buttons { flex-direction: column; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .cta-buttons { flex-direction: column; align-items: stretch; }
  .cta-buttons .btn { width: 100%; justify-content: center; }
  .hero-stats { gap: 16px; }
  .hero-stat .num { font-size: 1.6rem; }
  .rank-header { flex-wrap: wrap; gap: 8px; padding: 14px 16px 12px; }
  .rank-body { padding: 16px; }
  .rank-service { gap: 12px; }
  .rank-logo { width: 44px; height: 44px; font-size: 1.2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .comparison-table th, .comparison-table td { padding: 12px 14px; font-size: 0.82rem; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .section-title h2 { font-size: 1.4rem; }
  .btn-lg { padding: 14px 24px; font-size: 0.95rem; }
  .faq-question { padding: 16px; }
  .faq-answer { padding: 0 16px 16px; padding-top: 14px; }
  .breadcrumb { font-size: 0.8rem; flex-wrap: wrap; }
  .scroll-top { bottom: 20px; right: 16px; width: 40px; height: 40px; }
}

/* ============ Page-specific mobile fixes ============ */
@media (max-width: 900px) {
  /* page-hero inline badge blocks */
  .page-hero .badges-flex { flex-direction: column; gap: 10px; }
}

@media (max-width: 600px) {
  /* Hero description forced breaks */
  .hero-desc br { display: none; }
  .hero-desc { font-size: 1rem; }

  /* Page hero */
  .page-hero { padding: 32px 0 24px; }
  .page-hero h1 br { display: none; }
  .page-hero h1 { font-size: clamp(1.4rem, 5vw, 1.8rem); }

  /* TOC box */
  .toc-box { padding: 14px 16px; }
  .toc-box ol { padding-left: 16px; }

  /* Agent / cert / event card headers */
  .agent-header { flex-direction: column; gap: 12px; }
  .agent-logo-lg { width: 56px !important; height: 56px !important; font-size: 0.85rem !important; }
  .cert-header { flex-direction: column; gap: 10px; }
  .event-header { flex-direction: column; align-items: flex-start; }
  .site-header { flex-direction: column; align-items: flex-start; }
  .school-header { flex-direction: column; align-items: flex-start; }

  /* Event grid */
  .event-grid { grid-template-columns: 1fr; }
  .use-case-grid { grid-template-columns: 1fr; }

  /* Contact info grid */
  .contact-info-grid { grid-template-columns: 1fr; }

  /* Pros/cons side-by-side → stacked */
  .pros-cons { grid-template-columns: 1fr !important; }

  /* hero badges inline block */
  .hero-badge { font-size: 0.78rem; padding: 5px 12px; }

  /* Page-hero inline badge flex containers */
  .page-hero [style*="display:flex"] { flex-wrap: wrap !important; }

  /* rank-number font size */
  .rank-number { font-size: 1.5rem; }

  /* Section padding for pages with sidebar */
  .content-layout main { min-width: 0; }

  /* cost-row text overflow */
  .cost-row { flex-wrap: wrap; gap: 4px; }

  /* toc-box list font */
  .toc-box ol li { font-size: 0.85rem; margin-bottom: 6px; }

  /* update-badge */
  .update-badge { font-size: 0.75rem; }

  /* page-hero badge cards */
  .page-hero-badges { flex-direction: column !important; gap: 10px !important; }
  .page-hero-badges > div { min-width: 0; }

  /* strategy step */
  .strategy-step { flex-direction: column; gap: 10px; padding: 16px 0; }

  /* footer links wrap */
  .footer-links { flex-wrap: wrap; }
}

/* iOS zoom prevention on form focus */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Hamburger open state → X */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu close button — flows at top of menu below header */
.mobile-menu-close {
  display: none; /* hidden; hamburger X handles closing */
}

/* Table wrapper always scrollable */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

/* ============ Animations ============ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s, transform 0.6s;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ Utility ============ */
.text-center { text-align: center; }
.text-primary { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--text-muted) !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
