:root {
  color-scheme: light;
  --paper: #f6f3ee;
  --ink: #493d35;
  --rust: #a55236;
  --muted: #776a60;
  --focus: #42634e;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  background: var(--paper);
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(24px, 4vw, 52px);
}

h1, p { margin: 0; }

h1 { font-size: 14px; font-weight: 400; letter-spacing: -0.035em; }

main { display: grid; place-items: center; padding-block: 48px; }

.agent {
  display: flex;
  align-items: center;
  gap: 0.55em;
  color: var(--rust);
  font-size: clamp(20px, 3.6vw, 36px);
  transform: translateY(-3vh);
}

.mark {
  display: block;
  width: 1.1em;
  flex: none;
  font-family: Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 1.35em;
  font-variant-emoji: text;
  line-height: 1;
  text-align: center;
}

.activity { width: 16ch; white-space: nowrap; letter-spacing: -0.045em; }
.word { display: inline-block; }
.ellipsis { margin-left: 0.06em; }

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .word {
    background: linear-gradient(90deg,
      var(--rust) 38%, #793820 50%, var(--rust) 62%);
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s steps(24, end) infinite;
  }
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

button {
  padding: 8px 0 8px 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #b9ada2;
}

button:hover { color: var(--ink); text-decoration-color: currentColor; }
button:focus-visible { outline: 2px solid var(--focus); outline-offset: 5px; }
[hidden] { display: none; }

.screen-reader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.is-paused .word { animation-play-state: paused; }

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

@media (max-width: 380px) {
  .agent { font-size: 18px; }
  footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  button { padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-enabled) .word { animation: none; }
}

@media (forced-colors: active) {
  .word { background: none; color: CanvasText; -webkit-text-fill-color: CanvasText; }
}
