*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #020617;
  color: #e5e7eb;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.site-header {
  background: rgba(15, 23, 42, 0.98);
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.logo {
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.logo span {
  color: #22c55e;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
}

.main-nav a {
  padding: 4px 8px;
  border-radius: 999px;
  color: #e5e7eb;
  opacity: 0.9;
}

.main-nav a:hover {
  background: rgba(148, 163, 184, 0.25);
  opacity: 1;
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.6fr);
  gap: 24px;
  padding: 24px 0 8px;
}

.hero-text h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

.hero-subtitle {
  margin: 0 0 12px;
  color: #cbd5f5;
}

.hero-list {
  margin: 0;
  padding-left: 18px;
  color: #cbd5f5;
  font-size: 0.95rem;
}

.hero-list li {
  margin-bottom: 4px;
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-link {
  font-size: 0.9rem;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.tool-link:hover {
  border-color: #22c55e;
}

/* Buttons */

.btn-primary,
.btn-secondary {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: #22c55e;
  color: #020617;
}

.btn-primary:hover {
  background: #16a34a;
}

.btn-secondary {
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.8);
}

/* Sections */

.section {
  padding: 16px 0 28px;
}

.section h1,
.section h2,
.section h3 {
  margin-top: 0;
}

.section-subtitle {
  margin: 4px 0 16px;
  color: #cbd5f5;
  font-size: 0.95rem;
}

/* Tool layout */

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: flex-start;
}

.tool-two-columns {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
}

.tool-main {
  width: 100%;
}

.tool-side {
  width: 100%;
}

.tool-textarea {
  width: 100%;
  min-height: 260px;
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.tool-input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

.tool-select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
}

.field-group {
  margin-bottom: 10px;
}

.field-group label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
  color: #cbd5f5;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* Cards & lists */

.stats-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 10px 12px;
  font-size: 0.9rem;
}

.stats-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.stats-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 0.9rem;
}

.stats-list li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.checkbox-row input {
  flex-shrink: 0;
}

/* Tool cards on home */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.tool-card {
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 10px 12px;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.tool-card p {
  margin: 0;
  font-size: 0.9rem;
  color: #cbd5f5;
}

.tool-card:hover {
  border-color: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.9);
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.3);
  margin-top: 24px;
  padding: 14px 0 22px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.site-footer a {
  color: #e5e7eb;
}

/* Ads placeholder */

.ad {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  font-size: 0.8rem;
  text-align: center;
  color: #9ca3af;
}

.ad-hero {
  min-height: 80px;
}

.ad-side {
  margin-top: 10px;
}

/* Cookie banner */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  padding: 9px 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.cookie-banner p {
  margin: 0;
}

.cookie-banner a {
  color: #22c55e;
  text-decoration: underline;
}

.cookie-banner button {
  flex-shrink: 0;
  border: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #22c55e;
  color: #020617;
}

/* Utility */

.small-muted {
  font-size: 0.8rem;
  color: #9ca3af;
}

.small-heading {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.small-scroll {
  max-height: 260px;
  overflow: auto;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.link-list li {
  margin-bottom: 4px;
}

.link-list a {
  text-decoration: underline;
}

/* Diff result */

.diff-result {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 8px 10px;
  white-space: pre-wrap;
}

.diff-line {
  display: block;
}

.diff-add {
  background: rgba(22, 163, 74, 0.25);
}

.diff-remove {
  background: rgba(220, 38, 38, 0.25);
}

/* Markdown preview */

.markdown-preview {
  font-size: 0.9rem;
  line-height: 1.5;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3 {
  margin-top: 0.6em;
}

/* QR */

.qr-output {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-output img {
  display: block;
  max-width: 100%;
}

/* Hide helper */

.hidden {
  display: none;
}

/* Responsive */

@media (max-width: 800px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-layout,
  .tool-two-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
