:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f7f4f2;
  --bg-soft: #fff8f6;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-muted: rgba(255, 241, 238, 0.72);
  --text: #181114;
  --text-muted: #6f5f65;
  --border: #eadde1;
  --brand: #e60023;
  --brand-dark: #b8001c;
  --accent: #7c3aed;
  --success: #0f9f6e;
  --warning: #f97316;
  --glass-highlight: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(41, 18, 25, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --max-width: 1180px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100d12;
  --bg-soft: #17121a;
  --surface: rgba(32, 25, 35, 0.76);
  --surface-solid: #201923;
  --surface-muted: rgba(42, 28, 37, 0.72);
  --text: #fff8fb;
  --text-muted: #cbbbc3;
  --border: #392d35;
  --brand: #ff4f68;
  --brand-dark: #ff7689;
  --accent: #a78bfa;
  --success: #5ee6ad;
  --warning: #fdba74;
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #100d12;
    --bg-soft: #17121a;
    --surface: rgba(32, 25, 35, 0.76);
    --surface-solid: #201923;
    --surface-muted: rgba(42, 28, 37, 0.72);
    --text: #fff8fb;
    --text-muted: #cbbbc3;
    --border: #392d35;
    --brand: #ff4f68;
    --brand-dark: #ff7689;
    --accent: #a78bfa;
    --success: #5ee6ad;
    --warning: #fdba74;
    --glass-highlight: rgba(255, 255, 255, 0.08);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 8%, rgba(230, 0, 35, 0.18), transparent 26rem),
    radial-gradient(circle at 82% 0%, rgba(124, 58, 237, 0.18), transparent 30rem),
    radial-gradient(circle at 50% 100%, rgba(15, 159, 110, 0.1), transparent 28rem),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at top, black, transparent 72%);
  content: "";
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg {
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  width: min(100% - 32px, var(--max-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid color-mix(in srgb, var(--border), transparent 30%);
  background: color-mix(in srgb, var(--bg), transparent 8%);
  backdrop-filter: blur(18px);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 18px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 12px 24px rgba(230, 0, 35, 0.22);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--text-muted);
  font-weight: 700;
}

.nav-links a:hover,
.footer-grid a:hover {
  color: var(--brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle,
.ghost-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.theme-toggle,
.ghost-button,
.secondary-button {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--surface);
}

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  box-shadow: 0 14px 28px rgba(230, 0, 35, 0.24);
}

.secondary-button {
  color: var(--brand);
}

.theme-toggle:hover,
.ghost-button:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: center;
  padding: 56px 0 34px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface);
  font-size: 0.9rem;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.1rem;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 680px;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  line-height: 1.7;
}

.hero-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-card,
.panel,
.metric-card,
.trend-card,
.category-card,
.feature-card,
.seo-card,
.keyword-card,
.empty-state,
.insight-card {
  border: 1px solid color-mix(in srgb, var(--border), var(--glass-highlight) 35%);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface), var(--glass-highlight) 18%), color-mix(in srgb, var(--surface), transparent 8%));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
}

.hero-card::before {
  position: absolute;
  inset: -45% -30% auto auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(230, 0, 35, 0.14);
  content: "";
}

.dashboard-preview {
  position: relative;
  display: grid;
  gap: 14px;
}

.preview-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-weight: 800;
}

.live-pill {
  color: var(--success);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  padding: 18px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.metric-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.metric-change {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 800;
}

.preview-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 180px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.chart-bar {
  flex: 1;
  min-width: 18px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.section {
  padding: 42px 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading p {
  max-width: 580px;
  color: var(--text-muted);
  line-height: 1.6;
}

.panel {
  padding: 22px;
}

.search-panel {
  display: grid;
  gap: 16px;
}

.search-controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(180px, 0.6fr) auto;
  gap: 12px;
}

.input-group {
  position: relative;
}

.input-group input,
.search-controls select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0 16px;
  color: var(--text);
  background: var(--bg-soft);
  outline: none;
}

.input-group input:focus,
.search-controls select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.12);
}

.suggestions {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.suggestion-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.suggestion-item:hover {
  background: var(--surface-muted);
}

.results-grid,
.card-grid,
.keyword-grid,
.feature-grid,
.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.trend-card,
.category-card,
.feature-card,
.seo-card,
.keyword-card,
.insight-card,
.empty-state {
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: none;
}

.trend-card,
.keyword-card {
  display: grid;
  gap: 14px;
}

.card-topline,
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.keyword-link {
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 900;
}

.keyword-link:hover {
  color: var(--brand);
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand), transparent 88%);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: capitalize;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  padding: 10px;
  border-radius: 14px;
  background: var(--bg-soft);
}

.stat span {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.category-card {
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}

.category-card:hover,
.trend-card:hover,
.keyword-card:hover,
.seo-card:hover {
  border-color: color-mix(in srgb, var(--brand), var(--border) 40%);
  transform: translateY(-2px);
}

.category-card,
.trend-card,
.keyword-card,
.seo-card {
  transition: border-color 160ms ease, transform 160ms ease;
}

.category-count {
  color: var(--text-muted);
  font-weight: 700;
}

.feature-card p,
.seo-card p,
.insight-card p,
.empty-state p {
  color: var(--text-muted);
  line-height: 1.6;
}

.keyword-detail {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 22px;
  align-items: start;
  padding: 42px 0;
}

.detail-panel {
  display: grid;
  gap: 16px;
}

.breadcrumb {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--text-muted);
  font-weight: 800;
}

.chart-card {
  padding: 22px;
}

.chart-wrap {
  min-height: 300px;
}

canvas {
  max-width: 100%;
}

.footer {
  margin-top: 42px;
  border-top: 1px solid var(--border);
  padding: 34px 0;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--text-muted);
  font-weight: 700;
}

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

.content-page {
  padding: 54px 0;
}

.content-hero {
  max-width: 820px;
  margin-bottom: 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.content-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--border), var(--glass-highlight) 35%);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface), var(--glass-highlight) 20%), color-mix(in srgb, var(--surface), transparent 8%));
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.content-card p,
.content-card li {
  color: var(--text-muted);
  line-height: 1.75;
}

.content-card ul,
.content-card ol {
  margin: 0;
  padding-left: 1.25rem;
}

.contact-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-muted);
  font-weight: 800;
}

.contact-list a:hover {
  color: var(--brand);
}

@media (max-width: 900px) {
  .hero,
  .keyword-detail,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .search-controls {
    grid-template-columns: 1fr;
  }

  .results-grid,
  .card-grid,
  .keyword-grid,
  .feature-grid,
  .seo-grid,
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 22px, var(--max-width));
  }

  .navbar,
  .section-heading,
  .footer-grid {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .primary-button,
  .theme-toggle {
    flex: 1;
  }

  .hero {
    padding-top: 34px;
  }

  .results-grid,
  .card-grid,
  .keyword-grid,
  .feature-grid,
  .seo-grid,
  .metric-grid,
  .stat-row {
    grid-template-columns: 1fr;
  }

  .panel,
  .hero-card {
    padding: 16px;
  }
}

/* Premium SaaS dashboard refinements */
.glass-card,
.dashboard-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.glass-card::before,
.dashboard-card::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.32), transparent 34%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand), transparent 84%), transparent 42%);
  pointer-events: none;
  content: "";
}

.hero {
  gap: clamp(24px, 5vw, 52px);
  padding: clamp(42px, 8vw, 86px) 0 42px;
}

.hero h1 {
  max-width: 760px;
}

.hero-card {
  border-radius: 34px;
}

.hero-insights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-insights span {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--border), var(--brand) 18%);
  border-radius: 999px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface), transparent 18%);
  font-size: 0.9rem;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.search-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.search-panel-header h3 {
  margin: 10px 0 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.search-panel-header p {
  margin: 0;
  color: var(--text-muted);
  font-weight: 800;
  text-align: right;
}

.search-input-wrap input {
  padding-left: 46px;
  padding-right: 48px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 900;
  transform: translateY(-50%);
}

.clear-search {
  position: absolute;
  top: 50%;
  right: 10px;
  z-index: 2;
  display: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-solid);
  cursor: pointer;
  transform: translateY(-50%);
}

.clear-search.is-visible {
  display: grid;
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quick-filters button {
  border: 1px solid color-mix(in srgb, var(--border), var(--brand) 12%);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface), transparent 8%);
  font-weight: 850;
  cursor: pointer;
}

.quick-filters button:hover,
.quick-filters button.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand), transparent 76%);
}

.keyword-card {
  min-height: 260px;
  align-content: space-between;
}

.keyword-card-main p {
  margin-bottom: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.keyword-link {
  display: inline-flex;
  margin-bottom: 8px;
  font-size: 1.22rem;
  letter-spacing: -0.035em;
  text-transform: capitalize;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--success);
  background: color-mix(in srgb, var(--success), transparent 88%);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.trend-meter {
  overflow: hidden;
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border), transparent 30%);
}

.trend-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--warning), var(--accent));
}

.compact-actions {
  align-items: center;
  justify-content: space-between;
  margin-top: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.text-link {
  color: var(--brand);
  font-weight: 900;
}

.text-link:hover {
  color: var(--brand-dark);
}

.category-card small {
  display: block;
  margin-top: 12px;
  color: var(--text-muted);
  font-weight: 800;
}

.suggestion-item {
  display: grid;
  gap: 3px;
}

.suggestion-item span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 750;
}

@media (max-width: 680px) {
  h1 {
    font-size: clamp(2.45rem, 16vw, 3.7rem);
  }

  .hero-actions a,
  .search-controls .primary-button {
    width: 100%;
  }

  .search-panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-panel-header p {
    text-align: left;
  }

  .quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .quick-filters button {
    flex: 0 0 auto;
  }
}

/* Modern content pages */
.content-hero-modern {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: clamp(22px, 4vw, 44px);
  align-items: center;
  padding: clamp(42px, 7vw, 78px) 0 34px;
}

.content-hero-modern h1 {
  max-width: 780px;
}

.hero-summary-card {
  align-content: start;
  min-height: 280px;
}

.hero-summary-card p {
  color: var(--text-muted);
  line-height: 1.7;
}

.compact-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.step-list,
.link-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-muted);
}

.step-list strong {
  color: var(--text);
}

.step-list span {
  color: var(--text-muted);
  line-height: 1.6;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-muted);
  font-weight: 900;
}

.link-list a::after {
  color: var(--brand);
  content: "→";
}

.link-list a:hover,
.contact-list a:hover {
  color: var(--brand);
  transform: translateY(-1px);
}

.enhanced-contact-list a {
  align-items: center;
  min-height: 58px;
}

.enhanced-contact-list span:last-child {
  color: var(--brand);
  text-align: right;
}

.policy-grid .content-card h2:not(:first-of-type) {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .content-hero-modern {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .content-hero-modern {
    padding-top: 34px;
  }

  .compact-metrics {
    grid-template-columns: 1fr;
  }

  .contact-list a,
  .link-list a {
    align-items: flex-start;
    flex-direction: column;
  }

  .enhanced-contact-list span:last-child {
    text-align: left;
  }
}
