﻿:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(10, 18, 32, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.95);
  --text: #f8fafc;
  --heading: #ffffff;
  --muted: #9aa9bd;
  --line: rgba(148, 163, 184, 0.22);
  --brand: #2dd4bf;
  --brand-2: #38bdf8;
  --danger: #fb7185;
  --success: #34d399;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fafc;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --text: #172033;
  --heading: #07111f;
  --muted: #5b677a;
  --line: rgba(15, 23, 42, 0.13);
  --brand: #0f766e;
  --brand-2: #0284c7;
  --shadow: 0 20px 55px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 8%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 28%),
    radial-gradient(circle at 88% 2%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 30%),
    var(--bg);
}

a { color: inherit; }
.shell { width: min(1240px, calc(100% - 28px)); margin: 0 auto; }
.site-header { padding: 16px 0 18px; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #03131f; font-weight: 950; letter-spacing: -0.06em; }
.brand strong { display: block; color: var(--heading); font-size: 1rem; letter-spacing: -0.04em; }
.brand small { display: block; color: var(--muted); font-weight: 800; font-size: 0.68rem; }
.nav-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link, .theme-toggle { border: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 72%, transparent); color: var(--text); border-radius: 999px; padding: 9px 12px; text-decoration: none; font: inherit; font-weight: 850; cursor: pointer; }

.hero { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; padding: 28px 0 20px; }
.eyebrow, .kicker { margin: 0 0 8px; color: var(--brand); font-size: 0.68rem; font-weight: 950; letter-spacing: 0.14em; text-transform: uppercase; }
h1 { margin: 0; color: var(--heading); font-size: clamp(2rem, 4.8vw, 3.8rem); line-height: 1.02; letter-spacing: -0.06em; }
.hero-copy { margin: 14px 0 0; color: var(--muted); max-width: 720px; font-size: 0.98rem; line-height: 1.65; }
.hero-card { display: grid; gap: 8px; min-width: 210px; border: 1px solid var(--line); background: var(--panel); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); }
.hero-card span { color: var(--text); font-weight: 850; font-size: 0.86rem; }

.card { border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); border-radius: 24px; }
.toolbar { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px; margin-bottom: 14px; }
.toolbar-left, .toolbar-right, .output-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn { min-height: 40px; border-radius: 13px; border: 1px solid var(--line); padding: 10px 13px; font: inherit; font-size: 0.84rem; font-weight: 900; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.btn:hover { transform: translateY(-1px); }
.primary { border: 0; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #03131f; }
.secondary { background: color-mix(in srgb, var(--panel-strong) 82%, transparent); color: var(--text); }
.select-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.82rem; font-weight: 850; }
select, input[type="search"] { border: 1px solid var(--line); background: var(--panel-strong); color: var(--text); border-radius: 12px; min-height: 40px; padding: 0 11px; font: inherit; }
.file-input { display: none; }

.workspace { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.editor-card { overflow: hidden; min-height: 570px; display: flex; flex-direction: column; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0 0 4px; color: var(--heading); font-size: 1rem; letter-spacing: -0.025em; }
.panel-header p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.badge { border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 6px 10px; font-size: 0.72rem; font-weight: 950; white-space: nowrap; }
.badge.success { color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.badge.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.drop-zone, .output-wrap { flex: 1; min-height: 0; }
.drop-zone.dragging { outline: 2px dashed var(--brand); outline-offset: -10px; background: color-mix(in srgb, var(--brand) 8%, transparent); }
textarea, pre { width: 100%; height: 100%; min-height: 488px; margin: 0; border: 0; resize: none; outline: none; background: color-mix(in srgb, var(--bg) 78%, #020617); color: var(--text); font-family: "JetBrains Mono", Consolas, monospace; font-size: 0.84rem; line-height: 1.55; padding: 18px; tab-size: 2; }
pre { overflow: auto; white-space: pre-wrap; word-break: break-word; }
.output-actions { padding: 12px; border-top: 1px solid var(--line); }
.output-actions input { flex: 1; min-width: 190px; }
mark { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 14px 0; }
.stat { padding: 15px; }
.stat strong { display: block; color: var(--heading); font-size: 1.05rem; }
.stat span { color: var(--muted); font-size: .76rem; font-weight: 850; }
.seo-panel { margin: 14px 0 42px; padding: 24px; }
.seo-panel h2 { margin: 0 0 12px; color: var(--heading); font-size: clamp(1.35rem, 2.5vw, 2rem); letter-spacing: -0.04em; }
.seo-panel p { color: var(--muted); line-height: 1.72; font-size: 0.92rem; }

.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 20; display: grid; gap: 10px; }
.toast { border: 1px solid var(--line); background: var(--panel-strong); color: var(--text); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-weight: 850; max-width: 320px; }
.toast.success { border-color: color-mix(in srgb, var(--success) 50%, var(--line)); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }

@media (max-width: 920px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .hero-card { min-width: 0; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .nav, .toolbar { align-items: stretch; flex-direction: column; }
  .nav-actions, .toolbar-left, .toolbar-right, .output-actions { align-items: stretch; }
  .btn, select, input[type="search"] { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  textarea, pre { min-height: 360px; }
}
