:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --warning: #eab308;
  --danger: #ef4444;
  --gradient: linear-gradient(135deg, #6366f1, #a855f7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  padding: 0.75rem 0;
}
.header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); }
.logo span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
nav a { color: var(--text-muted); margin-left: 1.5rem; font-size: 0.875rem; transition: color 0.2s; }
nav a:hover { color: var(--text); text-decoration: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-muted); font-size: 1.125rem; max-width: 600px; margin: 0 auto; }

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s;
  cursor: pointer;
  display: block;
}
.tool-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
  text-decoration: none;
}
.tool-card .icon { font-size: 2rem; margin-bottom: 0.75rem; }
.tool-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.tool-card p { color: var(--text-muted); font-size: 0.8rem; }
.tool-card .badge {
  display: inline-block;
  background: var(--gradient);
  color: white;
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-top: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* Tool Page Layout */
.tool-page { padding: 2rem 0; max-width: 900px; margin: 0 auto; }
.tool-page h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }
.tool-page .subtitle { color: var(--text-muted); margin-bottom: 2rem; }

.tool-input {
  width: 100%;
  min-height: 200px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.tool-input:focus { border-color: var(--primary); }
.tool-input::placeholder { color: var(--text-muted); }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-primary { background: var(--gradient); color: white; }
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--primary); }

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.result-card .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.result-card .label { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

.score-bar {
  width: 100%;
  height: 12px;
  background: var(--bg-input);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.score-bar .fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.readability-result {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.readability-result h3 { font-size: 1rem; margin-bottom: 1rem; }
.readability-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.readability-item:last-child { border-bottom: none; }
.readability-item .name { color: var(--text-muted); font-size: 0.875rem; }
.readability-item .score { font-weight: 600; }

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 640px) {
  .tools-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  nav a { margin-left: 0.75rem; }
}
