:root {
  color-scheme: dark;
  --bg: #05070d;
  --surface: rgba(13, 17, 28, .74);
  --surface-strong: rgba(16, 22, 37, .92);
  --border: rgba(148, 163, 184, .16);
  --border-strong: rgba(125, 211, 252, .3);
  --text: #eef3ff;
  --muted: #9aa7c2;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --teal: #2dd4bf;
  --green: #22c55e;
  --red: #fb7185;
  --shadow: 0 24px 90px rgba(0,0,0,.42);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --max-width: 1180px;
  --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% -20%, rgba(59,130,246,.2), transparent 32rem), linear-gradient(135deg, var(--bg), #03040a 48%, #05070d);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}
body::before { content:""; position:fixed; inset:0; pointer-events:none; background-image:linear-gradient(rgba(148,163,184,.032) 1px, transparent 1px),linear-gradient(90deg,rgba(148,163,184,.032) 1px,transparent 1px); background-size:48px 48px; mask-image:linear-gradient(to bottom,rgba(0,0,0,.75),transparent 82%); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
textarea { resize: vertical; min-height: 180px; }
pre { white-space: pre-wrap; word-break: break-word; }

.page-shell { position: relative; min-height: 100vh; isolation: isolate; }
.noise { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .18; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.22'/%3E%3C/svg%3E"); }
.aurora { position: fixed; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; filter: blur(10px); }
.aurora span { position: absolute; width: 36rem; height: 36rem; border-radius: 999px; opacity: .2; filter: blur(36px); animation: floatBlob 16s var(--ease) infinite alternate; }
.aurora span:nth-child(1){ top:-12rem; left:-8rem; background:var(--purple); }
.aurora span:nth-child(2){ top:18rem; right:-14rem; background:var(--cyan); animation-delay:-5s; }
.aurora span:nth-child(3){ bottom:-16rem; left:28%; background:var(--blue); animation-delay:-9s; }
.cursor-glow { position: fixed; top: 0; left: 0; width: 22rem; height: 22rem; z-index: -1; pointer-events: none; border-radius: 999px; background: radial-gradient(circle, rgba(34,211,238,.12), transparent 62%); opacity: 0; transform: translate3d(-50%, -50%, 0); transition: opacity 220ms ease; }

.header, .hero, .section, .footer { width: min(var(--max-width), calc(100% - 40px)); margin-inline: auto; }
.header { padding: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.brand__mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 14px; background: linear-gradient(135deg,rgba(139,92,246,.92),rgba(34,211,238,.92)); box-shadow: 0 0 38px rgba(34,211,238,.22); }
.nav { display: inline-flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: 999px; background: rgba(8,11,20,.54); backdrop-filter: blur(18px); }
.nav a { padding: 9px 14px; border-radius: 999px; color: var(--muted); font-size: .92rem; transition: color 180ms ease, background 180ms ease; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.065); }

.hero { min-height: calc(100vh - 100px); display: grid; grid-template-columns: minmax(0,1.06fr) minmax(300px,.72fr); align-items: center; gap: 36px; padding: 48px 0 84px; }
.eyebrow { margin: 0 0 18px; color: var(--cyan); font-size: .78rem; font-weight: 760; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; letter-spacing: -.07em; line-height: .95; }
h1 { font-size: clamp(4.2rem,14vw,9.2rem); background: linear-gradient(110deg,#fff,#c7d2fe 30%,#7dd3fc 68%,#ccfbf1); -webkit-background-clip:text; background-clip:text; color: transparent; }
h2 { font-size: clamp(2.5rem,7vw,5rem); }
h3 { margin: 0 0 10px; letter-spacing: -.035em; }
.lead { margin: 18px 0 0; font-size: clamp(1.18rem,2.2vw,1.6rem); color: rgba(238,243,255,.96); }
.description, .section__heading p, .tool-card p, .footer p, .status, label { color: var(--muted); line-height: 1.65; }
.description { max-width: 700px; margin: 22px 0 0; font-size: 1.06rem; }
.search-box { margin-top: 30px; }
.search-box input, .input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(2,6,23,.55);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}
.search-box input:focus, .input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 4px rgba(34,211,238,.08); }
.hero-panel, .placeholder-card, .result-card, .preview, .discord-embed-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg,rgba(13,17,28,.9),rgba(14,23,39,.74));
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.hero-panel { padding: 24px; }
.hero-panel__row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid rgba(148,163,184,.08); }
.hero-panel__row:last-child { border-bottom: 0; }
.hero-panel__row span { color: var(--muted); }
.hero-panel__row strong { text-align: right; }

.section { padding: 20px 0 96px; }
.section__heading { max-width: 760px; margin-bottom: 34px; }
.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 18px; }
.tool-card {
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(13,17,28,.72);
  color: var(--text);
  padding: 20px;
  min-height: 180px;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}
.tool-card:hover, .tool-card.is-active { transform: translateY(-3px); border-color: var(--border-strong); background: rgba(17,24,39,.86); }
.tool-card span { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 18px; border-radius: 16px; background: linear-gradient(135deg, rgba(139,92,246,.4), rgba(34,211,238,.28)); color: #dff8ff; font-weight: 800; }
.tool-card p { margin: 0; }

.tool-workspace { padding-top: 0; }
.workspace-header { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 24px; }
.tool-panel { display: none; }
.tool-panel.active { display: block; }
.placeholder-card, .result-card, .preview { padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid--small { grid-template-columns: repeat(2, minmax(0,1fr)); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tall { min-height: 340px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.button, .button-like, .button-row button, #copy-result {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(125,211,252,.22);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.button-row button:first-child, .button-like:hover, .button--primary {
  background: linear-gradient(135deg,rgba(139,92,246,.92),rgba(59,130,246,.9));
  border-color: transparent;
}
.button--ghost { background: rgba(255,255,255,.035); border-color: rgba(125,211,252,.22); }
.checks { display: grid; gap: 8px; margin: 14px 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--text); -webkit-text-fill-color: initial; background: none; letter-spacing: normal; }
.telegram-preview, .markdown-body { min-height: 340px; overflow: auto; }
.discord-embed-preview { position: relative; display: grid; grid-template-columns: 6px 1fr; gap: 16px; padding: 18px; min-height: 160px; box-shadow: none; background: rgba(15,23,42,.8); }
.embed-color { border-radius: 999px; background: var(--purple); }
.discord-embed-preview p { color: var(--muted); white-space: pre-wrap; }
.discord-embed-preview small { color: var(--muted); }
.qr-canvas, .image-canvas { display: block; max-width: 100%; margin-top: 16px; border-radius: 20px; background: white; }
.image-canvas { background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.color-preview { height: 110px; border-radius: 22px; margin: 16px 0; border: 1px solid var(--border); background: #8b5cf6; }
.big-result { margin-top: 16px; font-size: clamp(3rem, 8vw, 6rem); font-weight: 800; line-height: 1; letter-spacing: -.06em; background: linear-gradient(110deg,#fff,#c7d2fe 30%,#7dd3fc 68%,#ccfbf1); -webkit-background-clip:text; background-clip:text; color: transparent; }
.footer { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 0 0 40px; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@keyframes floatBlob { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(4rem,-3rem,0) scale(1.08); } }
@media (max-width: 1100px) { .tools-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 900px) {
  .hero { min-height: auto; grid-template-columns: 1fr; padding: 36px 0 64px; }
  .tools-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .form-grid, .split { grid-template-columns: 1fr; }
  .workspace-header { align-items: stretch; flex-direction: column; }
}
@media (max-width: 680px) {
  .header { flex-direction: column; align-items: stretch; padding-top: 18px; }
  .brand { justify-content: center; }
  .nav { justify-content: center; flex-wrap: wrap; border-radius: 24px; }
  .nav a { flex: 1 1 auto; min-width: 92px; text-align: center; }
  .header, .hero, .section, .footer { width: min(100% - 28px, var(--max-width)); }
  h1 { font-size: clamp(3.6rem,19vw,6rem); }
  .tools-grid { grid-template-columns: 1fr; }
  .hero-panel__row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .tool-card { min-height: auto; }
  #copy-result { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .reveal.is-visible { opacity: 1; transform: none; }
}
