:root {
  --ink: #1c1917;
  --ink-soft: #57534e;
  --paper: #fbf7f2;
  --paper-2: #ffffff;
  --line: #e7ded3;
  --accent: #8c5a2b;
  --accent-ink: #6b421e;
  --ok: #166534;
  --warn: #92400e;
  --bad: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 23, .06), 0 12px 32px rgba(28, 25, 23, .06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.4vw, 3.15rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin-top: 2.2em; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
ul, ol { padding-left: 1.25em; }
li { margin: .3em 0; }

.wrap { width: min(1080px, calc(100% - 2.5rem)); margin-inline: auto; }
.muted { color: var(--ink-soft); }
.small { font-size: .88rem; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem .75rem; border-radius: 8px; z-index: 99; }

.site-head { border-bottom: 1px solid var(--line); background: rgba(251, 247, 242, .92); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; }
.brand { font-family: "Iowan Old Style", Georgia, serif; font-size: 1.15rem; font-weight: 600; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: .45rem; }
.brand-mark { color: var(--accent); }
.site-head nav { display: flex; gap: 1.15rem; flex-wrap: wrap; font-size: .95rem; }
.site-head nav a { text-decoration: none; color: var(--ink-soft); }
.site-head nav a:hover, .site-head nav a[aria-current] { color: var(--accent-ink); }

.hero { padding: 3.2rem 0 1.4rem; max-width: 46rem; }
.hero .lead { font-size: 1.15rem; color: var(--ink-soft); }

.tool { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem; margin: 1.4rem 0 2rem; }
.tool-head h2 { margin-top: 0; }
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; text-align: center; min-height: 170px; padding: 1.6rem; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; background: #fdfbf8; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: #fdf6ec; }
.dropzone.has-file { border-style: solid; border-color: var(--accent); }
.dropzone-title { font-weight: 600; }

.turnstile-row { margin: .9rem 0 .2rem; }
.turnstile-widget { min-height: 65px; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 1rem 0 .25rem; }
.tier { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: .75rem .9rem; cursor: pointer; background: #fff; }
.tier:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier span { display: flex; flex-direction: column; font-weight: 600; font-size: .96rem; }
.tier small { font-weight: 400; color: var(--ink-soft); font-size: .82rem; }

.primary, .ghost { font: inherit; font-size: .98rem; border-radius: 999px; padding: .7rem 1.4rem; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; }
.primary { background: var(--accent); color: #fff; font-weight: 600; }
.primary:hover { background: var(--accent-ink); }
.primary[disabled] { opacity: .5; cursor: not-allowed; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
#run-btn { margin-top: .9rem; }

.notice { margin-top: 1rem; padding: .85rem 1rem; border-radius: 10px; font-size: .95rem; background: #fdf6e7; border: 1px solid #f0d9a8; color: var(--warn); }
.notice.error { background: #fdecec; border-color: #f3c1c1; color: var(--bad); }

.steps { margin-top: 1.1rem; display: grid; gap: .45rem; }
.step { display: grid; grid-template-columns: 1.2rem 1fr auto; gap: .6rem; align-items: center; font-size: .92rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.step .dot { width: .65rem; height: .65rem; border-radius: 50%; background: #d6d3d1; }
.step[data-state="running"] .dot { background: #f59e0b; animation: pulse 1.1s infinite; }
.step[data-state="succeeded"] .dot { background: var(--ok); }
.step[data-state="pending"] .dot { background: var(--warn); }
.step[data-state="failed"] .dot { background: var(--bad); }
.step[data-state="mock"] .dot { background: #4f46e5; }
.step[data-state="skipped"] .dot { background: #a16207; }
.step .meta { color: var(--ink-soft); font-size: .82rem; text-align: right; }
@keyframes pulse { 50% { opacity: .35; } }

.preview { margin: 1.3rem 0 0; }
.preview-frame { position: relative; display: inline-block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #f1ede7; max-width: 100%; }
.preview img { display: block; max-width: 100%; height: auto; }
.watermark-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding-bottom: .8rem; font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 255, 255, .82); text-shadow: 0 1px 3px rgba(0, 0, 0, .6); background: repeating-linear-gradient(-30deg, transparent 0 90px, rgba(255, 255, 255, .06) 90px 180px); pointer-events: none; }
.preview-actions { display: flex; gap: .6rem; margin-top: .8rem; flex-wrap: wrap; }
.mock-badge { display: inline-block; margin-top: .9rem; padding: .35rem .7rem; font-size: .8rem; letter-spacing: .04em; border-radius: 999px; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }

.pricing .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); }
.card h3 { margin-bottom: .35rem; }
.card .price { font-size: 1.7rem; font-family: "Iowan Old Style", Georgia, serif; margin: 0 0 .2rem; }
.card ul { padding-left: 1.1em; font-size: .92rem; color: var(--ink-soft); }
.card .buy { margin-top: .6rem; }

.how-list { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: how; }
.how-list li { counter-increment: how; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.how-list li::before { content: "0" counter(how); display: block; font-family: "Iowan Old Style", Georgia, serif; color: var(--accent); font-size: 1.1rem; margin-bottom: .3rem; }
.how-list h3 { margin-bottom: .3rem; }

.prose { max-width: 46rem; }
.prose p { color: var(--ink-soft); }

.faq details { border-bottom: 1px solid var(--line); padding: .85rem 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: .6rem 0 0; color: var(--ink-soft); }

.site-foot { margin-top: 4rem; border-top: 1px solid var(--line); background: #f6f1ea; padding: 2.2rem 0 1.4rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 1.5rem; }
.site-foot h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.site-foot ul { list-style: none; padding: 0; font-size: .92rem; }
.foot-base { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1rem; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin: 1.4rem 0; }
.admin dt { font-size: .8rem; color: var(--ink-soft); }
.admin dd { margin: 0 0 .6rem; font-size: 1.3rem; font-family: "Iowan Old Style", Georgia, serif; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th, .admin-table td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
.admin-table th { color: var(--ink-soft); font-weight: 600; }

@media (max-width: 720px) {
  .turnstile-row { margin: .9rem 0 .2rem; }
.turnstile-widget { min-height: 65px; }
.tier-row { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .head-inner { align-items: flex-start; flex-direction: column; }
}
