:root {
  --ink: #17212b;
  --muted: #55616e;
  --paper: #fbfaf6;
  --card: #ffffff;
  --line: #dce2df;
  --brand: #5138ee;
  --brand-dark: #3821c7;
  --accent: #00a884;
  --soft: #eeebff;
  --shadow: 0 18px 50px rgba(27, 21, 70, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -2%, rgba(81, 56, 238, .13), transparent 28rem),
    radial-gradient(circle at 95% 14%, rgba(0, 168, 132, .10), transparent 25rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; }
button, textarea, input, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }
.narrow { width: min(790px, 100%); }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 50; padding: .8rem 1rem; background: var(--ink); color: white; border-radius: 10px; }
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 226, 223, .88);
  background: rgba(251, 250, 246, .9);
  backdrop-filter: blur(16px);
}

.nav { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-weight: 850; letter-spacing: -.03em; font-size: 1.18rem; }
.brand-mark { display: grid; place-items: center; width: 34px; aspect-ratio: 1; border-radius: 11px; color: white; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: 0 8px 20px rgba(81, 56, 238, .2); }
.nav-links { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.nav-links a { padding: .55rem .75rem; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 650; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--brand); background: var(--soft); }
.language-switch { display: flex; gap: .2rem; border: 1px solid var(--line); border-radius: 999px; padding: .2rem; background: white; }
.language-switch a { min-width: 2.35rem; padding: .3rem .5rem; text-align: center; font-size: .82rem; }
.language-switch a[aria-current="page"] { background: var(--ink); color: white; }

.hero { padding: 7rem 0 4.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); gap: 3rem; align-items: center; }
.eyebrow { margin: 0 0 .8rem; color: var(--brand); text-transform: uppercase; letter-spacing: .15em; font-weight: 850; font-size: .78rem; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.04em; }
h1 { margin: 0; font-size: clamp(2.65rem, 7vw, 5.7rem); max-width: 12ch; }
h2 { margin: 0 0 1rem; font-size: clamp(1.9rem, 4vw, 3.15rem); }
h3 { margin: 0 0 .55rem; font-size: 1.28rem; }
.lede { max-width: 64ch; margin: 1.35rem 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.3rem); }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.7rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 48px; padding: .75rem 1.1rem; border: 0; border-radius: 12px; background: var(--brand); color: white; font-weight: 780; text-decoration: none; box-shadow: 0 10px 20px rgba(81, 56, 238, .17); }
.button:hover, .button:focus-visible { background: var(--brand-dark); transform: translateY(-1px); }
.button.secondary { background: white; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.privacy-card { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.8); box-shadow: var(--shadow); }
.privacy-card strong { display: block; margin-bottom: .35rem; font-size: 1.05rem; }
.privacy-list { margin: 1rem 0 0; padding: 0; list-style: none; }
.privacy-list li { display: flex; gap: .65rem; margin-top: .55rem; color: var(--muted); }
.privacy-list li::before { content: "✓"; color: var(--accent); font-weight: 900; }

.section { padding: 4.5rem 0; }
.section.soft { background: rgba(238, 235, 255, .55); border-block: 1px solid rgba(81, 56, 238, .08); }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin-bottom: 1.8rem; }
.section-heading p { color: var(--muted); max-width: 52ch; margin: 0; }
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tool-card { display: flex; flex-direction: column; min-height: 245px; padding: 1.35rem; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 10px 26px rgba(23, 33, 43, .045); text-decoration: none; transition: .18s ease; }
.tool-card:hover, .tool-card:focus-visible { transform: translateY(-4px); border-color: rgba(81,56,238,.5); box-shadow: var(--shadow); }
.tool-icon { display: grid; place-items: center; width: 42px; aspect-ratio: 1; margin-bottom: 1rem; border-radius: 13px; color: var(--brand); background: var(--soft); font-size: 1.15rem; font-weight: 900; }
.tool-card p { color: var(--muted); margin: 0 0 1rem; }
.tool-card .open { margin-top: auto; color: var(--brand); font-weight: 780; }
.guide-grid { margin-top: 2rem; }
.guide-card { min-height: 320px; }
.guide-card h2 { margin: 0 0 .65rem; font-size: 1.55rem; }
.guide-intro { margin-inline: 0; }
.guide-prose > .lede { margin-bottom: 2.5rem; }
.guide-prose ol { padding-inline-start: 1.35rem; }

.page-hero { padding: 4.8rem 0 2rem; }
.page-hero h1 { font-size: clamp(2.35rem, 6vw, 4.5rem); max-width: 15ch; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.15rem; color: var(--muted); font-size: .9rem; }
.breadcrumbs a { color: var(--brand); }

.workspace { display: grid; gap: 1rem; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.workspace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .5rem; }
.field label { font-weight: 780; }
textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 1rem;
  border: 1px solid #cbd4d0;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
}
textarea:focus { outline: 3px solid rgba(81,56,238,.15); border-color: var(--brand); }
.controls { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.control-button { min-height: 42px; padding: .58rem .82rem; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-weight: 700; }
.control-button:hover, .control-button:focus-visible { border-color: var(--brand); color: var(--brand); }
.control-button.primary { background: var(--brand); color: white; border-color: var(--brand); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.stat { padding: .9rem; border-radius: 13px; background: #f7f8f7; border: 1px solid var(--line); }
.stat strong { display: block; font-size: 1.45rem; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .83rem; }
.status { min-height: 1.5rem; color: var(--accent); font-size: .9rem; font-weight: 700; }

.ad-shell { margin: 2rem auto; min-height: 0; padding: 1rem 0; overflow: hidden; text-align: center; }
.ad-shell:empty { display: none; }
.ad-label { display: block; margin-bottom: .35rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
.prose { color: #303a44; }
.prose h2 { margin-top: 2.4rem; font-size: 2rem; }
.prose h3 { margin-top: 1.7rem; }
.prose p, .prose li { max-width: 76ch; }
.prose li + li { margin-top: .45rem; }
.sidebar { position: sticky; top: 92px; padding: 1.2rem; border: 1px solid var(--line); border-radius: 16px; background: white; }
.sidebar a { display: block; padding: .5rem 0; color: var(--brand); }
.faq details { padding: 1rem 0; border-top: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 780; }
.faq p { color: var(--muted); }

.site-footer { margin-top: 4rem; padding: 3rem 0; color: #d9e0e2; background: #152126; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.site-footer .brand { color: white; }
.site-footer p { max-width: 45ch; color: #aeb9bd; }
.footer-links { display: grid; align-content: start; gap: .55rem; }
.footer-links strong { color: white; }
.footer-links a { color: #cbd4d6; text-decoration: none; }
.footer-links a:hover { color: white; }
.copyright { margin-top: 2rem; padding-top: 1.3rem; border-top: 1px solid rgba(255,255,255,.12); color: #94a2a6; font-size: .88rem; }

[dir="rtl"] .hero-grid, [dir="rtl"] .content-grid { direction: rtl; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }

@media (max-width: 900px) {
  .hero-grid, .content-grid { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar { position: static; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 24px, 1160px); }
  .site-header { position: static; }
  .nav { align-items: flex-start; padding: .75rem 0; }
  .nav-links > a:not(.mobile-keep) { display: none; }
  .hero { padding-top: 4rem; }
  .tool-grid, .workspace-grid, .footer-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  textarea { min-height: 220px; }
  .section-heading { align-items: start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
