/* The inquiry engine (js/inquiry.js) styled as a measurement worksheet:
   underlined measurement fields, step progress as notches on a tape, success mark drawn like a tracing line. */

.iq-shell { position: relative; }
.iq-noscript { font-size: 16px; }

/* ---------- progress: notches on a tape ---------- */
.iq-progress {
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 34px; padding: 0; height: 64px;
  border: 1px solid var(--ink); background: var(--sheet-2);
}
.iq-progress::before {
  /* mm and cm ticks along the tape's top edge */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(21,23,26,.6) 0 1px, transparent 1px 1cm) 0 0 / 100% 14px no-repeat,
    repeating-linear-gradient(90deg, rgba(21,23,26,.3) 0 1px, transparent 1px 2mm) 0 0 / 100% 7px no-repeat;
}
.iq-progress li { position: relative; display: flex; }
.iq-progress li + li { border-left: 1px solid rgba(21,23,26,.22); }
.iq-progress button {
  position: relative; flex: 1; display: flex; align-items: flex-end; gap: 8px; min-width: 0;
  padding: 0 10px 10px 12px; background: none; border: 0; cursor: pointer; text-align: left;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.iq-progress button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iq-progress button::before {
  /* the notch: a triangle cut down from the tape edge */
  content: ""; position: absolute; left: 12px; top: -1px;
  border: 7px solid transparent; border-top: 11px solid rgba(21,23,26,.25); border-bottom: 0;
  transition: border-top-color .25s ease, transform .4s var(--ease-spring);
}
.iq-progress button:disabled { cursor: not-allowed; opacity: .55; }
.iq-step-number { display: inline-grid; place-items: center; font-weight: 600; color: var(--ink); }
.iq-step-number svg { width: 12px; height: 12px; }
.iq-progress li.is-current button { color: var(--ink); background: var(--sheet); }
.iq-progress li.is-current button::before { border-top-color: var(--red); transform: scale(1.25); transform-origin: 50% 0; }
.iq-progress li.is-current .iq-step-number { color: var(--red); }
.iq-progress li.is-complete button { color: var(--ink); }
.iq-progress li.is-complete button::before { border-top-color: var(--ink); }
.iq-progress li.is-current::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--red);
}
@media (hover: hover) and (pointer: fine) { .iq-progress button:not(:disabled):hover { color: var(--ink); background: var(--sheet); } }
@media (max-width: 520px) {
  .iq-progress { height: 58px; }
  .iq-progress button { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 6px 7px 8px; font-size: 10px; letter-spacing: .03em; }
  .iq-progress button::before { left: 8px; border-width: 6px; border-top-width: 9px; }
}

/* ---------- step body and its transition ---------- */
.iq-step-body { animation: none; }
.motion .iq-step-body[data-dir="forward"] { animation: iq-in-fwd .34s var(--ease-out) both; }
.motion .iq-step-body[data-dir="back"] { animation: iq-in-back .34s var(--ease-out) both; }
@keyframes iq-in-fwd { from { clip-path: inset(0 100% 0 0); transform: translateX(14px); } to { clip-path: inset(0 0 0 0); transform: none; } }
@keyframes iq-in-back { from { clip-path: inset(0 0 0 100%); transform: translateX(-14px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.iq-step-heading { margin-bottom: 28px; }
.iq-title {
  font-family: var(--f-display); font-weight: 780; font-stretch: 104%;
  font-size: clamp(1.6rem, 1.1rem + 1.4vw, 2.4rem); line-height: 1.02; letter-spacing: -0.03em; color: var(--ink);
}
.iq-title:focus { outline: none; }
.iq-title:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.iq-step-heading p { margin-top: 10px; max-width: 52ch; color: var(--ink-2); font-size: 16px; }

/* ---------- fields: underlined measurement lines ---------- */
.iq-fields { display: grid; gap: 26px; }
.iq-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 28px; }
@media (max-width: 620px) { .iq-row { grid-template-columns: 1fr; } }
.iq-field { position: relative; display: grid; gap: 6px; min-width: 0; }
.iq-field > label, .iq-choice-group legend {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
}
.iq-field > label > span, .iq-choice-group legend > span {
  font-size: 10.5px; letter-spacing: .06em; color: var(--ink-3); text-transform: none;
  padding: 1px 6px; border: 1px dashed rgba(21,23,26,.4);
}
.iq-field input, .iq-field textarea, .iq-select select {
  width: 100%; min-width: 0; margin: 0; border: 0; border-radius: 0;
  background: transparent; color: var(--ink);
  font-family: var(--f-body); font-size: 18px; line-height: 1.4;
  padding: 8px 0 9px;
  box-shadow: inset 0 -1.5px 0 var(--ink);
  transition: box-shadow .25s var(--ease-out), background-color .25s ease;
  -webkit-appearance: none; appearance: none;
}
.iq-field textarea { resize: vertical; min-height: 96px; padding-top: 10px;
  /* ruled writing lines */
  background-image: repeating-linear-gradient(transparent 0 calc(1.4em + 1px), rgba(21,23,26,.14) calc(1.4em + 1px) calc(1.4em + 2px));
  background-position: 0 9px; background-attachment: local;
}
.iq-field input::placeholder, .iq-field textarea::placeholder { color: #6a6f75; opacity: 1; }
.iq-field input:focus, .iq-field textarea:focus, .iq-select select:focus { box-shadow: inset 0 -3px 0 var(--blue); }
.iq-field input:focus-visible, .iq-field textarea:focus-visible, .iq-select select:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.iq-field.has-error input, .iq-field.has-error textarea, .iq-field.has-error select { box-shadow: inset 0 -3px 0 var(--red); }
.iq-error {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; line-height: 1.35; color: var(--red); font-weight: 500;
}
.iq-error::before { content: ""; flex: none; width: 7px; height: 10px; background: var(--red); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.iq-select { position: relative; }
.iq-select::after {
  content: ""; position: absolute; right: 4px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 1.6px solid var(--ink); border-bottom: 1.6px solid var(--ink); transform: rotate(45deg); pointer-events: none;
}
.iq-select select { padding-right: 28px; cursor: pointer; text-overflow: ellipsis; }
.iq-select option { color: var(--ink); background: var(--sheet); }

/* ---------- choice groups ---------- */
.iq-choice-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.iq-choice-group legend { padding: 0; margin-bottom: 12px; }
.iq-needs { display: grid; border-top: 1px solid rgba(21,23,26,.3); }
.iq-need {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 22px; align-items: center; gap: 16px;
  padding: 14px 4px 14px 2px; border-bottom: 1px solid rgba(21,23,26,.3); cursor: pointer;
  transition: background-color .2s ease;
}
.iq-need-label { transition: transform .25s var(--ease-out); }
.iq-need.is-selected .iq-need-label { transform: translateX(10px); }
.iq-need input, .iq-feature input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.iq-need-label { display: flex; align-items: baseline; gap: 14px; font-size: 17px; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.iq-need-label small { font-family: var(--f-mono); font-size: 11px; color: var(--ink-3); }
.iq-radio-mark { position: relative; width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 50%; }
.iq-radio-mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--red); transform: scale(.4); opacity: 0; transition: transform .35s var(--ease-spring), opacity .2s ease; }
.iq-need.is-selected { background: var(--sheet-2); }
.iq-need.is-selected .iq-radio-mark::after { transform: scale(1); opacity: 1; }
.iq-need.is-selected .iq-need-label small { color: var(--red); }
.iq-need:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .iq-need:hover { background: var(--sheet-2); } }

.iq-features { display: flex; flex-wrap: wrap; gap: 10px; }
.iq-feature {
  position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 9px 14px 9px 10px; border: 1.2px dashed var(--ink); color: var(--ink);
  font-size: 15px; line-height: 1.2; background: transparent;
  transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.iq-feature:active { transform: scale(.97); }
.iq-feature-symbol { display: inline-grid; place-items: center; width: 16px; height: 16px; }
.iq-feature.is-selected { background: var(--ink); color: var(--sheet); border-style: solid; }
.iq-feature:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .iq-feature:not(.is-selected):hover { background: var(--sheet-2); } }

/* ---------- review ---------- */
.iq-review { display: grid; gap: 24px; }
.iq-review section { border: 1px solid rgba(21,23,26,.35); padding: 18px 20px 20px; background: var(--sheet); }
.iq-review-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px dashed rgba(21,23,26,.4); }
.iq-review-heading h3 { font-family: var(--f-mono); font-weight: 500; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.iq-review-heading button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer;
  background: none; border: 1px solid var(--ink); font-size: 13.5px; font-weight: 500; color: var(--ink);
  transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out);
}
.iq-review-heading button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .iq-review-heading button:hover { background: var(--ink); color: var(--sheet); } }
.iq-review dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin: 0; }
.iq-review dl > div { min-width: 0; }
.iq-review dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.iq-review dd { margin: 2px 0 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; white-space: pre-line; }
.iq-review-full { grid-column: 1 / -1; }
@media (max-width: 520px) { .iq-review dl { grid-template-columns: 1fr; } .iq-review section { padding: 14px 14px 16px; } }
.iq-privacy { font-size: 14px; color: var(--ink-3); max-width: 62ch; }
.iq-text-button {
  justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 8px 0;
  background: none; border: 0; cursor: pointer; font-size: 15px; font-weight: 500; color: var(--ink);
  text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--red); text-underline-offset: .3em;
}
.iq-text-button:active { transform: scale(.98); }

/* ---------- honeypot, server error, actions ---------- */
.iq-trap { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.iq-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.iq-server-error {
  margin-top: 26px; padding: 16px 18px; border: 1.5px solid var(--red); background: rgba(200, 34, 44, .06);
  display: grid; gap: 10px; justify-items: start;
}
.iq-server-error p { color: var(--ink); font-size: 15.5px; font-weight: 500; }
.iq-server-error a { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-weight: 500; overflow-wrap: anywhere; }
.iq-server-error button { background: none; border: 1px solid var(--ink); padding: 7px 12px; cursor: pointer; font-size: 14px; }
.iq-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 34px; padding-top: 24px; border-top: 1px solid rgba(21,23,26,.3); flex-wrap: wrap; }
.iq-required-note { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3); letter-spacing: .02em; }
.iq-back {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 4px; background: none; border: 0; cursor: pointer;
  font-size: 15.5px; font-weight: 500; color: var(--ink); transition: transform .16s var(--ease-out);
}
.iq-back:active { transform: scale(.97); }
.iq-back:disabled { opacity: .5; cursor: not-allowed; }
.iq-submit {
  display: inline-flex; align-items: center; gap: 14px; margin-left: auto;
  padding: 0 0 0 26px; height: 54px; border: 0; cursor: pointer; text-decoration: none;
  background: var(--ink); color: var(--sheet); font-size: 16px; font-weight: 500; white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 64%, 8px 50%, 0 36%);
  transition: transform .16s var(--ease-out), background-color .2s ease;
}
.iq-submit:active { transform: scale(.97); }
.iq-submit:disabled { cursor: progress; background: #3a3e44; }
.iq-submit-dot { display: grid; place-items: center; width: 54px; height: 54px; border-left: 1px solid rgba(243,244,240,.25); }
.iq-submit.is-final { background: var(--red); }
.iq-submit.is-final .iq-submit-dot { border-left-color: rgba(243,244,240,.4); }
@media (hover: hover) and (pointer: fine) {
  .iq-submit:not(:disabled):hover { background: #000; }
  .iq-submit.is-final:not(:disabled):hover { background: #a91a23; }
  .iq-submit:not(:disabled):hover .iq-submit-dot svg { transform: translate(2px, -2px); }
}
.iq-submit-dot svg { transition: transform .35s var(--ease-spring); }
.iq-spin { animation: iq-spin .7s linear infinite; }
@keyframes iq-spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) {
  .iq-actions { gap: 12px; }
  .iq-submit { padding-left: 20px; font-size: 15px; }
  .iq-required-note { flex-basis: 100%; order: 2; }
}

/* ---------- success ---------- */
.iq-success { display: grid; gap: 18px; justify-items: start; padding: 8px 0; }
.iq-success-mark { display: grid; place-items: center; width: 76px; height: 76px; border: 1.5px dashed var(--ink); border-radius: 50%; color: var(--red); }
.iq-success-mark svg { width: 46px; height: 46px; }
.iq-success-mark path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.motion .iq-success-mark path { animation: iq-draw 1s var(--ease-io) .15s both; }
@keyframes iq-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.iq-success p { max-width: 54ch; color: var(--ink-2); }
.iq-direct-email { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.iq-receipt { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--ink); background: var(--sheet-2); max-width: 100%; }
.iq-receipt span { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.iq-receipt code { font-family: var(--f-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.iq-success-actions { display: flex; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-top: 8px; }
.iq-success-actions .iq-submit { margin-left: 0; }

/* ---------- live brief: the pattern ticket ---------- */
.iq-brief {
  position: relative; padding: 22px 22px 20px; background: var(--sheet); border: 1.5px solid var(--ink);
}
.iq-brief::before {
  /* perforated tear line */
  content: ""; position: absolute; left: 0; right: 0; top: 46px; height: 3px;
  background: radial-gradient(circle, var(--green) 1.3px, transparent 1.6px) 0 50% / 7px 3px repeat-x;
}
.iq-brief-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.iq-brief-kicker { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); }
.iq-brief-meter {
  position: relative; flex: 0 1 140px; height: 10px; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(21,23,26,.45) 0 1px, transparent 1px 7px);
}
.iq-brief-meter i {
  position: absolute; inset: 0; background: var(--red); transform-origin: left;
  transform: scaleX(var(--done, 0)); transition: transform .6s var(--ease-out);
}
.iq-brief-name {
  font-family: var(--f-display); font-weight: 800; font-stretch: 104%; font-size: clamp(1.5rem, 1.1rem + 1vw, 2.1rem);
  line-height: 1.02; letter-spacing: -0.03em; color: var(--ink); overflow-wrap: anywhere; margin-bottom: 16px;
}
.iq-brief dl { display: grid; margin: 0; }
.iq-brief dl > div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-top: 1px solid rgba(21,23,26,.18); }
.iq-brief dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
.iq-brief dd { margin: 0; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.iq-brief.is-done { border-color: var(--green); }
.iq-brief.is-done .iq-brief-meter i { background: var(--green); }
.iq-brief-caption { margin-top: 12px; font-size: 14px; color: var(--ink-3); }

/* the brief card carries no label above its heading */
.iq-brief-kicker { display: none; }
.iq-brief-top { justify-content: flex-end; }
