:root {
  --paper: #f4efe6;
  --paper-2: #efe6d8;
  --ink: #1b1712;
  --muted: #5c564c;
  --line: #d9d0c3;
  --card: #fffdf8;
  --accent: #1b6b4a;
  --accent-ink: #f4efe6;
  --accent-deep: #114632;
  --warn: #8a2f1d;
  --ok: #1b6b4a;
  --shadow: 0 16px 40px rgba(27, 23, 18, 0.08);
  --radius: 18px;
  --max: 1120px;
  --sans: "Segoe UI", system-ui, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --mono: ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-deep); }
a:hover { color: var(--accent); }
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 88%, white);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(10px);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}
.nav a[aria-current="page"], .nav a:hover { color: var(--ink); }

.hero { padding: 2.4rem 0 1rem; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 560;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 0.8rem;
}
.lede { font-size: 1.2rem; max-width: 40rem; margin: 0 0 1.2rem; }
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 1.5rem; list-style: none; }
.pills li {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.88rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 800px) {
  .tool-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.pair figure { margin: 0; }
.pair img, .pair .after-frame {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 12px;
  background:
    linear-gradient(45deg, #d7d0c6 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 75%, #d7d0c6 75%) 0 0 / 16px 16px,
    linear-gradient(45deg, transparent 25%, #d7d0c6 25%) 8px 8px / 16px 16px,
    linear-gradient(45deg, #d7d0c6 75%, transparent 75%) 8px 8px / 16px 16px,
    #f7f3ec;
}
.pair figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.3rem; }
.sample-note { font-size: 0.82rem; color: var(--muted); margin: 0.6rem 0 0; }

.dropzone {
  border: 2px dashed color-mix(in srgb, var(--accent) 40%, var(--line));
  border-radius: 14px;
  padding: 1.4rem 1rem;
  text-align: center;
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  cursor: pointer;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
}
.dropzone.is-over { background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.dropzone strong { font-size: 1.15rem; }
.dropzone p { margin: 0; color: var(--muted); }

.btn, .btn-secondary, .file-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.btn { background: var(--accent); color: var(--accent-ink); }
.btn:hover { background: var(--accent-deep); }
.btn-secondary, .file-btn {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}
.file-btn input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.samples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.sample-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  padding: 0.2rem 0.5rem 0.2rem 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.sample-btn img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }

.status { min-height: 1.5rem; margin: 0.8rem 0 0; color: var(--muted); font-size: 0.95rem; }
.status[data-kind="error"] { color: var(--warn); }
.status[data-kind="ok"] { color: var(--ok); }
.status[data-kind="busy"] { color: var(--ink); }

.result { margin-top: 1rem; }
.result[hidden] { display: none !important; }
.result-canvas-wrap {
  border-radius: 12px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #d7d0c6 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 75%, #d7d0c6 75%) 0 0 / 18px 18px,
    linear-gradient(45deg, transparent 25%, #d7d0c6 25%) 9px 9px / 18px 18px,
    linear-gradient(45deg, #d7d0c6 75%, transparent 75%) 9px 9px / 18px 18px,
    #f7f3ec;
}
.result canvas { display: block; width: 100%; height: auto; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.swatches { display: flex; gap: 0.4rem; align-items: center; }
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.swatch.transparent {
  background:
    linear-gradient(45deg, #bbb 25%, #fff 25%, #fff 75%, #bbb 75%) 0 0 / 10px 10px,
    linear-gradient(45deg, #bbb 25%, #fff 25%, #fff 75%, #bbb 75%) 5px 5px / 10px 10px;
}
.model-note { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; }

.ad-slot {
  margin: 1.5rem 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--paper-2) 70%, white);
}

.section { padding: 2rem 0; }
.section h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 0.8rem;
  letter-spacing: -0.02em;
}
.columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 800px) { .columns { grid-template-columns: 1fr; } }
.columns article { margin: 0; }
.columns h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.columns p { margin: 0; color: var(--muted); }

.prose { max-width: 44rem; }
.prose h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 0.8rem;
}
.prose h2 { font-family: var(--serif); margin-top: 2rem; }
.prose p.answer {
  font-size: 1.15rem;
  background: var(--card);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.1rem;
  border-radius: 0 12px 12px 0;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); padding: 0.6rem 0.4rem; }
.prose .source { font-size: 0.88rem; color: var(--muted); }
.facts dt { font-weight: 700; margin-top: 1rem; }
.facts dd { margin: 0.25rem 0 0; }

.disclaimer {
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 1.2rem 0;
  margin-top: 1rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; }
.footer-nav a { color: var(--muted); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }

.error-page { padding: 4rem 0; text-align: center; }
.error-page h1 { font-family: var(--serif); font-size: 3rem; margin-bottom: 0.4rem; }
