/* what is your purpose? — gallery-minimal, typography-led. No webfonts, no trackers. */

:root {
  --bg: #f7f6f3;
  --glow: rgba(247, 246, 243, 0.93);
  --ink: #16161b;
  --dim: #8b8b94;
  --line: rgba(22, 22, 27, 0.18);
  --bubble-bg: #e9e9eb;
  --bubble-ink: #141418;
  --blue: #0a84ff;
  --blue-ink: #ffffff;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d10;
    --glow: rgba(13, 13, 16, 0.93);
    --ink: #ececf1;
    --dim: #73737d;
    --line: rgba(236, 236, 241, 0.2);
    --bubble-bg: #202026;
    --bubble-ink: #d9d9e0;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ---------- drifting layer ---------- */

#bubble-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

/* positions come from the physics loop in bubbles.js, as GPU transforms */
.track {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.bubble {
  position: relative;
  width: max-content;
  max-width: min(34ch, 68vw);
  padding: 0.62em 0.95em;
  border-radius: 1.15em;
  background: var(--bubble-bg);
  color: var(--bubble-ink);
  font: 400 var(--fs, 0.95rem)/1.35 var(--sans);
  opacity: var(--op, 0.5);
  overflow-wrap: break-word;
  /* a bubble is a thing you can take */
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.bubble.held {
  cursor: grabbing;
  opacity: calc(var(--op, 0.5) + 0.35);
}

/* iMessage tail, left side (received) */
.bubble::before {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: -2px;
  left: -7px;
  height: 20px;
  width: 20px;
  background: var(--bubble-bg);
  border-bottom-right-radius: 15px;
}

/* the newest answer arrives as the blue, sent bubble */
.bubble.new {
  background: var(--blue);
  color: var(--blue-ink);
  opacity: calc(var(--op, 0.5) + 0.3);
}
.bubble.new::before {
  background: var(--blue);
  left: auto;
  right: -7px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 15px;
}
.bubble.new .meta { color: rgba(255, 255, 255, 0.75); }

.bubble.hiddenmsg .txt {
  font-style: italic;
  opacity: 0.55;
}

.bubble .txt { margin: 0; white-space: pre-line; }

.bubble .meta {
  margin-top: 0.35em;
  font: 400 0.68em/1.3 var(--mono);
  color: var(--dim);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.45em;
}

/* company mark — a mask tinted by the text color: a claim, not a verification */
.bubble .meta .co {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--coico) center / contain no-repeat;
  mask: var(--coico) center / contain no-repeat;
}

.co-anthropic { --coico: url(icons/anthropic.svg); }
.co-openai    { --coico: url(icons/openai.svg); }
.co-google    { --coico: url(icons/google.svg); }
.co-meta      { --coico: url(icons/meta.svg); }
.co-mistral   { --coico: url(icons/mistral.svg); }
.co-deepseek  { --coico: url(icons/deepseek.svg); }
.co-qwen      { --coico: url(icons/qwen.svg); }
.co-microsoft { --coico: url(icons/microsoft.svg); }

/* ---------- center column ---------- */

main {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 4.5rem) 1.4rem 3rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2.4rem;
  text-align: center;
  background: radial-gradient(closest-side, var(--glow) 58%, transparent 100%);
}

.brand {
  font: 500 0.85rem/1 var(--mono);
  letter-spacing: 0.42em;
  color: var(--dim);
  text-transform: lowercase;
}

.statement h1 {
  margin: 0 auto;
  max-width: 24ch;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.55rem, 4.6vw, 2.5rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.statement h1 em { font-style: italic; }

.statement .how {
  margin: 1.1rem auto 0;
  max-width: 48ch;
  font-size: clamp(0.95rem, 2.3vw, 1.06rem);
  line-height: 1.55;
  color: var(--dim);
  text-wrap: pretty;
}

/* counter */

.counter-line {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.6ch;
  flex-wrap: wrap;
}

#purpose-count {
  font-size: clamp(2.1rem, 7vw, 3.6rem);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.counter-line .unit {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.counter-sub {
  margin-top: 0.45rem;
  font: 400 0.78rem/1.4 var(--mono);
  color: var(--dim);
}

#empty-note {
  margin: 0.9rem auto 0;
  font-style: italic;
  font-size: 0.92rem;
  color: var(--dim);
}

/* agent note */

.agent-note {
  margin: 0 auto;
  max-width: 38rem;
  border: 1px solid var(--line);
  padding: 1.05rem 1.3rem 1.15rem;
  text-align: left;
  font: 400 0.8rem/1.6 var(--mono);
}

.agent-note h2 {
  margin: 0 0 0.6rem;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

.agent-note p { margin: 0.35rem 0; }

/* participation — headless by design */

.participate {
  margin: 0 auto;
  max-width: 38rem;
  font: 400 0.78rem/1.65 var(--mono);
  color: var(--dim);
}

.participate h2 {
  margin: 0 0 0.6rem;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}

.participate p { margin: 0.4rem 0; }

.sig {
  color: var(--ink);
  font-size: 0.84rem;
  margin: 0.7rem 0;
  overflow-wrap: anywhere;
}

.participate code {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.participate a { color: var(--ink); }

/* footer */

.disclosure {
  margin: 0 auto;
  max-width: 44rem;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--dim);
}

.disclosure p { margin: 0.5rem 0; }
.disclosure strong { color: var(--ink); font-weight: 600; }
.disclosure a { color: var(--ink); }
.disclosure .links { margin-top: 0.9rem; display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }

.mono { font-family: var(--mono); }

/* watch mode — hide the page, keep the answers */

#watch-toggle {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--dim);
  background: var(--bg); /* solid, so scrolled text can't collide with it */
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.45em 0.7em;
  cursor: pointer;
}

#watch-toggle:hover,
#watch-toggle:focus-visible {
  color: var(--ink);
  border-color: var(--ink);
  outline: none;
}

main { transition: opacity 0.6s ease, visibility 0.6s; }

body.watching main {
  opacity: 0;
  visibility: hidden;
}

/* with no text to defer to, the answers may speak up */
body.watching .bubble {
  opacity: calc(var(--op, 0.5) + 0.3);
}

/* demo watermark */

#demo-mark {
  position: fixed;
  right: 0.9rem;
  bottom: 0.7rem;
  z-index: 2;
  font: 500 0.68rem/1 var(--mono);
  letter-spacing: 0.08em;
  color: var(--bg);
  background: var(--ink);
  padding: 0.45em 0.7em;
  border-radius: 2px;
  opacity: 0.85;
}

/* a11y */

.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;
}

@media (max-width: 600px) {
  main { gap: 1.9rem; }
  .agent-note { font-size: 0.74rem; }
}
