/* StitchMyPhoto website. Same token set as the demo: named after DMC floss. */
:root {
  --paper: #FFFFFF;
  --ground: #EEF1F5;
  --grid: #D9DFE7;
  --grid-strong: #9AA8B8;
  --ink: #213063;       /* DMC 823 */
  --ink-soft: #4F5F72;
  --red: #C72B3B;       /* DMC 321 */
  --red-deep: #A11F2E;
  --green: #056517;     /* DMC 699 */
  --wood: #C89A69;
  --wood-dark: #96693F;

  --display: "Zilla Slab", Georgia, serif;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input { color: inherit; font-family: inherit; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); font: 400 17px/1.55 var(--body);
  background-color: var(--ground);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 12px 12px;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.08; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }

.top { padding: 14px 16px; background: var(--paper); border-bottom: 1px solid var(--grid); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-link { font-weight: 700; font-size: 16px; text-underline-offset: 4px; padding: 11px 0; margin: -11px 0; white-space: nowrap; }
.wordmark { font: 700 22px/1 var(--display); text-decoration: none; display: inline-block; padding: 11px 0; margin: -11px 0; }
.wordmark span { color: var(--red); }

main { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 40px 0; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 18px; padding-top: 22px; }
.eyebrow { margin: 0 0 10px; font: 500 13px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--red); }
.hero h1 { font-size: clamp(34px, 9.6vw, 64px); }
.h1-turn { display: block; color: var(--red); }
.lede { margin: 12px 0 0; font-size: 17px; line-height: 1.5; color: var(--ink-soft); max-width: 34em; }
@media (min-width: 600px) { .lede { font-size: 18px; } }

.hero-demo { margin: 6px auto 0; width: min(100% - 28px, 290px); }
@media (min-width: 600px) { .hero-demo { width: min(100% - 28px, 440px); } }
.hoop { position: relative; aspect-ratio: 1; border-radius: 50%; background: #FBFBF8; }
.hoop img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.hoop::before {
  content: ""; position: absolute; inset: -12px; border-radius: 50%; z-index: 2; pointer-events: none;
  background: radial-gradient(closest-side, transparent calc(100% - 12.5px), var(--wood-dark) calc(100% - 12px),
    var(--wood) calc(100% - 9px), #DDB688 calc(100% - 6px), var(--wood) calc(100% - 3px), var(--wood-dark) calc(100% - 0.5px), transparent 100%);
  filter: drop-shadow(0 8px 14px rgba(33, 48, 99, 0.2));
}
.hoop-clasp {
  position: absolute; z-index: 3; top: -22px; left: 50%; width: 30px; height: 24px; transform: translateX(-50%);
  border-radius: 5px 5px 3px 3px; background: linear-gradient(90deg, #8C7442, #D8C07C 45%, #8C7442);
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.25);
}
/* The loop: the photo, then the pattern stitches in along the diagonal, holds, resets. */
.hd-pattern {
  -webkit-mask-image: linear-gradient(135deg, #000 46%, transparent 54%);
  mask-image: linear-gradient(135deg, #000 46%, transparent 54%);
  -webkit-mask-size: 300% 300%; mask-size: 300% 300%;
  -webkit-mask-position: 100% 100%; mask-position: 100% 100%;
  animation: stitch-in 7s ease-in-out infinite;
}
@keyframes stitch-in {
  0%, 14% { -webkit-mask-position: 100% 100%; mask-position: 100% 100%; opacity: 1; }
  42%, 90% { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; opacity: 1; }
  100% { -webkit-mask-position: 0% 0%; mask-position: 0% 0%; opacity: 0; }
}
.hero-demo figcaption { margin-top: 18px; text-align: center; font-size: 14px; color: var(--ink-soft); }
.demo-tag {
  font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--red);
  border: 1.5px solid var(--red); padding: 5px 8px; border-radius: 999px; margin-right: 6px;
}

.hero-cta { display: grid; gap: 10px; }
.cta-note { margin: 0; font-size: 15px; color: var(--ink-soft); text-align: center; }

/* Secondary path from the hero to the try-it section. */
.try-link { justify-self: center; color: var(--ink); font-weight: 700; font-size: 16px; text-underline-offset: 4px; padding: 12px 8px; }

/* ---------- Try it on your own photo ---------- */
.try { background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; padding: 28px 20px; margin: 16px 0; display: grid; gap: 14px; justify-items: center; text-align: center; }
.try h2 { font-size: clamp(28px, 7vw, 40px); }
.try-lede { margin: -4px 0 4px; color: var(--ink-soft); font-size: 17px; }
.try-stage { display: grid; gap: 14px; justify-items: center; width: 100%; }
.hoop--live { width: min(100% - 28px, 340px); margin-top: 14px; }
.hoop--live canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; display: block; background: #FBFBF8; }
.try-empty, .try-busy { position: absolute; inset: 0; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 18%; z-index: 1; }
.try-empty span { font: 500 15px/1.4 var(--mono); color: var(--ink-soft); }
.try-busy { background: rgba(255, 255, 255, 0.8); font-weight: 700; font-size: 15px; }
.try-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--grid); border-top-color: var(--red); animation: try-spin 0.8s linear infinite; }
@keyframes try-spin { to { transform: rotate(360deg); } }
.try-note { margin: 0; min-height: 1.2em; font-size: 15px; color: var(--red-deep); font-weight: 700; }
.try-after { display: grid; gap: 12px; justify-items: center; width: 100%; max-width: 460px; }
.try-stats { margin: 0; font: 500 14px/1.4 var(--mono); color: var(--ink-soft); }
.try-threads { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.try-threads li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--grid); border-radius: 999px; font: 500 14px/1 var(--mono); }
.try-swatch { width: 26px; height: 18px; border-radius: 9px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12); }
.try-more { margin: 0; font-size: 14px; color: var(--ink-soft); }
.try-pitch { margin: 6px 0 0; font-size: 17px; max-width: 30em; }

/* ---------- Sticky Reserve bar (phones) ---------- */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.95); background: color-mix(in srgb, var(--paper) 94%, transparent); border-top: 1px solid var(--grid);
  box-shadow: 0 -6px 20px rgba(33, 48, 99, 0.12); transform: translateY(110%); transition: transform 0.25s ease;
}
.sticky-cta .btn { width: 100%; }
.sticky-cta.is-on { transform: none; }
@media (min-width: 700px) { .sticky-cta { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  font: 700 18px/1.15 var(--body); border-radius: 999px; padding: 16px 24px; display: inline-block;
}
.btn--primary { background: var(--red); color: #fff; box-shadow: 0 3px 0 var(--red-deep); }
.btn--primary:hover { background: var(--red-deep); }
.btn--primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep); }
.btn--primary[disabled] { opacity: 0.6; cursor: progress; }
.btn--big { width: 100%; font-size: 19px; padding: 19px 24px; }
.btn--ghost-strong { border: 2px solid var(--ink); color: var(--ink); background: var(--paper); }

/* ---------- Sections ---------- */
.pain, .how, .get, .faq { background: var(--paper); border: 1px solid var(--grid); border-radius: 16px; padding: 28px 20px; margin: 16px 0; }
.pain h2, .how h2, .get h2, .faq h2 { font-size: clamp(28px, 7vw, 40px); margin-bottom: 14px; }
.pain p { margin: 0 0 12px; font-size: 18px; max-width: 36em; }
.pain p:last-child { margin-bottom: 0; }

/* Steps: numbered because it is a real sequence; numbers styled like chart axis labels. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; }
.steps li::before {
  content: counter(step); grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center;
  font: 500 18px/1 var(--mono); color: var(--paper); background: var(--ink); border-radius: 8px;
}
.steps h3 { font-size: 22px; align-self: end; }
.steps p { margin: 4px 0 0; color: var(--ink-soft); }

/* What you get: green checks (a red × would read as "not included"). */
.xlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.xlist li { position: relative; padding-left: 36px; font-size: 18px; }
.xlist li::before {
  content: "✓"; position: absolute; left: 0; top: 2px; width: 24px; height: 24px; display: grid; place-items: center;
  font: 700 15px/1 var(--body); color: #fff; background: var(--green); border-radius: 6px;
}

/* ---------- Price ---------- */
.price-card {
  background: var(--paper); border-radius: 18px; padding: 28px 20px; text-align: center;
  border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  max-width: 560px; margin: 0 auto; display: grid; gap: 12px;
}
.price-label { font: 500 14px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }
.price-big { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 12px; }
.price-now { font: 700 76px/1 var(--display); }
.price-unit { font-size: 18px; color: var(--ink-soft); }
.price-was { flex-basis: 100%; color: var(--ink-soft); font-size: 17px; }
.price-line { margin: 0; font-size: 17px; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px dashed var(--grid); padding: 14px 0; }
.faq details:last-child { border-bottom: 1px dashed var(--grid); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.faq summary::after { content: "+"; font: 500 22px/1 var(--mono); color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }

.close { max-width: 560px; margin: 0 auto; padding: 8px 0 32px; display: grid; gap: 10px; }

/* ---------- Footer ---------- */
.foot { text-align: center; padding: 28px 16px 40px; font-size: 14px; color: var(--ink-soft); }
.foot p { margin: 6px 0; }
.foot nav a { display: inline-block; padding: 13px 8px; }
.fine { font-size: 13px; }

/* ---------- Reserve dialog ---------- */
.reserve {
  border: 0; padding: 0; border-radius: 20px; width: min(100% - 24px, 460px);
  box-shadow: 0 24px 60px rgba(33, 48, 99, 0.35); color: var(--ink);
}
.reserve::backdrop { background: rgba(33, 48, 99, 0.55); }
.reserve form { padding: 30px 22px 22px; display: grid; gap: 12px; position: relative; }
.reserve h2 { font-size: 27px; padding-right: 28px; }
.reserve-close {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; background: transparent;
  font: 400 30px/1 var(--body); color: var(--ink-soft); cursor: pointer; border-radius: 50%;
}
.field-label { font-weight: 700; }
.reserve input[type="email"] {
  font: 400 18px/1.2 var(--body); padding: 15px 14px; border-radius: 12px; border: 2px solid var(--grid-strong); width: 100%; color: var(--ink); background: var(--paper);
}
.reserve input[type="email"]:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(199, 43, 59, 0.25); }
.field-error { margin: 0; color: var(--red-deep); font-weight: 700; }
.micro { margin: 0; font-size: 13.5px; color: var(--ink-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Thank-you ---------- */
.thanks { max-width: 560px; padding: 56px 16px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.thanks h1 { font-size: clamp(38px, 10vw, 56px); }
.thanks-mark { width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font: 700 38px/1 var(--body); }
.thanks-big { font: 700 22px/1.2 var(--display); margin: 0; }
.thanks p { margin: 0; }

/* ---------- Legal pages ---------- */
.legal { max-width: 760px; background: var(--paper); border: 1px solid var(--grid); border-radius: 16px; margin: 24px auto; padding: 28px 22px; }
.legal h1 { font-size: 36px; margin-bottom: 6px; }
.legal h2 { font-size: 22px; margin: 28px 0 8px; }
.legal .draft { font: 500 13px/1.4 var(--mono); color: var(--red-deep); background: #FCEDEE; padding: 10px 12px; border-radius: 8px; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr 1fr; grid-template-areas: "copy demo" "cta demo"; align-items: center; column-gap: 56px; padding-top: 56px; }
  .hero-copy { grid-area: copy; }
  .hero-demo { grid-area: demo; width: 100%; max-width: 480px; }
  .hero-cta { grid-area: cta; align-self: start; max-width: 460px; }
  .cta-note { text-align: left; }
  .pain, .how, .get, .faq { padding: 40px 44px; }
  .steps { grid-template-columns: 1fr 1fr; gap: 28px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sticky-cta { transition: none; }
  .hd-pattern { animation: none; -webkit-mask-image: none; mask-image: none; }
}

/* ---------- What you get: real PDF pages ---------- */
.pages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 10px; }
.page { margin: 0; display: grid; gap: 8px; align-content: start; }
.page img { width: 100%; height: auto; display: block; border-radius: 6px; border: 1px solid var(--grid); box-shadow: 0 6px 16px rgba(33, 48, 99, 0.12); background: #fff; }
.page figcaption { font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.pages-note { margin: 0 0 18px; font-size: 14px; color: var(--ink-soft); }
@media (max-width: 520px) {
  .pages { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 70%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .page { scroll-snap-align: start; }
}

/* ---------- Price card guarantee ---------- */
.guarantee { margin: 14px 0 0; font-size: 15px; color: var(--ink-soft); max-width: 30em; }
.guarantee strong { color: var(--ink); }

/* Buy buttons are links. */
a.btn { color: #fff; }
a.btn--ghost-strong { color: var(--ink); }

/* ---------- Legal pages and the checkout-pending page ---------- */
.legal .updated { margin: 0 0 8px; font: 500 13px/1.4 var(--mono); color: var(--ink-soft); }
.buy-soon { margin: 0 auto; }
.buy-soon p { font-size: 18px; color: var(--ink-soft); max-width: 30em; }
