/* Change the look here: these few values set the whole mood of the page. */
:root {
  --paper: #f6efe4;
  --ink: #2b2420;
  --soft-ink: #7a6d62;
  --accent: #b5533c;
  --line: #d9cdbd;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 34rem;
  padding: max(3.5rem, env(safe-area-inset-top)) 1.5rem max(3rem, env(safe-area-inset-bottom));
}

.view {
  animation: rise 0.6s ease both;
}

.view[hidden] {
  display: none;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--soft-ink);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 2rem;
  font-size: 1.9rem;
  font-weight: 500;
  line-height: 1.25;
}

form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

input {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.1rem;
  border: 0;
  border-bottom: 1.5px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem; /* 16px or more stops iOS zooming in on focus */
  outline: none;
  transition: border-color 0.2s;
}

input:focus {
  border-bottom-color: var(--accent);
}

input::placeholder {
  color: var(--soft-ink);
  opacity: 0.6;
}

button {
  padding: 0.65rem 1.3rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:disabled,
input:disabled {
  opacity: 0.45;
  cursor: default;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.status {
  min-height: 1.6em;
  margin: 1.25rem 0 0;
  color: var(--accent);
  font-size: 0.95rem;
}

.shake {
  animation: shake 0.35s ease;
}

.message {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}

.hint {
  margin: 2.5rem 0 0;
  color: var(--soft-ink);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  opacity: 0.7;
  transition: opacity 0.6s;
}

.hint.gone {
  opacity: 0;
}

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

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .view,
  .shake,
  .cursor {
    animation: none;
  }
}
