/* cf-static — Global Styles */

:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --border: #2a2d3a;
  --text: #e4e4e7;
  --text2: #9ca3af;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --success: #22c55e;
  --radius: 12px;
  --max-w: 960px;
}

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

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

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

.nav-links a {
  color: var(--text2);
  text-decoration: none;
  margin-left: 1.5rem;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--accent); }

/* ── Main ── */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem;
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.8rem;
}

.hero .description {
  color: var(--text2);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ── Tools Grid ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.tool-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 0.8rem;
}

.tool-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.tool-card p {
  color: var(--text2);
  font-size: 0.85rem;
}

/* ── Tool Area ── */
.tool-area {
  margin: 2rem 0;
}

.tool-container textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 1rem;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.tool-actions {
  display: flex;
  gap: 0.8rem;
  margin: 1rem 0;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
}

.btn-secondary:hover { border-color: var(--accent); }

/* ── FAQ ── */
.faq {
  margin-top: 3rem;
}

.faq h2 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.8rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin-top: 0.8rem;
  color: var(--text2);
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text2);
  font-size: 0.85rem;
}

footer nav {
  justify-content: center;
  margin-top: 0.5rem;
}

footer nav a {
  color: var(--text2);
  text-decoration: none;
  margin: 0 0.8rem;
}

footer nav a:hover { color: var(--accent); }

/* ── Calculator ── */
.calc-container {
  margin: 2rem 0;
}

.calc-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.calc-field {
  display: flex;
  flex-direction: column;
}

.calc-field label {
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.calc-field input,
.calc-field select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.6rem 0.8rem;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.calc-field input:focus,
.calc-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.calc-field .field-hint {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 0.3rem;
  opacity: 0.8;
}

.calc-result {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.calc-result h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.result-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}

.result-item .label {
  font-size: 0.8rem;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.result-item .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.result-item .value.highlight {
  color: var(--success);
}

.result-item .sub {
  font-size: 0.75rem;
  color: var(--text2);
  margin-top: 0.2rem;
}

.result-note {
  margin-top: 1rem;
  padding: 0.8rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.5;
}

.result-note strong {
  color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .hero h1 { font-size: 1.6rem; }
  .tools-grid { grid-template-columns: 1fr; }
  .calc-fields { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  main { padding: 1rem; }
}
