/* The Polka — AI Visibility Audit builder */
:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);

  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem;

  --ink: #2e2b34;
  --ink-soft: #5d5864;
  --ink-faint: #8a8490;
  --sand: #f4efe7;
  --sand-deep: #e7dfd1;
  --line: #ddd4c5;
  --card: #ffffff;
  --slate: #61778c;
  --slate-deep: #4b5f72;
  --green: #3f7652;
  --green-deep: #325f42;
  --green-tint: #e6efe8;
  --coral: #ff6161;
  --coral-tint: #ffe8e6;
  --lilac: #a08bcb;
  --lilac-tint: #eee9f6;
  --amber-tint: #fbf1dc;
  --amber-ink: #7a5710;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(46, 43, 52, .06), 0 6px 24px rgba(46, 43, 52, .06);
  --font-display: "Jost", "Futura", "Avenir Next", sans-serif;
  --font-body: "Satoshi", "Avenir Next", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body {
  margin: 0; background: var(--sand); color: var(--ink);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--slate-deep); }
:focus-visible { outline: 3px solid var(--lilac); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- header */
.site-header { background: var(--slate); color: #fff; }
.site-header .inner { max-width: 1120px; margin: 0 auto; padding: var(--space-4) var(--space-6); display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.brand { display: flex; align-items: center; gap: var(--space-3); color: #fff; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.brand .word { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; letter-spacing: .02em; line-height: 1; }
.brand .sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: var(--text-xs); letter-spacing: .06em; text-transform: uppercase; opacity: .82; margin-top: 3px; }
.header-links { display: flex; gap: var(--space-5); font-size: var(--text-sm); }
.header-links a { color: #fff; text-decoration: none; opacity: .9; }
.header-links a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- layout */
main { max-width: 1120px; margin: 0 auto; padding: var(--space-8) var(--space-6) var(--space-16); }
.stepper { display: flex; gap: var(--space-2); list-style: none; padding: 0; margin: 0 0 var(--space-8); overflow-x: auto; scrollbar-width: none; }
.stepper li { flex: 1 1 0; min-width: 120px; font-size: var(--text-xs); font-weight: 600; color: var(--ink-faint); padding-top: var(--space-3); border-top: 3px solid var(--line); transition: color .3s, border-color .3s; }
.stepper li .n { display: inline-block; margin-right: 6px; font-variant-numeric: tabular-nums; }
.stepper li.done { color: var(--ink-soft); border-color: var(--slate); }
.stepper li.current { color: var(--ink); border-color: var(--green); }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-8); align-items: start; }
@media (max-width: 920px) { .grid { grid-template-columns: 1fr; } }

.card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: var(--space-8); }
@media (max-width: 600px) { .card { padding: var(--space-5); } main { padding: var(--space-5) var(--space-4) var(--space-12); } }
.card + .card { margin-top: var(--space-6); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.005em; }
h1 { font-size: var(--text-xl); }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 700; }
.lede { color: var(--ink-soft); margin: var(--space-3) 0 var(--space-6); max-width: 62ch; }
.mark { background: linear-gradient(transparent 58%, var(--coral-tint) 58%); padding: 0 .1em; }
.eyebrow { font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--slate); margin-bottom: var(--space-2); }
p { margin: 0 0 var(--space-3); }
.muted { color: var(--ink-soft); }
.small { font-size: var(--text-sm); }
.tiny { font-size: var(--text-xs); }

/* ---------- forms */
.field { margin-bottom: var(--space-5); }
.field label, .label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.field .hint { font-size: var(--text-xs); color: var(--ink-soft); margin-top: var(--space-1); }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  padding: .72rem .85rem; font-size: var(--text-base); line-height: 1.4; transition: border-color .2s, box-shadow .2s;
}
textarea.input { resize: vertical; min-height: 5.5rem; }
.input:hover { border-color: #c9bfae; }
.input:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px rgba(97, 119, 140, .18); }
.input.invalid { border-color: var(--coral); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: .45rem 1rem; border-radius: 999px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); transition: background .2s, color .2s; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg input:focus-visible + span { outline: 3px solid var(--lilac); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; border-radius: 999px; padding: .8rem 1.4rem; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: var(--text-sm); line-height: 1.2; transition: background .2s, transform .15s, box-shadow .2s;
  background: var(--green); color: #fff;
}
.btn:hover { background: var(--green-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.secondary:hover { box-shadow: inset 0 0 0 1.5px var(--slate); background: #fff; }
.btn.ghost { background: transparent; color: var(--slate-deep); padding: .5rem .7rem; }
.btn.ghost:hover { background: var(--sand); }
.btn.lg { padding: 1rem 1.8rem; font-size: var(--text-base); }
.btn svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-top: var(--space-6); }
.actions .spacer { flex: 1; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.spin svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- side panel */
.side { position: sticky; top: var(--space-6); }
.side .card { padding: var(--space-6); }
.checklist { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-3); }
.checklist li { display: grid; grid-template-columns: 22px 1fr; gap: var(--space-3); font-size: var(--text-sm); color: var(--ink-soft); }
.checklist li strong { color: var(--ink); display: block; }
.checklist svg { width: 20px; height: 20px; color: var(--green); margin-top: 2px; }
.price { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; line-height: 1; }
.price small { font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink-soft); font-weight: 500; margin-left: 4px; }

/* ---------- loading */
.working { display: grid; place-items: center; text-align: center; padding: var(--space-12) var(--space-4); }
.pulse { width: 64px; height: 64px; margin-bottom: var(--space-5); color: var(--lilac); }
.pulse circle { transform-origin: 32px 32px; animation: bloom 1.8s var(--ease) infinite; }
.pulse circle:nth-child(2) { animation-delay: .15s; } .pulse circle:nth-child(3) { animation-delay: .3s; }
.pulse circle:nth-child(4) { animation-delay: .45s; } .pulse circle:nth-child(5) { animation-delay: .6s; }
.pulse circle:nth-child(6) { animation-delay: .75s; } .pulse circle:nth-child(7) { animation-delay: .9s; }
.pulse circle:nth-child(8) { animation-delay: 1.05s; }
@keyframes bloom { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
.working .msg { font-weight: 600; min-height: 1.6em; }
.progress { width: min(360px, 100%); height: 6px; border-radius: 99px; background: var(--sand-deep); overflow: hidden; margin-top: var(--space-4); }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width 1s linear; }

/* ---------- notices */
.notice { border-radius: var(--radius); padding: var(--space-4) var(--space-5); font-size: var(--text-sm); margin-bottom: var(--space-5); display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); }
.notice svg { width: 20px; height: 20px; margin-top: 1px; }
.notice.error { background: var(--coral-tint); color: #8a2020; }
.notice.info { background: var(--lilac-tint); color: #3f2f66; }
.notice.warn { background: var(--amber-tint); color: var(--amber-ink); }
.notice.good { background: var(--green-tint); color: #214a30; }

/* ---------- competitors */
.comp-list { display: grid; gap: var(--space-2); }
.comp-row { display: grid; grid-template-columns: 1fr 1fr 34px; gap: var(--space-2); align-items: center; }
@media (max-width: 600px) { .comp-row { grid-template-columns: 1fr 34px; } .comp-row .dom { grid-column: 1; } .comp-row .icon-btn { grid-row: 1 / span 2; grid-column: 2; } }

/* ---------- topics */
.topics { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; gap: .45rem; border-radius: 999px; padding: .5rem .95rem;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: var(--text-sm);
  transition: background .2s, border-color .2s, color .2s;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .5; }
.chip[data-weight="2"] { background: var(--green-tint); border-color: #b9d3c1; color: #214a30; }
.chip[data-weight="2"] .dot { background: currentColor; opacity: .7; }
.chip[data-weight="3"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip[data-weight="3"] .dot { background: #fff; border-color: #fff; opacity: 1; }
.chip .lvl { font-size: var(--text-xs); font-weight: 500; opacity: .85; }
.legend { display: flex; gap: var(--space-4); flex-wrap: wrap; font-size: var(--text-xs); color: var(--ink-soft); margin: var(--space-3) 0 0; }
.add-inline { display: flex; gap: var(--space-2); margin-top: var(--space-3); max-width: 420px; }
.add-inline .input { padding: .55rem .8rem; }
.section { padding-top: var(--space-6); margin-top: var(--space-6); border-top: 1px solid var(--sand-deep); }
.counter { font-size: var(--text-xs); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); color: var(--ink-soft); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; margin-top: var(--space-2); }
.dropzone.over { border-color: var(--green); background: var(--green-tint); }

/* ---------- question review */
.summary-bar { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: 0 0 var(--space-5); }
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--text-xs); font-weight: 700; border-radius: 999px; padding: .35rem .75rem; background: var(--sand); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--green-tint); color: #214a30; }
.pill.warn { background: var(--amber-tint); color: var(--amber-ink); }
.topic-group { margin-top: var(--space-6); }
.topic-group:first-of-type { margin-top: 0; }
.topic-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding-bottom: var(--space-2); border-bottom: 1px solid var(--sand-deep); margin-bottom: var(--space-1); }
.topic-head h3 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-base); }
.q { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: var(--space-3); align-items: start; padding: var(--space-2) 0; border-bottom: 1px solid #f1ece3; }
.q:last-child { border-bottom: 0; }
.q .type { font-size: var(--text-xs); font-weight: 700; color: var(--ink-soft); padding-top: .55rem; }
.q .type .yours { display: inline-block; margin-top: 3px; background: var(--lilac-tint); color: #4b3a78; border-radius: 99px; padding: 1px 8px; }
.q textarea { width: 100%; border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: .45rem .6rem; resize: none; overflow: hidden; background: transparent; line-height: 1.45; font-size: var(--text-sm); min-height: 2.3rem; transition: border-color .15s, background .15s; }
.q textarea:hover { background: var(--sand); }
.q textarea:focus { outline: none; border-color: var(--slate); background: #fff; }
.q .tools { display: flex; gap: 2px; padding-top: 2px; }
.q .flag { font-size: var(--text-xs); color: var(--amber-ink); padding: 0 .6rem; }
.q.fresh { animation: fresh 1.4s var(--ease); }
@keyframes fresh { 0% { background: var(--green-tint); } 100% { background: transparent; } }
@media (max-width: 600px) { .q { grid-template-columns: minmax(0, 1fr) auto; } .q .type { grid-column: 1 / -1; padding: 0; } }

/* ---------- taster */
.taster h2 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 700; }
.taster .pick { display: grid; gap: var(--space-2); margin: var(--space-3) 0; }
.taster .pick label { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2); font-size: var(--text-sm); cursor: pointer; align-items: start; }
.taster .pick input { margin-top: 4px; accent-color: var(--green); }
.code-input { letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; font-weight: 700; }
.result { border: 1px solid var(--sand-deep); border-radius: var(--radius); padding: var(--space-4); margin-top: var(--space-3); }
.result .q-text { font-weight: 700; font-size: var(--text-sm); margin-bottom: var(--space-2); }
.verdicts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-2); }
.verdict { font-size: var(--text-xs); font-weight: 700; border-radius: 99px; padding: 2px 9px; }
.verdict.yes { background: var(--green-tint); color: #214a30; }
.verdict.no { background: var(--coral-tint); color: #8a2020; }
.result details { font-size: var(--text-sm); color: var(--ink-soft); }
.result summary { cursor: pointer; color: var(--slate-deep); font-weight: 600; font-size: var(--text-xs); }
.result .excerpt { white-space: pre-line; margin-top: var(--space-2); max-height: 220px; overflow: auto; }

/* ---------- checkout summary */
.summary-list { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0 0 var(--space-6); font-size: var(--text-sm); }
.summary-list dt { color: var(--ink-soft); }
.summary-list dd { margin: 0; font-weight: 600; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: var(--space-3); font-size: var(--text-sm); align-items: start; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--green); width: 17px; height: 17px; }
.secure { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-xs); color: var(--ink-soft); margin-top: var(--space-3); }
.secure svg { width: 15px; height: 15px; }

/* ---------- order status */
.timeline { list-style: none; margin: var(--space-6) 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 32px 1fr; gap: var(--space-4); padding-bottom: var(--space-5); position: relative; }
.timeline li::before { content: ""; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: var(--sand-deep); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--ink-faint); border: 2px solid var(--sand-deep); }
.timeline .dot svg { width: 16px; height: 16px; }
.timeline li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.timeline li.active .dot { border-color: var(--green); color: var(--green); background: #fff; }
.timeline li.active .dot svg { animation: spin 1.2s linear infinite; }
.timeline strong { display: block; }
.timeline span { font-size: var(--text-sm); color: var(--ink-soft); }
.ready-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); margin: var(--space-6) 0; }
.stat { background: var(--sand); border-radius: var(--radius); padding: var(--space-4); }
.stat b { display: block; font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.1; }
.stat span { font-size: var(--text-xs); color: var(--ink-soft); }

footer.site { max-width: 1120px; margin: 0 auto; padding: 0 var(--space-6) var(--space-10); font-size: var(--text-xs); color: var(--ink-soft); display: flex; gap: var(--space-5); flex-wrap: wrap; }
footer.site a { color: var(--ink-soft); }

.fade-in { animation: fadeIn .35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 640px) {
  .header-links { display: none; }
  .stepper { display: none; }
}
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 6px; }
.legend .sw.inc { background: var(--green-tint); border: 1.5px solid #b9d3c1; }
.legend .sw.foc { background: var(--green); }
.legend .sw.off { background: #fff; border: 1.5px solid var(--line); }
.jump { font-size: var(--text-xs); font-weight: 700; color: var(--green-deep); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; padding: .35rem .25rem; }
@media (min-width: 921px) { .jump { display: none; } }
