/*
 * Let Me Ask That For You.
 *
 * One surface does both jobs, the way letmegooglethat.com does it: the box you
 * type into as the author is the exact same box the recipient watches a fake
 * cursor drive. The narrator strip under it carries the joke.
 *
 * Each engine repaints the mock chrome through --fake-* tokens set on
 * body[data-engine]. Those are deliberately literal colors — they impersonate
 * ChatGPT / Gemini / Brave, so they must not inherit site brand tokens.
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Several toggled blocks below are `display: flex`, which outranks the UA
 * `[hidden] { display: none }` rule. Without this they never hide. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui, system-ui, sans-serif);
  background: var(--surface-0, #fafafa);
  color: var(--text-1, #1a1a1a);
  line-height: 1.45;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page {
  max-width: 760px;
  margin: 0 auto;
  /* Clears the fixed nav toggle (~44px tall) without shoving content sideways. */
  padding: 76px 20px 56px;
}

/* ── Engine skins ─────────────────────────────────────────────── */

body[data-engine='chatgpt'] {
  --fake-bg: #212121;
  --fake-fg: #ececec;
  --fake-muted: #9b9b9b;
  --fake-box: #303030;
  --fake-edge: #4a4a4a;
  --fake-accent: #10a37f;
  --fake-on-accent: #ffffff;
}

body[data-engine='gemini'] {
  --fake-bg: #1b1c1d;
  --fake-fg: #e3e3e3;
  --fake-muted: #9aa0a6;
  --fake-box: #282a2c;
  --fake-edge: #444746;
  --fake-accent: #4285f4;
  --fake-on-accent: #ffffff;
}

body[data-engine='brave'] {
  --fake-bg: #1c1b22;
  --fake-fg: #f0edf6;
  --fake-muted: #a7a3b3;
  --fake-box: #2a2833;
  --fake-edge: #4a4657;
  --fake-accent: #fb542b;
  --fake-on-accent: #ffffff;
}

body[data-engine='all'] {
  --fake-bg: #1a1a1a;
  --fake-fg: #ededed;
  --fake-muted: #9b9b9b;
  --fake-box: #2b2b2b;
  --fake-edge: #494949;
  --fake-accent: #1a73e8;
  --fake-on-accent: #ffffff;
}

/* ── The mock app ─────────────────────────────────────────────── */

.stage {
  position: relative;
}

.fake {
  background: var(--fake-bg);
  color: var(--fake-fg);
  border: 1px solid var(--fake-edge);
  border-radius: 12px;
  overflow: hidden;
  transition: background 200ms ease;
}

.fake-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fake-edge);
}

.fake-brand {
  font-weight: 600;
  font-size: 0.95rem;
}

.fake-dots {
  display: flex;
  gap: 5px;
}

.fake-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fake-edge);
}

.fake-body {
  padding: 40px 24px 28px;
  text-align: center;
}

.greeting {
  margin: 0 0 28px;
  font-family: var(--font-display, Georgia, serif);
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.prompt-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px 10px 10px 18px;
  background: var(--fake-box);
  border: 1px solid var(--fake-edge);
  border-radius: 26px;
  text-align: left;
}

#prompt {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  resize: none;
  padding: 8px 0;
  max-height: 6rem;
}

/* Ring the whole pill rather than the bare textarea inside it. */
.prompt-box:focus-within {
  border-color: var(--fake-accent);
}

#prompt:focus,
#prompt:focus-visible {
  outline: none;
  box-shadow: none;
}

#prompt::placeholder {
  color: var(--fake-muted);
}

/* Grid centering + an SVG glyph: a text arrow rides its font baseline and
 * sits visibly high inside the circle. */
#send {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--fake-accent);
  color: var(--fake-on-accent);
  cursor: pointer;
  transition: transform 90ms ease;
}

#send svg {
  display: block;
  width: 20px;
  height: 20px;
}

#send.is-pressed {
  transform: scale(0.88);
}

/* ── Narrator: the cyan strip, in the engine's accent ──────────── */

.narrator {
  display: inline-block;
  margin: 24px auto 0;
  padding: 12px 20px;
  border-radius: 4px;
  background: var(--fake-accent);
  color: var(--fake-on-accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.narrator[data-tone='punchline'] {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1.3rem;
}

.narrator[data-tone='warn'] {
  background: var(--danger, #c5221f);
}

.opening {
  margin: 12px 0 0;
  color: var(--fake-muted);
  font-size: 0.9rem;
}

.destinations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.destination {
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--fake-accent);
  color: var(--fake-on-accent);
  font-weight: 600;
  text-decoration: none;
}

/* ── Author controls, inside the mock so the page stays one thing ── */

.authoring,
.playback-bar {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--fake-edge);
}

.engines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  border: 0;
  margin: 0;
  padding: 0;
}

.engines label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--fake-edge);
  border-radius: 999px;
  color: var(--fake-fg);
  font-size: 0.9rem;
  cursor: pointer;
}

.engines input {
  accent-color: var(--fake-accent);
}

.engines label:has(input:checked) {
  border-color: var(--fake-accent);
  background: color-mix(in srgb, var(--fake-accent) 18%, transparent);
}

.share {
  max-width: 560px;
  margin: 18px auto 0;
}

#share-url {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--fake-edge);
  border-radius: 6px;
  background: var(--fake-box);
  color: var(--fake-fg);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.85rem;
}

/* "Copy URL or Preview" — the source page renders these as plain links. */
.share-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 0;
}

.share-actions em {
  color: var(--fake-muted);
  font-size: 0.85rem;
}

.link-button {
  border: 0;
  background: none;
  color: var(--fake-muted);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:hover {
  color: var(--fake-fg);
}

.playback-bar {
  display: flex;
  gap: 20px;
  justify-content: center;
}

/* ── The fake cursor ──────────────────────────────────────────── */

#cursor {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 3;
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(1px 2px 2px rgba(0, 0, 0, 0.4));
}

#cursor svg {
  display: block;
  width: 22px;
  height: 22px;
  transition: transform 90ms ease;
}

#cursor.is-clicking svg {
  transform: scale(0.8);
}

.fine-print {
  margin-top: 28px;
  text-align: center;
  color: var(--text-3, #6e6e6e);
  font-size: 0.75rem;
  line-height: 1.7;
}

.fine-print p {
  margin: 0;
}

.fine-print p:first-child {
  color: var(--text-2, #555);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  #cursor,
  #cursor svg,
  #send,
  .fake {
    transition: none;
  }
}
