:root{
  --bg: #060a06;
  --fg: #35ff6e;
  --fg-dim: #1b7a3b;
  --amber: #ffb000;
  --glass: rgba(20, 40, 24, 0.35);
  color-scheme: dark;
}

*{ box-sizing: border-box; }

html,body{
  margin:0;
  height:100%;
  background: var(--bg);
  color: var(--fg);
  font-family: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden;
}

.crt{
  position: relative;
  height: 100vh;
  height: 100dvh;
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    radial-gradient(ellipse at center, rgba(53,255,110,0.06) 0%, rgba(0,0,0,0) 60%),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75) 100%),
    var(--bg);
  animation: flicker 7s infinite;
}

@keyframes flicker{
  0%, 96%, 100% { filter: brightness(1); }
  97% { filter: brightness(1.08) contrast(1.05); }
  98% { filter: brightness(0.92); }
}

.scanline{
  pointer-events:none;
  position:absolute; inset:0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.35) 3px
  );
  mix-blend-mode: multiply;
  z-index: 3;
}

.noise{
  pointer-events:none;
  position:absolute; inset:0;
  z-index: 2;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: noiseShift .3s steps(2) infinite;
}

@keyframes noiseShift{
  0%{ transform: translate(0,0); }
  100%{ transform: translate(-2px,1px); }
}

.term{
  position: relative;
  z-index: 4;
  width: min(720px, 92vw);
  border: 1px solid var(--fg-dim);
  border-radius: 6px;
  background: rgba(3, 8, 4, 0.6);
  box-shadow:
    0 0 0 1px rgba(53,255,110,0.05),
    0 0 40px rgba(53,255,110,0.08),
    inset 0 0 60px rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
}

.term__bar{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--fg-dim);
  font-size: 12px;
  color: var(--fg-dim);
}

.dot{
  width:9px; height:9px;
  border-radius:50%;
  background: var(--fg-dim);
  opacity:.6;
}

.term__title{
  margin-left: 8px;
  letter-spacing: 0.05em;
}

.term__body{
  padding: 22px 20px 26px;
  font-size: 14px;
  line-height: 1.65;
  min-height: 220px;
  max-height: min(60vh, 480px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--fg-dim) transparent;
}

.term__body::-webkit-scrollbar{
  width: 8px;
}

.term__body::-webkit-scrollbar-track{
  background: transparent;
}

.term__body::-webkit-scrollbar-thumb{
  background: var(--fg-dim);
  border-radius: 4px;
}

.term__log{
  margin:0;
  white-space: pre-wrap;
  word-break: break-word;
}

.term__log .ok{ color: var(--fg); }
.term__log .dim{ color: var(--fg-dim); }
.term__log .warn{ color: var(--amber); }

.term__line{
  position: relative;
  display:flex;
  align-items:center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.prompt{
  color: var(--amber);
  white-space: nowrap;
}

.term__typed{
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}

.term__input{
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  font-size: 16px;
}

.cursor{
  display:inline-block;
  width: 9px;
  height: 16px;
  background: var(--fg);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink{
  0%, 49%{ opacity: 1; }
  50%, 100%{ opacity: 0; }
}

.mail-btn{
  --btn-right: max(22px, env(safe-area-inset-right));
  position: fixed;
  right: var(--btn-right);
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--fg-dim);
  background: var(--glass);
  color: var(--fg-dim);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.mail-btn.info-btn{
  right: calc(max(22px, env(safe-area-inset-right)) + 54px);
}

.info-icon{
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
}

.mail-btn:hover,
.mail-btn:focus-visible{
  color: var(--fg);
  border-color: var(--fg);
  box-shadow: 0 0 18px rgba(53,255,110,0.25);
  outline: none;
}

.mail-btn:disabled{
  opacity: .4;
  cursor: default;
}

a.contact-link{
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px dashed var(--fg-dim);
}

a.contact-link:hover{
  border-bottom-color: var(--fg);
}

@media (max-width: 480px){
  .term__body{ font-size: 13px; padding: 18px 14px 22px; }
  .term__title{ font-size: 11px; }
}
