:root {
  --bg: #f4f1ea;
  --fg: #1d1c1a;
  --muted: #77726a;
  --line: #cdc6b8;
  --accent: #b0502e;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --fg: #ece7dd;
    --muted: #958f84;
    --line: #3d3a35;
    --accent: #e07c55;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.wordmark .d {
  padding-right: 0.04em;
  color: var(--accent);
  font-style: italic;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* splash */

.splash {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.splash main {
  width: 100%;
  text-align: center;
}

.splash h1 {
  margin: 0 0 3rem;
  font-size: clamp(2.5rem, 12vw, 4.5rem);
}

#unlock {
  display: flex;
  max-width: 20rem;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#unlock:focus-within {
  border-color: var(--fg);
  box-shadow: 0 1px 0 var(--fg);
}

#unlock.error {
  border-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
  animation: shake 0.35s;
}

#unlock input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

#unlock input::placeholder {
  color: var(--muted);
  letter-spacing: 0;
}

#unlock input::selection {
  background: var(--accent);
  color: var(--bg);
}

#unlock button {
  padding: 0 0.25rem 0 0.75rem;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

#unlock button:hover,
#unlock button:focus-visible {
  color: var(--accent);
  transform: translateX(3px);
}

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

#message {
  min-height: 1.6em;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@media (prefers-reduced-motion: reduce) {
  #unlock.error {
    animation: none;
  }
}
