/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-primary: #4f46e5;
  --color-primary-dark: #4338ca;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --max-width: 960px;
  --header-height: 60px;
}

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

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
}

/* Header */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary);
  text-decoration: none;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  background: #eef2ff;
}

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-icon {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text);
  position: absolute;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

@media (max-width: 640px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px;
    flex-direction: column;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 12px;
    font-size: 16px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
  }
}

@media (min-width: 641px) {
  .site-nav {
    display: flex;
    gap: 4px;
  }
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 20px 16px;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--color-text-muted);
}

.footer-nav {
  display: flex;
  gap: 16px;
}

.footer-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
}

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

/* Tool page sections */
.tool-section {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 32px;
}

.tool-section h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
}

.content-section {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 24px;
}

.content-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--color-text);
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  margin-bottom: 12px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.content-section details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}

.content-section summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  background: #f8fafc;
}

.content-section details[open] summary {
  border-bottom: 1px solid var(--color-border);
}

.content-section details p {
  padding: 12px 16px;
  margin: 0;
}

/* Homepage cards */
.hero {
  text-align: center;
  padding: 48px 16px 32px;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
}

.hero p {
  color: var(--color-text-muted);
  font-size: 16px;
  margin-top: 8px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 0 0 32px;
}

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

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.tool-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.tool-card h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Content page (privacy, about) */
.page-content {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.page-content h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

.page-content h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.page-content p,
.page-content li {
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 8px;
}

.page-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}
