:root {
  color-scheme: dark;
  color: #d2dfd1;
  background: #000;
  font-family: "Cascadia Code", "Consolas", "Courier New", "Microsoft YaHei", "Segoe UI Symbol", monospace;
  font-size: clamp(13px, 1.1vw, 18px);
  line-height: 1.5;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #000; }
body { min-height: 100vh; min-height: 100svh; }
[hidden] { display: none !important; }

.terminal {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  height: 100vh;
  height: 100svh;
  padding: clamp(16px, 3vw, 48px);
  overflow: hidden;
  background: transparent;
}

button, a, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 1px solid #aebfac;
  outline-offset: 3px;
}
.terminal-command {
  flex-shrink: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  line-height: inherit;
}
.cursor {
  display: inline-block;
  width: .58em;
  height: 1em;
  margin-left: .3ch;
  vertical-align: -.12em;
  background: currentColor;
  animation: cursor-blink 1s steps(1, end) infinite;
}
@keyframes cursor-blink { 50% { opacity: 0; } }
.terminal:not([data-state="home"]) #open-menu .cursor { visibility: hidden; }

.view-port {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #374037 #000;
}
.terminal[data-state="intro"] .view-port,
.terminal[data-state="transition"] .view-port { overflow: hidden; }

.execution {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: #a7b6a7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  tab-size: 4;
  font-variant-ligatures: none;
}
.corrupt-glyph { display: inline-block; width: 1ch; text-align: center; }
.corrupt-glyph.is-wide { width: 2ch; }
.corrupt-warning { color: #e1b34e; }
.corrupt-error { color: #f07167; }
.corrupt-highlight-red { color: #000; background: #ff0000; box-shadow: 0 0 .35em #ff000066; }
.corrupt-highlight-green { color: #000; background: #00ff00; box-shadow: 0 0 .35em #00ff0066; }
.corrupt-highlight-yellow { color: #000; background: #ffff00; box-shadow: 0 0 .35em #ffff0066; }
.screen-tear { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; }
.navigation { width: max-content; max-width: 100%; }
.code-punctuation { color: #899b8a; }
.navigation ul {
  display: block;
  margin: 0;
  padding: 0 0 0 2ch;
  list-style: none;
}
.navigation a {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 2.4em;
  text-decoration: none;
  white-space: pre;
}
.navigation a:hover,
.navigation a:focus-visible { color: #f0faeb; text-decoration: underline; text-underline-offset: .3em; }
.section-view { width: 100%; max-width: 80ch; padding-inline-start: 4ch; }
.section-view h1 { margin: 0; font: inherit; }
.inline-command { text-decoration: underline; text-underline-offset: .2em; }
.inline-command:hover { color: #f0faeb; }

.home-records, .about-records {
  max-width: 100%;
  margin: 1.5em 0 0;
  color: #a7b6a7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  tab-size: 4;
}

.contact-form { width: 100%; max-width: 60ch; margin-top: 1.5em; }
.message-field { position: relative; width: 100%; }
.message-field textarea, .message-mirror {
  display: block; width: 100%; height: 12em; margin: 0; padding: .6em;
  border: 1px solid #374037; border-radius: 0; background: #000;
  font: inherit; font-variant-ligatures: none; line-height: inherit;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
  overflow: auto; scrollbar-width: none;
}
.message-field textarea { resize: none; caret-color: #d2dfd1; }
.message-field textarea::-webkit-scrollbar,
.message-mirror::-webkit-scrollbar { display: none; }
.message-mirror { display: none; position: absolute; inset: 0; pointer-events: none; border-color: transparent; background: transparent; }
.mirror-enabled textarea { color: transparent; }
.mirror-enabled .message-mirror { display: block; }
.send-command { display: block; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; }
.send-command:hover { text-decoration: underline; text-underline-offset: .3em; }
.send-command:disabled { opacity: .5; cursor: wait; }
.contact-result { margin: 0; min-height: 1.5em; color: #899b8a; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
  .screen-tear { display: none; }
}
