/* Vyzier — minimalist philosophical interface */
:root {
  --ink: #ece9e4;
  --ink-dim: #8d8880;
  --ink-faint: #56524c;
  --ground: #0b0b0c;
  --ground-soft: #141416;
  --line: #26252a;
  --accent: #c9a227;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --measure: 34rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.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;
}

.stage {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
}

/* wordmark */
.mark {
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .42em;
  text-transform: lowercase;
  color: var(--ink-faint);
  text-align: center;
  padding-bottom: 2rem;
}

/* the question */
.ask {
  align-self: center;
  text-align: center;
  animation: rise 1.4s cubic-bezier(.16,1,.3,1) both;
}
.ask__q {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.4rem, 9vw, 3.9rem);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 1.1rem;
}
.ask__sub {
  font-size: .84rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-dim);
  margin: 0;
  max-width: 24rem;
  margin-inline: auto;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* conversation */
.thread {
  display: none;
  flex-direction: column;
  gap: 1.65rem;
  padding: 1rem 0 2rem;
  overflow-y: auto;
}
.stage--talk .ask { display: none; }
.stage--talk .thread { display: flex; }
.stage--talk { grid-template-rows: auto 1fr auto auto; }

.turn { animation: rise .7s cubic-bezier(.16,1,.3,1) both; }
.turn__who {
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: .5rem;
}
.turn__body {
  font-size: 1rem;
  line-height: 1.72;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.turn--you .turn__body {
  color: var(--ink-dim);
  border-left: 1px solid var(--line);
  padding-left: 1rem;
}
.turn--vyzier .turn__body {
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.62;
}

/* thinking indicator */
.dots { display: inline-flex; gap: .34rem; padding: .3rem 0; }
.dots i {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-faint);
  animation: pulse 1.3s ease-in-out infinite;
}
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes pulse {
  0%, 100% { opacity: .25; transform: translateY(0); }
  50%      { opacity: 1;   transform: translateY(-2px); }
}

/* composer */
.composer {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  border-bottom: 1px solid var(--line);
  padding: .55rem .2rem .7rem;
  transition: border-color .35s ease;
}
.composer:focus-within { border-color: var(--ink-faint); }
.composer__input {
  flex: 1;
  background: none;
  border: 0;
  resize: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.6;
  max-height: 9rem;
  padding: 0;
}
.composer__input::placeholder { color: var(--ink-faint); }
.composer__input:focus { outline: none; }
.composer__send {
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  padding: .2rem;
  display: grid;
  place-items: center;
  transition: color .25s ease, transform .25s ease;
}
.composer__send:hover:not(:disabled) { color: var(--accent); transform: translateX(2px); }
.composer__send:disabled { opacity: .3; cursor: default; }

.foot {
  padding-top: .85rem;
  min-height: 1.5rem;
  text-align: center;
}
.foot__status {
  font-size: .7rem;
  letter-spacing: .08em;
  color: var(--ink-faint);
}
.foot__status[data-kind="error"] { color: #b4726a; }

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