:root {
  --bg: #f3f5fa;
  --surface: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --faint: #64748b;
  --line: #e2e8f0;
  --navy: #0b1224;
  --navy-2: #151c33;
  --accent: #6d5ef7;
  --accent-hover: #5b4ce8;
  --accent-soft: #eef0ff;
  --ok: #0f7a56;
  --ok-bg: #e8f7f0;
  --warn: #9a6700;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --radius: 16px;
  --max: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.55 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid rgba(109, 94, 247, .55); outline-offset: 2px; }
.skip {
  position: absolute; left: 8px; top: -40px; background: #fff; color: var(--ink);
  padding: 8px 12px; border-radius: 8px; z-index: 100;
}
.skip:focus { top: 8px; }
.wrap { width: min(var(--max), calc(100% - 32px)); margin-inline: auto; }

/* Header */
.site-header {
  background: var(--navy);
  color: #fff;
  position: sticky; top: 0; z-index: 30;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: #dbe3f5; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .95rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.08); }
.menu-btn {
  display: none; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer;
}

/* Hero */
.hero {
  background:
    radial-gradient(700px 280px at 85% 0%, rgba(109,94,247,.38), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  padding: 56px 0 64px;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 12px; max-width: 18ch; }
.hero p.lead { margin: 0 0 28px; color: #c9d2e8; max-width: 42rem; font-size: 1.08rem; }
.search {
  display: flex; gap: 8px; max-width: 560px; background: #fff; border-radius: 14px; padding: 6px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.search input {
  flex: 1; border: 0; background: transparent; font: inherit; padding: 12px 14px; min-width: 0; color: var(--ink);
}
.search input:focus { outline: none; }
.search button {
  border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  border-radius: 10px; padding: 10px 18px; cursor: pointer;
}
.search button:hover { background: var(--accent-hover); }
.trust { margin-top: 16px; color: #9aa8c7; font-size: .92rem; }

/* Sections */
main { flex: 1; }
.section { padding: 48px 0; }
.section h2 { font-size: 1.45rem; letter-spacing: -.02em; margin: 0 0 8px; }
.section .sub { color: var(--muted); margin: 0 0 24px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 8px;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
a.card:hover { transform: translateY(-2px); border-color: #c7c9f8; box-shadow: 0 10px 28px rgba(15,23,42,.08); color: inherit; }
.icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 6px;
}
.icon svg { width: 22px; height: 22px; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.badge { display: inline-block; background: var(--ok-bg); color: var(--ok); font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; width: fit-content; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step strong { display: block; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); }
.step .n { color: var(--accent); font-weight: 700; font-size: .85rem; }

/* Tool page */
.crumb { font-size: .9rem; color: var(--faint); margin: 24px 0 12px; }
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent); }
.tool-head h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; }
.tool-head .lead { margin: 0 0 24px; color: var(--muted); max-width: 46rem; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 32px;
}
label { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { display: block; color: var(--faint); font-size: .88rem; font-weight: 400; margin-top: 2px; }
input[type="text"], input[type="url"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #cbd5e1; border-radius: 10px; padding: 10px 12px;
}
textarea { min-height: 200px; resize: vertical; }
.row { display: grid; gap: 12px; margin-bottom: 14px; }
.row.cols-2 { grid-template-columns: 1fr 1fr; }
.row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.btn {
  appearance: none; border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #eef2ff; color: #312e81; }
.btn.secondary:hover { background: #e0e7ff; color: #312e81; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .85rem; }
.preview {
  margin-top: 16px; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
  border: 1px solid var(--line); border-radius: 12px; min-height: 180px; display: grid; place-items: center; overflow: auto; padding: 16px;
}
.preview canvas, .preview img { max-width: 100%; height: auto; background: #fff; }
.drop {
  border: 2px dashed #cbd5e1; border-radius: 14px; padding: 28px 16px; text-align: center; background: #fafbff; cursor: pointer;
}
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop input { display: none; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: .94rem; }
.msg.error { background: var(--danger-bg); color: var(--danger); }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.info { background: #f1f5f9; color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.presets button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 10px; font: inherit; font-size: .85rem; cursor: pointer;
}
.presets button:hover, .presets button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; margin: 8px 0; }
.check input { width: auto; }
.range { display: flex; align-items: center; gap: 12px; }
.range input { flex: 1; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.compare figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.compare img, .compare canvas { max-height: 240px; width: auto; max-width: 100%; }
.compare figcaption { color: var(--muted); font-size: .85rem; margin-top: 8px; }

/* Prose / FAQ */
.prose { margin: 0 0 32px; }
.prose h2 { margin: 0 0 10px; font-size: 1.25rem; }
.prose ol, .prose ul { margin: 0; padding-left: 1.2rem; color: var(--ink); }
.prose li { margin: 0 0 6px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); }
.page { padding: 8px 0 48px; }
.page h1 { letter-spacing: -.02em; }
.page .prose p, .legal p { color: var(--ink); max-width: 48rem; }
.legal h2 { font-size: 1.15rem; margin: 28px 0 8px; }
.muted { color: var(--muted); }
.empty-search { display: none; color: var(--muted); padding: 12px 0; }

/* Footer */
.site-footer {
  background: var(--navy); color: #c9d2e8; padding: 32px 0 24px; margin-top: auto; font-size: .92rem;
}
.site-footer a { color: #dbe3f5; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer .copy { margin-top: 16px; color: #8b97b3; }

@media (max-width: 720px) {
  .menu-btn { display: inline-flex; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    background: #10182e; flex-direction: column; padding: 8px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; }
  .hero { padding: 36px 0 44px; }
  .steps, .row.cols-2, .row.cols-3, .compare { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
}

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

/* Guides / articles */
.article { max-width: 44rem; }
.article h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.02em; }
.article .lead { margin: 0 0 8px; color: var(--muted); }
.article .updated { margin: 0 0 24px; color: var(--faint); font-size: .9rem; }
.article h2 { margin: 28px 0 8px; font-size: 1.25rem; }
.article h3 { margin: 20px 0 6px; font-size: 1.05rem; }
.article p { margin: 0 0 12px; }
.article ol, .article ul { margin: 0 0 16px; padding-left: 1.25rem; }
.article li { margin: 0 0 8px; }
.article table {
  width: 100%; border-collapse: collapse; margin: 12px 0 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; font-size: .95rem;
}
.article th, .article td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { background: #f8f9ff; font-weight: 600; }
.article tr:last-child th, .article tr:last-child td { border-bottom: 0; }
.cta-box {
  background: var(--accent-soft); border: 1px solid #d9dcff; border-radius: 14px;
  padding: 16px 18px; margin: 20px 0 24px;
}
.cta-box p { margin: 0 0 10px; }
.cta-box p:last-child { margin: 0; }
.note {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; color: var(--muted); margin: 0 0 16px;
}
.related-inline { margin: 8px 0 0; }
.guides-home { margin-top: 8px; }

@media (max-width: 720px) {
  .article table { font-size: .88rem; }
  .article th, .article td { padding: 8px; }
}
