/* MAIN STYLES FOR CRT / LEET PAGE */
@charset "utf-8";

/* FONTS */
.anonymous-pro-regular {
  font-family: "Anonymous Pro", monospace;
  font-weight: 400;
  font-style: normal;
}

.anonymous-pro-bold {
  font-family: "Anonymous Pro", monospace;
  font-weight: 700;
  font-style: normal;
}

.anonymous-pro-regular-italic {
  font-family: "Anonymous Pro", monospace;
  font-weight: 400;
  font-style: italic;
}

.anonymous-pro-bold-italic {
  font-family: "Anonymous Pro", monospace;
  font-weight: 700;
  font-style: italic;
}

.vt323-regular {
  font-family: "VT323", monospace;
  font-weight: 400;
  font-style: normal;
}

.press-start-2p-regular {
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;       /* let page grow if content exceeds viewport */
  background: #212121;
  color: #ff009b;
  font-family: 'Courier New', Courier, monospace;
  display: flex;
  flex-direction: column;  /* prevents unwanted stretching on mobile */
  justify-content: center;
  align-items: center;
  text-align: center;
  overflow-x: hidden;      /* hide horizontal scroll */
  overflow-y: auto;        /* allow vertical scroll if content grows */
  position: relative;
}

/* FOREGROUND TITLE */
h2 {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 1px;
  white-space: pre;
  position: relative;
  z-index: 6; /* above most overlays */
  text-shadow: 0px 2px 6px rgba(0,0,0,0.9);
  margin: 0;
  padding: 0 12px;
}

#contentArea {
  overflow: hidden;
}

#leetText {
  font-family: "Anonymous Pro", monospace;
  font-weight: 400;
  font-style: normal;
}

/* GREEN FLICKER SPAN STYLE */
.flicker {
  color: #00ff12;
  text-shadow: 0 0 3px #00ff12, 0 0 8px #00ff12;
  filter: blur(1px);
  display: inline-block;
  transform: translate(0,0);
}

/* small helper so placeholders keep baseline spacing consistent */
.letter-placeholder {
  display: inline-block;
  vertical-align: top;
  opacity: 0;
  pointer-events: none;
}

/* FULL-PAGE SUBTLE NOISE (scanline / film grain) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 5;
  background: repeating-linear-gradient(
		0deg,
		rgba(255,255,255,0.05) 0,
		rgba(255,255,255,0.05) 1px,
		transparent 1px,
		transparent 2px
	);
	animation: noise 0.1s steps(2) infinite;
}

@keyframes noise {
	0% { transform: translate(0,0); }
	25% { transform: translate(-3px,-3px); }
	50% { transform: translate(3px,3px); }
	75% { transform: translate(-3px,3px); }
	100% { transform: translate(3px,-3px); }
}

/* SELECTION COLORS */
::selection { background-color: transparent; color: #00ff12; }
::-moz-selection { background-color: transparent; color: #00ff12; }

/* BACKGROUND CONSOLE: the typing output */
.bg-console {
  position: fixed;
  inset: 0;
  padding: 6vh 6vw;
  z-index: 1;               /* under the noise and main text */
  pointer-events: none;     /* non-interactive */
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  opacity: 0.45;
  filter: drop-shadow(0 0 1px #00ff12);
  mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 90%, transparent);
}

/* make the background terminal actually scroll and hide scrollbars */
.bg-console pre {
  font-family: "VT323", monospace;
  font-weight: 400;
  font-style: normal;
  margin: 0;
  color: #00ff12;
  white-space: pre-wrap;
  max-width: 100%;
  width: 100%;
  height: 100%;          /* <-- key: fill container */
  overflow: auto;        /* <-- key: allow scrolling */
  text-align: left;
  letter-spacing: 0.2px;
  word-break: break-word;

  /* hide scrollbars cross-browser */
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge legacy */
}
.bg-console pre::-webkit-scrollbar { display: none; }  /* WebKit */

/* SUBTLE SCANLINE VIBE ON CONSOLE ONLY (extra subtle) */
.bg-console::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0,
    rgba(0,0,0,0) 2px,
    rgba(255,255,255,0.03) 2px,
    rgba(255,255,255,0.03) 3px
  );
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.6;
}

.console-line {
  transition: all 0.5s ease; /* smooth animation */
  opacity: 1;
  transform: translateY(0);
}

.console-line.fade-slide {
  opacity: 0;
  transform: translateY(20px); /* slide down */
}

/* LIVE CLOCK */
#liveClock {
  font-family: "Anonymous Pro", monospace;
  font-weight: 400;
  font-style: normal;
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 99999;
  color: #00ff12;
  font-size: 13px;
  background: rgba(0,0,0,0.25);
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  pointer-events: auto;
  cursor: pointer;
  letter-spacing: 0.6px;
}

#liveClock .blink {
  display: inline-block;
  margin-left: 6px;
  animation: blinkOnOff 1s steps(1) infinite;
  transform-origin: center;
  font-weight: 700;
}
@keyframes blinkOnOff {
  0% { opacity: 1; transform: scaleX(1); }
  50% { opacity: 0; transform: scaleX(0.9); }
  100% { opacity: 1; transform: scaleX(1); }
}

/* MOBILE */
@media (max-width: 480px) {
  #liveClock { font-size: 12px; right: 10px; bottom: 10px; padding: 5px 8px; }
  h2 { font-size: 1.35rem; padding: 0 8px; }
}

/* CRT-STYLE VIGNETTE OVERLAY */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 7; /* above noise and content, under any top UI */
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.25) 80%,
    rgba(0, 0, 0, 0.6) 100%
  );
}

/* DISTORTION / GLITCH LAYER - used briefly */
.glitch-flash {
  position: fixed;
  z-index: 8;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
}

/* ASCII FACE FLASH CONTAINER */
.ascii-flash {
  position: fixed;
  z-index: 9;
  left: 50%;
  top: 30%;
  transform: translate(-50%, -50%);
  color: rgba(255,0,155,0.9);
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1;
  white-space: pre;
  text-shadow: 0 0 8px rgba(255,0,155,0.15);
  display: none;
  pointer-events: none;
  opacity: 0;
}

/* RESPONSIVE TWEAKS */
@media (max-width: 700px) {
  .ascii-flash { font-size: 10px; left: 50%; top: 28%; }
}

/* === COMMAND PANEL (APPEARS AFTER CLOCK CLICK) === */
.cmd-panel {
  position: fixed;
  left: 6vw;
  right: 6vw;
  bottom: 8vh;
  z-index: 10000;
  display: none; /* SHOWN VIA JS */
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,0,155,0.45);
  box-shadow: 0 8px 20px rgba(0,0,0,0.45), inset 0 0 18px rgba(255,0,155,0.15);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ff009b;
  backdrop-filter: blur(4px);
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Anonymous Pro", monospace;
  font-size: 14px;
  line-height: 1.6;
}

.cmd-input-wrap .prompt {
  color: #00ff12;
  text-shadow: 0 0 6px rgba(0,255,18,0.4);
  user-select: none;
}

#cmdInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ff009b;
  font-family: "Anonymous Pro", monospace;
  font-size: 14px;
  letter-spacing: 0.4px;
}

#cmdInput:focus {
  outline: 2px solid rgba(0,255,18,0.12);
  outline-offset: 2px;
}

.cmd-cursor {
  color: #00ff12;
  margin-left: 6px;
  animation: blinkOnOff 1s steps(1) infinite;
}

.cmd-feedback {
  margin-top: 6px;
  min-height: 18px;
  font-size: 12px;
  color: #ff009b;
  opacity: 0.9;
}

/* ERROR / OK FEEDBACK */
.feedback-ok    { color: #00ff12; text-shadow: 0 0 6px rgba(0,255,18,0.35); }
.feedback-error { color: #ff009b; filter: drop-shadow(0 0 2px rgba(255,0,155,0.5)); }

/* === CONTENT PANELS === */
.content-area {
  position: fixed;
  left: 6vw;
  right: 6vw;
  bottom: calc(8vh + 64px);
  max-height: 50vh;
  overflow: auto;
  z-index: 9000;
  pointer-events: auto;
  display: none; /* SHOWN VIA JS WHEN A PANEL IS ACTIVE */
}

.content-area .panel {
  display: none; /* ONE AT A TIME */
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,0,155,0.35);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 0 10px rgba(255,0,155,0.12);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 5px;
  color: #ff77c0; /* SOFTER PINK FOR BODY TEXT */
  backdrop-filter: blur(4px);
}

.content-area .panel h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: #ff009b;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 0 6px rgba(255,0,155,0.45);
}

.content-area .panel code,
.content-area .panel .brand {
  color: #00ff12;
}

/* GLITCH ANIMATION FOR ERRORS */
@keyframes glitchFlash {
  0%, 100% { transform: translate(0,0); filter: none; }
  20% { transform: translate(-1px,0); text-shadow: -1px 0 #00ff12, 1px 0 #ff009b; }
  40% { transform: translate(1px,0);  text-shadow: 1px 0 #00ff12, -1px 0 #ff009b; }
  60% { transform: translate(-1px,0); text-shadow: -1px 0 #00ff12, 1px 0 #ff009b; }
  80% { transform: translate(1px,0);  text-shadow: 1px 0 #00ff12, -1px 0 #ff009b; }
}
.glitch { animation: glitchFlash 300ms linear 1; }

/* PREP LEET TEXT FOR CRUMBLE (LETTERS AS INLINE-BLOCKS FOR ANIM) */
#leetText span.letter {
  display: inline-block;
  will-change: transform, opacity;
  cursor: default;
}

/* LETTER “SCATTER/JUMP” INTERACTION */
#leetText span.letter:hover {
  text-shadow: 0 0 6px rgba(255,0,155,0.6), 0 0 12px rgba(255,0,155,0.35);
}

/* SMALLER ON MOBILE */
@media (max-width: 600px) {
  .cmd-panel { left: 4vw; right: 4vw; bottom: 7vh; }
  .content-area { left: 4vw; right: 4vw; bottom: calc(7vh + 56px); max-height: 46vh; }
}

/* CRT RESET OVERLAY (FULLSCREEN COMPRESS-AND-VANISH EFFECT) */
.crt-reset-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: radial-gradient(circle at 50% 40%, rgba(255,0,155,0.06), rgba(0,0,0,0.55) 60%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: center center;
  overflow: hidden;
}

/* The inner "scanline" bar that compresses — looks like the CRT collapsing */
.crt-reset-inner {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg,
      rgba(255,0,155,0.02),
      rgba(255,0,155,0.06) 10%,
      rgba(0,0,0,0.0) 40%,
      rgba(0,0,0,0.0) 60%,
      rgba(255,0,155,0.04) 90%,
      rgba(255,0,155,0.02));
  will-change: transform, opacity;
}

/* Optional quick flash/scanlines during compress */
.crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03) 0,
    rgba(255,255,255,0.03) 1px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0) 3px
  );
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.9;
}

/* --- reset effect helpers (scoped, non-destructive) --- */
#mainContainer.crt-collapsing {
  transform-origin: center center;
  will-change: transform;
}

/* start transparent; we’ll fade this in via JS only during reset */
.crt-reset-overlay { opacity: 0; }

/* HELPERS FOR RESET CLONE (DO NOT REMOVE) */
.crt-reset-clone {
  position: fixed;
  inset: 0;
  z-index: 22000;        /* above everything so it visually replaces page */
  pointer-events: none;  /* non-interactive - original page still handles events */
  overflow: hidden;
  transform-origin: center center;
  will-change: transform, opacity;
}

/* FADE-IN AFTER RELOAD (page enters from black) */
body {
  /* START HIDDEN SO RELOAD DOESN'T FLASH THE OLD CONTENT */
  opacity: 0;
  transition: opacity 1.8s ease;
}

/* WHEN JS ADDS .fade-in, THE PAGE WILL SMOOTHLY APPEAR */
body.fade-in {
  opacity: 1 !important;
}

/* Ensure reset clone/overlay z-index won't conflict if not present already */
.crt-reset-cover { z-index: 19990; }
.crt-reset-clone { z-index: 19995; }
.crt-reset-overlay { z-index: 20000; }

/* "CODE" VIEW PANEL BOXES */
.boot-log {
  font-family: monospace;
  font-size: 0.85rem;
  color: #00ff12;
  opacity: 0.9;
  white-space: pre;
  padding: 2px 4px;
  width: 100%;
  max-width: calc(100vw - 16px); /* keep ASCII within viewport */
  box-sizing: border-box;
  overflow-wrap: normal;  /* preserve ASCII alignment */
  word-break: keep-all;   /* prevent breaking characters */
}

/* MOBILE FONT ADJUSTMENTS */
@media (max-width: 480px) {
  .boot-log {
    font-size: 0.7rem;
  }
}

/* Default: desktop shows, mobile hidden */
.log {
  display: flex;
}
.log-mobile {
  display: none;
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  .log {
    display: none;
  }
  .log-mobile {
    display: flex;
  }
}

/* DESKTOP ONLY TEXT */
@media (max-width: 768px) {
	.desktop-text {
		display: none;
	}
}

/* SNAKE */
.snake-block {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: #00ff12;
  border-radius: 2px;
}
.snake-head {
  background-color: #bfffbf;
}

/* CONTACT FORM */
.crt-input {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,0,155,0.4);
  color: #ff009b;
  border-radius: 6px;
  padding: 6px 8px;
  font-family: 'Anonymous Pro', monospace;
  font-size: 0.85rem;
  resize: none;
}

.crt-input::placeholder {
  color: #ff009b;
  opacity: 0.7;
}

.crt-input:focus,
.crt-input:active {
  outline: 2px solid #00ff12;  /* bright green glow */
  outline-offset: 2px;
  color: #00ff12;              /* text turns green while typing */
  background: rgba(0,0,0,0.3); /* slightly brighter background */
  box-shadow: 0 0 6px #00ff12, 0 0 12px #00ff12;
}

/* Also fix the select dropdown focus glow */
.crt-input:focus option {
  color: #121212; /* optional: text inside dropdown remains readable */
}

.crt-btn {
  background: #ff009b;
  color: #121212;
  font-family: 'Anonymous Pro', monospace;
  border: none;
  border-radius: 6px;
  padding: 6px 0;
  font-size: 0.85rem;
  transition: 0.2s;
}

.crt-btn:hover {
  background: #ff33c3;
  color: #ffffff;
}

.crt-feedback {
  font-size: 0.82rem;
  color: #00ff12;
  min-height: 20px;
}
