/* /aipromptbuilder: a calm workbench in the Wurt sticker style. Light only. */
:root {
  --paper: #fff6e9;
  --ink: #2b1d3a;
  --soft: #5b4a6b;
  --pink: #ff5fa2;
  --pink-l: #ffd6e8;
  --blue: #3ab8ff;
  --blue-l: #d4efff;
  --lemon: #ffd23f;
  --lemon-l: #fff1b8;
  --mint: #3ddc97;
  --mint-l: #d1f7e5;
  --grape: #8b5cf6;
  --grape-l: #e6dcff;
  --orange: #ff8a3d;
  --orange-l: #ffe1cc;
  /* One color per ingredient, shared by the chips, the live prompt and the recipe. */
  --c-subject: var(--pink);
  --c-subject-l: var(--pink-l);
  --c-look: var(--blue);
  --c-look-l: var(--blue-l);
  --c-light: var(--lemon);
  --c-light-l: var(--lemon-l);
  --c-camera: var(--mint);
  --c-camera-l: var(--mint-l);
  --c-motion: var(--grape);
  --c-motion-l: var(--grape-l);
  --c-sound: var(--orange);
  --c-sound-l: var(--orange-l);
  --round: "Fredoka", "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", sans-serif;
  --body: "Nunito", ui-rounded, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 5px 5px 0 var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(43, 29, 58, .08) 1.5px, transparent 0);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.55;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: #c2186b; text-underline-offset: 3px; }
a:hover { color: var(--grape); }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 8px; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: #fff; padding: 8px 14px; border: 3px solid var(--ink); border-radius: 12px; }

nav.site {
  max-width: 1160px; margin: 0 auto; padding: 18px 20px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
nav.site .brand { font-family: var(--round); font-weight: 700; font-size: 1.5rem; color: var(--ink); text-decoration: none; }
nav.site .brand::first-letter { color: var(--pink); }
.pill-link {
  font-family: var(--round); font-weight: 600; text-decoration: none; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); border-radius: 999px; padding: 4px 16px; box-shadow: 3px 3px 0 var(--ink);
}

/* Header */
.top { padding: 18px 20px 6px; }
.top-inner {
  max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 250px); gap: 24px; align-items: end;
}
.kicker { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 10px; font-weight: 800; color: var(--soft); }
.kicker span {
  font-family: var(--round); background: var(--lemon); border: 3px solid var(--ink); border-radius: 999px;
  padding: 2px 14px; color: var(--ink); transform: rotate(-3deg); display: inline-block;
}
h1 {
  font-family: var(--round); font-weight: 700; font-size: clamp(2.4rem, 7vw, 4.4rem);
  line-height: 1.02; margin: 0 0 14px; letter-spacing: -.5px;
}
h1 .w { display: inline-block; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
h1 .w1 { color: var(--pink); }
h1 .w2 { color: var(--blue); }
h1 .w3 { color: var(--lemon); }
.lede { font-size: 1.2rem; max-width: 36rem; margin: 0; color: var(--soft); font-weight: 700; }

.buddy { margin: 0; justify-self: center; width: 100%; max-width: 230px; display: grid; grid-template-columns: minmax(0, 1fr); }
.buddy img { display: block; width: 62%; justify-self: center; filter: drop-shadow(5px 6px 0 rgba(43, 29, 58, .16)); }
.bubble {
  position: relative; margin: 0 0 14px; background: #fff; border: 3px solid var(--ink); border-radius: 20px;
  padding: 10px 14px; font-family: var(--round); font-weight: 600; font-size: 1rem; line-height: 1.3; box-shadow: 4px 4px 0 var(--ink);
}
.bubble::after {
  content: ""; position: absolute; left: 46%; bottom: -14px; width: 20px; height: 20px; background: #fff;
  border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(45deg);
}

/* Buttons */
.btn {
  display: inline-block; font: 700 1.1rem/1.2 var(--round); text-decoration: none; text-align: center; cursor: pointer;
  color: var(--ink); background: var(--pink); border: 3px solid var(--ink); border-radius: 999px;
  padding: 10px 22px; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: var(--ink); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn:disabled { cursor: default; opacity: .45; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.btn-ghost { background: #fff; }
.btn-small { font-size: 1rem; padding: 7px 16px; box-shadow: 3px 3px 0 var(--ink); }
.btn-small:hover { box-shadow: 5px 5px 0 var(--ink); }
.btn-go { background: var(--mint); }
.linkish {
  font: 800 .95rem var(--body); color: var(--soft); background: none; border: 0; padding: 6px 4px;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.linkish:hover { color: var(--grape); }

/* Sections */
main { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.block { padding: 30px 0; }
h2 {
  font-family: var(--round); font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.1;
  margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.tag {
  font-size: .95rem; padding: 3px 12px; border: 3px solid var(--ink); border-radius: 999px; transform: rotate(-4deg);
  display: inline-block; box-shadow: 3px 3px 0 var(--ink);
}
.tag-pink { background: var(--pink-l); }
.tag-lemon { background: var(--lemon-l); }
.intro { margin: -6px 0 18px; color: var(--soft); font-weight: 700; max-width: 44rem; }

/* Builder */
.desk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 28px; align-items: start; }
.controls {
  background: #fff; border: 3px solid var(--ink); border-radius: 28px; padding: 22px 22px 8px; box-shadow: 8px 8px 0 var(--ink);
  min-width: 0;
}
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.modes { display: inline-flex; margin: 0; padding: 4px; border: 3px solid var(--ink); border-radius: 999px; background: var(--paper); gap: 4px; min-width: 0; }
.mode { position: relative; display: inline-flex; cursor: pointer; }
.mode input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.mode span { font: 700 1.05rem var(--round); padding: 5px 18px; border-radius: 999px; border: 2px solid transparent; }
.mode input:checked + span { background: var(--ink); color: #fff; }
.mode input:focus-visible + span { outline: 3px solid var(--grape); outline-offset: 2px; }

.field { margin-bottom: 20px; }
.field-label, .group h3 { font: 700 1.2rem/1.2 var(--round); display: flex; align-items: center; gap: 8px; margin: 0 0 2px; }
.field-help, .group-help { margin: 0 0 8px; color: var(--soft); font-size: .95rem; font-weight: 700; }
#subject {
  width: 100%; font: 700 1.1rem var(--body); color: var(--ink); background: var(--paper);
  border: 3px solid var(--ink); border-radius: 16px; padding: 12px 14px;
}
#subject::placeholder { color: #8a7a98; font-weight: 600; }
#subject:focus { outline: none; border-color: var(--grape); box-shadow: 0 0 0 3px var(--grape-l); }

.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }
.dot-subject { background: var(--c-subject); }
.dot-look { background: var(--c-look); }
.dot-light { background: var(--c-light); }
.dot-camera { background: var(--c-camera); }
.dot-motion { background: var(--c-motion); }
.dot-sound { background: var(--c-sound); }

.group { margin: 0 0 20px; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: 8px; }
.chip {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 8px 11px;
  box-shadow: 2px 2px 0 var(--ink); transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
}
.chip b { font: 700 1rem/1.2 var(--round); }
.chip span { font-size: .84rem; line-height: 1.3; color: var(--soft); font-weight: 700; }
.chip:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.chip[aria-pressed="true"] { box-shadow: 3px 3px 0 var(--ink); }
.chip[aria-pressed="true"] b::after { content: " \2713"; }
[data-kind="look"] .chip[aria-pressed="true"] { background: var(--c-look-l); }
[data-kind="light"] .chip[aria-pressed="true"] { background: var(--c-light-l); }
[data-kind="camera"] .chip[aria-pressed="true"] { background: var(--c-camera-l); }
[data-kind="motion"] .chip[aria-pressed="true"] { background: var(--c-motion-l); }
[data-kind="sound"] .chip[aria-pressed="true"] { background: var(--c-sound-l); }

/* Video-only parts show in video mode. Without the script they stay visible. */
.js-builder:not([data-mode="video"]) .video-only { display: none; }

/* Result */
.result { position: sticky; top: 16px; min-width: 0; }
.result-card {
  background: var(--lemon-l); border: 3px solid var(--ink); border-radius: 28px; padding: 18px 20px; box-shadow: 8px 8px 0 var(--ink);
}
.result-title { font-size: 1.4rem; margin: 0 0 10px; }
.prompt-out {
  margin: 0; min-height: 6.5em; max-height: 18em; overflow-y: auto; background: #fff; border: 3px solid var(--ink); border-radius: 16px;
  padding: 12px 14px; font-weight: 700; font-size: 1.05rem; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap;
}
.prompt-out.is-empty { color: var(--soft); font-style: italic; }
.prompt-out.flash { animation: flash .5s ease; }
.seg { border-radius: 5px; padding: 0 2px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.seg-subject { background: var(--c-subject-l); }
.seg-look { background: var(--c-look-l); }
.seg-light { background: var(--c-light-l); }
.seg-camera { background: var(--c-camera-l); }
.seg-motion { background: var(--c-motion-l); }
.seg-sound { background: var(--c-sound-l); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; font-size: .82rem; font-weight: 800; }
.k { border: 2px solid var(--ink); border-radius: 999px; padding: 0 9px; }
.k-subject { background: var(--c-subject-l); }
.k-look { background: var(--c-look-l); }
.k-light { background: var(--c-light-l); }
.k-camera { background: var(--c-camera-l); }
.k-motion { background: var(--c-motion-l); }
.k-sound { background: var(--c-sound-l); }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.status { margin: 8px 0 0; min-height: 1.4em; font-weight: 800; color: var(--soft); font-size: .95rem; }

/* Recipe */
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.formula-2 { margin-bottom: 24px; }
.f { font: 700 1.15rem var(--round); border: 3px solid var(--ink); border-radius: 999px; padding: 4px 16px; box-shadow: 3px 3px 0 var(--ink); }
.op { font: 700 1.4rem var(--round); color: var(--soft); }
.f-subject { background: var(--c-subject-l); }
.f-look { background: var(--c-look-l); }
.f-light { background: var(--c-light-l); }
.f-camera { background: var(--c-camera-l); }
.f-motion { background: var(--c-motion-l); }
.f-sound { background: var(--c-sound-l); }
.f-out { background: var(--ink); color: #fff; }
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.tip { background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 16px 18px; box-shadow: var(--shadow); }
.tip h3 { font: 700 1.2rem/1.25 var(--round); margin: 0 0 6px; }
.tip p { margin: 0; }
.aside { margin: 22px 0 0; font: 600 1.15rem/1.4 var(--round); }

/* Try Wurt */
.try {
  display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 26px; align-items: center;
  background: var(--mint-l); border: 3px solid var(--ink); border-radius: 30px; padding: 24px 28px; box-shadow: 8px 8px 0 var(--ink);
}
.try-buddy { width: 100%; max-width: 170px; justify-self: center; }
.try-text h2 { margin-bottom: 10px; }
.try-text p { margin: 0 0 10px; font-weight: 700; }
.btns { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px !important; }

/* FAQ */
.faq { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; }
.qa { background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: 16px 20px; box-shadow: var(--shadow); }
.qa h3 { font: 700 1.2rem/1.25 var(--round); margin: 0 0 6px; }
.qa p { margin: 0; }

.site-foot { max-width: 1160px; margin: 20px auto 0; padding: 26px 20px 40px; border-top: 3px dashed rgba(43, 29, 58, .25); text-align: center; color: var(--soft); font-weight: 700; }
.site-foot p { margin: 0 0 6px; }

/* Motion (all of it is off for reduced motion, below) */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
@keyframes flash { 0% { background-color: var(--lemon); } 100% { background-color: #fff; } }
.buddy img { animation: bob 3.4s ease-in-out infinite; transform-origin: 50% 100%; }

@media (max-width: 900px) {
  .desk { grid-template-columns: minmax(0, 1fr); gap: 0; }
  /* On phones, once there is a prompt, it rides along at the bottom while the chips scroll by. */
  .result { position: static; padding: 14px 0 8px; }
  .result.has-prompt { position: sticky; top: auto; bottom: 0; z-index: 2; padding-bottom: 8px; }
  .result-card { padding: 10px 12px; border-radius: 20px; box-shadow: 4px 4px 0 var(--ink); }
  .result-title { font-size: 1rem; margin-bottom: 4px; }
  .prompt-out { min-height: 0; max-height: 4.8em; font-size: .95rem; line-height: 1.5; padding: 6px 10px; border-width: 2px; border-radius: 12px; }
  .legend { display: none; }
  .result-actions { margin-top: 8px; gap: 8px; }
  .result-actions .btn-small { font-size: .95rem; padding: 5px 13px; }
  .status { margin-top: 4px; min-height: 0; font-size: .88rem; }
  .status:empty { display: none; }
  .controls { margin-bottom: 4px; }
}

@media (max-width: 640px) {
  .top-inner { grid-template-columns: minmax(0, 1fr); }
  .buddy { display: none; }
  .controls { padding: 16px 14px 4px; border-radius: 22px; box-shadow: 5px 5px 0 var(--ink); }
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chip { padding: 7px 9px; }
  .try { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .try-buddy { max-width: 120px; }
  .btns { justify-content: center; }
  .f { font-size: 1rem; padding: 3px 12px; }
}

@media (max-width: 360px) {
  .chips { grid-template-columns: minmax(0, 1fr); }
  .mode span { padding: 5px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; }
  nav.site, .skip, .toolbar, .result-actions, .buddy { display: none; }
  .result { position: static; }
  .controls, .result-card, .tip, .try, .qa { box-shadow: none; }
}
