/* ═══════════════════════════════════════
   Katakana Converter — Premium Dark Theme
   ═══════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-jp: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;

  --bg-deep: #060918;
  --bg-surface: #0d1129;
  --bg-card: rgba(15, 20, 50, 0.65);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.07);

  --accent-primary: #6366f1;
  --accent-secondary: #a78bfa;
  --accent-tertiary: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --accent-success: #34d399;
  --accent-error: #f87171;
  --accent-warning: #fbbf24;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-focus: rgba(99, 102, 241, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  --transition-fast: 0.15s ease;
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

body.menu-open { overflow: hidden; }

/* ── Background Effects ── */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(129, 140, 248, 0.04) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* ── Container ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 14px;
  z-index: 100;
  padding: 0 0 10px;
  background: transparent;
}

.site-header::before {
  content: '';
  position: absolute;
  inset: 0 18px auto;
  height: calc(100% - 10px);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 17, 37, 0.88) 0%, rgba(10, 12, 28, 0.8) 100%);
  border: 1px solid rgba(142, 125, 255, 0.14);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  padding: 0 14px;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.15rem;
  min-width: 0;
  flex-shrink: 0;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #7b6df1 0%, #9a8cff 58%, #f0c86f 120%);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  font-family: var(--font-jp);
  color: white;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(122, 110, 214, 0.28);
}

.logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.logo-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-tagline {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 245, 249, 0.5);
}

.header-nav-shell {
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.desktop-nav {
  display: flex;
  gap: 6px;
  list-style: none;
}

.desktop-nav a {
  color: rgba(241, 245, 249, 0.72);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  transition: var(--transition-fast);
  letter-spacing: 0.01em;
}

.desktop-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

#mobile-nav-toggle {
  display: none;
  background: linear-gradient(180deg, rgba(124, 110, 230, 0.2) 0%, rgba(124, 110, 230, 0.08) 100%);
  border: 1px solid rgba(142, 125, 255, 0.24);
  border-radius: 14px;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  width: 46px;
  height: 46px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

#mobile-menu {
  display: none;
  position: fixed;
  top: 92px;
  left: 16px;
  right: 16px;
  bottom: auto;
  background: rgba(10, 12, 28, 0.97);
  z-index: 99;
  padding: 18px;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(142, 125, 255, 0.16);
  border-radius: 22px;
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.35);
}

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

#mobile-menu a {
  color: rgba(241, 245, 249, 0.74);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 16px;
  border-radius: 14px;
  transition: var(--transition-fast);
}

#mobile-menu a:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.05); }

/* ── Hero Section ── */
.hero {
  padding: 80px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(24, 28, 58, 0.84) 0%, rgba(17, 20, 42, 0.86) 100%);
  border: 1px solid rgba(142, 125, 255, 0.18);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.82rem;
  color: #d7d0ff;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 22px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-success);
  border-radius: 50%;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-base);
}

.how-section,
.explore-tools-section,
.seo-content-section,
.faq-section,
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: 1px 900px;
}

.glass-card:hover {
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(99, 102, 241, 0.05);
}

/* ── Converter Tool ── */
.converter-section {
  padding: 20px 0 60px;
}

.converter-card {
  max-width: 720px;
  margin: 0 auto;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

#english-input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  font-family: var(--font-primary);
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-base);
}

#english-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), var(--shadow-glow);
}

#english-input::placeholder { color: var(--text-muted); }

.input-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-switch input:checked + .toggle-slider::after {
  transform: translateX(16px);
  background: white;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.btn-primary, .btn-secondary, .btn-benchmark {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
}

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

/* ── Result Card ── */
#result-card {
  opacity: 1;
  transform: none;
  pointer-events: all;
  position: relative;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(142, 125, 255, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(28, 24, 54, 0.94) 0%, rgba(17, 16, 36, 0.98) 100%);
  border: 1px solid rgba(142, 125, 255, 0.16);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#result-card.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.result-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #b9abff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#source-tag {
  font-size: 0.74rem;
  color: #efe9ff;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-overline {
  margin-bottom: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(241, 245, 249, 0.56);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#katakana-output {
  font-family: var(--font-jp);
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  font-weight: 700;
  color: var(--text-primary);
  min-height: 88px;
  display: flex;
  align-items: center;
  word-break: break-all;
  line-height: 1.28;
  padding: 0 0 8px;
}

#katakana-output.placeholder-text {
  color: rgba(241, 245, 249, 0.36);
  font-weight: 500;
}

.result-support {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
  margin-top: 4px;
}

.phoneme-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.phoneme-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #b9abff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

#phoneme-output {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.75;
}

/* ── How It Works ── */
.how-section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

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

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step-card {
  padding: 24px;
  text-align: center;
  position: relative;
}

.step-number {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  margin: 0 auto 16px;
}

.step-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Benchmark Section ── */
.benchmark-section {
  padding: 60px 0 80px;
}

.benchmark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.btn-benchmark {
  background: linear-gradient(135deg, #059669, #34d399);
  color: white;
  box-shadow: 0 4px 15px rgba(52, 211, 153, 0.2);
  min-width: 180px;
}

.btn-benchmark:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(52, 211, 153, 0.3);
}

.btn-benchmark.loading {
  opacity: 0.7;
  pointer-events: none;
}

#benchmark-results {
  opacity: 0;
  transition: var(--transition-slow);
}

#benchmark-results.visible { opacity: 1; }

/* Summary Metrics */
#benchmark-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.metric-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.metric-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Results Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.benchmark-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.benchmark-table th {
  background: var(--bg-glass);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.benchmark-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.benchmark-table td:nth-child(2),
.benchmark-table td:nth-child(3) {
  font-family: var(--font-jp);
  font-size: 0.95rem;
}

.benchmark-table tr.pass td { color: var(--text-primary); }
.benchmark-table tr.fail td:nth-child(3) { color: var(--accent-error); }

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.pass { background: rgba(52, 211, 153, 0.15); color: var(--accent-success); }
.badge.fail { background: rgba(248, 113, 113, 0.15); color: var(--accent-error); }

.source-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

.source-badge.dictionary { background: rgba(167, 139, 250, 0.15); color: var(--accent-secondary); }
.source-badge.rules { background: rgba(52, 211, 153, 0.15); color: var(--accent-success); }

/* ── Footer (3-Column) ── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-brand .logo { margin-bottom: 16px; }

.footer-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 380px;
}

.footer-nav-col h3, .footer-social-col h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--transition-fast);
}

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

.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.footer-contact-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.footer-contact-item:hover {
  color: var(--text-primary);
  border-color: rgba(170, 150, 255, 0.32);
  background: rgba(255, 255, 255, 0.05);
}

.footer-contact-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.social-icons {
  display: flex;
  gap: 12px;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.social-icon:hover {
  color: var(--text-accent);
  background: var(--bg-glass-hover);
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

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

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(120, 104, 241, 0.95) 0%, rgba(90, 73, 212, 0.95) 100%);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28), 0 0 24px rgba(122, 110, 214, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 120;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.32), 0 0 28px rgba(122, 110, 214, 0.32);
}

/* ── Active nav state ── */
.desktop-nav a.active {
  color: #f8f7ff;
  background: linear-gradient(180deg, rgba(124, 110, 230, 0.28) 0%, rgba(124, 110, 230, 0.18) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Dropdown Nav ── */
.nav-dropdown {
  position: relative;
  display: inline-block;
}
.desktop-nav .nav-dropdown {
  padding-bottom: 18px;
  margin-bottom: -18px;
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: linear-gradient(180deg, rgba(20, 17, 39, 0.98) 0%, rgba(13, 11, 28, 0.98) 100%);
  min-width: 280px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
  z-index: 1000;
  border-radius: 18px;
  border: 1px solid rgba(142, 125, 255, 0.14);
  padding: 10px 0;
  list-style: none;
  margin: 8px 0 0;
}
.nav-dropdown:hover .dropdown-content { display: block; }
.dropdown-content li { display: block; }
.dropdown-content a {
  display: block;
  padding: 11px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 12px;
  white-space: nowrap;
  margin: 0 8px;
}
.dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #f2ebff;
}

/* ── Page Hero (sub pages) ── */
.page-hero {
  padding: 80px 0 40px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-hero p {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── Content Page ── */
.content-section {
  padding: 0 0 80px;
}

.content-card {
  max-width: 800px;
  margin: 0 auto;
}

.content-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 32px 0 12px;
}

.content-card h2:first-child { margin-top: 0; }

.content-card p, .content-card li {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.content-card ul, .content-card ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.content-card a {
  color: var(--text-accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

.content-card a:hover { text-decoration: underline; }

/* ── Contact Form ── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition-base);
}

.form-input:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-textarea { resize: vertical; min-height: 140px; }

.form-status {
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(52, 211, 153, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.form-status.error {
  display: block;
  background: rgba(248, 113, 113, 0.1);
  color: var(--accent-error);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

.form-status.sending {
  display: block;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-tertiary);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.email-fallback {
  text-align: center;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.email-fallback a { color: var(--text-accent); }

/* ── FAQ Accordion ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background:
    linear-gradient(180deg, rgba(31, 24, 56, 0.92) 0%, rgba(19, 16, 38, 0.96) 100%);
  border: 1px solid rgba(142, 125, 255, 0.18);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.faq-item summary {
  padding: 22px 24px;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-fast);
}

.faq-item summary:hover { background: rgba(255, 255, 255, 0.03); }

.faq-item summary::after {
  content: '+';
  font-size: 1.4rem;
  color: #f5c96d;
  transition: var(--transition-fast);
}

.faq-item[open] summary::after {
  content: '−';
  color: #f5c96d;
}

.faq-item .faq-answer {
  padding: 0 24px 22px;
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-answer p {
  margin: 0;
}

/* ── Sitemap Page ── */
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.sitemap-group h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.sitemap-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sitemap-group a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sitemap-group a::before {
  content: '→';
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sitemap-group a:hover { color: var(--text-accent); }

/* ── 404 Page ── */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-code {
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 8px;
}

.error-page h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.error-page p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.btn-home {
  display: inline-flex;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-tertiary));
  color: white;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition-base);
}

.btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .hero { padding: 50px 0 24px; }
  .glass-card { padding: 20px; }
  .desktop-nav { display: none; }
  .header-nav-shell { display: none; }
  #mobile-nav-toggle { display: block; }
  .converter-card { padding: 20px; }
  .btn-row { flex-direction: column; }
  .benchmark-header { flex-direction: column; align-items: stretch; text-align: center; }
  .steps-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .page-hero { padding: 50px 0 24px; }
  .site-header { top: 10px; }
  .site-header::before { inset: 0 12px auto; }
  .header-inner { min-height: 72px; padding: 0 10px; }
  .logo-tagline { display: none; }
}

@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
  #benchmark-summary { grid-template-columns: 1fr 1fr; }
  .sitemap-grid { grid-template-columns: 1fr; }
}

/* ── Selection ── */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--bg-glass-hover); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.12); }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── RTL Support ── */
[dir="rtl"] {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .logo-icon {
  margin-right: 0;
  margin-left: 12px;
}

[dir="rtl"] .input-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .toggle-row {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .result-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .faq-item summary {
  flex-direction: row-reverse;
}

[dir="rtl"] .desktop-nav {
  flex-direction: row-reverse;
}

/* ── Explore Tools Grid ── */
.explore-tools-section {
  padding: 96px 0 88px;
  position: relative;
  z-index: 10;
}

.explore-tools-section::before {
  content: '';
  position: absolute;
  inset: 18px 0 auto;
  height: 320px;
  background:
    radial-gradient(circle at 18% 20%, rgba(108, 92, 231, 0.14), transparent 42%),
    radial-gradient(circle at 82% 20%, rgba(245, 201, 109, 0.08), transparent 34%);
  pointer-events: none;
  z-index: 0;
}

.faq-section {
  padding: 10px 0 88px;
}

.section-header-left,
.section-header-left .section-title,
.section-header-left .section-subtitle {
  text-align: left;
}

.explore-tools-section .section-header-left,
.explore-tools-section .section-header-left .section-title,
.explore-tools-section .section-header-left .section-subtitle,
.faq-section .section-header-left,
.faq-section .section-header-left .section-title,
.faq-section .section-header-left .section-subtitle {
  text-align: center;
}

.section-header {
  position: relative;
  z-index: 1;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.section-subtitle {
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1rem;
  line-height: 1.8;
}

.seo-content-section {
  padding: 34px 0 44px;
}

.content-intro {
  max-width: 880px;
  margin: 0 auto 36px;
}

.content-intro p {
  color: var(--text-secondary);
  font-size: clamp(1.08rem, 1.8vw, 1.22rem);
  line-height: 1.95;
  text-align: justify;
}

.content-flow {
  max-width: 880px;
  margin: 0 auto;
}

.content-block {
  padding: 0 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.content-block:last-child {
  margin-bottom: 0;
}

.content-block h2 {
  font-size: clamp(1.72rem, 2.45vw, 2.3rem);
  line-height: 1.14;
  margin-bottom: 18px;
  color: var(--text-primary);
  text-align: justify;
  text-align-last: left;
  letter-spacing: -0.04em;
}

.content-block p {
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 1.5vw, 1.14rem);
  line-height: 1.95;
  text-align: justify;
}

.content-block a,
.content-intro a {
  color: #f5c96d;
  text-decoration: none;
}

.content-block a:hover,
.content-intro a:hover {
  text-decoration: underline;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  margin-top: 44px;
}
.tool-card {
  background:
    linear-gradient(180deg, rgba(31, 24, 56, 0.9) 0%, rgba(20, 17, 39, 0.97) 100%);
  border: 1px solid rgba(122, 110, 214, 0.28);
  border-radius: 18px;
  padding: 28px 24px 24px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  min-height: 100%;
  align-items: flex-start;
  overflow: hidden;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(138, 120, 255, 0.12), transparent 46%);
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(170, 150, 255, 0.6);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(170, 150, 255, 0.2), 0 0 28px rgba(122, 110, 214, 0.18);
}
.tool-icon {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 30px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.06);
  color: #efe9ff;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}
.tool-card h3 {
  color: #fff;
  font-size: 1.16rem;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-align: left;
  position: relative;
  z-index: 1;
}
.tool-card p {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.75;
  margin-bottom: 28px;
  flex-grow: 1;
  text-align: left;
  position: relative;
  z-index: 1;
}
.tool-link-text {
  color: #b9abff;
  font-size: 0.92rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  width: fit-content;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}
.tool-card:hover .tool-link-text {
  color: #f4eeff;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
