:root {
  --ink: #18181b;
  --muted: #52525b;
  --line: #e4e4e7;
  --soft: #f4f4f5;
  --bg: #ffffff;
  --accent: #4f46e5;
  --accent-ink: #ffffff;
  --radius: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: #4338ca; }
a:hover { color: #312e81; }
h1, h2, h3 { line-height: 1.15; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 820px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 20px; }
.brand:hover { color: var(--ink); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-weight: 500; font-size: 15px; }
.main-nav a { color: #3f3f46; text-decoration: none; }
.main-nav a:hover { color: var(--accent); }

/* Hero */
.hero { text-align: center; padding-top: 44px; padding-bottom: 8px; }
.hero h1 { margin: 0 0 12px; font-weight: 800; font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.03em; }
.lead { margin: 0 auto; max-width: 58ch; color: var(--muted); font-size: 19px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 10px; }

/* Tool */
.tool { display: flex; flex-wrap: wrap; gap: 24px; padding-top: 24px; padding-bottom: 24px; align-items: flex-start; }
.editor { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

.stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--soft);
  min-height: 360px;
  display: flex; align-items: center; justify-content: center;
  outline: 2px dashed transparent; outline-offset: -10px;
  transition: outline-color .15s;
}
.stage.drag { outline-color: var(--accent); }
.stage.has-image { background: #0f0f12; }
.frame { position: relative; line-height: 0; }
.layer { display: block; max-width: 100%; max-height: 72vh; width: auto; height: auto; }
.layer-under { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.split-line { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.2); pointer-events: none; display: none; }
.stage.comparing .layer-under, .stage.comparing .split-line { display: block; }
.tag { position: absolute; top: 14px; background: rgba(24,24,27,.78); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.tag-left { left: 14px; }
.tag-right { right: 14px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty svg { color: #a1a1aa; }
.empty-title { margin: 10px 0 2px; font-size: 20px; font-weight: 700; color: var(--ink); }
.empty-sub { margin: 0 0 20px; }
.empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.cam-bar { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: center; align-items: center; gap: 28px; }
.round { width: 48px; height: 48px; border-radius: 50%; border: none; background: rgba(24,24,27,.7); color: #fff; display: grid; place-items: center; cursor: pointer; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: var(--accent); cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
.shutter:active { transform: scale(.94); }
.busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,15,18,.45); color: #fff; font-weight: 700; }
.error { margin: 0; padding: 12px 16px; border-radius: 12px; background: #fef2f2; color: #991b1b; font-weight: 500; }

.compare { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); font-weight: 500; }
.compare input { flex: 1; }
input[type=range] { accent-color: var(--accent); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grow { flex: 1 1 auto; }
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 20px;
  border-radius: 12px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #4338ca; color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: #d4d4d8; }
.btn-ghost:hover { border-color: #a1a1aa; }
.btn:focus-visible, .chip:focus-visible, summary:focus-visible { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.btn:focus-within { outline: 3px solid #a5b4fc; outline-offset: 2px; }

.share-panel { border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.share-title { margin: 0 0 10px; font-weight: 700; }
.share-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.share-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.group-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; min-height: 38px; border-radius: 10px; cursor: pointer; border: 1px solid #d4d4d8; background: #fff; color: var(--ink); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.strength-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
#strength { width: 100%; }

/* Ads: reserve space so the page does not jump when they load */
.ad { text-align: center; }
.ad-square { min-height: 250px; }
.ad-wide { min-height: 100px; margin: 24px 0; }

/* Content */
.steps { background: #fafafa; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 24px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding-top: 52px; padding-bottom: 52px; }
.steps h2 { margin: 0 0 8px; font-size: 20px; font-weight: 800; }
.steps p { margin: 0; color: var(--muted); }

.content { padding-top: 52px; padding-bottom: 32px; }
.content h2 { margin: 32px 0 14px; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.content h2:first-child { margin-top: 0; }
.content p { color: #3f3f46; }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }

.more { padding-top: 24px; padding-bottom: 56px; }
.more h2 { font-size: 26px; font-weight: 800; margin: 0 0 16px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.more-card { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-decoration: none; color: var(--ink); }
.more-card:hover { border-color: var(--accent); color: var(--ink); }
.more-card h3 { margin: 0 0 6px; font-size: 17px; }
.more-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 12px; }
.footer-links a { color: var(--muted); }
.footer-meta { margin: 0; }

/* Share page and plain pages */
.show { text-align: center; padding-top: 32px; padding-bottom: 32px; }
.show img { max-width: 100%; max-height: 75vh; border-radius: var(--radius); }
.show .actions { justify-content: center; margin-top: 18px; }
.prose { padding-top: 40px; padding-bottom: 56px; }
.prose h1 { font-size: 36px; margin: 0 0 16px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }

@media (max-width: 640px) {
  .stage { min-height: 300px; }
  .actions .btn { flex: 1 1 auto; }
  .grow { display: none; }
}
.sr-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
