@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

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

:root {
  --primary: #10B981;
  --primary-hover: #059669;
  --primary-light: #D1FAE5;
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --text: #111827;
  --muted: #6B7280;
  --border: #E5E7EB;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
}

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

/* ── Nav ── */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-back {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.nav-back:hover { color: var(--text); }

/* ── Ad top ── */
.ad-top { text-align: center; padding: 0.5rem 1rem; background: var(--surface); border-bottom: 1px solid var(--border); min-height: 0; }

/* ── Hero (tool page) ── */
.tool-hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  max-width: 680px;
  margin: 0 auto;
}
.tool-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  color: var(--text);
}
.tool-hero p {
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.badge-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.badge {
  background: var(--primary-light);
  color: var(--primary-hover);
  padding: 0.2rem 0.75rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-alt {
  background: #FEF3C7;
  color: #92400E;
}

/* ── Upload zone ── */
.upload-wrap {
  max-width: 760px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}
.upload-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 4rem 2rem;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: #F0FDF9;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 1rem; display: block; }
.upload-zone h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.upload-zone p { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.25rem; }
.hint { font-size: 0.8rem !important; color: var(--border) !important; margin-top: 0.75rem !important; margin-bottom: 0 !important; }
.error-msg { color: #EF4444; font-size: 0.85rem; margin-top: 0.75rem; font-weight: 500; }

/* ── Buttons ── */
.btn-primary, .btn-upload {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-primary:hover, .btn-upload:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}
.btn-download {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 2.5rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-download:hover { background: var(--primary-hover); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ── Progress ── */
.progress-wrap {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}
.progress-label {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 500;
}
.progress-bar-track {
  background: var(--border);
  border-radius: 99px;
  height: 6px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary), #34D399);
  height: 100%;
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}
#progressText { color: var(--muted); font-size: 0.85rem; }

/* ── Result ── */
.result-wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.compare-pane { text-align: center; }
.compare-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.compare-pane img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: repeating-conic-gradient(#E5E7EB 0% 25%, #F9FAFB 0% 50%) 0 0 / 20px 20px;
  display: block;
}
.ad-result { margin-top: 2rem; text-align: center; }

/* ── Inpaint brush zone ── */
.brush-zone {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  text-align: center;
}
.brush-instructions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}
.brush-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.brush-controls label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brush-controls input[type="range"] { accent-color: var(--primary); }
.canvas-container {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#imageCanvas { display: block; max-width: 100%; height: auto; }
#maskCanvas {
  position: absolute;
  top: 0; left: 0;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
}
.brush-actions { display: flex; gap: 0.75rem; justify-content: center; align-items: center; flex-wrap: wrap; }

/* ── Homepage hero ── */
.home-hero {
  text-align: center;
  padding: 5rem 1rem 3rem;
  background: linear-gradient(180deg, #F0FDF9 0%, #FFFFFF 100%);
}
.home-hero .eyebrow {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-hover);
  padding: 0.3rem 1rem;
  border-radius: 99px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}
.home-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: var(--text);
}
.home-hero h1 span { color: var(--primary); }
.home-hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 2rem;
}
.home-upload-wrap {
  max-width: 680px;
  margin: 0 auto;
}
.home-upload-zone {
  border: 2px dashed #D1FAE5;
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-shadow: var(--shadow);
}
.home-upload-zone:hover, .home-upload-zone.drag-over {
  border-color: var(--primary);
  background: #F0FDF9;
}
.home-upload-zone .upload-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.home-upload-zone p { color: var(--muted); font-size: 0.95rem; margin-bottom: 1.25rem; }

/* ── Feature strips ── */
.features {
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem;
  flex-wrap: wrap;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}
.feature-item .check { color: var(--primary); font-size: 1rem; }

/* ── Tools grid ── */
.tools-section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.4rem;
}
.section-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  display: block;
}
.tool-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.tool-card .icon { font-size: 1.75rem; margin-bottom: 0.75rem; display: block; }
.tool-card h2 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.tool-card p { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }

/* ── Alt banner ── */
.alt-banner {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  text-align: center;
  padding: 2.5rem 1rem;
}
.alt-banner h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.4rem; }
.alt-banner p { opacity: 0.9; font-size: 0.95rem; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.site-footer a { color: var(--muted); text-decoration: none; }

/* ── Sidebar layout (ads) ── */
.layout { display: flex; gap: 1.5rem; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.layout-main { flex: 1; min-width: 0; }
.ad-sidebar { width: 300px; flex-shrink: 0; padding-top: 1.5rem; }

/* ── Privacy note ── */
.privacy-note {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.75rem;
}
.privacy-note .lock { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .site-nav { padding: 0.75rem 1rem; }
  .tool-hero h1 { font-size: 1.75rem; }
  .home-hero h1 { font-size: 2.25rem; }
  .compare { grid-template-columns: 1fr; }
  .layout { flex-direction: column; }
  .ad-sidebar { width: 100%; }
  .result-actions { flex-direction: column; }
}
