/* =====================================================
   TouchTyping.guru — Main Stylesheet
   Design: clean, modern, educational (typing.com inspired)
   ===================================================== */

:root {
  --blue-dark:   #1565C0;
  --blue-mid:    #1976D2;
  --blue-light:  #42A5F5;
  --blue-pale:   #E3F2FD;
  --blue-hero:   linear-gradient(135deg, #1565C0 0%, #1976D2 50%, #42A5F5 100%);
  --gold:        #F9A825;
  --gold-dark:   #E65100;
  --white:       #FFFFFF;
  --gray-50:     #FAFAFA;
  --gray-100:    #F5F5F5;
  --gray-200:    #EEEEEE;
  --gray-400:    #BDBDBD;
  --gray-600:    #757575;
  --gray-800:    #424242;
  --gray-900:    #212121;
  --text:        #1A1A2E;
  --text-muted:  #616161;
  --border:      #E0E0E0;
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.12);
  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   20px;
  --font:        'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-heading:'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-w:       1200px;
  --max-w-text:  760px;
}

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

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

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--blue-mid); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-dark); }
a:focus-visible {
  outline: 3px solid var(--blue-light);
  outline-offset: 2px;
  border-radius: 3px;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5rem; }

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--blue-dark);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow { max-width: var(--max-w-text); }

/* =====================================================
   NAVIGATION
   ===================================================== */
.site-nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--blue-dark);
  text-decoration: none;
  margin-right: auto;
  letter-spacing: -0.5px;
}
.nav-logo .logo-dot { color: var(--gold); }
.nav-logo:hover { text-decoration: none; color: var(--blue-dark); }

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

.nav-links > li { position: relative; }
.mob-lang-item { display: none; }

.nav-links > li > a {
  display: block;
  padding: 0 1rem;
  height: 64px;
  line-height: 64px;
  font-weight: 500;
  font-size: 0.925rem;
  color: var(--gray-800);
  white-space: nowrap;
  transition: color 0.15s;
}
.nav-links > li > a:hover,
.nav-links > li:hover > a {
  color: var(--blue-dark);
  text-decoration: none;
}

/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.15s ease;
  list-style: none;
}
.nav-links > li:hover .nav-dropdown,
.nav-links > li:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  color: var(--gray-800);
}
.nav-dropdown a:hover { background: var(--blue-pale); color: var(--blue-dark); text-decoration: none; }

.nav-caret { font-size: 0.7rem; margin-left: 0.25rem; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 1.5rem;
}

.lang-switcher {
  display: flex;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.lang-switcher a {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--gray-600);
  font-weight: 500;
}
.lang-switcher a:hover { background: var(--blue-pale); color: var(--blue-dark); text-decoration: none; }
.lang-switcher a.active { background: var(--blue-mid); color: white; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--gray-800);
  font-size: 1.5rem;
  line-height: 1;
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  background: var(--blue-hero);
  color: white;
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: white;
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 480px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hero-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-lg);
  color: var(--text);
}

.hero-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--gray-900);
}

.hero-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.55;
  opacity: 1;
  max-width: none;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--gold);
  color: var(--gray-900);
  box-shadow: 0 2px 8px rgba(249,168,37,0.4);
}
.btn-primary:hover { background: #FFB300; color: var(--gray-900); box-shadow: 0 4px 16px rgba(249,168,37,0.5); }

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255,255,255,0.7);
}
.btn-secondary:hover { background: rgba(255,255,255,0.15); color: white; border-color: white; }

.btn-blue {
  background: var(--blue-mid);
  color: white;
  box-shadow: 0 2px 8px rgba(25,118,210,0.3);
}
.btn-blue:hover { background: var(--blue-dark); color: white; }

.btn-outline {
  background: transparent;
  color: var(--blue-mid);
  border: 2px solid var(--blue-mid);
}
.btn-outline:hover { background: var(--blue-mid); color: white; }

.btn-gold-dark {
  background: var(--gold);
  color: var(--gray-900);
  font-weight: 700;
}
.btn-gold-dark:hover { background: #FFB300; color: var(--gray-900); }

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.9rem 2.25rem;
  font-size: 1.05rem;
}

/* =====================================================
   SECTIONS
   ===================================================== */
.section {
  padding: 72px 0;
}
.section--gray { background: var(--gray-50); }
.section--blue { background: var(--blue-pale); }
.section--dark {
  background: var(--blue-hero);
  color: white;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  color: var(--blue-dark);
}
.section--dark .section-header h2 { color: white; }
.section-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}
.section--dark .section-header p { color: rgba(255,255,255,0.85); }

/* =====================================================
   CARDS
   ===================================================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.card-grid--2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card--link { cursor: pointer; display: block; color: inherit; }
.card--link:hover { text-decoration: none; color: inherit; }

.card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--gray-900);
}

.card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.card-tag {
  display: inline-block;
  background: var(--blue-pale);
  color: var(--blue-dark);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}

/* =====================================================
   BREADCRUMBS
   ===================================================== */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
}
.breadcrumbs li + li::before {
  content: '›';
  margin-right: 0.25rem;
  color: var(--gray-400);
}
.breadcrumbs a { color: var(--blue-mid); }
.breadcrumbs [aria-current="page"] { color: var(--text-muted); font-weight: 500; }

/* =====================================================
   ARTICLE / CONTENT PAGES
   ===================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 2.25rem 0 1rem;
  letter-spacing: -0.3px;
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 1.75rem 0 0.75rem;
}
.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 1.5rem 0 0.5rem;
}
.article-body p { margin-bottom: 1.15rem; }
.article-body ul, .article-body ol { margin-bottom: 1.15rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body strong { color: var(--gray-900); }
.article-body a { color: var(--blue-mid); font-weight: 500; }

.article-header {
  margin-bottom: 2.5rem;
}
.article-header h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--gray-900);
  margin-bottom: 1rem;
}
.article-meta {
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}
.article-meta .reading-time::before { content: '⏱ '; }
.article-meta .updated::before { content: '📅 '; }

.article-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

/* Table of contents */
.toc {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.toc-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}
.toc ol { padding-left: 1.25rem; }
.toc li { margin-bottom: 0.4rem; font-size: 0.9rem; }
.toc a { color: var(--blue-mid); }

/* Sidebar */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 84px;
}

.sidebar-box {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.sidebar-box h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-600);
  margin-bottom: 0.75rem;
}
.sidebar-box ul { list-style: none; padding: 0; }
.sidebar-box li { margin-bottom: 0.5rem; font-size: 0.9rem; }
.sidebar-box a { color: var(--blue-mid); }

.sidebar-cta {
  background: var(--blue-hero);
  color: white;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.sidebar-cta h4 { color: white !important; font-size: 1rem !important; letter-spacing: 0 !important; margin-bottom: 0.5rem; }
.sidebar-cta p { font-size: 0.875rem; opacity: 0.9; margin-bottom: 1rem; }

/* =====================================================
   GLOSSARY
   ===================================================== */
.glossary-term-page .term-definition {
  font-size: 1.15rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--blue-pale);
  border-left: 4px solid var(--blue-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.related-terms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.related-term-chip {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  background: var(--blue-pale);
  border: 1px solid #BBDEFB;
  color: var(--blue-dark);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}
.related-term-chip:hover { background: var(--blue-mid); color: white; border-color: var(--blue-mid); text-decoration: none; }

.glossary-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.glossary-index-card {
  display: block;
  padding: 1.15rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
  color: inherit;
}
.glossary-index-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-sm);
  color: var(--blue-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.glossary-index-card strong { display: block; margin-bottom: 0.3rem; color: var(--gray-900); }
.glossary-index-card span { font-size: 0.85rem; color: var(--text-muted); }

/* =====================================================
   TOOLS
   ===================================================== */
.tool-page .tool-widget {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2.5rem;
}

.tool-input-group {
  margin-bottom: 1.25rem;
}
.tool-input-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--gray-800);
}
.tool-input-group input[type="number"],
.tool-input-group input[type="text"],
.tool-input-group select,
.tool-input-group textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--gray-50);
  transition: border-color 0.15s;
  color: var(--text);
}
.tool-input-group input:focus,
.tool-input-group select:focus,
.tool-input-group textarea:focus {
  outline: none;
  border-color: var(--blue-mid);
  background: white;
  box-shadow: 0 0 0 3px rgba(25,118,210,0.12);
}
.tool-input-group textarea { resize: vertical; min-height: 100px; }

.tool-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
}

.tool-result {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--blue-pale);
  border-radius: var(--radius);
  display: none;
}
.tool-result.visible { display: block; }
.tool-result h3 { font-size: 1rem; color: var(--blue-dark); margin-bottom: 1rem; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.result-item {
  background: white;
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.result-item .result-value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.result-item .result-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.result-message {
  font-size: 0.95rem;
  color: var(--gray-800);
  line-height: 1.6;
}

.practice-output {
  margin-top: 1.5rem;
  display: none;
}
.practice-output.visible { display: block; }
.practice-text-box {
  background: var(--gray-900);
  color: #E0E0E0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  padding: 1.5rem;
  border-radius: var(--radius);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.tool-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.tool-hub-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.15s;
  color: inherit;
  text-decoration: none;
}
.tool-hub-card:hover {
  border-color: var(--blue-mid);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
  text-decoration: none;
}
.tool-hub-card .tool-card-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}
.tool-hub-card h3 { font-size: 0.975rem; margin-bottom: 0.3rem; color: var(--gray-900); }
.tool-hub-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

/* =====================================================
   FAQ
   ===================================================== */
.faq-list { display: flex; flex-direction: column; gap: 0.5rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: white;
  border: none;
  text-align: left;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--gray-900);
  font-family: var(--font);
  transition: background 0.15s;
}
.faq-question:hover { background: var(--gray-50); }
.faq-question[aria-expanded="true"] { background: var(--blue-pale); color: var(--blue-dark); }
.faq-icon {
  font-size: 1.1rem;
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: 1rem;
}
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s;
}
.faq-answer.open {
  max-height: 600px;
  padding: 1rem 1.25rem 1.25rem;
}
.faq-answer p { margin-bottom: 0.75rem; font-size: 0.95rem; color: var(--text-muted); }
.faq-answer a { color: var(--blue-mid); }

/* =====================================================
   BLOG
   ===================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.15s;
  color: inherit;
  text-decoration: none;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: inherit; text-decoration: none; }

.blog-card-cover {
  height: 180px;
  background: var(--blue-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
}

.blog-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.blog-card-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--blue-dark);
  background: var(--blue-pale);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.blog-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.6rem; line-height: 1.35; }
.blog-card p { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; flex: 1; line-height: 1.55; }
.blog-card-meta { font-size: 0.8rem; color: var(--gray-400); }

/* =====================================================
   CTA BLOCKS
   ===================================================== */
.cta-block {
  background: var(--blue-hero);
  color: white;
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-block h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.75rem; }
.cta-block p { opacity: 0.9; margin-bottom: 1.75rem; font-size: 1.05rem; }

.cta-inline {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--blue-pale);
  border: 1px solid #BBDEFB;
  border-left: 4px solid var(--blue-mid);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}
.cta-inline .cta-icon { font-size: 1.75rem; flex-shrink: 0; }
.cta-inline-text { flex: 1; }
.cta-inline-text strong { display: block; color: var(--blue-dark); margin-bottom: 0.25rem; }
.cta-inline-text p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

/* =====================================================
   STATS / NUMBERS
   ===================================================== */
.stats-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 2.5rem 0;
}
.stat-item { text-align: center; }
.stat-number {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  color: white;
  line-height: 1;
  margin-bottom: 0.35rem;
}
.stat-label { font-size: 0.875rem; opacity: 0.85; color: white; }

/* =====================================================
   LESSON PAGES
   ===================================================== */
.lesson-drill {
  background: var(--gray-900);
  color: #E8E8E8;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  padding: 1.75rem;
  border-radius: var(--radius);
  line-height: 2;
  margin: 1.5rem 0;
  letter-spacing: 0.05em;
}

.key-highlight {
  display: inline-block;
  background: var(--blue-mid);
  color: white;
  border-radius: 4px;
  padding: 0 0.3rem;
  font-weight: 700;
}

.finger-map {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 0.35rem;
  margin: 1.5rem 0;
}
.finger-key {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid transparent;
}
.finger-key.left-pinky  { background: #FCE4EC; border-color: #F48FB1; color: #880E4F; }
.finger-key.left-ring   { background: #F3E5F5; border-color: #CE93D8; color: #4A148C; }
.finger-key.left-middle { background: #E8EAF6; border-color: #9FA8DA; color: #1A237E; }
.finger-key.left-index  { background: #E3F2FD; border-color: #90CAF9; color: #0D47A1; }
.finger-key.thumb       { background: var(--gray-200); border-color: var(--gray-400); color: var(--gray-800); }
.finger-key.right-index { background: #E8F5E9; border-color: #A5D6A7; color: #1B5E20; }
.finger-key.right-middle{ background: #FFF8E1; border-color: #FFE082; color: #E65100; }
.finger-key.right-ring  { background: #FFF3E0; border-color: #FFCC80; color: #BF360C; }
.finger-key.right-pinky { background: #FFEBEE; border-color: #EF9A9A; color: #B71C1C; }
.finger-key.home-row    { border-width: 3px; font-weight: 900; }

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: #1A1A2E;
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}

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

.footer-brand .footer-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.75rem;
  display: block;
}
.footer-brand .footer-logo .logo-dot { color: var(--gold); }
.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.footer-col h4 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: white;
  margin-bottom: 1rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: rgba(255,255,255,0.65); font-size: 0.875rem; }
.footer-col a:hover { color: white; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
}
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { color: rgba(255,255,255,0.55); }
.footer-bottom-links a:hover { color: white; text-decoration: none; }

/* =====================================================
   HOMEPAGE SPECIAL SECTIONS
   ===================================================== */
.speed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.925rem;
}
.speed-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  background: var(--blue-dark);
  color: white;
  font-weight: 600;
}
.speed-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--gray-800);
}
.speed-table tr:last-child td { border-bottom: none; }
.speed-table tr:nth-child(even) td { background: var(--gray-50); }

.wpm-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
}
.wpm-slow   { background: #FFEBEE; color: #B71C1C; }
.wpm-avg    { background: #FFF3E0; color: #E65100; }
.wpm-good   { background: #E8F5E9; color: #1B5E20; }
.wpm-great  { background: #E3F2FD; color: #0D47A1; }

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.feature-row--reverse { direction: rtl; }
.feature-row--reverse > * { direction: ltr; }

.feature-img-placeholder {
  background: var(--blue-hero);
  border-radius: var(--radius-lg);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border);
  color: var(--gray-800);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
  text-decoration: none;
}
.page-btn:hover { border-color: var(--blue-mid); color: var(--blue-mid); text-decoration: none; }
.page-btn.active { background: var(--blue-mid); color: white; border-color: var(--blue-mid); }

/* =====================================================
   ALERTS / NOTES
   ===================================================== */
.note {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  font-size: 0.925rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.note-icon { flex-shrink: 0; font-size: 1.1rem; margin-top: 0.1rem; }
.note--info { background: var(--blue-pale); border-left: 3px solid var(--blue-mid); }
.note--tip  { background: #F1F8E9; border-left: 3px solid #8BC34A; }
.note--warn { background: #FFF8E1; border-left: 3px solid var(--gold); }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: span 3; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-cards { max-width: 480px; }
  .feature-row { grid-template-columns: 1fr; gap: 2rem; }
  .feature-row--reverse { direction: ltr; }
}

@media (max-width: 768px) {
  .section { padding: 48px 0; }
  .hero { padding: 52px 0 80px; }
  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: block; }

  /* Mobile nav overlay */
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    padding: 0;
    overflow-y: auto;
    z-index: 999;
    gap: 0;
  }
  .nav-links.open > li {
    border-bottom: 1px solid var(--border);
  }
  .nav-links.open > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: auto;
    line-height: 1.4;
    padding: 1rem 1.25rem;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    border-bottom: none;
  }
  .nav-links.open > li > a:hover { background: var(--blue-pale); }

  /* Mobile dropdowns — hidden by default, toggled by JS */
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
    border-radius: 0;
    display: none;
    padding: 0.25rem 0 0.5rem;
  }
  .nav-links > li.mob-open .nav-dropdown { display: block; }
  .nav-dropdown a {
    padding: 0.65rem 1.25rem 0.65rem 2rem;
    text-align: left;
    font-size: 0.95rem;
    display: block;
  }

  /* Backdrop */
  .nav-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 999;
  }
  .nav-backdrop.open { display: block; }

  /* Footer mobile */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 0; }
  .footer-brand { grid-column: span 2; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 0.5rem; }
  .footer-col { padding: 0; }
  .footer-col h4 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .footer-col h4::after { content: '+'; font-size: 1.1rem; font-weight: 400; opacity: 0.7; }
  .footer-col.mob-open h4::after { content: '−'; }
  .footer-col ul { display: none; padding: 0.5rem 0 0.75rem; }
  .footer-col.mob-open ul { display: block; }

  .card-grid--4 { grid-template-columns: 1fr 1fr; }
  .tool-input-row { grid-template-columns: 1fr; }
  .hero-cards { grid-template-columns: 1fr; max-width: 100%; }
  .tool-hub-grid { grid-template-columns: 1fr; }
  .blog-grid { grid-template-columns: 1fr; }
  .speed-table { font-size: 0.8rem; }
  .speed-table th, .speed-table td { padding: 0.5rem 0.6rem; }

  /* Mobile lang switcher inside nav */
  .mob-lang-item { display: flex !important; align-items: center; gap: 0.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
  .mob-lang-item a { font-size: 0.9rem; font-weight: 600; color: var(--gray-500); padding: 0.25rem 0.5rem; border-radius: 4px; }
  .mob-lang-item a.active { color: var(--blue-mid); background: var(--blue-pale); }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1.25rem;
  }
  .footer-bottom-links { flex-wrap: wrap; gap: 0.5rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-brand { grid-column: span 1; }
  .card-grid--4 { grid-template-columns: 1fr; }
  .stats-row { gap: 1.5rem; }
}
