/* Handwriting Personality Test: paper and ink. Fraunces for headings, Inter for text. */
:root {
  --paper: #fbf6ea;
  --sheet: #ffffff;
  --ink: #1f2a44;
  --muted: #6b7285;
  --line: #e3dccb;
  --track: #ece5d3;
  --accent: #2f4f9e;
  --accent-dark: #233d7d;
  --warn: #b3261e;
  --ok: #2e6b3a;
  --radius: 16px;
  --type: var(--accent);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Fraunces", Georgia, "Times New Roman", serif; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 3.6vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1em; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fine { font-size: .86rem; color: var(--muted); }
.center { text-align: center; }
.eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5em; }
.tag { display: inline-block; margin-left: .5em; padding: .08em .5em; border-radius: 99px; background: var(--track); color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 14px 20px; }
.brand { font-family: "Fraunces", Georgia, serif; font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--accent); }
.top-cta { font-weight: 600; font-size: .92rem; text-decoration: none; padding: .45em 1em; border: 2px solid var(--ink); border-radius: 99px; color: var(--ink); white-space: nowrap; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px 40px; }
.hero { text-align: center; padding: 10px 0 18px; max-width: 760px; margin: 0 auto; }
.hero .lead { font-size: 1.06rem; color: #3b4660; margin: 0 auto; }

.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.card-panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 6px 24px rgba(31, 42, 68, .06); }
.card-panel h2 { font-size: 1.2rem; margin: 1.1em 0 .5em; }
.card-panel h2:first-of-type { margin-top: 0; }
.step { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--ink); color: #fff; font: 600 .8rem "Inter", sans-serif; vertical-align: middle; margin-right: .3em; }

.sentence {
  font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; font-size: 1.3rem; line-height: 2.05rem; color: #24336b;
  padding: .35rem 1rem .1rem; margin: 0 0 .5em; border-radius: 10px; border: 1px solid var(--line);
  background: repeating-linear-gradient(#fffdf6, #fffdf6 calc(2.05rem - 1px), #cfd9ee calc(2.05rem - 1px), #cfd9ee 2.05rem);
}
.sentence .blank { border-bottom: 2px dashed #8d9ac0; color: #8d9ac0; padding: 0 .3em; font-size: .95rem; }

.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; background: var(--track); border-radius: 12px; margin-bottom: 12px; }
.mode-btn { border: 0; background: transparent; padding: .6em .4em; border-radius: 9px; font: 600 .95rem "Inter", sans-serif; color: var(--muted); cursor: pointer; }
.mode-btn[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 4px rgba(31, 42, 68, .14); }

.photo-pick { display: grid; place-items: center; min-height: 150px; padding: 14px; border: 2px dashed #b9c2d8; border-radius: 12px; background: #f7f9fd; text-align: center; cursor: pointer; color: var(--muted); font-size: .9rem; }
.photo-pick strong { display: block; color: var(--accent); font-size: 1.05rem; margin-bottom: .2em; }
.photo-pick.has-photo { padding: 6px; border-style: solid; background: #fff; }
.photo-pick img { max-height: 240px; border-radius: 8px; display: block; }
#photoStep .btn-mini { margin-top: 8px; }

.pad-wrap { position: relative; border: 2px solid #b9c2d8; border-radius: 12px; overflow: hidden; background: #fff; }
#pad { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #a6aec2; pointer-events: none; font-size: .95rem; }
.pad-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pad-tools .fine { flex: 1 1 200px; }

.field { display: block; margin: 16px 0 10px; }
.field span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .3em; }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input { width: 100%; padding: .7em .85em; font: inherit; color: var(--ink); border: 1px solid #b9c2d8; border-radius: 10px; background: #fff; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.privacy-note { margin-bottom: 12px; }
.form-error { color: var(--warn); font-weight: 600; background: #fdecea; border-radius: 10px; padding: .6em .8em; }
.human-check:not(:empty) { margin-bottom: 10px; }

.btn { display: inline-block; border: 2px solid transparent; border-radius: 12px; padding: .7em 1.1em; font: 600 1rem "Inter", sans-serif; text-align: center; text-decoration: none; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: #b9c2d8; }
.btn-lg { font-size: 1.08rem; padding: .85em 1.2em; }
.btn-block { display: block; width: 100%; }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn-mini { border: 1px solid #b9c2d8; background: #fff; border-radius: 8px; padding: .3em .7em; font: 500 .85rem "Inter", sans-serif; color: var(--ink); cursor: pointer; }

.vs-banner { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 16px; border-radius: 12px; background: #eef2fb; border: 1px solid #cdd7ef; }
.vs-banner p { margin: 0; flex: 1; font-size: .92rem; }
.vs-banner strong { display: block; font-size: 1rem; }

.empty-sample { display: block; margin: 0 auto 10px; width: 100%; max-width: 380px; border-radius: 12px; box-shadow: 0 8px 28px rgba(31, 42, 68, .14); }
#progressBox { text-align: center; padding: 50px 0; }
.pen { font-size: 2.6rem; color: var(--accent); animation: write 1.4s ease-in-out infinite; }
@keyframes write { 0%, 100% { transform: translateX(-14px) rotate(-8deg); } 50% { transform: translateX(14px) rotate(6deg); } }
.bar { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; margin: 14px auto; max-width: 360px; }
.bar-fill { height: 100%; width: 4%; background: var(--accent); border-radius: 99px; transition: width .5s linear; }

.type-icon { display: inline-grid; place-items: center; border-radius: 50%; background: #fff; border: 2px solid var(--type, var(--accent)); padding: 8px; line-height: 0; }
.type-head, .full-head, .type-hero { text-align: center; }
.type-head h2, .full-head h2 { font-size: clamp(1.9rem, 6vw, 2.5rem); color: var(--type); margin: .1em 0 .2em; }
.type-lines { color: #3b4660; margin-bottom: .6em; }
.fun-note { text-align: center; font-size: .82rem; color: var(--muted); background: #f6f1e2; border-radius: 8px; padding: .5em .8em; }
.summary { font-size: 1.05rem; }

.scores { display: grid; gap: 9px; margin: 16px 0; }
.score { display: grid; grid-template-columns: 7.2em 1fr 2.2em; align-items: center; gap: 10px; font-size: .95rem; }
.score-label { font-weight: 500; }
.score-bar { height: 12px; background: var(--track); border-radius: 99px; overflow: hidden; display: block; }
.score-fill { display: block; height: 100%; border-radius: 99px; }
.score-value { font-weight: 600; text-align: right; }

.features { display: grid; gap: 10px; }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fffdf8; }
.feature p { margin: 0 0 .35em; }
.feature p:last-child { margin-bottom: 0; }
.feature-name { display: block; font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.feature-observed { font-weight: 500; }
.feature-says { color: #3b4660; font-size: .95rem; }

.card-box { margin-top: 22px; text-align: center; }
.card-box img, #vsCardImg, #certImg { display: block; margin: 0 auto 12px; width: 100%; max-width: 360px; border-radius: 12px; box-shadow: 0 8px 28px rgba(31, 42, 68, .16); }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px; }
.share-row .btn { flex: 1 1 auto; }

.compare-cta, .locked, .vs-box { margin-top: 22px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: #fffdf8; }
.compare-cta h3, .locked h3, .vs-box h3 { margin-top: 0; }
.locked { background: #f4f6fc; border-color: #cdd7ef; }
.locked-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .93rem; }
.locked-list li { padding-left: 1.5em; position: relative; cursor: pointer; }
.locked-list li::before { content: ""; position: absolute; left: 0; top: .28em; width: .95em; height: .8em; border-radius: 3px; background: var(--accent); opacity: .75; }
.locked-list li::after { content: ""; position: absolute; left: .2em; top: -.02em; width: .55em; height: .5em; border: 2px solid var(--accent); border-bottom: 0; border-radius: .4em .4em 0 0; opacity: .75; box-sizing: border-box; }

.vs-pair { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.vs-person { display: grid; justify-items: center; gap: 2px; flex: 1; }
.vs-type { font-family: "Fraunces", Georgia, serif; font-weight: 700; }
.vs-amp { font-family: "Fraunces", Georgia, serif; font-size: 1.4rem; color: var(--muted); }
.vs-match { text-align: center; margin: 12px 0 4px; font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; }
.vs-match strong { font-size: 1.6rem; }
.vs-lines { text-align: center; color: #3b4660; }
.vs-bars { display: grid; gap: 7px; margin: 12px 0 16px; }
.vs-row { display: grid; grid-template-columns: 2em 1fr 7.4em 1fr 2em; align-items: center; gap: 6px; font-size: .85rem; }
.vs-label { text-align: center; font-weight: 500; }
.vs-num { font-weight: 600; text-align: center; }
.vs-bar { height: 10px; background: var(--track); border-radius: 99px; overflow: hidden; display: flex; }
.vs-bar span { display: block; height: 100%; border-radius: 99px; }
.vs-bar-me { justify-content: flex-end; }

.full { margin-top: 22px; padding-top: 6px; border-top: 2px solid var(--line); }
.paid-note { color: var(--ok); font-weight: 600; text-align: center; background: #e9f4eb; border-radius: 10px; padding: .5em; }
.plain-list { margin: 0 0 1em; padding-left: 1.2em; }
.plain-list li { margin-bottom: .3em; }
#againBtn { margin-top: 18px; }
#failBox { text-align: center; padding: 30px 0; }

.how, .intro, .types, .faq { max-width: 820px; margin: 46px auto 0; }
.steps { padding-left: 1.3em; margin: 0 0 1.2em; }
.steps li { margin-bottom: .6em; }
.flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px; margin: 20px 0 0; }
.flow img { border-radius: 10px; box-shadow: 0 6px 20px rgba(31, 42, 68, .12); }
.flow img:first-child { flex: 1 1 260px; max-width: 420px; }
.flow img:nth-of-type(2) { width: 170px; }
.flow-arrow { font-size: 2rem; color: var(--muted); }
.flow figcaption { flex-basis: 100%; text-align: center; font-size: .82rem; color: var(--muted); }

.type-grid, .type-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.type-grid a { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); text-decoration: none; color: var(--ink); height: 100%; }
.type-grid .type-icon { grid-row: span 2; padding: 6px; }
.type-grid strong { font-family: "Fraunces", Georgia, serif; }
.type-grid span:not(.type-icon) { font-size: .84rem; color: var(--muted); grid-column: 2; }
.type-grid a > strong:first-child, .type-grid a > strong:first-child + span { grid-column: 1 / -1; }

.faq details { border-bottom: 1px solid var(--line); padding: .8em 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: .6em 0 0; color: #3b4660; }

.foot { max-width: 1120px; margin: 40px auto 0; padding: 22px 20px 34px; border-top: 1px solid var(--line); text-align: center; font-size: .9rem; }
.foot nav { line-height: 2; }
.foot a { color: var(--ink); }

/* Worker-rendered pages (/handwriting-analysis, /types/*), legal pages and the 404 page. */
.article, .legal { max-width: 760px; margin: 0 auto; padding: 10px 20px 40px; }
.article section { margin-top: 30px; }
.article .lead { font-size: 1.1rem; color: #3b4660; }
.article ul { padding-left: 1.2em; }
.article li { margin-bottom: .45em; }
.feature-doc { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--sheet); }
.feature-doc h2 { font-size: 1.25rem; }
.type-hero { padding: 16px 0 0; }
.type-hero h1 { color: var(--type); }
.type-links { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.type-links a { display: block; padding: .5em .8em; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); text-decoration: none; }
.cta-row { text-align: center; margin-top: 34px; }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.notfound { text-align: center; padding: 60px 20px; }

@media (max-width: 860px) {
  .maker { grid-template-columns: 1fr; }
  .maker-result.is-empty { display: none; }
  .hero { text-align: left; padding-top: 0; }
  .hero h1 { margin-bottom: .3em; }
  .hero .lead { font-size: .98rem; }
  .card-panel { padding: 16px; }
  .locked-list { grid-template-columns: 1fr; }
  .top-cta { display: none; }
}

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  #fullBox, #fullBox * { visibility: visible; }
  #fullBox { position: absolute; left: 0; top: 0; width: 100%; margin: 0; padding: 0 12mm; border: 0; }
  .no-print, .no-print *, #paidNote { display: none !important; }
  .feature { break-inside: avoid; }
}
