:root {
  --page: #e6eaf1;
  --panel: #ffffff;
  --ink: #1a2250;
  --muted: #565f7e;
  --line: #c6cddc;
  --thread: #f2b200;
  --thread-ink: #1a2250;
  --error-bg: #fff1ec;
  --error-ink: #9a2b12;
  --radius-patch: 22px;
  --radius-small: 10px;
  --wrap: 720px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #11162c;
    --panel: #1a2142;
    --ink: #e8ebf6;
    --muted: #a2a9c6;
    --line: #2f3866;
    --error-bg: #3a1d18;
    --error-ink: #ffb8a3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #11162c;
  --panel: #1a2142;
  --ink: #e8ebf6;
  --muted: #a2a9c6;
  --line: #2f3866;
  --error-bg: #3a1d18;
  --error-ink: #ffb8a3;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.55;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--thread); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--thread); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* header */
.site-head { padding: 22px 0 0; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.brand svg { width: 30px; height: 30px; }
.head-nav { display: flex; gap: 18px; font-size: 15px; color: var(--muted); }
.head-nav a { text-decoration: none; }
.head-nav a:hover, .head-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--thread); text-decoration-thickness: 2px; }

/* hero */
.hero { padding: 48px 0 8px; }
.hero h1 {
  font-size: clamp(38px, 8.2vw, 66px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
  margin: 0 0 16px;
  max-width: 15ch;
}
.hero .lede { margin: 0 0 30px; color: var(--muted); font-size: 19px; max-width: 46ch; }

/* the patch */
.patch {
  position: relative;
  background: var(--panel);
  border-radius: var(--radius-patch);
  padding: 26px;
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -28px rgba(26, 34, 80, 0.45);
}
.stitch {
  position: absolute;
  inset: 9px;
  width: calc(100% - 18px);
  height: calc(100% - 18px);
  overflow: visible;
  pointer-events: none;
}
.stitch rect {
  fill: none;
  stroke: var(--thread);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 9 7;
}
.patch.is-loading .stitch rect { animation: sew 0.9s linear infinite; }
@keyframes sew { to { stroke-dashoffset: -32; } }

.field-label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.field-row { display: flex; gap: 10px; }
.field {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--page);
  border: 1.5px solid transparent;
  border-radius: var(--radius-small);
  padding: 14px 14px;
}
.field::placeholder { color: var(--muted); opacity: 0.8; }
.field:focus { outline: none; border-color: var(--ink); }
.btn {
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  border: 0;
  border-radius: var(--radius-small);
  padding: 14px 22px;
  cursor: pointer;
  background: var(--ink);
  color: var(--panel);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover { filter: brightness(1.15); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-thread { background: var(--thread); color: var(--thread-ink); }
.btn-quiet { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-quiet:hover { border-color: var(--ink); filter: none; }
.helper { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.linklike { white-space: nowrap; background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.status { margin: 16px 0 0; font-size: 15px; color: var(--muted); min-height: 0; }
.status:empty { display: none; }
.status.is-error { background: var(--error-bg); color: var(--error-ink); padding: 12px 14px; border-radius: var(--radius-small); }

/* results */
.results { margin-top: 26px; }
.results[hidden] { display: none; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-head h2 { font-size: 22px; letter-spacing: -0.02em; margin: 0; }
.results-head p { margin: 0; color: var(--muted); font-size: 15px; }
.caption { margin: 0 0 16px; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.tile { background: var(--panel); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.tile-media { background: #000; aspect-ratio: 4 / 5; display: flex; align-items: center; justify-content: center; }
.tile-media img, .tile-media video { width: 100%; height: 100%; object-fit: contain; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; }
.tile-kind { font-size: 14px; color: var(--muted); }
.tile .btn { padding: 10px 14px; font-size: 15px; }

/* content sections */
.section { padding: 56px 0 0; }
.section h2 { font-size: clamp(26px, 4.6vw, 34px); letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 18px; }
.section p { margin: 0 0 14px; max-width: 62ch; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 18px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(s);
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px dashed var(--thread);
  display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
}
.steps strong { display: block; font-size: 18px; }
.steps span { color: var(--muted); }

.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 400; font-size: 24px; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.prose h1 { font-size: clamp(34px, 6vw, 48px); letter-spacing: -0.03em; line-height: 1.05; margin: 40px 0 10px; }
.prose h2 { font-size: 22px; margin: 32px 0 8px; letter-spacing: -0.015em; }
.prose p, .prose li { max-width: 64ch; }
.prose .updated { color: var(--muted); font-size: 15px; }

.site-foot { margin-top: 72px; padding: 28px 0 40px; border-top: 2.5px dashed var(--line); font-size: 14px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.site-foot p { margin: 0; max-width: 62ch; }

.ad-slot:empty { display: none; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 34px; }
  .hero .lede { font-size: 17px; }
  .patch { padding: 22px 20px; }
  .field-row { flex-direction: column; }
  .btn-go { width: 100%; }
  .head-nav { display: none; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile-foot { flex-direction: column; align-items: stretch; }
  .tile-kind { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .patch.is-loading .stitch rect { animation: none; stroke-dasharray: 3 7; }
}
