:root {
  --header-height: 90px;
  --primary: #2563eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --radius: 16px;
}

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

html, body {
  min-height: 100%;
}

body {
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-top: var(--header-height);
  display: flex;
  flex-direction: column;
}

/* HEADER */
#header {
  height: var(--header-height);
  background: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: fixed;
  top: 0;
  width: 100%;
  border-bottom: 1px solid #e5e7eb;
  z-index: 999;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

#HIcon { width: 48px; }

.header-actions {
  display: flex;
  gap: 10px;
}

#hamburger,
#darkModeToggle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #f1f5f9;
  cursor: pointer;
}

/* NAV */
#nav {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: white;
  padding: 90px 20px;
  transition: .3s ease;
  box-shadow: -20px 0 40px rgba(0,0,0,.2);
  z-index: 1000;
}

#nav.active { right: 0; }

#navClose {
  position: absolute;
  top: 20px;
  right: 20px;
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
}

#nav ul { list-style: none; }
#nav li { margin-bottom: 15px; }
#nav a { text-decoration: none; color: var(--text); }

/* MAIN */
main {
  flex: 1;
}

/* HERO */
.hero {
  max-width: 1100px;
  margin: 60px auto 30px;
  padding: 30px;
  text-align: center;
}

.hero select {
  margin-top: 20px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
}

/* GRID */
.tools-section {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
}

.tool-card {
  background: var(--card);
  padding: 25px;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,.06);
  transition: .2s ease;
}

.tool-card:hover {
  transform: translateY(-6px);
}

.tool-card h3 { margin-bottom: 10px; }
.tool-card p { color: var(--muted); margin-bottom: 20px; }

.tool-btn {
  display: inline-block;
  padding: 10px 22px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 600;
}

.loader {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}

/* FOOTER FIXED */
#footer {
  text-align: center;
  padding: 40px 20px;
  margin-top: auto;
  background: transparent;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* DARK MODE */
body.dark-mode {
  background: #0f172a;
  color: #e5e7eb;
}

body.dark-mode #header,
body.dark-mode #nav,
body.dark-mode .tool-card {
  background: #1e293b;
}

body.dark-mode a {
  color: #93c5fd;
}
