/* ==========================================================================
   ask.css - Ask Dennis (js/ask.js), on the desktop and the phone
   ========================================================================== */

/* --------------------------------------------------------------------------
   SHARED
   -------------------------------------------------------------------------- */

.ask-thread {
  --ask-fg: var(--app-fg, #fff);
  --ask-soft: var(--app-fg-soft, rgba(255, 255, 255, 0.75));
  --ask-line: rgba(255, 255, 255, 0.35);
  max-width: 760px;
  color: var(--ask-fg);
}

.ask-intro { padding: 4px 0 28px; }
.ask-intro[hidden] { display: none; }

.ask-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  margin-bottom: 22px;
}

.ask-hello {
  font-family: var(--font-light);
  font-weight: 200;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.1;
  margin: 0 0 12px;
}

.ask-sub {
  font-size: 15px;
  line-height: 1.55;
  color: var(--ask-soft);
  max-width: 36em;
  margin: 0 0 24px;
}

.ask-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ask-chip {
  background: transparent;
  border: 2px solid var(--ask-line);
  color: inherit;
  padding: 7px 14px;
  font: 14px/1.3 var(--font);
  text-align: left;
  cursor: pointer;
}
.ask-chip:hover { border-color: currentColor; }
.ask-chip:active { background: var(--ask-fg); color: var(--app-bg, #000); }

.ask-list { display: flex; flex-direction: column; gap: 20px; }

.ask-q span {
  display: inline-block;
  border-left: 4px solid var(--accent);
  padding: 2px 0 2px 13px;
  font-family: var(--font-semilight);
  font-weight: 300;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ask-a { padding-left: 17px; }
.ask-a-text {
  white-space: pre-wrap;
  font-size: 15.5px;
  line-height: 1.62;
  color: var(--ask-fg);
  opacity: 0.92;
  overflow-wrap: anywhere;
}
.ask-a-text a { color: var(--accent-light); text-decoration: underline; text-underline-offset: 2px; }
.ask-a.is-error .ask-a-text { opacity: 0.78; font-style: italic; }

.ask-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ask-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 8px 14px;
  font: 14px var(--font);
  cursor: pointer;
}
.ask-open:hover { background: var(--accent-light); }
.ask-open:active { transform: scale(0.97); }

/* The marching dots: the indeterminate progress this OS always used. */
.ask-dots { position: relative; width: 220px; height: 10px; overflow: hidden; margin-top: 8px; }
.ask-dots i {
  position: absolute;
  top: 2px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-light);
  opacity: 0;
  animation: ask-dot 2.4s infinite;
}
.ask-dots i:nth-child(2) { animation-delay: 0.16s; }
.ask-dots i:nth-child(3) { animation-delay: 0.32s; }
.ask-dots i:nth-child(4) { animation-delay: 0.48s; }
.ask-dots i:nth-child(5) { animation-delay: 0.64s; }
@keyframes ask-dot {
  0%   { transform: translateX(0);     opacity: 0; animation-timing-function: cubic-bezier(.1,.7,.3,1); }
  12%  { opacity: 1; }
  40%  { transform: translateX(100px); animation-timing-function: linear; }
  62%  { transform: translateX(120px); animation-timing-function: cubic-bezier(.7,0,.9,.3); }
  88%  { opacity: 1; }
  100% { transform: translateX(220px); opacity: 0; }
}

/* The box you type in. */
.ask-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ask-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: #fff;
  color: #111;
  font: 16px var(--font);
  padding: 0 12px;
  border-radius: 0;
  outline: none;
}
.ask-input:focus { border-color: var(--accent-light); }
.ask-send {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.ask-send:hover { background: var(--accent-light); }
.ask-bar.is-busy .ask-send { opacity: 0.45; pointer-events: none; }
.ask-clear {
  flex: none;
  background: none;
  border: 0;
  color: inherit;
  opacity: 0.65;
  font: 14px var(--font);
  cursor: pointer;
  padding: 0 4px;
}
.ask-clear:hover { opacity: 1; text-decoration: underline; }
.ask-clear[hidden] { display: none; }

/* --------------------------------------------------------------------------
   DESKTOP
   -------------------------------------------------------------------------- */

.ask-app .ask-body { padding-bottom: 24px; }
.ask-app .ask-bar {
  padding: 14px var(--app-edge, clamp(36px, 6vw, 118px)) 28px;
  max-width: calc(760px + 2 * clamp(36px, 6vw, 118px));
  color: #fff;
}

/* Snapped: everything a little tighter. */
.snap-pane .ask-hello { font-size: 26px; }
.snap-pane .ask-mark { width: 56px; height: 56px; }
.snap-pane .ask-app .ask-bar { padding: 10px 18px 18px; }

/* --------------------------------------------------------------------------
   PHONE
   -------------------------------------------------------------------------- */

.ask-thread.is-phone {
  --ask-fg: var(--wp-fg);
  --ask-soft: color-mix(in srgb, var(--wp-fg) 70%, transparent);
  --ask-line: color-mix(in srgb, var(--wp-fg) 35%, transparent);
}
.ask-thread.is-phone .ask-hello { font-size: 28px; }
.ask-thread.is-phone .ask-q span { font-size: 18px; }
.ask-thread.is-phone .ask-a-text { font-size: 15px; }

.ask-bar.is-phone {
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--wp-chrome);
  color: var(--wp-fg);
}
.ask-bar.is-phone .ask-input { border-color: transparent; }
