:root {
  --ink: #24221d;
  --muted: #716b61;
  --line: rgba(55, 48, 38, .14);
  --saffron: #d58a2b;
  --leaf: #5f8067;
  --paper: #fffaf0;
  --ground: #f1e7d7;
  --white: #fffef9;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(140deg, rgba(213, 138, 43, .16), transparent 38%),
    linear-gradient(320deg, rgba(95, 128, 103, .22), transparent 42%),
    var(--ground);
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.app-shell {
  width: min(1080px, 100%);
  min-height: 100vh;
  margin: auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--ink);
  font: 650 28px Georgia, serif;
  text-decoration: none;
}

.brand span {
  color: var(--saffron);
}

.install-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 254, 249, .72);
  font-size: 22px;
}

.install-button.available {
  display: block;
}

.oracle {
  align-self: center;
  text-align: center;
  padding: 28px 0 44px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #8b642f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
}

h1 {
  margin: 0;
  font: 650 clamp(48px, 8vw, 88px) Georgia, serif;
  line-height: .96;
}

.intro {
  width: min(610px, 100%);
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.install-help {
  width: min(520px, 100%);
  margin: 20px auto 0;
  border: 1px solid rgba(95, 128, 103, .22);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(255, 254, 249, .7);
  text-align: left;
}

.install-help strong {
  display: block;
  margin-bottom: 5px;
  color: var(--leaf);
  font-weight: 800;
}

.install-help p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.focus-ring {
  width: min(330px, 74vw);
  aspect-ratio: 1;
  margin: 38px auto 22px;
  border: 1px solid rgba(120, 91, 48, .18);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: rgba(255, 254, 249, .42);
  box-shadow: inset 0 0 0 18px rgba(255, 254, 249, .28), 0 26px 70px rgba(89, 70, 43, .13);
}

.halo {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  position: absolute;
  background: radial-gradient(circle at 34% 28%, #ffe3a9, #d58a2b 58%, #956321);
  box-shadow: 0 18px 42px rgba(169, 103, 32, .22);
}

.focus-ring.waiting .halo {
  animation: breathe 1.15s ease-in-out infinite alternate;
}

@keyframes breathe {
  to {
    transform: scale(.88);
    filter: brightness(1.08);
  }
}

.answer-number {
  z-index: 1;
  min-height: 92px;
  color: white;
  font: 650 78px Georgia, serif;
  text-shadow: 0 3px 18px rgba(50, 32, 12, .26);
}

.status {
  z-index: 1;
  position: absolute;
  bottom: 74px;
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.primary {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 0 28px;
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 34px rgba(36, 34, 29, .24);
  font-weight: 800;
}

.primary:disabled {
  opacity: .72;
}

.answer-panel,
.history {
  border: 1px solid rgba(255, 254, 249, .72);
  border-radius: 8px;
  background: rgba(255, 254, 249, .72);
  box-shadow: 0 18px 50px rgba(82, 65, 43, .1);
}

.answer-panel {
  width: min(700px, 100%);
  margin: 28px auto 0;
  padding: 26px;
  text-align: left;
}

.answer-meta {
  color: #8b642f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.answer-panel p {
  margin: 12px 0 0;
  font: 500 clamp(21px, 4vw, 32px) Georgia, serif;
  line-height: 1.42;
}

.history {
  align-self: center;
  padding: 22px;
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.history h2 {
  margin: 0;
  font: 650 22px Georgia, serif;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--leaf);
  font-weight: 800;
  padding: 6px 0;
}

.text-button:disabled {
  opacity: .38;
}

.history ol {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.history li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.history li:first-child {
  border-top: 0;
}

.history li button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(95, 128, 103, .24);
  border-radius: 50%;
  background: #edf3ea;
  color: #405f48;
  font-weight: 800;
}

.history p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .oracle {
    padding-top: 18px;
  }

  .history {
    width: min(700px, 100%);
    justify-self: center;
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding: 18px 14px 28px;
  }

  .intro {
    font-size: 15px;
  }

  .focus-ring {
    margin-top: 30px;
  }

  .status {
    bottom: 58px;
  }

  .answer-panel {
    padding: 22px;
  }
}
