@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;700&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  /* CP2077 Color Palette */
  --cp-yellow:     #fcee0a;
  --cp-red:        #ff003c;
  --cp-cyan:       #00f0ff;
  --cp-dark:       #090a0f;
  --cp-darker:     #050505;
  --cp-grey:       #2b2b2b;
  
  --text-main:     #e0e6ed;
  
  --font-sans:     'Chakra Petch', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  background: var(--cp-darker);
  overflow-x: hidden;
  text-transform: uppercase;
  position: relative;
  isolation: isolate;
}

/* Global CRT Overlay (Vignette & Micro-lines) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: 
    linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
    linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 2px, 3px 100%;
  box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

body.page-uplink, 
body.page-checkpoint, 
body.page-corrupted { 
  background: var(--cp-darker); 
}

/* -----------------------------------------
   GRIDS & PARTICLES
----------------------------------------- */
.grid-veil {
  position: fixed;
  inset: 0;
  z-index: -3;
  opacity: 0.15;
  background-image: 
    linear-gradient(var(--cp-grey) 1px, transparent 1px),
    linear-gradient(90deg, var(--cp-grey) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
  animation: gridMove 10s linear infinite;
}

@keyframes gridMove {
  100% { background-position: 0 40px; }
}

.scan-sweep {
  position: fixed;
  left: 0;
  right: 0;
  height: 15vh;
  z-index: -2;
  opacity: 0.1;
  background: linear-gradient(to bottom, transparent, var(--sweep-color, var(--cp-cyan)) 50%, transparent);
  animation: sweep 4s linear infinite;
}

.page-uplink .scan-sweep {
  --sweep-color: var(--cp-yellow);
  opacity: 0.12;
}

.page-corrupted .scan-sweep {
  --sweep-color: var(--cp-red);
  animation-duration: 2.5s;
  opacity: 0.15;
}

@keyframes sweep {
  0%   { top: -20%; }
  100% { top: 120%; }
}

.particles {
  position: fixed;
  inset: 0;
  z-index: -2;
}

.particles span {
  position: absolute;
  width: 2px;
  opacity: 0;
  animation: dataFall linear infinite;
}

.page-uplink .particles span {
  background: var(--cp-yellow);
  box-shadow: 0 0 10px var(--cp-yellow);
}

.page-checkpoint .particles span {
  background: var(--cp-cyan);
  box-shadow: 0 0 10px var(--cp-cyan);
}

.page-corrupted .particles span {
  background: var(--cp-red);
  box-shadow: 0 0 10px var(--cp-red);
}

@keyframes dataFall {
  0%   { transform: translateY(-10vh); opacity: 1; height: 10px; }
  80%  { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; height: 40px; }
}

.particles span:nth-child(1) { left: 10%; animation-duration: 2s; animation-delay: 0.1s; }
.particles span:nth-child(2) { left: 25%; animation-duration: 3s; animation-delay: 1.5s; }
.particles span:nth-child(3) { left: 40%; animation-duration: 2.5s; animation-delay: 0.8s; }
.particles span:nth-child(4) { left: 55%; animation-duration: 4s; animation-delay: 2s; }
.particles span:nth-child(5) { left: 70%; animation-duration: 1.8s; animation-delay: 0.3s; }
.particles span:nth-child(6) { left: 85%; animation-duration: 3.2s; animation-delay: 1.1s; }

/* -----------------------------------------
   CONTAINERS & LAYOUT
----------------------------------------- */
.container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 620px;
  background: rgba(9, 10, 15, 0.85);
  border: 2px solid var(--cp-grey);
  border-top: 4px solid var(--card-accent, var(--cp-cyan));
  padding: 40px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%);
  box-shadow: inset 0 0 40px rgba(0,0,0,0.8);
  backdrop-filter: blur(10px);
}

.page-uplink .container {
  --card-accent: var(--cp-yellow);
  border-color: rgba(252, 238, 10, 0.3);
}

.page-checkpoint .container {
  --card-accent: var(--cp-cyan);
  border-color: rgba(0, 240, 255, 0.2);
}

.page-corrupted .container {
  --card-accent: var(--cp-red);
  border-color: rgba(255, 0, 60, 0.3);
  animation: chassisShake 0.4s infinite;
}

.container::after {
  content: "";
  position: absolute;
  bottom: 5px;
  right: 40px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--card-accent, var(--cp-cyan));
  opacity: 0.5;
  letter-spacing: 2px;
}

.page-uplink .container::after {
  content: ""; /* Empty for uplink */
}

@keyframes chassisShake {
  0%, 100% { transform: translate(0,0); }
  20%      { transform: translate(-1px,1px); }
  40%      { transform: translate(1px,-1px); }
  60%      { transform: translate(-2px,0); }
  80%      { transform: translate(1px,2px); }
}

/* -----------------------------------------
   TYPOGRAPHY
----------------------------------------- */
h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 2.2rem;
  letter-spacing: 2px;
  color: #fff;
  margin-bottom: 24px;
  position: relative;
}

h1.title-center {
  text-align: center;
  font-size: 2.6rem;
  margin-bottom: 30px;
  display: block;
}

h1[data-text]::before {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 4px;
  background: var(--card-accent, var(--cp-cyan));
}

h1.title-center[data-text]::before {
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
}

p {
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 15px;
}

b {
  color: var(--cp-yellow);
  font-weight: 600;
}

h1[data-text] {
  display: inline-block;
  position: relative;
}

.page-corrupted h1[data-text]::before,
.page-corrupted h1[data-text]::after,
.page-uplink h1[data-text]::before,
.page-uplink h1[data-text]::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--cp-dark);
}

.page-uplink h1 {
  color: var(--cp-yellow);
  text-shadow: 0 0 10px rgba(252,238,10,0.4);
}

.page-uplink h1[data-text]::before,
.page-uplink h1[data-text]::after {
  background: rgba(9, 10, 15, 0.85);
}

.page-corrupted h1[data-text]::before {
  left: 3px;
  text-shadow: -2px 0 var(--cp-red);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitch 2s infinite linear alternate-reverse;
}

.page-corrupted h1[data-text]::after {
  left: -3px;
  text-shadow: 2px 0 var(--cp-cyan);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch 2.5s infinite linear alternate-reverse;
}

.page-uplink h1[data-text]::before {
  left: 2px;
  text-shadow: -2px 0 var(--cp-cyan);
  animation: glitch 3s infinite linear alternate-reverse;
}

.page-uplink h1[data-text]::after {
  left: -2px;
  text-shadow: 2px 0 var(--cp-red);
  animation: glitch 2.5s infinite linear alternate-reverse;
}

@keyframes glitch {
  0%   { clip-path: inset(20% 0 80% 0); transform: translate(-2px, 1px); }
  20%  { clip-path: inset(60% 0 10% 0); transform: translate(2px, -1px); }
  40%  { clip-path: inset(40% 0 50% 0); transform: translate(-2px, 2px); }
  60%  { clip-path: inset(80% 0 5% 0); transform: translate(2px, -2px); }
  80%  { clip-path: inset(10% 0 70% 0); transform: translate(-1px, 1px); }
  100% { clip-path: inset(30% 0 50% 0); transform: translate(1px, -1px); }
}

/* -----------------------------------------
   BOXES & MODULES
----------------------------------------- */
.quote-block {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cp-yellow);
  background: rgba(252,238,10,0.05);
  border-left: 4px solid var(--cp-yellow);
  padding: 20px;
  margin-bottom: 25px;
  text-transform: none;
}

.quote-author {
  display: block;
  text-align: right;
  margin-top: 15px;
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--cp-red);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.goofy-box {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cp-cyan);
  background: rgba(0,240,255,0.08);
  border: 1px solid var(--cp-cyan);
  padding: 15px 20px;
  margin: 20px 0;
  text-transform: none;
  position: relative;
}

.goofy-box::before {
  content: "[MSG]";
  position: absolute;
  top: -10px;
  left: 10px;
  background: var(--cp-darker);
  padding: 0 5px;
  font-size: 0.75rem;
  color: var(--cp-cyan);
}

.goofy-box.alert {
  color: #fff;
  background: rgba(255,0,60,0.15);
  border-color: var(--cp-red);
}

.goofy-box.alert::before {
  content: "[FATAL_ERR]";
  color: var(--cp-red);
}

.fragment-line {
  font-family: var(--font-mono);
  text-align: center;
  color: var(--cp-yellow);
  background: #000;
  border: 1px dashed var(--cp-grey);
  padding: 15px;
  margin-bottom: 20px;
  text-transform: none;
}

.john-avatar img {
  width: 70px;
  height: 70px;
  border: 2px solid var(--cp-red);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  filter: grayscale(100%) contrast(150%) brightness(80%);
  margin-bottom: 20px;
}

/* -----------------------------------------
   BUTTONS
----------------------------------------- */
.huge-cookie-btn {
  display: block;
  width: 100%;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--cp-dark);
  background: var(--cp-yellow);
  border: none;
  padding: 18px 24px;
  margin-top: 30px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  outline: transparent;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  transition: 0.2s;
}

.huge-cookie-btn:hover {
  background: var(--cp-cyan);
}

.huge-cookie-btn::after {
  content: 'Chase The Last Packet';
  position: absolute;
  inset: 0;
  background: var(--cp-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: inherit;
  opacity: 0;
}

.huge-cookie-btn:active::after {
  opacity: 1;
  animation: btnGlitch 0.2s infinite;
}

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

/* -----------------------------------------
   UPLINK SPECIFIC (PROGRESS BAR)
----------------------------------------- */
.decryption-box {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px dashed var(--cp-grey);
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--cp-darker);
  border: 1px solid var(--cp-grey);
  margin-bottom: 15px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--cp-cyan);
  box-shadow: 0 0 10px var(--cp-cyan);
  animation: load 3s cubic-bezier(0.1, 0.7, 1.0, 0.1) infinite;
}

@keyframes load {
  0%   { width: 0%; }
  20%  { width: 15%; }
  40%  { width: 15%; }
  60%  { width: 60%; }
  80%  { width: 85%; }
  100% { width: 100%; }
}


.fragment-text b {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--cp-red);
  text-shadow: 0 0 8px rgba(255,0,60,0.4);
}

@media (max-width: 520px) {
  .container { 
    padding: 30px 20px; 
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
  }
}

/* part 2 --> 3_t0_ */