:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --text: #111827;
  --muted: #5f6673;
  --line: rgba(17, 24, 39, 0.12);
  --accent: #007aff;
  --accent-strong: #005ecb;
  --success: #15803d;
  --shadow: 0 18px 55px rgba(31, 41, 55, 0.10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 44%, #eef3f9 100%);
  color: var(--text);
}

body[dir="rtl"] {
  direction: rtl;
}

button,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 16px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.72);
  backdrop-filter: blur(22px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.language-select,
button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75) inset;
}

.language-select {
  padding: 0 34px 0 12px;
}

button {
  padding: 0 14px;
  cursor: pointer;
  font-weight: 650;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 122, 255, 0.42);
}

button:active {
  transform: translateY(0);
}

button.quiet {
  background: transparent;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
  padding: 54px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 760;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 14px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: 0;
}

.lede {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.55;
}

.trust-strip {
  display: grid;
  gap: 8px;
  min-width: 220px;
  color: var(--muted);
  font-size: 14px;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trust-strip span::before {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--success);
  content: "";
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
  gap: 18px;
  align-items: stretch;
}

.editor-panel,
.stats-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.editor-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 640px;
}

.editor-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.editor-toolbar label {
  display: block;
  margin-bottom: 5px;
  font-weight: 760;
}

.editor-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

textarea {
  width: 100%;
  min-height: 520px;
  resize: vertical;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 22px;
  color: var(--text);
  font-size: 18px;
  line-height: 1.7;
}

textarea::placeholder {
  color: #939aa7;
}

.stats-panel {
  padding: 18px;
}

.detected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

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

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

.stat {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.stat span,
.detail-group h2 {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.stat strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1;
}

.detail-group {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-group h2 {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 15px;
}

.breakdown {
  display: grid;
  gap: 10px;
}

.meter-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5e9f0;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.keyword-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

body[dir="rtl"] .keyword-list {
  padding-right: 20px;
  padding-left: 0;
}

.keyword-list li {
  color: var(--muted);
}

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

.ad-band {
  margin: 22px 0;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px dashed rgba(17, 24, 39, 0.20);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.content-grid article,
.faq {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 22px;
}

.content-grid h2,
.faq h2 {
  margin-bottom: 10px;
  font-size: 20px;
  letter-spacing: 0;
}

.content-grid p,
.faq p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq {
  margin: 0 0 36px;
}

details {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

summary {
  cursor: pointer;
  font-weight: 720;
}

details p {
  margin-top: 10px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 980px) {
  .intro,
  .tool-shell,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .trust-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tool-shell {
    gap: 14px;
  }
}

@media (max-width: 640px) {
  main,
  .nav,
  .site-footer {
    width: min(100% - 24px, 1180px);
  }

  .nav {
    align-items: flex-start;
    gap: 12px;
  }

  .intro {
    padding-top: 34px;
  }

  h1 {
    font-size: 42px;
  }

  .trust-strip,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .editor-panel {
    min-height: 520px;
  }

  .editor-toolbar,
  .site-footer {
    flex-direction: column;
  }

  .button-row {
    justify-content: flex-start;
  }

  textarea {
    min-height: 380px;
    padding: 18px;
    font-size: 16px;
  }
}
