:root {
  --bg: #0e0e10;
  --surface: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --radius: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Libre Baskerville', Georgia, serif;
  --mono: 'Courier New', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* Nav */
header {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  background: rgba(14,14,16,0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}
nav {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: inline-flex; align-items: center; color: #71717a; transition: color 0.2s; }
.logo:hover { color: #a1a1aa; }
nav ul { list-style: none; display: flex; gap: 2rem; }
nav ul a { color: var(--muted); font-size: 0.875rem; font-weight: 500; transition: color 0.15s; letter-spacing: 0.01em; }
nav ul a:hover { color: var(--text); }
nav ul a.active { color: var(--text); }

/* Layout */
main { flex: 1; max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
footer { border-top: 1px solid var(--border); text-align: center; padding: 1.5rem; color: var(--muted); font-size: 0.85rem; }

/* Hero */
.hero { padding: 6rem 0 4rem; }
h1, h2 { font-family: var(--font-display); }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; margin-bottom: 1.25rem; }
.hero h1 span { background: linear-gradient(135deg, var(--accent), var(--accent-hover)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.2rem; color: var(--muted); margin-bottom: 2.5rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: #fff;
  padding: 0.65rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; font-family: var(--font);
  transition: background 0.15s, transform 0.1s;
  cursor: pointer; border: none;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }

/* Section */
.section { padding: 4rem 0; border-top: 1px solid var(--border); }

/* Tool cards */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 2.5rem; }
.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; display: flex; flex-direction: column; gap: 0.75rem;
  transition: border-color 0.15s, transform 0.1s; color: var(--text);
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.tool-icon {
  width: 40px; height: 40px; border-radius: 6px;
  background: rgba(180, 150, 100, 0.08);
  border: 1px solid rgba(180, 150, 100, 0.18);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.tool-card h3 { font-size: 1rem; font-weight: 600; }
.tool-card p { font-size: 0.9rem; color: var(--muted); flex: 1; }

/* Tags */
.tag { display: inline-block; font-size: 0.75rem; font-weight: 500; padding: 0.2rem 0.55rem; border-radius: 4px; background: rgba(180,150,100,0.1); color: #a08860; border: 1px solid rgba(180,150,100,0.25); }
.tag-warning { background: rgba(160,130,80,0.12); color: #907040; border-color: rgba(160,130,80,0.28); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tool-link { font-size: 0.875rem; font-weight: 500; color: var(--accent); }
.tool-link:hover { color: var(--accent-hover); }

/* Forms */
input[type="text"], input[type="number"], textarea, select {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); font-family: var(--font); font-size: 0.95rem;
  padding: 0.6rem 0.85rem; width: 100%; transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.5; min-height: 120px; }
input[type="range"] { accent-color: var(--accent); cursor: pointer; width: 100%; }
input[type="checkbox"] { accent-color: var(--accent); width: 1rem; height: 1rem; cursor: pointer; flex-shrink: 0; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.row { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.row .field { flex: 1; min-width: 140px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

/* Utilities */
.copy-btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--muted); cursor: pointer; font-family: var(--font); font-size: 0.8rem;
  padding: 0.35rem 0.75rem; transition: border-color 0.15s, color 0.15s; white-space: nowrap;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-hover); }

.notice { background: rgba(251,191,36,0.08); border: 1px solid rgba(251,191,36,0.2); border-radius: var(--radius); padding: 0.75rem 1rem; font-size: 0.875rem; color: #fbbf24; }

.output-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; font-family: var(--mono); font-size: 0.875rem; word-break: break-all; white-space: pre-wrap; line-height: 1.6; min-height: 3rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
.stat-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2.5rem 2rem; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; position: relative;
}
.drop-zone:hover, .drop-zone.drag-over { border-color: var(--accent); background: rgba(99,102,241,0.04); }
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.drop-zone strong { display: block; margin-bottom: 0.25rem; }
.drop-zone p { color: var(--muted); font-size: 0.875rem; pointer-events: none; }

.file-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.file-name { flex: 1; font-size: 0.9rem; word-break: break-all; }
.file-status { font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.file-status.done { color: #4ade80; }
.file-status.error { color: #f87171; }
.file-status.converting { color: var(--accent-hover); }

.diff-line { display: block; padding: 0.1rem 0.75rem; font-family: var(--mono); font-size: 0.85rem; line-height: 1.6; }
.diff-added { background: rgba(74,222,128,0.12); color: #4ade80; }
.diff-removed { background: rgba(248,113,113,0.12); color: #f87171; }
.diff-unchanged { color: var(--muted); }

.match-hl { background: rgba(251,191,36,0.4); border-radius: 2px; }

.swatch { width: 100%; height: 80px; border-radius: var(--radius); border: 1px solid var(--border); }

@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .hero { padding: 4rem 0 2.5rem; } }