/*
 * Tri-Solaris historical author terminal (Books only)
 * Independent of the global site design.
 */
.author-archive-terminal {
  position: relative;
  isolation: isolate;
  min-width: 0;
  overflow: hidden;
  border: 2px solid rgba(249, 251, 255, .94);
  border-radius: 12px;
  /* Colors sampled from Ren's 2163 holographic GUI ring. */
  --author-holo-dark: #0a1c23;
  --author-holo-base: #15323d;
  --author-holo-panel: #225a6e;
  --author-holo-cyan: #53abbd;
  --author-holo-glow: #8bdae5;
  --author-holo-gold: #f4cb7d;
  --author-holo-gold-bright: #ffe6aa;
  background: var(--author-holo-base);
  box-shadow:
    0 0 0 1px rgba(139, 218, 229, .22) inset,
    0 16px 42px rgba(0, 0, 0, .36),
    0 0 18px rgba(83, 171, 189, .26),
    0 0 48px rgba(83, 171, 189, .12);
  /* Temporal fluctuations are triggered only while the terminal is visible. */
}

/* A static glass-edge bloom for the translucency of Ren's GUI ring. */
.author-archive-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg,
      rgba(139, 218, 229, .14) 0%,
      transparent 5%,
      transparent 95%,
      rgba(139, 218, 229, .12) 100%),
    linear-gradient(180deg,
      rgba(139, 218, 229, .10) 0%,
      transparent 8%,
      transparent 92%,
      rgba(139, 218, 229, .08) 100%);
  box-shadow: inset 0 0 16px rgba(83, 171, 189, .12);
}

/* No additional scan texture: the moving cyan trace is the only line. */

.author-terminal-chrome,
.author-terminal-chronometer,
.author-terminal-controls,
.author-terminal-bottomline {
  position: relative;
  z-index: 1;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.author-terminal-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(139, 218, 229, .46);
  background: linear-gradient(100deg, #225a6e 0%, #277287 53%, #234a59 100%);
  box-shadow: inset 0 -1px 0 rgba(139, 218, 229, .16), 0 2px 14px rgba(83, 171, 189, .12);
  color: #f3f6fc;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .055em;
}

.author-terminal-chrome-title { min-width: 0; }
.author-terminal-glyph { color: var(--author-holo-gold-bright); padding-right: 7px; text-shadow: 0 0 8px rgba(255, 214, 137, .75), 0 0 20px rgba(240, 170, 74, .36); }
.author-terminal-chrome-code {
  flex: 0 0 auto;
  color: var(--author-holo-gold-bright);
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(241, 191, 103, .38);
}

/* Same Gaia date/time engine as the Central Hub, outside the reader viewport.
   The clock never takes part in typing, scanning, or reader scroll position. */
.author-terminal-chronometer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 7px 16px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(139, 218, 229, .24);
  background: linear-gradient(90deg, rgba(10, 28, 35, .96), rgba(21, 50, 61, .97));
  color: #d1e2e9;
  font: 600 10px/1.5 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .055em;
}
.author-terminal-clock-date {
  min-width: 0;
  color: var(--author-holo-gold-bright);
  font: inherit;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(242, 188, 94, .36);
}
.author-terminal-clock-time {
  color: #a5edfa;
  font: inherit;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 9px rgba(139, 218, 229, .20);
}
.author-terminal-clock-zone {
  color: #c1b58e;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
}

.author-terminal-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 18px;
  border-bottom: 1px solid rgba(139, 218, 229, .22);
  background: rgba(21, 50, 61, .97);
}

.author-terminal-controls[hidden],
.author-terminal-prompt[hidden],
.author-terminal-system-output[hidden],
.author-terminal-system-line[hidden],
.author-terminal-connection-step[hidden],
.author-archive-terminal .tri-archive-record[hidden],
.author-archive-terminal .author-story-heading[hidden],
.author-archive-terminal .tri-archive-record-end[hidden],
.author-terminal-actions button[hidden] { display: none !important; }

.author-terminal-status {
  color: #d7e7ef;
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: .015em;
}

.author-terminal-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.author-terminal-actions button {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 10px;
  border: 1px solid rgba(139, 218, 229, .55);
  border-radius: 5px;
  background: rgba(83, 171, 189, .11);
  color: #f0e4c9;
  font: 500 10px/1.5 "JetBrains Mono", Consolas, monospace;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.author-terminal-actions button:hover {
  background: rgba(139, 218, 229, .20);
  border-color: #e9faff;
}
.author-terminal-actions button:focus-visible,
.author-terminal-screen:focus-visible {
  outline: 2px solid #ffe0a2;
  outline-offset: -3px;
}

/* The background and waveform stay stationary while the reader scrolls. */
.author-terminal-screen-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 77% 13%, rgba(139, 218, 229, .16), transparent 57%),
    radial-gradient(ellipse at 0% 83%, rgba(83, 171, 189, .10), transparent 53%),
    linear-gradient(155deg, #1a4c5d 0%, #153b49 35%, #15323d 68%, #0a1c23 100%);
  box-shadow: inset 0 0 52px rgba(4, 15, 23, .23),
              inset 0 0 18px rgba(83, 171, 189, .08);
}
.author-terminal-wave {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  /* One faint scanning trace behind the reading surface, never an overlay. */
  opacity: .44;
  filter: blur(.35px);
}
.author-terminal-screen {
  position: relative;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  /* Keep the reader scrollable, but leave room for the terminal chrome,
     fixed site bars and its bottom edge in short desktop viewports. */
  height: clamp(260px, calc(100vh - 400px), 560px);
  height: clamp(260px, calc(100dvh - 400px), 560px);
  max-height: none;
  min-height: 0;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
  padding: clamp(20px, 3.5vw, 31px);
  /* Translucent reading glass mutes the trace beneath every letter. */
  background: rgba(10, 29, 39, .30);
  scrollbar-width: thin;
  scrollbar-color: #53abbd #0a1c23;
}
.author-terminal-screen::-webkit-scrollbar { width: 9px; }
.author-terminal-screen::-webkit-scrollbar-track { background: #0a1c23; }
.author-terminal-screen::-webkit-scrollbar-thumb {
  border: 2px solid #0a1c23;
  border-radius: 9px;
  background: #53abbd;
}

/* The fictionally simulated link is displayed before the historical record.
   Commands are typed, their bracketed responses appear in order, and only
   after [ARCHIVDATEI: GELADEN] does the archived biography become visible. */
.author-terminal-connection {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0 0 24px;
  padding-bottom: 21px;
  border-bottom: 1px solid rgba(213, 176, 100, .28);
  font: 500 clamp(11px, 1.24vw, 12px)/1.75 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .012em;
}
.author-terminal-connection-step {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.author-terminal-connection-command {
  margin: 5px 0 2px;
  padding: 4px 0 3px;
  color: #e9d5ad;
}
.author-terminal-connection-shell {
  color: #ffdc9e;
  font-weight: 700;
  text-shadow: 0 0 9px rgba(247, 189, 94, .31);
}
.author-terminal-connection-typed {
  color: #b8e6ef;
  text-shadow: 0 0 7px rgba(139, 218, 229, .16);
}
.author-terminal-connection-status {
  color: #c7dce0;
  text-shadow: 0 0 7px rgba(139, 218, 229, .10);
}
.author-terminal-connection-ok {
  color: #a7e9ce;
  text-shadow: 0 0 9px rgba(118, 218, 182, .19);
}
.author-terminal-connection-ready {
  color: var(--author-holo-gold-bright);
  font-weight: 700;
  text-shadow: 0 0 11px rgba(247, 190, 99, .45);
}

/* Integrate the existing fictional archive heading rather than stacking cards. */
.author-archive-terminal .tri-archive-record {
  margin: 0 0 25px;
  padding: 0 0 24px;
  border: 0;
  border-bottom: 1px solid rgba(236, 240, 248, .19);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.author-archive-terminal .tri-archive-record-note {
  color: #d4c9b5;
  font-size: 11px;
  line-height: 1.85;
}
.author-archive-terminal .tri-archive-record-metadata dd { color: #e7e3dc; }
.author-archive-terminal .tri-archive-record-mark {
  color: var(--author-holo-gold-bright);
  border-color: rgba(246, 190, 94, .52);
  background: rgba(240, 180, 85, .08);
  box-shadow: 0 0 16px rgba(246, 192, 100, .18), inset 0 0 12px rgba(246, 192, 100, .10);
  text-shadow: 0 0 10px rgba(246, 192, 100, .60);
}
.author-archive-terminal .tri-archive-record-overline {
  color: var(--author-holo-gold);
  text-shadow: 0 0 9px rgba(249, 207, 123, .40);
}
.author-archive-terminal .tri-archive-record-source strong {
  color: #ffebbc;
  text-shadow: 0 0 10px rgba(246, 197, 107, .30);
}
.author-archive-terminal .tri-archive-record-metadata dt { color: #d2b780; }
.author-archive-terminal .tri-archive-record-note strong {
  color: var(--author-holo-gold-bright);
  text-shadow: 0 0 10px rgba(246, 193, 93, .45);
}
.author-archive-terminal .author-story-heading {
  margin: 0 0 25px;
  padding-left: 16px;
  border-left: 2px solid rgba(255, 205, 111, .79);
}
.author-archive-terminal .author-story-heading .section-title {
  margin: 0 0 10px;
  color: var(--author-holo-gold-bright);
  font-size: clamp(22px, 2.5vw, 31px);
  line-height: 1.45;
  text-shadow: 0 0 8px rgba(255, 204, 110, .62), 0 0 25px rgba(244, 174, 74, .34);
}
.author-archive-terminal .author-story-heading .section-title::after {
  content: "";
  display: block;
  width: min(240px, 75%);
  height: 2px;
  margin-top: 11px;
  background: linear-gradient(90deg, #ffd78e 0%, rgba(247, 192, 101, .65) 42%, transparent 100%);
  box-shadow: 0 0 12px rgba(247, 191, 87, .57);
}
.author-archive-terminal .author-story-role { color: #ead39f; }

/* Goldene Kapitelmarkierungen sind echte h3 innerhalb des Transkripts.
   Der vorhandene Text-Node-Writer tippt sie ohne zusaetzliche JavaScript-Logik. */
.author-archive-terminal .author-terminal-transcript .author-terminal-chapter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 13px;
  min-width: 0;
  margin: 39px 0 19px;
  padding: 12px 14px 13px 16px;
  border: 0;
  border-left: 3px solid rgba(255, 205, 116, .91);
  border-bottom: 1px solid rgba(246, 189, 96, .30);
  border-radius: 0 6px 6px 0;
  background: linear-gradient(100deg, rgba(243, 179, 74, .13) 0%, rgba(243, 179, 74, .045) 58%, transparent 100%);
  box-shadow: inset 8px 0 16px -14px rgba(253, 198, 101, .65), 0 4px 17px -14px rgba(255, 194, 91, .50);
  color: #ffe7b2;
  font: 700 clamp(15px, 1.7vw, 19px)/1.52 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .025em;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(255, 204, 112, .67), 0 0 25px rgba(244, 173, 73, .28);
}
.author-archive-terminal .author-terminal-transcript .author-terminal-chapter:first-child { margin-top: 2px; }
.author-archive-terminal .author-terminal-chapter-index {
  flex: 0 0 auto;
  color: #dcb678;
  font: 600 9px/1.5 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .12em;
  text-shadow: 0 0 8px rgba(245, 193, 110, .25);
}
.author-archive-terminal .author-terminal-chapter-title {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: break-word;
}

.author-archive-terminal .author-terminal-transcript p {
  max-width: 78ch;
  margin: 0 0 23px;
  color: #d9bd85;
  font: 400 clamp(14px, 1.33vw, 16px)/1.92 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .005em;
  text-align: left;
  text-wrap: pretty;
  hyphens: auto;
  overflow-wrap: break-word;
  text-shadow: 0 0 6px rgba(228, 193, 128, .19), 0 0 15px rgba(228, 193, 128, .07);
}
.author-archive-terminal .author-terminal-transcript p strong {
  color: #ffdf9d;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(247, 196, 99, .33);
}
.author-archive-terminal .author-terminal-transcript p em { color: #e8cb94; }
.author-archive-terminal .author-terminal-transcript .author-story-opening {
  margin-bottom: 29px;
  color: #e8ce99;
  font-size: clamp(15px, 1.48vw, 17px);
  font-weight: 500;
  line-height: 1.85;
}
.author-archive-terminal .author-terminal-transcript .author-story-conclusion {
  margin: 35px 0 20px;
  padding: 17px 17px 16px;
  border-left: 3px solid rgba(255, 205, 117, .86);
  background: linear-gradient(90deg, rgba(247, 187, 89, .08), rgba(247, 187, 89, .012) 85%);
  box-shadow: inset 8px 0 16px -16px rgba(254, 208, 125, .9);
  color: #f2d69e;
  font-size: clamp(15px, 1.48vw, 17px);
  line-height: 1.85;
}


/* Reconstructed biography and first-person archivist marginalia are distinct
   archival layers. Both are streamed by the existing progressive text reader. */
.author-archive-terminal .author-terminal-transcript .author-archivist-note {
  margin: 8px 0 30px;
  padding: 13px 16px 15px;
  border-left: 2px solid rgba(139, 218, 229, .66);
  border-top: 1px solid rgba(139, 218, 229, .18);
  background: linear-gradient(105deg, rgba(35, 90, 110, .28), rgba(10, 34, 44, .13));
  box-shadow: inset 3px 0 15px rgba(83, 171, 189, .065);
}
.author-archive-terminal .author-archivist-note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px 14px;
  margin: 0 0 10px;
  font: 600 10px/1.6 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .07em;
}
.author-archive-terminal .author-archivist-note-label {
  color: #a0e1eb;
  text-shadow: 0 0 8px rgba(83, 171, 189, .22);
}
.author-archive-terminal .author-archivist-note-kind {
  color: #bdd4dd;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: .025em;
}
.author-archive-terminal .author-terminal-transcript .author-archivist-note p {
  max-width: none;
  margin: 0;
  color: #d1e1e3;
  font: 400 clamp(13px, 1.2vw, 14px)/1.78 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .002em;
  text-shadow: 0 0 6px rgba(139, 218, 229, .07);
}
.author-archive-terminal .author-terminal-transcript .author-archivist-note p strong {
  color: #c6f3f8;
  text-shadow: 0 0 9px rgba(139, 218, 229, .24);
}

/* Readers must be able to select and copy the historical text. */
.author-archive-terminal .author-terminal-transcript,
.author-archive-terminal .author-terminal-transcript * {
  -webkit-user-select: text;
  user-select: text;
}
.author-archive-terminal .author-terminal-transcript ::selection {
  background: rgba(228, 195, 127, .85);
  color: #0a1a30;
}

.author-archive-terminal .tri-archive-record-end {
  margin-top: 29px;
  padding-top: 16px;
  border-top: 1px solid rgba(241, 245, 251, .19);
  color: #c6c9ce;
}
.author-archive-terminal .tri-archive-record-end span:first-child { color: #e3c487; }

/* STU book notation: bracketed archive system responses after the report. */
.author-terminal-system-output {
  display: grid;
  gap: 5px;
  min-width: 0;
  margin: 22px 0 15px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(212, 173, 99, .32);
  font: 500 clamp(10px, 1.25vw, 12px)/1.8 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .03em;
}
.author-terminal-system-line {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #d9e7df;
  text-shadow: 0 0 7px rgba(139, 218, 229, .17);
}
.author-terminal-system-line-highlight {
  color: #ffe5a9;
  text-shadow: 0 0 9px rgba(246, 197, 101, .42), 0 0 19px rgba(244, 173, 73, .17);
}
.author-terminal-system-line-nominal {
  color: #a8e7cd;
  text-shadow: 0 0 9px rgba(114, 216, 179, .28);
}

/* Terminal is an archive reader, not an editable shell. */
.author-terminal-prompt {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 9px;
  min-width: 0;
  margin-top: 17px;
  color: #f1dba6;
  font: 600 clamp(11px, 1.45vw, 14px)/1.7 "JetBrains Mono", Consolas, monospace;
  letter-spacing: .005em;
  text-shadow: 0 0 10px rgba(230, 195, 126, .27);
}
.author-terminal-prompt-text {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.author-terminal-prompt-user { color: #f6dba3; }
.author-terminal-prompt-host { color: #b7eaf0; }
.author-terminal-prompt-path { color: #e0c48f; }
.author-terminal-prompt-sigil { color: #ffe5aa; text-shadow: 0 0 10px rgba(253, 194, 99, .50); }
.author-terminal-cursor {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 1.1em;
  vertical-align: text-bottom;
  border-radius: 1px;
  background: #eedbaa;
  box-shadow: 0 0 9px rgba(238, 219, 170, .35);
  animation: author-terminal-cursor-blink 1.1s steps(1, end) infinite;
}

.author-terminal-bottomline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px 15px;
  padding: 10px 18px;
  border-top: 1px solid rgba(139, 218, 229, .32);
  background: #15323d;
  color: #c5d9e2;
  font-size: 9px;
  line-height: 1.6;
  letter-spacing: .02em;
}

/* Noticeable but brief, infrequent temporal distortion.
   No position changes, no strobe loop, no interference with reading. */
.author-archive-terminal.is-fluctuating {
  animation: author-terminal-time-fluctuation 620ms ease-in-out 1 both;
}
@keyframes author-terminal-time-fluctuation {
  0%, 100% { filter: brightness(1) saturate(1); }
  23% { filter: brightness(.86) saturate(.94); }
  43% { filter: brightness(1.13) saturate(1.08); }
  66% { filter: brightness(.94) saturate(.98); }
  81% { filter: brightness(1.07) saturate(1.04); }
}
@keyframes author-terminal-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@media (max-width: 620px) {
  .author-terminal-chrome { padding: 10px 12px; font-size: 9px; }
  .author-terminal-chrome-code { font-size: 9px; }
  .author-terminal-chronometer {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 10px;
    padding: 9px 12px;
    font-size: 9px;
  }
  .author-terminal-clock-zone {
    grid-column: 1 / -1;
    justify-self: end;
    font-size: 8px;
  }
  .author-terminal-controls { align-items: stretch; flex-direction: column; gap: 9px; padding: 9px 12px; }
  .author-terminal-actions button { padding: 5px 9px; }
  /* Compact and independent from the growing transmitted text. */
  .author-terminal-screen { height: clamp(240px, 44vh, 360px); height: clamp(240px, 44dvh, 360px); padding: 16px 12px; }
  .author-terminal-wave { opacity: .36; }
  .author-terminal-connection { font-size: 10px; gap: 6px; margin-bottom: 17px; padding-bottom: 16px; }
  .author-terminal-connection-command { font-size: 10px; }
  .author-archive-terminal .author-story-heading { padding-left: 12px; }
  .author-archive-terminal .author-story-heading .section-title { font-size: clamp(20px, 5vw, 25px); }
  .author-archive-terminal .author-terminal-transcript .author-terminal-chapter {
    margin: 30px 0 17px;
    padding: 10px 9px 11px 12px;
    gap: 3px 9px;
    font-size: clamp(14px, 3.8vw, 17px);
    line-height: 1.5;
  }
  .author-archive-terminal .author-terminal-chapter-title { flex-basis: 180px; }
  .author-terminal-bottomline { padding: 8px 12px; font-size: 8px; }
  .author-terminal-system-output { margin-top: 17px; font-size: 10px; letter-spacing: 0; line-height: 1.7; }
  .author-terminal-prompt { font-size: clamp(10px, 2.8vw, 13px); gap: 6px; }
  .author-archive-terminal .author-terminal-transcript p { line-height: 1.85; }
  .author-archive-terminal .author-terminal-transcript .author-archivist-note { padding: 11px 12px 13px; margin-bottom: 25px; }
  .author-archive-terminal .author-archivist-note-meta { gap: 2px 8px; }
  .author-archive-terminal .author-terminal-transcript .author-archivist-note p { font-size: 13px; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  .author-archive-terminal,
  .author-archive-terminal.is-fluctuating,
  .author-terminal-cursor { animation: none !important; filter: none !important; }
  .author-terminal-wave { display: none; }
  .author-terminal-cursor { opacity: 1; }
  .author-terminal-actions button { transition: none; }
}
