/* Shared terminal look for all cyberkef.be pages (Nord palette) */

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  --page: #d8dee9;
  --term: #2e3440;
  --term-bar: #242933;
  --row-alt: #333a47;
  --row-hover: #3b4252;
  --line: rgba(129, 161, 193, .2);
  --ink: #d8dee9;
  --dim: #7b88a1;
  --white: #eceff4;
  --green: #a3be8c;
  --yellow: #ebcb8b;
  --orange: #d08770;
  --red: #bf616a;
  --purple: #b48ead;
  --blue: #81a1c1;
  --aqua: #8fbcbb;
  --frost: #88c0d0;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --page: #1c2028; }
}
:root[data-theme="dark"] { --page: #1c2028; }

*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0;
  height: 100%;
  padding: 1rem;
  display: flex;
  justify-content: center;
  background: var(--page);
  font-family: var(--mono);
  transition: background-color .3s;
}

.term {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--term);
  color: var(--ink);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(129, 161, 193, .35), 0 1.5rem 3rem -1rem rgba(0, 0, 0, .55);
}

.bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .5rem 1rem;
  font-size: .78rem;
  color: var(--dim);
  background: var(--term-bar);
  border-bottom: 1px solid var(--line);
}

.screen {
  flex: 1;
  overflow-y: auto;
  background-image: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(255, 255, 255, .018) 2px 3px);
}

.ps1 { font-weight: 600; color: var(--green); white-space: nowrap; }
.ps1 .path { color: var(--blue); }
.ps1 .sign { color: var(--ink); }

.blink { animation: blinker 1s step-start infinite; }
@keyframes blinker { 50% { opacity: 0; } }

a { color: var(--frost); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--white); }
a:focus-visible, input:focus-visible { outline: 2px solid var(--frost); outline-offset: 2px; }

.dim { color: var(--dim); }

/* tmux-style status bar, doubles as navigation */
.status {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .2rem .8rem;
  background: var(--frost);
  color: var(--term);
  font-size: .75rem;
  font-weight: 600;
}
.status a { color: var(--term); text-decoration: none; }
.status a:hover { color: var(--term); text-decoration: underline; }
.status a:focus-visible { outline-color: var(--term); }
.status .win { margin-right: 1ch; }

.hidden { display: none; }

@media (max-width: 40rem) {
  body { padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
  body { transition: none; }
}
