:root {
  --font-size: 32px;
  --duration: 0.5s;
  --per-letter-delay: 0.03s;
  
  --hover-color: #8FBC8F; /* ירוק בהיר יותר לניגודיות על שחור */
  --text-color: #F0F0F0; /* טקסט בהיר כמעט לבן */
  --bg-color: #050505; /* שחור כבסיס */
  
  --y-offset: 2em; 
  --menu-gap: 15px;
  
  --player-bg: rgba(20, 20, 20, 0.85); 
  --easing: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  
  background-color: var(--bg-color);
  background-image: radial-gradient(circle at center, #1b2620 0%, #000000 70%);
  
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: var(--text-color);
  overflow: hidden;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes slideOutRight {
  from { transform: translateX(0); }
  to { transform: translateX(100%); }
}

/* --- Menu & Links --- */
.menu-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--menu-gap);
}

.menu-wrapper:hover .link-container { opacity: 0.3; filter: blur(1px); }

.link-container {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-size);
  cursor: pointer;
  position: relative;
  overflow: hidden; 
  line-height: 1.2;
  text-decoration: none;
  padding: 5px 30px 5px 15px;
  color: inherit;
  outline: none;
  opacity: 0;
  animation: fadeInUp 0.8s var(--easing) forwards;
  transition: opacity 0.4s ease, filter 0.4s ease;
  
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 700;
}

.link-container:nth-child(1) { animation-delay: 0.1s; }
.link-container:nth-child(2) { animation-delay: 0.2s; }
.link-container:nth-child(3) { animation-delay: 0.3s; }
.link-container:nth-child(4) { animation-delay: 0.4s; }
.link-container:nth-child(5) { animation-delay: 0.5s; }

.menu-wrapper .link-container:hover { opacity: 1; filter: blur(0); }

.link-container span.letter {
  display: inline-block;
  position: relative;
  text-shadow: 0 var(--y-offset) 0 var(--text-color);
  transform: translateY(0);
  transition: transform var(--duration) cubic-bezier(0.22, 0.61, 0.36, 1), color var(--duration) ease-out;
}

.link-container:hover span.letter,
.link-container:focus-visible span.letter {
  transform: translateY(calc(-1 * var(--y-offset)));
  color: var(--hover-color);
  text-shadow: 0 var(--y-offset) 0 var(--hover-color);
}

.external-icon {
  font-size: 0.35em;
  position: absolute;
  top: 5px;
  right: 8px;
  opacity: 0.3;
  transition: opacity var(--duration) ease, color var(--duration) ease;
  pointer-events: none;
}

.link-container:hover .external-icon { opacity: 1; color: var(--hover-color); }

/* --- Modals (General) --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6); 
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; visibility: hidden;
  transition: all 0.4s ease;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-content {
  background: #1a1a1a; 
  border: 1px solid rgba(255, 255, 255, 0.1); 
  padding: 0; /* Padding moved to scroll-area */
  border-radius: 40px;
  max-width: 550px;
  width: 90%;
  max-height: 85vh; 
  position: relative;
  text-align: center;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
  transform: translateY(20px);
  transition: transform 0.4s var(--easing);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-scroll-area {
  padding: 50px 40px;
  overflow-y: auto;
  flex: 1;
  background:
    linear-gradient(#1a1a1a 30%, rgba(26, 26, 26, 0)),
    linear-gradient(rgba(26, 26, 26, 0), #1a1a1a 70%) 0 100%,
    radial-gradient(farthest-side at 50% 0, rgba(0,0,0,0.5), rgba(0,0,0,0)),
    radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,0.5), rgba(0,0,0,0)) 0 100%;
  background-repeat: no-repeat;
  background-color: #1a1a1a;
  background-size: 100% 40px, 100% 40px, 100% 30px, 100% 30px;
  background-attachment: local, local, scroll, scroll;
}

.modal-overlay.active .modal-content { transform: translateY(0); }

.close-btn {
  position: absolute;
  top: 20px; right: 20px;
  width: 40px; height: 40px;
  background: rgba(255, 255, 255, 0.15); 
  color: var(--text-color);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
  z-index: 1100;
}

.close-btn:hover { transform: rotate(90deg); background: var(--hover-color); color: #fff; }

.about-layout {
  max-width: 750px;
}

.modal-scroll-area .about-grid {
  display: flex;
  align-items: center;
  gap: 30px;
  text-align: left;
}

.about-text {
  flex: 2;
}

.about-text h2 {
  margin-top: 0;
  color: var(--hover-color);
  font-size: 2rem;
}

.about-text p {
  line-height: 1.6;
  font-weight: 400;
  color: #ccc;
  margin-bottom: 15px;
}

.about-image {
  flex: 1;
  display: flex;
  justify-content: center;
}

.profile-mask {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--hover-color);
  box-shadow: 0 0 20px rgba(143, 188, 143, 0.2);
}

.profile-mask img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.skill-tag {
  background: rgba(143, 188, 143, 0.1);
  color: var(--hover-color);
  border: 1px solid var(--hover-color);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

/* --- Full Screen BTS View --- */
#btsView {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0a0a0a; 
  z-index: 2000;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding: 60px 40px;
}

.bts-entering {
  display: flex !important;
  animation: slideInRight 0.5s var(--easing) forwards;
}

.bts-exiting {
  display: flex !important;
  animation: slideOutRight 0.5s var(--easing) forwards;
}

.bts-header {
  max-width: 800px;
  margin: 0 auto 20px auto;
  width: 100%;
}

.back-btn {
  background: none; border: none;
  color: var(--text-color);
  font-family: inherit; font-weight: 700; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 0; transition: color 0.3s ease;
}

.back-btn:hover { color: var(--hover-color); }

.markdown-body {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-weight: 400;
  color: #cccccc; 
  padding-bottom: 50px;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  font-weight: 700;
  color: #ffffff;
}

/* --- Contact Form & Status Handling --- */
.contact-form { display: flex; flex-direction: column; gap: 15px; margin-top: 25px; }

.contact-form input, .contact-form textarea {
  padding: 15px 20px; 
  border-radius: 15px; 
  border: 1px solid rgba(255,255,255,0.1);
  font-family: inherit; 
  background: rgba(255, 255, 255, 0.05); 
  color: var(--text-color);
  outline: none;
  resize: none;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    border-color: var(--hover-color);
    background: rgba(255, 255, 255, 0.1);
}

.form-status {
  margin-top: 10px;
  font-size: 14px;
  min-height: 20px;
  display: none;
}
.status-success { color: var(--hover-color); font-weight: bold; }
.status-error { color: #ff6b6b; font-weight: bold; }

.submit-btn {
  appearance: button;
  background-color: var(--hover-color);
  border: solid transparent;
  border-radius: 16px;
  border-width: 0 0 4px;
  box-sizing: border-box;
  color: #FFFFFF; 
  cursor: pointer;
  display: inline-block;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .8px;
  line-height: 20px;
  margin: 10px 0 8px;
  outline: none;
  overflow: visible;
  padding: 13px 19px;
  text-align: center;
  text-transform: uppercase;
  touch-action: manipulation;
  transform: translateZ(0);
  transition: filter .2s;
  user-select: none;
  vertical-align: middle;
  white-space: nowrap;
  position: relative;
  text-shadow: none;
}

.submit-btn:after {
  background-clip: padding-box;
  background-color: rgba(0,0,0,0.2); 
  border: solid transparent;
  border-radius: 16px;
  border-width: 0 0 4px;
  bottom: -4px;
  content: "";
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: -1;
}

.submit-btn:hover:not(:disabled) { filter: brightness(1.1); }
.submit-btn:disabled { cursor: auto; opacity: 0.5; }
.submit-btn:active:after { border-width: 0 0 0px; }
.submit-btn:active { padding-bottom: 13px; transform: translateY(4px); }

/* --- Audio Player --- */
.audio-player {
  position: fixed;
  bottom: 30px; right: 30px;
  background: var(--player-bg);
  backdrop-filter: blur(15px);
  padding: 12px 20px;
  border-radius: 50px;
  display: flex; align-items: center; gap: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
  border: 1px solid rgba(255,255,255,0.05);
  z-index: 500;
  opacity: 0;
  animation: fadeInUp 0.8s 1s forwards;
}

.play-pause-btn {
  width: 40px; height: 40px;
  background: var(--hover-color); color: white;
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

.track-info { display: flex; flex-direction: column; }
.track-name { font-size: 11px; font-weight: 700; margin-bottom: 4px; color: var(--text-color); }
.progress-container { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; }
.progress-bar { width: 0%; height: 100%; background: var(--hover-color); }

/* --- Media Queries --- */
@media (max-width: 768px) {
  .modal-scroll-area { padding: 40px 25px; }
  .modal-scroll-area .about-grid { 
    flex-direction: column-reverse; 
    text-align: center !important; 
    gap: 20px;
  }
  .about-text { text-align: center; }
  .skills-tags { justify-content: center; }
  .profile-mask { width: 150px; height: 150px; }
}

@media (max-width: 600px) {
  :root { --font-size: 24px; }
  #btsView { padding: 30px 20px; }
}