/* ==========================================================================
   Twitch Username Generator — SEOWebChecker.com
   Design tokens: dark navy base + Twitch-violet accent
   ========================================================================== */

:root {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-soft: #eef0f8;
  --text-primary: #14162b;
  --text-secondary: #4d5170;
  --text-muted: #8285a3;
  --border: #e1e3f0;
  --border-strong: #ccd0e8;
  --accent: #9146ff;
  --accent-hover: #7c3aed;
  --accent-soft: #f1e9ff;
  --accent-2: #00d4b5;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(20, 22, 43, 0.06);
  --shadow-md: 0 8px 24px rgba(20, 22, 43, 0.08);
  --shadow-lg: 0 20px 60px rgba(20, 22, 43, 0.14);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

[data-theme="dark"] {
  --bg: #0b0c17;
  --bg-elevated: #14162b;
  --bg-soft: #1a1d38;
  --text-primary: #f3f4fc;
  --text-secondary: #b7b9d6;
  --text-muted: #7c7fa3;
  --border: #262a4c;
  --border-strong: #34386a;
  --accent: #a970ff;
  --accent-hover: #bf8bff;
  --accent-soft: #241a45;
  --accent-2: #21e6c4;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; color: var(--text-secondary); }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------------- Top utility bar ---------------- */
.top-bar {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.top-bar .container { display: flex; justify-content: space-between; align-items: center; padding: 6px 24px; }
.top-bar a { color: var(--text-muted); }
.top-bar a:hover { color: var(--accent); }

/* ---------------- Navbar ---------------- */
.navbar {
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-wrapper { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 20px; }
.brand-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-logo .dot { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links > li { position: relative; }
.nav-links > li > a, .nav-cta-link {
  display: block; padding: 10px 14px; border-radius: var(--radius-sm);
  font-weight: 500; font-size: 0.94rem; color: var(--text-secondary);
}
.nav-links > li > a:hover { background: var(--bg-soft); color: var(--accent); }
.nav-links > li > a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* Mega dropdown */
.has-dropdown > button {
  background: none; border: none; font: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: var(--text-secondary); font-weight: 500; font-size: 0.94rem;
}
.has-dropdown > button:hover { background: var(--bg-soft); color: var(--accent); }
.has-dropdown > button svg { transition: transform 0.2s ease; width: 14px; height: 14px; }
.has-dropdown.open > button svg { transform: rotate(180deg); }
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  width: min(640px, 90vw);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 20px;
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 20px;
  z-index: 250;
}
.has-dropdown.open .mega-dropdown { display: grid; }
.mega-dropdown a { display: block; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.88rem; color: var(--text-secondary); }
.mega-dropdown a:hover { background: var(--accent-soft); color: var(--accent); }

.nav-right { display: flex; align-items: center; gap: 10px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--bg-soft); cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }

.nav-cta-link { background: var(--accent); color: #fff !important; font-weight: 600; padding: 10px 18px; }
.nav-cta-link:hover { background: var(--accent-hover); }

.hamburger { display: none; width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-soft); cursor: pointer; }
.hamburger span { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--text-primary); transition: 0.2s; }

/* ---------------- Breadcrumb ---------------- */
.breadcrumb-bar { border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 0.84rem; padding: 12px 0; color: var(--text-muted); list-style: none; margin: 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--border-strong); }
.breadcrumb li[aria-current] { color: var(--text-secondary); font-weight: 500; }

/* ---------------- Hero ---------------- */
.hero { padding: 64px 0 40px; position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -180px; right: -120px; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%); opacity: 0.18; pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); line-height: 1.1; margin-bottom: 18px; }
.hero h1 span { color: var(--accent); }
.hero-lead { font-size: 1.1rem; max-width: 620px; }
.hero-stats { display: flex; gap: 28px; margin-top: 28px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--text-primary); }
.hero-stat span { font-size: 0.82rem; color: var(--text-muted); }

/* ---------------- Generator card ---------------- */
.generator-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md); padding: 32px; margin-top: 8px;
}
.gen-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 8px; color: var(--text-primary); }
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 6px; }
input[type="text"], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong);
  background: var(--bg); color: var(--text-primary); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
textarea { resize: vertical; min-height: 70px; }
input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none;
}
input.input-error { border-color: var(--error); }
.field-error { color: var(--error); font-size: 0.8rem; margin-top: 6px; display: none; }
.field-error.show { display: block; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: var(--bg); font-size: 0.84rem; cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider-toggle { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; cursor: pointer; transition: 0.2s; }
.slider-toggle::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider-toggle { background: var(--accent); }
.switch input:checked + .slider-toggle::before { transform: translateX(20px); }

.range-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-value { font-weight: 700; font-family: var(--font-display); min-width: 30px; text-align: right; }

.btn-generate {
  width: 100%; padding: 16px; border: none; border-radius: var(--radius-sm); background: var(--accent);
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 6px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn-generate:hover:not(:disabled) { background: var(--accent-hover); }
.btn-generate:active:not(:disabled) { transform: scale(0.99); }
.btn-generate:disabled { opacity: 0.7; cursor: not-allowed; }
.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: none; }
.btn-generate.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.alert { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-top: 16px; display: none; }
.alert.show { display: block; }
.alert-error { background: #fdecec; color: #7a1f1f; border: 1px solid #f3b9b9; }
[data-theme="dark"] .alert-error { background: #2a1414; color: #ff9d9d; border-color: #4a1f1f; }

/* ---------------- Results ---------------- */
.results-section { display: none; }
.results-section.show { display: block; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.results-toolbar h2 { margin: 0; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-sm {
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); background: var(--bg-elevated);
  color: var(--text-primary); font-weight: 600; font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.result-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.result-card .uname { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; word-break: break-all; }
.result-card .uname::before { content: '@'; color: var(--accent); }
.copy-icon-btn { border: none; background: var(--bg-soft); width: 34px; height: 34px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); flex-shrink: 0; display:flex; align-items:center; justify-content:center; }
.copy-icon-btn:hover { color: var(--accent); }
.copy-icon-btn.copied { color: var(--success); }
.copy-icon-btn svg { width: 16px; height: 16px; }

/* ---------------- Tool strip (reference tools) ---------------- */
.tool-strip { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.tool-strip h2 { font-size: 1.4rem; }
.tool-strip-sub { color: var(--text-muted); margin-bottom: 28px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tool-pill {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px; font-size: 0.88rem; font-weight: 500; color: var(--text-secondary);
}
.tool-pill:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------- Features ---------------- */
.section-head { max-width: 640px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.feature-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 26px; }
.feature-icon { width: 46px; height: 46px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.feature-icon svg { width: 22px; height: 22px; }
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { font-size: 0.9rem; margin: 0; }

/* ---------------- How it works ---------------- */
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; counter-reset: step; }
.step-card { position: relative; padding-top: 8px; }
.step-num { font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; color: var(--accent-soft); -webkit-text-stroke: 1.5px var(--accent); }
.step-card h3 { font-size: 1.02rem; margin-top: 6px; }
.step-card p { font-size: 0.9rem; }

/* ---------------- FAQ ---------------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q { width: 100%; text-align: left; background: none; border: none; padding: 20px 4px; font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text-primary); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform 0.2s ease; color: var(--accent); }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-item.open .faq-a { max-height: 300px; }
.faq-a p { padding: 0 4px 20px; font-size: 0.92rem; }

/* ---------------- Article ---------------- */
.article-section { background: var(--bg-soft); border-top: 1px solid var(--border); }
.article-body { max-width: 780px; margin: 0 auto; font-size: 0.96rem; }
.article-body h2 { font-size: 1.5rem; }
.article-body p { color: var(--text-secondary); }

/* ---------------- CTA ---------------- */
.cta-section { text-align: center; }
.cta-box {
  background: linear-gradient(135deg, var(--accent) 0%, #5b21b6 100%); border-radius: var(--radius-lg);
  padding: 56px 32px; color: #fff;
}
.cta-box h2 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-box p { color: rgba(255,255,255,0.85); max-width: 520px; margin: 0 auto 26px; }
.cta-buttons { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--accent); padding: 13px 26px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem; }
.btn-outline-white { border: 1.5px solid rgba(255,255,255,0.6); color: #fff; padding: 13px 26px; border-radius: var(--radius-sm); font-weight: 700; font-size: 0.95rem; }

/* ---------------- Footer ---------------- */
footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-brand p { font-size: 0.85rem; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 14px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: 0.87rem; color: var(--text-secondary); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 44px; padding: 22px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 0.8rem; color: var(--text-muted); }
.footer-bottom .legal-links { display: flex; gap: 18px; }
.footer-bottom a:hover { color: var(--accent); }

/* ---------------- Cookie banner ---------------- */
.cookie-banner {
  position: fixed; bottom: 18px; left: 18px; right: 18px; max-width: 480px; margin: 0 auto;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 20px; z-index: 999; display: flex; flex-direction: column; gap: 12px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { font-size: 0.85rem; margin: 0; }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions button { flex: 1; padding: 10px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.btn-cookie-accept { background: var(--accent); color: #fff; border: none; }
.btn-cookie-dismiss { background: none; border: 1.5px solid var(--border-strong); color: var(--text-secondary); }

/* ---------------- Utility ---------------- */
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
  .gen-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 780px) {
  .nav-links, .nav-cta-link { display: none; }
  .hamburger { display: block; }
  section { padding: 52px 0; }
  .generator-card { padding: 22px; }
  .hero-stats { gap: 18px; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-buttons { flex-direction: column; }
  .results-toolbar { flex-direction: column; align-items: flex-start; }
}

/* Mobile nav drawer */
.mobile-nav {
  position: fixed; inset: 0; background: var(--bg); z-index: 300; padding: 20px 24px; overflow-y: auto;
  display: none;
}
.mobile-nav.open { display: block; }
.mobile-nav-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav > ul > li > a, .mobile-nav-group > button { display: block; padding: 14px 4px; border-bottom: 1px solid var(--border); font-weight: 600; width: 100%; text-align: left; background: none; border-left: none; border-right: none; border-top: none; font: inherit; color: var(--text-primary); cursor: pointer; }
.mobile-nav-sub { display: none; padding-left: 14px; }
.mobile-nav-group.open .mobile-nav-sub { display: block; }
.mobile-nav-sub li a { padding: 10px 4px; font-weight: 400; font-size: 0.9rem; border-bottom: none; color: var(--text-secondary); }
