/* RankerHamna Keyword Density Checker — tokens synced from rankerhamna.com */

:root {
  --background: #050a24;
  --foreground: #f5f7ff;
  --card: #141a3a;
  --primary: #1de9b6;
  --primary-foreground: #04122a;
  --accent-warm: #fbbf24;
  --accent-blue: #0ea5e9;
  --secondary: #1b2250;
  --muted-foreground: #a9b1d6;
  --border: #ffffff1f;
  --destructive: #f87171;
  --radius: 0.625rem;
  --font-body: Inter, system-ui, sans-serif;
  --font-heading: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
  --max: 72rem;
  --header-h: 4rem;
  --glow: rgb(29 233 182 / 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--foreground);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 70% 50% at 85% 12%, var(--glow), transparent 55%),
    radial-gradient(ellipse 50% 40% at 10% 80%, rgb(14 165 233 / 0.08), transparent 50%),
    var(--background);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  max-width: var(--max);
  margin: 0 auto;
}

.site-header::before {
  content: "";
  position: absolute;
  left: 50%;
  translate: -50% 0;
  top: 0;
  width: 100vw;
  height: 100%;
  border-bottom: 1px solid var(--border);
  background: rgb(5 10 36 / 0.85);
  backdrop-filter: blur(12px);
  z-index: -1;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover {
  text-decoration: none;
  color: var(--foreground);
}

.brand-mark {
  width: 1.55rem;
  height: auto;
  color: var(--primary);
}

.brand-text span {
  color: var(--muted-foreground);
  font-weight: 600;
  margin-left: 0.35rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: rgb(245 247 255 / 0.85);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
}

.nav a:hover {
  color: var(--foreground);
  text-decoration: none;
}

.nav .cta {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: var(--radius);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.875rem;
}

.nav .cta:hover {
  filter: brightness(1.05);
  color: var(--primary-foreground);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.hero {
  text-align: center;
  padding: 1.5rem 0 2.25rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  color: var(--muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
}

.eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero h1 em,
.section h2 .serif {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  color: var(--primary);
}

.lede,
.section-lede {
  margin: 0 auto;
  max-width: 40rem;
  color: var(--muted-foreground);
  font-size: 1.05rem;
}

.scoreboard,
.workspace {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.panel {
  background: linear-gradient(180deg, rgb(255 255 255 / 0.03), transparent 40%), var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 0.45rem);
  padding: 1.2rem 1.25rem 1.3rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.panel-head h2,
.score-meta h2,
.section h2,
.tips-card h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  text-align: center;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn {
  border: 0;
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 600;
  font-size: 0.875rem;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  color: var(--foreground);
  border: 1px solid var(--border);
}

.btn:focus-visible,
.tab:focus-visible,
input:focus-visible,
textarea:focus-visible,
.check input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.score-card {
  display: flex;
  gap: 1.15rem;
  align-items: flex-start;
}

.score-ring-wrap {
  position: relative;
  width: 7.5rem;
  height: 7.5rem;
  flex-shrink: 0;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-track,
.score-ring-value {
  fill: none;
  stroke-width: 8;
}

.score-ring-track {
  stroke: var(--secondary);
}

.score-ring-value {
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.45s ease;
}

.score-number {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1;
}

.score-number strong {
  font-family: var(--font-heading);
  font-size: 1.7rem;
}

.score-number span,
.score-label,
.hint,
.stat span,
.focus-count,
.fineprint {
  color: var(--muted-foreground);
}

.score-label {
  margin: 0.2rem 0 0.7rem;
}

.checklist,
.tips-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.checklist li,
.tips-list li {
  position: relative;
  padding-left: 1.15rem;
  font-size: 0.9rem;
  color: rgb(245 247 255 / 0.9);
}

.checklist li::before,
.tips-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--muted-foreground);
}

.checklist li.pass::before {
  background: var(--primary);
}

.checklist li.warn::before {
  background: var(--accent-warm);
}

.checklist li.fail::before {
  background: var(--destructive);
}

.tips-list li::before {
  background: var(--primary);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.field span,
.check span {
  font-size: 0.875rem;
  font-weight: 600;
}

.field small,
.label-row em,
.hint {
  font-weight: 500;
  font-style: normal;
  color: var(--muted-foreground);
  font-size: 0.8rem;
}

.label-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

textarea,
input[type="text"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(5 10 36 / 0.45);
  padding: 0.7rem 0.8rem;
  resize: vertical;
}

textarea {
  min-height: 16rem;
  line-height: 1.55;
}

.options {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.check input {
  accent-color: var(--primary);
  width: 1rem;
  height: 1rem;
}

.field.slim {
  margin: 0;
}

.copy-note {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--primary);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.45rem;
  text-align: center;
}

.stat strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.stat span {
  font-size: 0.72rem;
}

.focus-phrase {
  margin: 0 0 0.4rem;
  font-family: var(--font-heading);
  font-size: 1.15rem;
}

.focus-figure {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.focus-percent {
  margin: 0;
  font-family: var(--font-heading);
  line-height: 1;
}

.focus-percent strong {
  font-size: 2.6rem;
  letter-spacing: -0.04em;
}

.focus-percent span {
  font-size: 1.2rem;
  color: var(--muted-foreground);
}

.focus-count {
  margin: 0;
}

.gauge {
  position: relative;
  height: 0.55rem;
  margin: 0.75rem 0 0.45rem;
  border-radius: 999px;
  background: var(--secondary);
  overflow: hidden;
}

.gauge-zone,
.gauge-fill {
  position: absolute;
  top: 0;
  bottom: 0;
}

.gauge-zone {
  z-index: 2;
  background: transparent;
  box-shadow: inset 0 0 0 2px rgb(29 233 182 / 0.95);
  border-radius: 999px;
}

.gauge-fill {
  width: 0;
  background: var(--primary);
  border-radius: 999px;
}

.gauge-fill.high {
  background: var(--accent-warm);
}

.gauge-fill.stuffed {
  background: var(--destructive);
}

.gauge-fill.light {
  background: var(--accent-blue);
}

.thirds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  margin-top: 0.9rem;
}

.thirds span,
.thirds em {
  display: block;
  font-size: 0.75rem;
  font-style: normal;
  color: var(--muted-foreground);
}

.third-track {
  height: 0.4rem;
  margin: 0.3rem 0;
  border-radius: 999px;
  background: var(--secondary);
  overflow: hidden;
}

.third-track div {
  height: 100%;
  width: 0;
  background: var(--primary);
}

.pill {
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
}

.pill.optimal {
  color: var(--primary);
  border-color: rgb(29 233 182 / 0.45);
  background: rgb(29 233 182 / 0.1);
}

.pill.light {
  color: var(--accent-blue);
  border-color: rgb(14 165 233 / 0.45);
  background: rgb(14 165 233 / 0.1);
}

.pill.high {
  color: var(--accent-warm);
  border-color: rgb(251 191 36 / 0.45);
  background: rgb(251 191 36 / 0.1);
}

.pill.stuffed,
.pill.missing {
  color: var(--destructive);
  border-color: rgb(248 113 113 / 0.5);
  background: rgb(248 113 113 / 0.1);
}

.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.tab.active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
}

.results,
.preview-panel {
  margin-bottom: 1.25rem;
}

.hint.inline {
  margin: 0;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--muted-foreground);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover {
  background: rgb(255 255 255 / 0.03);
}

td.keyword {
  white-space: normal;
  font-weight: 600;
}

.bar {
  width: 7rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--secondary);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.empty-row td {
  color: var(--muted-foreground);
  cursor: default;
  white-space: normal;
}

.marked {
  min-height: 8rem;
  max-height: 24rem;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.7;
  color: rgb(245 247 255 / 0.92);
}

.marked .placeholder {
  color: var(--muted-foreground);
}

.marked mark {
  background: rgb(29 233 182 / 0.22);
  color: var(--foreground);
  border-radius: 0.25rem;
  padding: 0 0.15rem;
}

.section {
  padding: 1.5rem 0 0.5rem;
}

.steps {
  max-width: 42rem;
  margin: 1.25rem auto 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0.9rem 1rem 0.9rem 3.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0.85rem;
  top: 0.95rem;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--primary);
  font-size: 0.85rem;
}

.faq-list {
  max-width: 42rem;
  margin: 1.25rem auto 0;
  display: grid;
  gap: 0.6rem;
}

.faq-list details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}

.faq-list summary {
  cursor: pointer;
  font-weight: 650;
  font-family: var(--font-heading);
}

.faq-list p {
  margin: 0.6rem 0 0.2rem;
  color: var(--muted-foreground);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
}

.site-footer p {
  margin: 0.35rem auto;
  max-width: 50rem;
  color: var(--muted-foreground);
  font-size: 0.9rem;
}

@media (min-width: 900px) {
  .scoreboard {
    grid-template-columns: 1.15fr 0.85fr;
  }

  .workspace {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }

  .insights {
    display: grid;
    gap: 1.25rem;
  }
}

@media (max-width: 899px) {
  .site-header {
    height: auto;
    min-height: var(--header-h);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    flex-wrap: wrap;
  }

  .stat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .score-card {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .nav a:not(.cta) {
    font-size: 0.8rem;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat:last-child {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .score-ring-value {
    transition: none;
  }
}
