:root {
  --bg: #fbfaff;
  --bg-soft: #f3f0fc;
  --card: #ffffff;
  --text: #1d1a2e;
  --muted: #625d78;
  --line: #e6e2f3;
  --accent: #7c3aed;
  --accent-2: #db2777;
  --accent-soft: #efe7ff;
  --ok: #059669;
  --shadow: 0 1px 2px rgba(40, 20, 90, .05), 0 8px 24px -12px rgba(40, 20, 90, .18);
  --radius: 14px;
  --header-h: 64px;
  --wrap: 1120px;
  --narrow: 820px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0f0d17;
  --bg-soft: #17142250;
  --card: #1a1726;
  --text: #ece9f7;
  --muted: #a39dbb;
  --line: #2c2840;
  --accent: #a78bfa;
  --accent-2: #f472b6;
  --accent-soft: #2a2145;
  --ok: #34d399;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 90px); }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: var(--narrow); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 12px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span b { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.dd { position: relative; }
.dd > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--text); user-select: none;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.dd > summary:hover, .dd[open] > summary { background: var(--accent-soft); }
.dd-panel {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px; z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 8px; display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 2px;
}
.dd-panel.cols-3 { grid-template-columns: repeat(3, minmax(150px, 1fr)); right: 0; left: auto; }
.dd:last-of-type .dd-panel { right: 0; left: auto; }
.dd-panel a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); font-size: 15px; white-space: nowrap; }
.dd-panel a:hover, .dd-panel a[aria-current="page"] { background: var(--accent-soft); text-decoration: none; }
.dd-panel a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.flag { width: 20px; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px var(--line); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; color: var(--text);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.menu-toggle { display: none; }

/* Hero */
.hero { position: relative; padding: 48px 0 26px; text-align: center; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto; height: 520px; z-index: -1;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
              radial-gradient(closest-side at 70% 40%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 70%);
  filter: blur(10px);
}
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: .6; }
.hero h1 { font-size: clamp(32px, 5.2vw, 52px); font-weight: 850; margin-bottom: 14px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 2.1vw, 20px); color: var(--muted); max-width: 680px; margin: 0 auto 18px; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.badges li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 14px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.badges li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

/* Generator */
.tool { padding-bottom: 12px; }
.input-bar {
  position: sticky; top: calc(var(--header-h) + 10px); z-index: 20;
  display: flex; align-items: stretch; gap: 8px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow);
}
#fancy-input {
  flex: 1; min-height: 56px; max-height: 180px; resize: none; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 19px; line-height: 1.45; padding: 10px 12px; color: var(--text);
}
#fancy-input::placeholder { color: var(--muted); opacity: .8; }
.input-bar .icon-btn { align-self: center; border-color: transparent; background: transparent; color: var(--muted); }
.input-bar .icon-btn:hover { color: var(--accent); background: var(--accent-soft); }
.font-list { display: grid; gap: 10px; margin-top: 18px; }
.fx-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; min-height: 62px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.fx-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.fx-text { flex: 1; min-width: 0; font-size: 20px; line-height: 1.5; padding: 6px 0; overflow-wrap: anywhere; cursor: pointer; }
.fx-copy {
  flex: 0 0 auto; min-width: 92px; padding: 10px 16px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: 15px;
  color: var(--accent); background: var(--accent-soft); transition: background .15s, color .15s;
}
.fx-copy:hover { background: var(--accent); color: #fff; }
.fx-row.is-copied { border-color: var(--ok); }
.fx-row.is-copied .fx-copy { background: var(--ok); color: #fff; }
.more { text-align: center; margin: 22px 0 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 12px; border: 0; cursor: pointer;
  font-weight: 700; font-size: 16px; color: #fff; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { color: var(--accent); background: var(--card); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--accent); }

/* Ads */
.ad-slot { margin: 22px auto; text-align: center; }
.ad-slot:empty { margin: 0; }

/* Generator catalogue */
.catalog { padding-top: 34px; padding-bottom: 10px; }
.catalog > h2 { font-size: clamp(24px, 3.4vw, 32px); text-align: center; margin-bottom: 24px; }
.catalog h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 26px 0 12px; }
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.gen-card {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 14px; min-height: 96px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.gen-card:hover { text-decoration: none; transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); box-shadow: var(--shadow); }
.gen-sample { font-size: 20px; line-height: 1.45; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gen-name { font-size: 14px; font-weight: 600; color: var(--muted); }
.gen-card[aria-current="page"] { border-color: var(--accent); }

/* Article */
.prose { padding: 30px 20px 10px; }
.prose h2 { font-size: clamp(23px, 3vw, 29px); margin-top: 1.8em; }
.prose > h2:first-child { margin-top: .4em; }
.prose p { color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 10px; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 16px 18px 16px 64px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.faq { display: grid; gap: 10px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.faq summary { cursor: pointer; list-style: none; padding: 15px 30px 15px 0; font-weight: 700; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 11px; font-size: 24px; font-weight: 400; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--text); font-size: 15px; }
.chips a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Share */
.share { margin: 40px auto 10px; padding: 28px 22px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); }
.share h2 { font-size: 22px; margin-bottom: 6px; }
.share p { color: var(--muted); margin-bottom: 16px; }
.share ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.share a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.share a:hover { border-color: var(--accent); }
.share img { width: 20px; height: 20px; }
:root[data-theme="dark"] .share img { filter: invert(1) brightness(.9); }

/* Footer */
.site-footer { margin-top: 50px; padding: 44px 0 26px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 28px; }
.foot-grid h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot-grid a { color: var(--text); }
.foot-grid p { color: var(--muted); margin-top: 12px; max-width: 320px; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); }
.foot-bottom ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; }
.foot-bottom a { color: var(--muted); }
.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s;
  box-shadow: var(--shadow);
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* Documents (legal, about, 404) */
.doc { padding: 40px 20px 20px; }
.doc h1 { font-size: clamp(30px, 4.4vw, 42px); }
.doc h2 { font-size: 22px; margin-top: 1.8em; }
.doc h3 { font-size: 19px; margin-top: 1.6em; }
.doc .meta { color: var(--muted); }
.doc address { font-style: normal; margin-bottom: 1em; }
.notfound { text-align: center; padding: 60px 20px 20px; }
.notfound .code { font-size: 96px; font-weight: 900; line-height: 1; background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound .chips { justify-content: center; margin-top: 30px; }

@media (max-width: 1080px) {
  .dd-panel.cols-3 { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}
@media (max-width: 900px) {
  .menu-toggle { display: inline-grid; }
  .theme-toggle { margin-left: auto; }
  .menu {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 12px 16px;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .menu.open { display: flex; }
  .dd > summary { padding: 12px 10px; justify-content: space-between; }
  .dd-panel, .dd-panel.cols-3 { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 14px; }
  .hero { padding: 30px 0 18px; }
  .brand { font-size: 17px; }
  .input-bar { top: calc(var(--header-h) + 6px); padding: 6px; }
  #fancy-input { font-size: 17px; min-height: 50px; }
  .fx-row { padding: 6px 6px 6px 14px; min-height: 56px; }
  .fx-text { font-size: 18px; }
  .fx-copy { min-width: 74px; padding: 9px 12px; }
  .gen-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gen-card { padding: 12px; min-height: 84px; }
  .gen-sample { font-size: 17px; }
  .steps li { padding: 14px 14px 14px 58px; }
  .foot-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .site-header, .site-footer, .share, .ad-slot, .to-top { display: none !important; }
}
