:root {
  --bone: #f4eee4;
  --mute: rgba(244, 238, 228, 0.55);
  --copper: #d3894a;
  --ink: #07080b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--bone);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

#timer {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 20;
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--mute);
}

#timer[hidden] { display: none !important; }

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  padding: 1.5rem;
}

.panel {
  display: none;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 22rem;
}

.view-home #home,
.view-checking #checking,
.view-sure #sure,
.view-input #input,
.view-why #why,
.view-talk #talk,
.view-venn #venn,
.view-ux-venn #ux-venn {
  display: -webkit-flex;
  display: flex;
}

#app.view-sure.is-hint {
  -webkit-align-items: stretch;
  align-items: stretch;
  padding: 0.75rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}

.view-sure.is-hint #sure {
  max-width: none;
  width: 100%;
  min-height: 100%;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
  gap: 0.75rem;
}

.hint-doc {
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  width: 100%;
  min-height: 60vh;
  height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #0a0a0a;
  color: #e6e0d4;
}

.hint-doc::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.hint-doc[hidden] { display: none !important; }

#spaghetti-doc {
  -webkit-filter: invert(1);
  filter: invert(1);
}

.si {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.6rem 1.25rem 2.5rem;
  font-family: Palatino, "Palatino Linotype", "Book Antiqua", Georgia, serif;
}

.si-rule {
  height: 1px;
  background: #4a1618;
  border: 0;
}

.si-rule-short {
  width: 7.5rem;
  margin: 0.85rem auto 1.1rem;
}

.si-rule-mid {
  width: 8.5rem;
  margin: 1.75rem auto;
}

.si-title {
  margin: 1.6rem 0 0;
  text-align: center;
  font-weight: 500;
  font-size: 1.85rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f3eee4;
}

.si-kicker {
  margin: 0 0 0.45rem;
  text-align: center;
  letter-spacing: 0.14em;
  font-size: 0.95rem;
  color: #d8d0c4;
}

.si-meta {
  margin: 0 0 1.6rem;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: #b7afa3;
}

.si-p {
  margin: 0 0 0.95rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: #e6e0d4;
}

.si-quote {
  margin: 1.4rem 0 1.6rem;
  text-align: center;
  font-style: italic;
  color: #b8943f;
  font-size: 1.02rem;
  line-height: 1.5;
}

.si-h {
  margin: 1.7rem 0 0.7rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #2a2a2a;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a2226;
}

.si-sh {
  margin: 1.05rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #b8943f;
}

.si-list {
  margin: 0 0 0.95rem;
  padding: 0 0 0 1.15rem;
  font-size: 0.98rem;
  line-height: 1.5;
  color: #e6e0d4;
}

.si-list li { margin: 0 0 0.35rem; }

.si-end { margin-bottom: 1.6rem; }

#doc-back,
#doc-next {
  display: block;
  margin: 1.4rem auto 0.4rem;
}

button {
  -webkit-appearance: none;
  appearance: none;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(211, 137, 74, 0.25);
}

#check,
#yes,
#no {
  border: 1px solid var(--copper);
  background: transparent;
  color: var(--bone);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  min-height: 48px;
  min-width: 7.5rem;
  padding: 0.9rem 1.4rem;
  border-radius: 999px;
}

#check { min-width: 12rem; text-transform: lowercase; }
#check:active,
#yes:active,
#no:active { background: rgba(211, 137, 74, 0.12); }

.yn {
  display: -webkit-flex;
  display: flex;
  gap: 0.75rem;
}

.yn[hidden] { display: none !important; }

#back,
#hint,
#doc-back,
#doc-next {
  border: 0;
  background: none;
  color: var(--mute);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  min-height: 44px;
  padding: 0.75rem 1rem;
}

#hint[hidden] { display: none !important; }

#hint {
  -webkit-animation: hint-in 0.8s ease;
  animation: hint-in 0.8s ease;
}

.q {
  margin: 0;
  color: var(--bone);
  letter-spacing: 0.06em;
  font-size: 1.15rem;
}

.q[hidden] { display: none !important; }

#checking p {
  margin: 0;
  color: var(--mute);
  letter-spacing: 0.12em;
  text-transform: lowercase;
  font-size: 0.95rem;
}

.field {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  max-width: 18rem;
  font: inherit;
  font-size: 1rem;
  color: var(--bone);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(244, 238, 228, 0.28);
  padding: 0.65rem 0.15rem;
  border-radius: 0;
}

.field:focus {
  outline: none;
  border-bottom-color: var(--copper);
}

.field[hidden] { display: none !important; }

.ask {
  width: 100%;
  max-width: 18rem;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-align-items: center;
  align-items: center;
}

.ask[hidden] { display: none !important; }

.spinner {
  width: 2.25rem;
  height: 2.25rem;
  border: 2px solid rgba(244, 238, 228, 0.18);
  border-top-color: var(--copper);
  border-radius: 50%;
  -webkit-animation: spin 0.8s linear infinite;
  animation: spin 0.8s linear infinite;
}

.thread {
  width: 100%;
  max-width: 18rem;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 0.65rem;
}

.thread p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.thread .you { color: var(--bone); }
.thread .bot { color: var(--mute); }

.thread .bot .tok {
  opacity: 0;
  -webkit-animation: tok-in 0.32s ease forwards;
  animation: tok-in 0.32s ease forwards;
}

.is-busy .field { opacity: 0.55; }

.venn {
  width: 13rem;
  height: auto;
  color: var(--copper);
}

.view-ux-venn #app,
#app.view-ux-venn {
  padding: 0;
}

.view-ux-venn #ux-venn {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  gap: 0;
}

.ux-venn {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

@-webkit-keyframes spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes hint-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes hint-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@-webkit-keyframes tok-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tok-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .spinner,
  #hint,
  .thread .bot .tok {
    -webkit-animation: none;
    animation: none;
  }
  .thread .bot .tok { opacity: 1; }
}
