/* /creators: qt creator crew application, rendered inside a phone. */
.crew-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  gap: clamp(32px, 5vw, 84px);
  align-items: start;
  padding-top: 36px;
  background:
    radial-gradient(circle at 82% 18%, #f5b1cb66 0 18%, transparent 19%),
    radial-gradient(circle at 92% 82%, #c5e74866 0 14%, transparent 15%),
    var(--cream);
  overflow: hidden;
}
.crew-copy h1 { font-size: clamp(48px, 5.4vw, 88px); margin: 6px 0 18px; }
.crew-copy { padding-top: 8px; }
.crew-copy .lead { max-width: 560px; margin-bottom: 22px; }
.crew-start { background: var(--ink); color: var(--cream); border: 0; cursor: pointer; font-family: var(--font-body); margin-bottom: 30px; }
.crew-start:hover { background: var(--pink-hot); color: var(--ink); }
.crew-start:focus-visible { outline: 3px solid var(--pink-hot); outline-offset: 3px; }
.crew-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 640px; }
.crew-card { border-radius: 28px; padding: 22px 22px 18px; }
.crew-card.pink { background: var(--pink); }
.crew-card.pale { background: var(--pale); }
.crew-card h2 { font-size: 24px; margin-bottom: 10px; }
.crew-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 16px; font-weight: 500; line-height: 1.35; }
.crew-card li { padding-left: 22px; position: relative; }
.crew-card li::before { content: "✦"; position: absolute; left: 0; top: 0; font-size: 14px; }
.crew-fine { font-size: 14px; margin-top: 16px; max-width: 600px; opacity: 0.85; }

/* ---------- stage + phone ---------- */
.crew-stage { position: relative; display: grid; place-items: center; padding: 12px 0 28px; }
.phone {
  position: relative;
  z-index: 2;
  width: 322px;
  height: 664px;
  padding: 10px;
  border-radius: 56px;
  background: linear-gradient(145deg, #3d6230, var(--ink) 55%, #22381a);
  box-shadow:
    0 0 0 2px #1d3016,
    inset 0 0 0 2px #ffffff22,
    0 40px 80px rgba(46, 75, 33, 0.35),
    0 12px 24px rgba(46, 75, 33, 0.18);
  transform: rotate(-2.5deg);
  transition: transform 0.4s cubic-bezier(.2, .8, .2, 1);
}
.crew-stage:hover .phone, .crew-stage:focus-within .phone { transform: rotate(0deg); }
.phone::before, .phone::after { /* side buttons */
  content: ""; position: absolute; width: 4px; border-radius: 2px; background: #22381a;
}
.phone::before { left: -4px; top: 135px; height: 62px; }
.phone::after { right: -4px; top: 170px; height: 90px; }
.phone-screen {
  position: relative;
  height: 100%;
  border-radius: 46px;
  background: var(--cream);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.status-bar {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  height: 50px; padding: 4px 30px 0;
  font: 700 15px/1 var(--font-body);
  color: var(--ink);
}
.status-bar svg { fill: currentColor; }
.sb-icons { display: flex; gap: 6px; align-items: center; }
.island { width: 112px; height: 32px; border-radius: 20px; background: #15230f; }

.app-bar {
  flex: none;
  display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  padding: 4px 18px 8px;
}
.app-back {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--pale); color: var(--ink); cursor: pointer;
}
.app-back[hidden] { display: grid !important; visibility: hidden; }
.app-title { grid-column: 2; text-align: center; font: 800 20px/1 var(--font-display); letter-spacing: -0.03em; }
.app-step { text-align: right; font-size: 13px; font-weight: 700; }
.app-progress { flex: none; height: 6px; margin: 0 22px; border-radius: 6px; background: #2e4b2115; overflow: hidden; }
.app-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--pink-hot); transition: width 0.4s ease; }

.crew-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 22px 12px;
  animation: screen-in 0.35s cubic-bezier(.2, .8, .2, 1);
}
.screen.back-in { animation-name: screen-back; }
@keyframes screen-in { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes screen-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
.screen h2 { font-size: 28px; margin: 4px 0 12px; }
.screen-kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; color: #b8336f; }
.screen-sub { font-size: 16px; font-weight: 500; line-height: 1.45; margin-bottom: 12px; }

.welcome-art { display: grid; place-items: center; height: 150px; margin: 0 -22px 12px; background: var(--pink); border-radius: 0 0 40px 40px; margin-top: -20px; }
.welcome-art img { width: 190px; height: auto; filter: drop-shadow(0 12px 18px rgba(46, 75, 33, .25)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1.5deg); } }
.welcome-list { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; }
.welcome-list li { background: var(--pale); border-radius: 16px; padding: 8px 14px; font-weight: 600; font-size: 15px; }
.welcome-list span { margin-right: 6px; }

/* fields */
.f { display: grid; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.f label, .f legend { font-weight: 700; font-size: 15px; padding: 0; }
.f legend { margin-bottom: 8px; }
.opt { font-weight: 500; font-size: 12px; background: #2e4b2112; border-radius: 20px; padding: 2px 8px; margin-left: 4px; vertical-align: 1px; }
.crew-form input[type="text"], .crew-form input[type="email"], .crew-form select, .crew-form textarea {
  width: 100%;
  font: 600 16px/1.3 var(--font-body);
  color: var(--ink);
  background: #fff;
  border: 2px solid #2e4b2122;
  border-radius: 16px;
  padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.crew-form textarea { resize: none; }
.crew-form input::placeholder, .crew-form textarea::placeholder { color: #2e4b2188; font-weight: 500; }
.crew-form input:focus, .crew-form select:focus, .crew-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px #f26fa855; }
.crew-form [aria-invalid="true"] { border-color: #c2185b !important; }
.at-field { position: relative; }
.at-field span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; }
.at-field input { padding-left: 30px !important; }
.f-hint { font-size: 13px; font-weight: 500; opacity: .85; line-height: 1.35; }
.f-hint.count { text-align: right; }
.f-err, .form-error { font-size: 13px; font-weight: 700; color: #b0154f; min-height: 0; }
.f-err:empty, .form-error:empty { display: none; }
.qt-post { background: var(--pale); border-radius: 20px; padding: 12px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips legend { width: 100%; }
.chips .f-err { width: 100%; }
.chip { position: relative; cursor: pointer; }
.chip input, .flavor input, .check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-block; padding: 9px 14px; border-radius: 999px;
  border: 2px solid #2e4b2133; background: #fff; font-weight: 700; font-size: 14px;
  transition: background .15s, border-color .15s, transform .15s;
}
.chip:hover span { transform: translateY(-1px); }
.chip input:checked + span { background: var(--lime); border-color: var(--ink); }
.chip input:focus-visible + span, .flavor input:focus-visible ~ span:last-child, .check input:focus-visible + span::before { outline: 3px solid var(--pink-hot); outline-offset: 2px; }

/* flavors */
.flavors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.flavors legend, .flavors .f-err { grid-column: 1 / -1; }
.flavor {
  position: relative; cursor: pointer; display: grid; justify-items: center; gap: 4px;
  border-radius: 18px; padding: 8px 4px 8px; border: 2px solid transparent; text-align: center;
  font-size: 11.5px; font-weight: 700; line-height: 1.15; transition: transform .15s, border-color .15s;
}
.flavor.straw { background: #fbd3e2; }
.flavor.peach { background: #fde0cc; }
.flavor.yuzu { background: #fbf0b0; }
.flavor.any { background: var(--pale); }
.flavor img { width: auto; height: 76px; object-fit: contain; transition: transform .2s; }
.flavor .surprise { width: 38px; height: 76px; display: grid; place-items: center; font: 800 34px/1 var(--font-display); }
.flavor:hover { transform: translateY(-2px); }
.flavor:has(input:checked) { border-color: var(--ink); box-shadow: 0 6px 14px rgba(46,75,33,.18); }
.flavor:has(input:checked) img { transform: rotate(-8deg) scale(1.08); }
.flavor:has(input:focus-visible) { outline: 3px solid var(--pink-hot); outline-offset: 2px; }

/* checks */
.checks { display: grid; gap: 10px; margin-bottom: 12px; }
.check { position: relative; cursor: pointer; display: block; }
.check > span {
  display: block; position: relative; padding: 12px 12px 12px 48px; border-radius: 16px; background: #fff;
  border: 2px solid #2e4b2118; font-size: 14px; font-weight: 600; line-height: 1.35;
}
.check > span::before {
  content: ""; position: absolute; left: 14px; top: 12px; width: 22px; height: 22px; border-radius: 8px;
  border: 2px solid var(--ink); background: #fff; transition: background .15s;
}
.check input:checked + span { border-color: var(--ink); }
.check input:checked + span::before { background: var(--lime) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%232e4b21' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.check.opt-in > span { background: var(--pale); }
.check[data-invalid] > span { border-color: #c2185b; }

/* actions */
.app-actions { flex: none; padding: 10px 22px 34px; background: linear-gradient(transparent, var(--cream) 30%); }
.app-next { width: 100%; background: var(--ink); color: var(--cream); font-size: 18px; min-height: 56px; border: 0; cursor: pointer; font-family: var(--font-body); }
.app-next:hover { background: var(--lime); color: var(--ink); }
.app-next:focus-visible { outline: 3px solid var(--pink-hot); outline-offset: 3px; }
.app-next[aria-busy="true"] { opacity: .7; cursor: progress; }
.home-bar { position: absolute; bottom: 9px; left: 50%; width: 130px; height: 5px; border-radius: 4px; background: var(--ink); transform: translateX(-50%); opacity: .85; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.noscript { padding: 20px 22px; font-weight: 600; }

/* done */
.done { text-align: center; position: relative; display: grid; align-content: center; justify-items: center; }
.done:focus { outline: none; }
.done-badge { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); font: 800 42px/1 var(--font-display); margin-bottom: 14px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.done-links { display: grid; gap: 10px; width: 100%; margin-top: 8px; }
.done-links .btn { width: 100%; }
.btn.ghost { background: transparent; border: 2px solid var(--ink); }
.crew-form.is-done .app-actions { display: none; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 3px; animation: fall 2.4s ease-in forwards; opacity: 0; }
.confetti i:nth-child(3n) { background: var(--pink-hot); }
.confetti i:nth-child(3n+1) { background: var(--lime); }
.confetti i:nth-child(3n+2) { background: var(--pink); }
.confetti i:nth-child(1) { left: 6%; animation-delay: .05s; } .confetti i:nth-child(2) { left: 14%; animation-delay: .3s; }
.confetti i:nth-child(3) { left: 23%; animation-delay: .15s; } .confetti i:nth-child(4) { left: 31%; animation-delay: .45s; }
.confetti i:nth-child(5) { left: 40%; animation-delay: .1s; } .confetti i:nth-child(6) { left: 49%; animation-delay: .35s; }
.confetti i:nth-child(7) { left: 57%; animation-delay: .2s; } .confetti i:nth-child(8) { left: 65%; animation-delay: .5s; }
.confetti i:nth-child(9) { left: 73%; animation-delay: .05s; } .confetti i:nth-child(10) { left: 81%; animation-delay: .4s; }
.confetti i:nth-child(11) { left: 88%; animation-delay: .25s; } .confetti i:nth-child(12) { left: 95%; animation-delay: .15s; }
@keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(620px) rotate(540deg); } }

/* decor */
.sticker {
  position: absolute; z-index: 3; font: 800 18px/1 var(--font-display); letter-spacing: -0.02em;
  padding: 10px 16px; border-radius: 999px; box-shadow: 0 8px 18px rgba(46,75,33,.16);
}
.sticker-a { background: var(--lime); top: 9%; left: -2%; transform: rotate(-10deg); }
.sticker-b { background: var(--pink); top: 44%; right: -4%; transform: rotate(8deg); }
.float-packet { position: absolute; z-index: 1; width: 64px; height: auto; filter: drop-shadow(0 14px 18px rgba(46,75,33,.22)); animation: bob 5s ease-in-out infinite; }
.fp-1 { top: 4%; right: 8%; transform: rotate(14deg); }
.fp-2 { bottom: 6%; right: 6%; transform: rotate(-12deg); animation-delay: -1.5s; }
.fp-3 { top: 30%; left: 0; transform: rotate(-18deg); animation-delay: -3s; }

/* "this is a button" cues: callout arrow + pulsing start button */
.crew-callout {
  position: absolute; z-index: 4; right: calc(100% - 26px); bottom: 74px;
  display: grid; justify-items: start; color: var(--ink); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.crew-callout span {
  font: 800 22px/1 var(--font-display); letter-spacing: -0.02em; white-space: nowrap;
  background: var(--lime); padding: 8px 14px; border-radius: 999px; transform: rotate(-7deg);
  box-shadow: 0 8px 18px rgba(46,75,33,.16); margin-left: -18px;
}
.crew-callout svg { margin-top: 2px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translate(6px, 3px); } }
.crew-stage.started .crew-callout { opacity: 0; transform: translateX(-10px); }
.crew-stage:not(.started) .app-next { animation: ring 1.8s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 #f26fa8aa; } 70%, 100% { box-shadow: 0 0 0 14px #f26fa800; } }
.screen[data-step="0"] { cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .crew-hero { grid-template-columns: 1fr; }
  .crew-stage { order: -1; }
  .crew-copy { max-width: 720px; }
}
@media (max-width: 640px) {
  /* a phone on a phone: keep the bezel, size it to the screen */
  .crew-hero { padding-top: 20px; gap: 22px; }
  .crew-stage { order: 0; padding: 18px 0 10px; }
  .crew-cards { grid-template-columns: 1fr; }
  .phone {
    width: min(100%, 360px);
    height: clamp(560px, calc(100svh - 110px), 740px);
    padding: 9px;
    border-radius: 48px;
    transform: none !important;
  }
  .phone::before { left: -3px; top: 120px; height: 56px; width: 3px; }
  .phone::after { right: -3px; top: 150px; height: 80px; width: 3px; }
  .phone-screen { border-radius: 40px; }
  .status-bar { height: 42px; padding: 2px 24px 0; font-size: 14px; }
  .island { width: 92px; height: 27px; }
  .app-bar { padding: 2px 14px 6px; }
  .app-progress { margin: 0 18px; }
  .screen { padding: 16px 18px 10px; }
  .screen h2 { font-size: 26px; }
  .welcome-art { height: 170px; margin: -16px -18px 10px; }
  .welcome-art img { width: 200px; }
  .app-actions { padding: 8px 18px 28px; }
  .home-bar { bottom: 8px; width: 110px; }
  .float-packet, .crew-callout { display: none; }
  .crew-start { width: 100%; }
  .sticker { font-size: 14px; padding: 7px 12px; }
  .sticker-a { top: 0; left: 2px; }
  .sticker-b { top: 4px; bottom: auto; right: 2px; transform: rotate(7deg); }
  .flavors { grid-template-columns: repeat(2, 1fr); }
  .flavor { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; padding: 6px 10px; font-size: 13px; }
  .flavor img, .flavor .surprise { height: 52px; }
  .flavor .surprise { width: 26px; font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .welcome-art img, .float-packet, .done-badge, .confetti i, .crew-callout svg, .app-next { animation: none !important; }
  .confetti { display: none; }
  .phone { transition: none; }
}
