@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

/* STRICT ANTI-COPY & ANTI-SELECT */
* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-user-select: none !important; -ms-user-select: none !important; user-select: none !important;
  -webkit-user-drag: none !important;
}
input, textarea {
  -webkit-user-select: text !important; user-select: text !important;
}
::selection { background-color: transparent; }
::-moz-selection { background-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at center, #0a1128 0%, #000000 100%);
  color: #ffffff; min-height: 100vh; display: flex; flex-direction: column;
  overflow: hidden; position: relative; transition: background 0.5s ease;
}

#stars-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden; }
.star { position: absolute; background: #ffffff; border-radius: 50%; animation: twinkle linear infinite; box-shadow: 0 0 4px #ffffff; }
@keyframes twinkle { 0% { opacity: 0.2; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0.2; transform: scale(0.8); } }

/* ---------- TOP HEADER ---------- */
.header { display: flex; width: 100%; padding: 30px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); align-items: center; z-index: 10; }
.header-half { flex: 1; display: flex; justify-content: center; align-items: center; position: relative; z-index: 2; }
.string-container { flex: 1.5; position: relative; height: 60px; margin: 0 10px; }
#physics-svg { width: 100%; height: 100%; overflow: visible; }

.ball {
  position: absolute; width: 14px; height: 14px; background: #ffffff; border-radius: 50%;
  top: 0; left: 0; transform: translate(-50%, -50%);
  box-shadow: 0 0 8px #fff, 0 0 16px #fff, 0 0 24px #e0f0ff, 0 0 40px #a0c0ff;
  z-index: 10; animation: bright-pulse 1.5s infinite alternate;
}
.ball::before { content: ''; position: absolute; background: #ffffff; width: 32px; height: 2px; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 8px #ffffff; }
.ball::after { content: ''; position: absolute; background: #ffffff; width: 2px; height: 32px; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 8px #ffffff; }
@keyframes bright-pulse { 0% { box-shadow: 0 0 8px #fff, 0 0 16px #fff, 0 0 24px #e0f0ff, 0 0 40px #a0c0ff; opacity: 0.8; } 100% { box-shadow: 0 0 12px #fff, 0 0 24px #fff, 0 0 36px #e0f0ff, 0 0 60px #a0c0ff; opacity: 1; } }

.social-link { display: inline-block; padding: 12px 30px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 1rem; color: #ffffff; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); transition: all 0.25s ease; cursor: pointer; text-align: center; }
.youtube-link { background-color: #FF0000; }
.youtube-link:hover { background-color: #cc0000; transform: translateY(-3px); }
.github-link { background-color: #24292e; border: 1px solid #444; }
.github-link:hover { background-color: #000000; transform: translateY(-3px); }

/* ---------- MAIN LAYOUT ---------- */
.portfolio-wrapper { flex: 1; display: flex; flex-direction: column; justify-content: center; z-index: 10; padding-bottom: 30px; }
.portfolio { display: flex; align-items: center; width: 100%; gap: 70px; }
.portfolio__image { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }

.portfolio__image img {
  width: 320px; height: 320px; object-fit: cover; border-radius: 12px; 
  display: block; background-color: #f4f4f4; border: 4px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8); margin-left: 50px; pointer-events: none; 
}

.portfolio__text { flex: 1; padding-right: 50px; }
.portfolio__text p { font-family: 'Cinzel', serif; font-size: 1.8rem; line-height: 1.7; color: #ffffff; margin-bottom: 0; max-width: 800px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }

/* ---------- SECRET CHAT BOX ---------- */
.apology-box { display: block; margin-top: 15px; margin-left: 50px; width: 320px; background: #000000; border: 2px solid #ff0000; padding: 20px 15px; border-radius: 10px; text-align: center; box-shadow: 0 0 25px rgba(255, 0, 0, 0.6); font-family: 'Space Mono', monospace; }
.apology-box.hidden { display: none; }

.terminal-header { color: #ff0000; font-weight: bold; font-size: 1.1rem; border-bottom: 1px solid #ff0000; padding-bottom: 10px; margin-bottom: 10px; letter-spacing: 1px; }
.user-info { text-align: left; font-size: 0.75rem; color: #00FF00; background: #111; padding: 8px; border-radius: 5px; margin-bottom: 15px; border-left: 3px solid #00FF00; }
.user-info span { display: block; margin-bottom: 4px; }
.fix-text { color: #ffffff; font-size: 0.9rem; margin-bottom: 15px; line-height: 1.5; }
.fix-text strong { color: #00FF00; font-size: 1.2rem; }
.input-group { display: flex; gap: 5px; justify-content: center; }

.apology-box input { padding: 8px 12px; border-radius: 5px; border: 1px solid #444; font-family: 'Space Mono', monospace; width: 160px; outline: none; background: #111; color: #fff; }
.apology-box button { padding: 8px 15px; border-radius: 5px; border: none; background: #ff0000; color: white; font-weight: bold; font-family: 'Space Mono', monospace; cursor: pointer; transition: 0.2s; }
.apology-box button:hover { background: #cc0000; box-shadow: 0 0 10px #ff0000; }

/* ---------- EMAIL SECTION AT BOTTOM ---------- */
.email-container { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 40px; margin-bottom: 10px; padding: 15px 30px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 50px; align-self: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); backdrop-filter: blur(10px); }
.email-text { font-family: 'Space Mono', monospace; font-size: 1.2rem; color: #a0c0ff; letter-spacing: 1px; }
.copy-btn { background: #ffffff; color: #000000; border: none; padding: 10px 25px; border-radius: 30px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 0 10px rgba(255, 255, 255, 0.3); }
.copy-btn:hover { background: #a0c0ff; transform: scale(1.05); box-shadow: 0 0 20px rgba(160, 192, 255, 0.8); }

/* ---------- GLITCH MODE (CHAOS / CRASH) ---------- */
body.glitch-mode { background: repeating-linear-gradient(45deg, #110000, #110000 10px, #000000 10px, #000000 20px) !important; animation: glitch-shake 0.2s infinite; }
@keyframes glitch-shake { 0% { transform: translate(0, 0); } 25% { transform: translate(2px, -2px); } 50% { transform: translate(-2px, 2px); } 75% { transform: translate(2px, 2px); } 100% { transform: translate(0, 0); } }
.glitch-mode .portfolio__text p { color: #ff0000; font-family: 'Space Mono', monospace; text-transform: uppercase; text-shadow: 2px 2px 0px #00FF00, -2px -2px 0px #0000ff; }
.glitch-mode .portfolio__image img { border-color: #ff0000; transform: rotate(180deg) scale(1.1); transition: 0.5s; filter: grayscale(100%) contrast(200%); }
.glitch-mode .copy-btn, .glitch-mode .social-link { pointer-events: none; background: #444; color: #888; border-color: #444; }

/* ---------- CUSTOM ALERT POPUP ---------- */
.custom-alert { position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%); padding: 15px 30px; border-radius: 8px; font-size: 1.1rem; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 9999; text-align: center; }
.custom-alert.show { bottom: 40px; }
.alert-youtube { background-color: #ffffff; color: #FF0000; border: 2px solid #FF0000; }
.alert-github { background-color: #000000; color: #00FF00; border: 2px solid #00FF00; }
.alert-email { background-color: #00FF00; color: #000000; border: 2px solid #ffffff; }
.alert-hazard { background-color: #ff0000; color: #ffffff; border: 2px solid #ffffff; font-size: 1.3rem; text-transform: uppercase; font-family: 'Space Mono', monospace;}

/* ==========================================
   MOBILE RESPONSIVE (Perfect Fit for Screens)
   ========================================== */
@media (max-width: 768px) {
  body { 
    overflow-y: auto; /* Allows scrolling on small screens */
    overflow-x: hidden;
  }

  .header { 
    flex-direction: column; 
    gap: 15px; 
    padding: 15px 0; 
  }

  .header-half { 
    width: 100%; 
    padding: 0 20px;
  }

  .string-container { 
    width: 90%; 
    height: 50px;
    margin: 5px 0; 
  }

  .social-link { 
    width: 100%; 
    max-width: 300px;
    padding: 14px 0;
    font-size: 1rem;
  }

  .portfolio-wrapper { 
    justify-content: flex-start; 
    padding: 20px 15px 40px 15px; 
  }

  .portfolio { 
    flex-direction: column; 
    text-align: center; 
    gap: 25px; 
    padding: 0;
  }

  .portfolio__image img { 
    width: 70vw; 
    height: 70vw; 
    max-width: 260px; 
    max-height: 260px; 
    margin-left: 0; 
  }

  .apology-box { 
    margin-left: 0; 
    margin-top: 20px; 
    width: 90vw; 
    max-width: 320px; 
  }

  .portfolio__text { 
    padding-right: 0; 
    width: 100%;
  }

  .portfolio__text p { 
    font-size: clamp(1.05rem, 4.5vw, 1.4rem); /* Fluid text sizing */
    text-align: center; 
    padding: 0 10px;
  }

  .email-container { 
    flex-direction: column; 
    width: 95%; 
    max-width: 340px;
    margin-top: 35px;
    padding: 20px 15px;
    gap: 15px;
    border-radius: 20px; 
  }

  .email-text { 
    font-size: clamp(0.8rem, 3.5vw, 1rem); 
    word-break: break-all;
    text-align: center;
  }

  .copy-btn { 
    width: 100%; 
    padding: 14px 0;
  }

  .custom-alert { 
    width: 90%; 
    max-width: 350px;
    font-size: 0.95rem; 
    bottom: -150px; 
  }

  .custom-alert.show { 
    bottom: 20px; 
  }
}
