/* Research: one question box in the middle of the page; after a question, the box moves up and the page
   fills with the temperature bar, the answer, the references, and the 3D graph at the bottom. See README.md. */
main { display: flex; flex-direction: column; min-height: calc(100vh - 62px); padding: 0 clamp(16px, 4vw, 40px) 40px; }
main > section { width: min(820px, 100%); margin: 0 auto; }

/* the question box */
#hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 0 20px;
  transition: padding .5s; }
body.calm #hero { flex: 1; justify-content: center; padding-bottom: 16vh; }
#hero h1 { font: 400 clamp(40px, 9vw, 68px)/1.1 var(--display); letter-spacing: .3em; margin: 0 -.3em 0 0; }
#hero .tagline { margin: 10px 0 30px; color: var(--soft); font-size: 16px; }
body:not(.calm) #hero h1, body:not(.calm) #hero .tagline { display: none; }
.ask { display: flex; align-items: flex-end; gap: 8px; width: min(680px, 100%); padding: 7px 7px 7px 22px; border-radius: 28px;
  border: 1px solid rgba(120, 130, 255, .3); background: rgba(10, 12, 36, .7); backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px -30px rgba(79, 107, 255, .6); transition: border-color .3s, box-shadow .3s; }
.ask:focus-within { border-color: rgba(232, 185, 92, .6); box-shadow: 0 0 0 3px rgba(232, 185, 92, .12), 0 20px 60px -30px rgba(79, 107, 255, .6); }
.ask textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; box-shadow: none !important; padding: 9px 0;
  font-size: 16px; line-height: 1.5; max-height: 40vh; }
.ask button { width: 42px; height: 42px; padding: 0; font-size: 19px; letter-spacing: 0; flex: none; }
.under { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 14px; min-height: 24px; }

#notice { padding: 28px 30px; text-align: center; margin-top: 8vh; }
#notice p { color: var(--soft); }
#joins { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* after a question */
#result { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
#asked { font: 400 clamp(20px, 3vw, 26px)/1.35 var(--display); letter-spacing: .02em; margin: 14px 0 22px; }
#asked small { display: block; font: 300 13.5px var(--body); color: var(--soft); margin-top: 4px; }

#status { margin: 4px 0 20px; min-height: 22px; }
#status:empty { display: block; }
#status b { color: var(--text); }

/* the answer */
#answer { padding: 22px 26px; border-left: 3px solid var(--blue); transition: border-color .6s; }
#answer.final { border-left-color: var(--gold); }
#answer .tag { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
#answer .text { white-space: pre-wrap; font-size: 16.5px; line-height: 1.7; font-weight: 400; }
#answer .btn { padding: 8px 18px; font-size: 12px; }
#earlier { margin: 12px 4px 0; color: var(--soft); font-size: 14px; }
#earlier summary { cursor: pointer; }
#earlier .old { white-space: pre-wrap; border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 10px 0; }

/* the references: they arrive as they are found, and leave when the final answer does not rest on them */
.refs-head { margin: 34px 4px 12px; }
#refs { display: grid; gap: 8px; }
.ref { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: rgba(0, 0, 10, .4); cursor: pointer;
  font-size: 14px; transition: opacity .45s, transform .45s, border-color .3s, background .3s; }
.ref.new { animation: rise .5s both; }
.ref:hover { border-color: rgba(155, 140, 255, .38); }
.ref.gone { opacity: 0; transform: scale(.97); }
.ref .kind { font-size: 12px; letter-spacing: .06em; color: var(--dim); display: flex; gap: 8px; align-items: center; }
.ref .kind sup { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 6px; font-size: 11px; font-weight: 600; color: #140c00; background: var(--gold); }
.ref.cited { border-color: rgba(232, 185, 92, .3); background: rgba(232, 185, 92, .05); }
.ref.cited .kind { color: var(--soft); }
.ref .words { color: var(--soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ref.cited .words { color: var(--text); }
.ref.open .words { display: block; white-space: pre-wrap; }
.ref .words:empty { display: none; }

#graph { margin-top: 40px; width: min(1400px, calc(100vw - 2 * clamp(16px, 4vw, 40px))); position: relative; left: 50%; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { #result, .ref.new { animation: none; } }
/* From the press until the final answer the box and its button look spent (they are not: another question may be asked) */
.ask.busy { border-color: rgba(120, 130, 255, .12); }
.ask.busy textarea { color: var(--dim); }
.ask.busy button { opacity: .45; filter: saturate(.4); animation: wait 1.4s ease-in-out infinite; }
@keyframes wait { 50% { opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .ask.busy button { animation: none; } }
.mark { font: 600 11px var(--body); min-width: 18px; height: 18px; padding: 0 5px; margin: 0 2px; border-radius: 6px; border: 0; vertical-align: 2px;
  background: var(--gold); color: #1a1408; cursor: pointer; }
.mark:hover { filter: brightness(1.15); }
.ref.flash { animation: flash 1.2s; }
@keyframes flash { 0%, 40% { border-color: var(--gold); box-shadow: 0 0 18px rgba(232, 184, 85, .35); } }
