/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1f2937;
    background: #fff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: #1f2937; }
.logo:hover { text-decoration: none; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { color: #6b7280; font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: #2563eb; text-decoration: none; }

/* Hero */
.hero {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: #fff;
    padding: 60px 0 70px;
    text-align: center;
}
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero-sub { font-size: 1.15rem; color: rgba(255,255,255,0.85); max-width: 600px; margin: 0 auto 32px; }

/* Search Box */
.search-box { max-width: 580px; margin: 0 auto; }
.search-input-wrap {
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}
.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 18px 24px;
    font-size: 1.15rem;
    font-family: inherit;
    color: #1f2937;
    min-width: 0;
}
.search-input-wrap input::placeholder { color: #9ca3af; }
.search-hint { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin-top: 10px; }
.search-section { padding: 24px 0; background: #f9fafb; }
.search-section .search-input-wrap { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; }

/* Button */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }

/* Sections */
.section { padding: 50px 0; }
.bg-gray { background: #f9fafb; }
.section-title { font-size: 1.8rem; font-weight: 700; text-align: center; margin-bottom: 32px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step { text-align: center; }
.step-icon {
    width: 52px; height: 52px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700;
    margin: 0 auto 14px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: #6b7280; font-size: 0.95rem; }

/* Popular grid */
.popular-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.popular-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    color: #1f2937;
    transition: all 0.15s;
}
.popular-item:hover { border-color: #2563eb; color: #2563eb; text-decoration: none; box-shadow: 0 2px 8px rgba(37,99,235,0.1); }

/* Length grid */
.length-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.length-item {
    display: flex; flex-direction: column; align-items: center;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 12px; padding: 16px 12px;
    transition: all 0.15s;
}
.length-item:hover { border-color: #2563eb; text-decoration: none; box-shadow: 0 2px 8px rgba(37,99,235,0.1); }
.length-num { font-size: 1.6rem; font-weight: 700; color: #2563eb; }
.length-label { font-size: 0.8rem; color: #6b7280; }

/* Breadcrumb */
.breadcrumb { padding: 12px 0; font-size: 0.85rem; color: #9ca3af; }
.breadcrumb a { color: #6b7280; }
.breadcrumb span { margin: 0 6px; }

/* Results */
.results-title { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
.results-title .highlight { color: #2563eb; }
.results-summary { color: #6b7280; font-size: 1.05rem; margin-bottom: 32px; }

.result-group { margin-bottom: 32px; }
.group-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 12px; color: #1f2937; }
.group-count { color: #9ca3af; font-weight: 400; font-size: 0.9rem; }

.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.word-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    padding: 10px 14px;
    border-radius: 8px;
    transition: all 0.15s;
}
.word-card:hover { border-color: #2563eb; background: #eff6ff; }
.word-text { font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em; }
.word-score { font-size: 0.8rem; color: #2563eb; font-weight: 600; }
.word-card.more { justify-content: center; color: #9ca3af; font-size: 0.85rem; }

.no-results { text-align: center; padding: 40px; color: #9ca3af; }

/* Length navigation */
.length-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.length-nav-item {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; border-radius: 8px;
    font-weight: 600; color: #6b7280;
    font-size: 0.9rem;
}
.length-nav-item:hover { background: #dbeafe; color: #2563eb; text-decoration: none; }
.length-nav-item.active { background: #2563eb; color: #fff; }

/* Alpha nav */
.alpha-nav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 24px; }
.alpha-link {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    background: #f3f4f6; border-radius: 6px;
    font-weight: 600; color: #2563eb; font-size: 0.85rem;
}
.alpha-link:hover { background: #dbeafe; text-decoration: none; }
.alpha-link.disabled { color: #d1d5db; cursor: default; }

/* Related searches */
.related-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid #e5e7eb; }
.related-section h2 { font-size: 1.3rem; margin-bottom: 16px; }
.related-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.related-item {
    background: #f3f4f6; padding: 8px 16px; border-radius: 8px;
    font-size: 0.85rem; color: #4b5563; font-weight: 500;
}
.related-item:hover { background: #dbeafe; color: #2563eb; text-decoration: none; }

/* Content/SEO sections */
.content-section { max-width: 800px; }
.content-section h2 { font-size: 1.5rem; margin: 32px 0 12px; }
.content-section h3 { font-size: 1.2rem; margin: 24px 0 8px; }
.content-section p { color: #4b5563; margin-bottom: 16px; }
.content-section ul { padding-left: 24px; margin-bottom: 16px; }
.content-section li { color: #4b5563; margin-bottom: 8px; }
.seo-blurb { margin-top: 40px; padding-top: 32px; border-top: 1px solid #e5e7eb; }

/* FAQ */
.faq-list { max-width: 700px; margin: 0 auto; }
.faq { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px 24px; margin-bottom: 12px; }
.faq h3 { font-size: 1rem; margin-bottom: 6px; }
.faq p { color: #6b7280; font-size: 0.95rem; margin: 0; }

/* Quick results (AJAX) */
.quick-results { max-width: 580px; margin: 16px auto 0; text-align: left; }
.quick-results .word-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }

/* Footer */
.footer { background: #f9fafb; border-top: 1px solid #e5e7eb; padding: 32px 0; }
.footer-inner { text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 16px; }
.footer-links a { font-size: 0.85rem; color: #6b7280; }
.footer-links a:hover { color: #2563eb; }
.footer-copy { color: #9ca3af; font-size: 0.8rem; }

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .hero-sub { font-size: 1rem; }
    .hero { padding: 40px 0 50px; }
    .steps { grid-template-columns: 1fr; gap: 20px; }
    .search-input-wrap { flex-direction: column; border-radius: 12px; }
    .search-input-wrap input { border-bottom: 1px solid #e5e7eb; text-align: center; }
    .btn { width: 100%; border-radius: 0 0 12px 12px; }
    .word-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .results-title { font-size: 1.5rem; }
    .nav-links { display: none; }
    .section { padding: 32px 0; }
}
