/* The personal terminal is deliberately self contained. */
@font-face {
  font-family: "VT323";
  src: url('/fonts/VT323-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
.hero:has(.profile-terminal) {
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  gap: 0;
  min-height: 0;
  padding-block: 36px 48px;
}
#profile-terminal, #about { scroll-margin-top: 28px; }
@media (max-width: 480px) {
  .hero:has(.profile-terminal) { padding-block: 18px 32px; }
}
.profile-terminal {
  --crt-phosphor: #a6ffc4;
  --crt-secondary: #abd5b8;
  --crt-line: #315f43;
  --crt-screen: #04140a;
  --crt-glow: #62ff9f1a;
  --crt-type: "VT323", var(--mono);
  position: relative;
  width: 100%;
  max-width: 800px;
  min-width: 0;
  margin: 0 auto;
  padding: 21px 21px 15px;
  isolation: isolate;
  border: 1px solid #555b50;
  border-bottom-color: #181d18;
  border-radius: 30px 30px 34px 34px;
  background: linear-gradient(160deg, #41463c 0%, #2b3029 40%, #20251f 100%);
  box-shadow: inset 0 2px 0 #b4bca22e, inset 3px 0 8px #bbc3ad0d,
    inset -3px -5px 8px #030704a6, 0 5px 0 #151a15,
    0 28px 48px -12px #0009, 0 0 80px #62ff9f08;
  font-family: var(--mono);
  color: var(--crt-phosphor);
}
.profile-terminal::before,
.profile-terminal::after {
  content: "";
  position: absolute;
  bottom: -9px;
  width: 34px;
  height: 9px;
  z-index: -1;
  border-radius: 0 0 4px 4px;
  background: #121b15;
  box-shadow: 0 2px 1px #0006;
}
.profile-terminal::before { left: 32px; }
.profile-terminal::after { right: 32px; }
.profile-terminal .terminal-case-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 7px 12px;
  color: #c1c9b4;
  font-size: 9px;
  letter-spacing: .12em;
  line-height: 1.4;
}
.profile-terminal .terminal-case-title { margin: 0; font-weight: 600; font-size: 11px; letter-spacing: .07em; }
.profile-terminal .terminal-model { color: #aab69e; white-space: nowrap; }
.profile-terminal .terminal-bezel {
  position: relative;
  padding: 9px;
  border: 1px solid #152117;
  border-radius: 26px / 30px;
  background: linear-gradient(135deg, #0c120e, #42473b 90%);
  box-shadow: 0 1px 0 #6a795150, inset 1px 3px 7px #0009;
}
.profile-terminal .terminal-screen {
  position: relative;
  overflow: hidden;
  padding: 24px 25px 22px;
  border: 1px solid #4e785875;
  border-radius: 22px / 27px;
  background: radial-gradient(ellipse at 50% 42%, #0b2d18 0%, var(--crt-screen) 64%, #010703 100%);
  box-shadow: inset 0 0 26px 4px #0005, 0 0 16px #62ff9f0d;
  text-shadow: 0 0 5px var(--crt-glow);
  transform-origin: center;
}
.profile-terminal .terminal-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  border-radius: inherit;
  background: radial-gradient(ellipse at 20% 6%, #dcffe212, transparent 46%),
    radial-gradient(ellipse at center, transparent 62%, #0005 100%);
}
.profile-terminal .terminal-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  border-radius: inherit;
  background-image: linear-gradient(transparent, #82ffb008 48%, transparent),
    repeating-linear-gradient(to bottom, transparent 0 2px, #0004 2px 3px, transparent 3px 4px);
  background-size: 100% 160px, 100% 4px;
  background-repeat: no-repeat, repeat;
  background-position: 0 -160px, 0 0;
  opacity: .22;
  animation: terminal-scan 14s linear infinite;
}
.profile-terminal .terminal-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-height: 57px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--crt-line);
}
.profile-terminal .terminal-reveal {
  min-height: 44px;
  padding: 8px 0 8px 6px;
  border: 0;
  background: transparent;
  color: var(--crt-phosphor);
  font: 11px/1.4 var(--mono);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.profile-terminal .terminal-answer-text.is-typing::after {
  content: '';
  display: inline-block;
  width: .4em;
  height: .8em;
  margin-left: .1em;
  vertical-align: -.05em;
  background: currentColor;
  box-shadow: 0 0 6px var(--crt-glow);
  animation: terminal-cursor .9s steps(1) infinite;
}
.profile-terminal .terminal-session {
  margin: 0;
  color: var(--crt-phosphor);
  font: 400 20px/1.2 var(--crt-type);
  letter-spacing: .02em;
}
.profile-terminal .terminal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--crt-secondary);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: .04em;
  white-space: nowrap;
}
.profile-terminal .terminal-status::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #b9efab;
  box-shadow: 0 0 6px #9cd88250;
}
.profile-terminal .terminal-output {
  position: relative;
  height: 380px;
  margin: 15px 0 13px;
}
.profile-terminal .terminal-transcript,
.profile-terminal .terminal-boot {
  height: 100%;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #53704a #0b190e;
  padding: 1px 6px 3px 0;
  color: var(--crt-phosphor);
  font: 21px/1.35 var(--crt-type);
  text-shadow: 0 0 5px var(--crt-glow);
}
.home-page .profile-terminal[data-conversation="welcome"] .terminal-clear { display: none; }
.home-page #terminal-chat-panel { position: relative; display: flow-root; }
.home-page .profile-terminal .terminal-screen { padding-bottom: 12px; }
.home-page .profile-terminal .terminal-output { margin-bottom: 4px; }
.home-page .profile-terminal .terminal-conversation-tools { align-items: flex-start; gap: 16px; }
.home-page .profile-terminal .terminal-clear { flex: 0 0 auto; }
.profile-terminal .terminal-transcript p { margin: 0 0 12px; }
.profile-terminal .terminal-transcript p:last-child { margin-bottom: 0; }
.profile-terminal .terminal-user-message { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-terminal .terminal-transcript .terminal-welcome-title {
  margin-bottom: 14px;
  color: #a7ffc8;
  font: 400 clamp(27px, 3.2vw, 34px)/1.1 var(--crt-type);
  letter-spacing: -.025em;
}
.profile-terminal .terminal-welcome-title span { display: inline-block; }
.profile-terminal .terminal-transcript .terminal-welcome-visual { display: contents; }
.profile-terminal .terminal-transcript a {
  color: #d6f6c6;
  text-decoration: underline;
  text-underline-offset: .2em;
}
.profile-terminal .terminal-entry + .terminal-entry {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px dashed #36532e;
}
.profile-terminal .terminal-speaker,
.profile-terminal .terminal-prompt {
  margin: 0 0 6px;
  color: var(--crt-secondary);
  font-size: 10px;
  line-height: 1.6;
}
.profile-terminal .terminal-speaker { font: 14px/1.4 var(--crt-type); }
.profile-terminal .terminal-boot { margin: 0; white-space: normal; font: 20px/1.4 var(--crt-type); }
.profile-terminal .boot-heading { display: block; color: #b2ffd1; font-weight: 600; letter-spacing: .05em; }
.profile-terminal .boot-subtitle { display: block; margin: 2px 0 18px; color: var(--crt-secondary); font-size: 15px; letter-spacing: .05em; }
.profile-terminal .boot-check { display: flex; align-items: baseline; gap: 10px; max-width: 36ch; min-height: 1.4em; }
.profile-terminal .boot-leader { flex: 1; border-bottom: 1px dotted #427d55; }
.profile-terminal .boot-result { width: 2ch; color: #a7ffc8; }
.profile-terminal .boot-progress { display: block; margin-top: 18px; white-space: nowrap; letter-spacing: .04em; }
.profile-terminal .boot-ready { display: block; margin-top: 10px; color: #b2ffd1; }
.profile-terminal[data-state="booting"] #terminal-chat-panel > :not(.terminal-output):not(.terminal-boot) { visibility: hidden; }
.profile-terminal[data-state="booting"] .terminal-boot { height: 380px; padding-top: 24px; }
.home-page .profile-terminal .terminal-boot {
  position: absolute;
  inset: 0;
  height: 100%;
  padding-top: 8px;
}
.home-page .profile-terminal[data-state="booting"] .terminal-transcript { visibility: hidden; }
.home-page .profile-terminal.terminal-chat-reveal .terminal-form { animation: terminal-controls-in .24s ease-out both; }
.profile-terminal.terminal-power-on .terminal-screen { animation: terminal-power-on .72s ease-out both; }
.profile-terminal button,
.profile-terminal input,
.profile-terminal textarea {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}
.profile-terminal button { cursor: pointer; }
.profile-terminal .terminal-form { margin: 0; }
.profile-terminal .terminal-conversation-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-terminal .terminal-conversation-tools .terminal-input-label { margin: 0; }
.profile-terminal .terminal-clear {
  margin-left: auto;
  min-height: 44px;
  padding: 6px 0 6px 8px;
  border: 0;
  background: transparent;
  color: #c8e6b5;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: 10px/1.5 var(--mono);
}
.profile-terminal .terminal-context { margin: 7px 0 0; color: var(--crt-secondary); font: 10px/1.6 var(--mono); }
.profile-terminal .terminal-context.sr-only,
.profile-terminal .terminal-activity.sr-only,
.profile-terminal .terminal-input-label.sr-only { margin: -1px; padding: 0; }
.profile-terminal .terminal-input-label {
  display: block;
  margin-bottom: 7px;
  color: var(--crt-secondary);
  font-size: 10px;
  line-height: 1.6;
}
.profile-terminal .terminal-command-line {
  display: flex;
  align-items: stretch;
  min-height: 47px;
  overflow: visible;
  border: 1px solid #66865b;
  border-radius: 2px;
  background: #061109;
}
.profile-terminal .terminal-command-prefix {
  display: flex;
  align-items: center;
  padding-left: 10px;
  color: #b9efab;
  font: 15px/1 var(--mono);
}
.profile-terminal .terminal-input {
  display: block;
  resize: none;
  min-width: 0;
  width: 100%;
  flex: 1;
  border: 0;
  border-radius: 0;
  padding: 10px 8px;
  background: transparent;
  color: #e1f6d8;
  font: 16px/1.4 var(--mono);
  caret-color: #bcf3a7;
}
.profile-terminal .terminal-input::placeholder { color: #adc2a4; opacity: 1; font-size: 13px; }
.profile-terminal .terminal-submit {
  min-width: 48px;
  min-height: 47px;
  margin: -1px -1px -1px 0;
  padding: 8px;
  border: 1px solid #90b67d;
  border-radius: 0 2px 2px 0;
  background: #a4cf8e;
  color: #0c1d0d;
  font: 18px/1 var(--mono);
}
.profile-terminal .terminal-submit:hover { background: #c4e8b2; }
.profile-terminal button:focus-visible,
.profile-terminal input:focus-visible,
.profile-terminal textarea:focus-visible,
.profile-terminal a:focus-visible,
.profile-terminal .terminal-transcript:focus-visible {
  outline: 2px solid #d0efb9;
  outline-offset: 3px;
}
.profile-terminal .terminal-input:focus-visible { outline-offset: -3px; }
.profile-terminal button:disabled { cursor: default; opacity: .55; }
.profile-terminal .terminal-feedback {
  min-height: 1.6em;
  margin: 7px 0 0;
  color: #e3cd9d;
  font-size: 10px;
  line-height: 1.6;
}
.profile-terminal .terminal-feedback:empty { display: none; }
.profile-terminal .terminal-activity {
  margin: 8px 0 0;
  color: var(--crt-secondary);
  font: 10px/1.6 var(--mono);
}
.profile-terminal[data-state="busy"] .terminal-status::before { background: #e3cd9d; box-shadow: none; }
.profile-terminal[data-state="error"] .terminal-status::before { background: #e3cd9d; box-shadow: none; }
.profile-terminal .terminal-boundary-note {
  margin: 8px 0 0;
  color: #8eaa83;
  font: 9px/1.7 var(--mono);
}
.home-page .profile-terminal .terminal-boundary-note {
  color: #b1c7a9;
  font-size: 11px;
  line-height: 1.6;
  text-shadow: none;
}
.home-page .terminal-privacy {
  flex: 1 1 0;
  min-width: 0;
  color: #b1c7a9;
  font: 11px/1.65 var(--mono);
  text-shadow: none;
}
.home-page .terminal-privacy > summary {
  width: fit-content;
  min-height: 44px;
  padding-block: 12px;
  cursor: pointer;
  color: #c6e8c4;
  text-underline-offset: 3px;
}
.home-page .terminal-privacy > summary:hover { text-decoration: underline; }
.home-page .terminal-privacy > summary:focus-visible { outline: 2px solid #d0efb9; outline-offset: 3px; }
.home-page .terminal-privacy p { margin: 0 0 10px; }
.profile-terminal .terminal-case-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  margin: 10px 7px 0;
}
.profile-terminal .terminal-vent {
  width: 55px;
  height: 13px;
  border-block: 1px solid #18251a;
  background: repeating-linear-gradient(90deg, #122017 0 2px, transparent 2px 5px);
  opacity: .65;
}
.profile-terminal .terminal-case-label {
  color: #bbc5ac;
  font-size: 11px;
  letter-spacing: .08em;
  line-height: 1.5;
}
.profile-terminal .terminal-power {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b9c3aa;
  font-size: 8px;
  letter-spacing: .06em;
}
.profile-terminal .terminal-power::after {
  content: "";
  width: 9px;
  height: 9px;
  border: 2px solid #172716;
  border-radius: 50%;
  background: #a4dc7d;
  box-shadow: 0 0 6px #a4dc7d55;
}
.profile-terminal [hidden] { display: none !important; }
@media (max-width: 480px) {
  .profile-terminal { padding: 9px 6px 7px; border-radius: 20px 20px 24px 24px; }
  .profile-terminal .terminal-case-top { margin: 0 5px 9px; font-size: 8px; letter-spacing: .07em; }
  .profile-terminal .terminal-bezel { padding: 4px; }
  .profile-terminal .terminal-screen { padding: 12px 10px; }
  .profile-terminal .terminal-screen-header { gap: 4px 10px; padding-bottom: 10px; }
  .profile-terminal .terminal-session { font-size: 17px; }
  .profile-terminal .terminal-status { font-size: 8px; }
  .profile-terminal .terminal-output { height: 360px; margin-block: 12px; }
  .profile-terminal .terminal-transcript { font-size: 20px; line-height: 1.35; }
  .profile-terminal .terminal-boot { font-size: 17px; line-height: 1.45; }
  .profile-terminal .boot-subtitle { font-size: 13px; }
  .profile-terminal .boot-progress { letter-spacing: 0; }
  .profile-terminal .terminal-case-bottom { min-height: 30px; margin: 8px 5px 0; gap: 8px; }
  .profile-terminal .terminal-case-label { font-size: 10px; letter-spacing: .03em; }
  .profile-terminal .terminal-vent { width: 35px; }
  .profile-terminal .terminal-boundary-note { font-size: 9px; }
  .profile-terminal .terminal-screen::after { opacity: .14; }
}
@media (prefers-reduced-motion: reduce) {
  .profile-terminal, .profile-terminal * { scroll-behavior: auto; animation: none !important; transition: none !important; }
  .profile-terminal ::before, .profile-terminal ::after { animation: none !important; }
}
@media (forced-colors: active) {
  .profile-terminal, .profile-terminal .terminal-bezel, .profile-terminal .terminal-screen { border: 1px solid CanvasText; }
  .profile-terminal .terminal-screen::before, .profile-terminal .terminal-screen::after { display: none; }
  .profile-terminal .terminal-status::before, .profile-terminal .terminal-power::after { background: CanvasText; }
}
@keyframes terminal-power-on {
  0%, 28% { transform: scale(1, .006); filter: brightness(1.8); }
  66% { transform: scale(1, 1); filter: brightness(1.25); }
  100% { transform: scale(1, 1); filter: brightness(1); }
}
@keyframes terminal-scan { to { background-position: 0 calc(100% + 160px), 0 0; } }
@keyframes terminal-cursor { 50% { opacity: 0; } }
@keyframes terminal-controls-in { from { opacity: 0; } to { opacity: 1; } }

.profile-terminal .terminal-power-flash {
  position: absolute;
  inset: 9px;
  z-index: 5;
  pointer-events: none;
  border-radius: inherit;
  background: #d7ffe6;
  box-shadow: 0 0 28px #9affc5;
  opacity: 0;
}
.profile-terminal.terminal-power-on .terminal-power-flash { animation: terminal-flash .72s ease-out both; }
@keyframes terminal-flash {
  0% { opacity: 0; transform: scale(.05, .002); }
  12% { opacity: .75; transform: scale(.15, .004); }
  30% { opacity: .65; transform: scale(1, .006); }
  55% { opacity: .18; transform: scale(1, .95); }
  100% { opacity: 0; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce), (forced-colors: active) {
  .profile-terminal .terminal-power-flash { display: none; }
}
