* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f5f5;
  --surface: #fff;
  --text: #111;
  --muted: #555;
  --border: #ddd;
  --accent: #111;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

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

.site-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.9rem;
}

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

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 2.5rem;
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: center;
}

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

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Tool (home) */
.tool-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 1.5rem 1.25rem;
  gap: 1.25rem;
}

.home-seo {
  width: 100%;
  max-width: 420px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
}

.home-seo p {
  margin: 0;
}

.tool-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.tool-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
}

.tool-intro {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #333;
}

.bg-choice {
  margin-top: 1rem;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  font-size: 0.95rem;
  border: none;
  padding: 0;
}

.bg-choice label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.preview {
  margin-top: 1.5rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 8px;
  padding: 1rem;
}

.preview.transparent-bg {
  background-color: #e8e8e8;
  background-image:
    linear-gradient(45deg, #ccc 25%, transparent 25%),
    linear-gradient(-45deg, #ccc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ccc 75%),
    linear-gradient(-45deg, transparent 75%, #ccc 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.preview canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.preview-empty {
  color: #888;
  font-size: 0.9rem;
}

.error {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #c00;
  min-height: 1.2em;
}

.btn {
  margin-top: 1.25rem;
  width: 100%;
  padding: 0.75rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn:not(:disabled):hover {
  background: #333;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Content pages */
.content-page {
  max-width: 720px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.content-page h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  line-height: 1.25;
}

.content-page .lead {
  margin: 0 0 1.75rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.content-page h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.15rem;
}

.content-page p,
.content-page li {
  color: #222;
}

.content-page ul {
  padding-left: 1.25rem;
}

.content-page .updated {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.contact-email {
  font-size: 1.1rem;
  font-weight: 600;
}

.contact-form label {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.contact-form textarea {
  margin-top: 0.35rem;
  min-height: 120px;
  resize: vertical;
}

.contact-form .btn {
  width: auto;
  min-width: 140px;
}

.contact-note {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
