/* method.log, as a terminal inside the monitor (the case, the tube and its glass are in polish.css).
   A list of entries on the left, one entry printed at a time on the right, a status line under both.
   Without the script every entry is simply printed one after another. Faces are the site's own. */

.term {
  display: flex;
  flex-direction: column;
  max-width: 1040px;
  min-height: 100%;
}

.term-top,
.term-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  font-size: 0.72em;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 214, 251, 0.72);
}

.term-top {
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(250, 189, 249, 0.4);
}

.term-top span:first-child::before {
  content: '';
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.9em;
  background: #fabdf9;
  box-shadow: 0 0 8px #ff4dea;
  animation: blink 1s steps(2) infinite;
}

.term-body {
  flex: 1;
  display: block;
}

.term-nav,
.term-cmd,
.term-foot {
  display: none;
}

.term-sec {
  margin-bottom: 26px;
}

.term-sec h3 {
  margin-top: 0;
}

/* With the script: one entry at a time. */
.term-live .term-body {
  display: grid;
  grid-template-columns: minmax(210px, 27%) minmax(0, 1fr);
  gap: clamp(20px, 4vmin, 52px);
  align-items: start;
}

.term-live .term-nav {
  display: flex;
  flex-direction: column;
  border-top: 1px dashed rgba(250, 189, 249, 0.3);
}

.term-nav button {
  display: grid;
  grid-template-columns: 2ch minmax(0, 1fr);
  gap: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.78em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: left;
  text-shadow: inherit;
  color: rgba(255, 214, 251, 0.78);
  background: none;
  border: 0;
  border-bottom: 1px dashed rgba(250, 189, 249, 0.3);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, padding 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.term-nav button:hover,
.term-nav button:focus-visible {
  padding-left: 16px;
  color: #fff;
  background: rgba(250, 189, 249, 0.14);
  outline: none;
}

/* The entry on screen: inverse video, as a selected line is. */
.term-nav button[aria-current='true'] {
  padding-left: 16px;
  color: #14061c;
  background: #fabdf9;
  text-shadow: none;
  box-shadow: 0 0 18px rgba(255, 77, 234, 0.55);
}

.term-live .term-cmd {
  display: block;
  margin: 0 0 16px;
  color: rgba(255, 214, 251, 0.72);
}

.term-live .term-sec {
  margin: 0;
}

.term-live .term-sec[hidden] {
  display: none;
}

.term-live .term-sec h3 {
  margin-bottom: 14px;
  font-size: 0.86em;
}

/* An entry prints from the top down, a few lines at a time. */
.term-sec.is-printing {
  animation: term-print 0.5s steps(9) both;
}

@keyframes term-print {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.term-live .term-foot {
  display: flex;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(250, 189, 249, 0.4);
}

.term-live .term-body {
  margin-bottom: 22px;
}

.term-bar {
  flex: 1;
  display: flex;
  gap: 4px;
}

.term-bar i {
  flex: 1;
  height: 6px;
  background: rgba(250, 189, 249, 0.2);
  transition: background 0.2s, box-shadow 0.2s;
}

.term-bar i.on {
  background: #fabdf9;
  box-shadow: 0 0 8px #ff4dea;
}

.term-at {
  font-family: 'Chakra Petch', var(--mono);
  font-weight: 900;
  font-size: 1.5em;
  letter-spacing: 0;
  color: #fff;
}

@media (max-width: 760px) {
  .term-top span:last-child,
  .term-keys {
    display: none;
  }

  .term-live .term-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  /* The list becomes a strip of numbers across the top. */
  .term-live .term-nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    border-top: 0;
    scrollbar-width: none;
  }

  .term-nav button {
    flex: none;
    display: block;
    min-width: 40px;
    padding: 10px 0;
    text-align: center;
    border: 1px solid rgba(250, 189, 249, 0.35);
  }

  .term-nav button:hover,
  .term-nav button:focus-visible,
  .term-nav button[aria-current='true'] {
    padding-left: 0;
  }

  .term-nav button span + span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .term-sec.is-printing,
  .term-top span:first-child::before {
    animation: none;
  }
}
