.section {
  padding: 100px 10% 50px;
  max-width: 1200px;
  margin: 0 auto;
}

.tag {
  display: inline-block;
  background: rgba(0, 242, 254, 0.1);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: bold;
  /* text-transform: uppercase; */
  margin-bottom: 15px;
}


/* Tech Stack */
.marquee-container {
  width: 100%;
  padding: 45px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  overflow: hidden;
  position: relative;
}

.marquee-container::before,
.marquee-container::after {
  content: "";
  position: absolute;
  top: 0;
  width: 15%;
  height: 100%;
  z-index: 2;
}

.marquee-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg), transparent);
}

.marquee-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg), transparent);
}

.marquee-container p {
  text-align: center; 
  font-size: 0.90rem; 
  text-transform: uppercase; 
  letter-spacing: 3px; 
  opacity: 0.5; 
  margin-bottom: 20px;
}

.marquee {
  display: flex;
  width: 200%;
}

.track {
  display: flex;
  align-items: center;
  gap: 60px;
  animation: scroll 30s linear infinite;
}

/* Slow down on hover so users can read */
.marquee:hover .track {
  animation-play-state: paused;
}

.logo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  opacity: 0.7;
  white-space: nowrap;
}

.logo-item i {
  font-size: 1.8rem;
  color: var(--secondary);
}



/* Portfolio */
#portfolio {
  padding: 80px 5%;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 30px;
  margin-top: 20px;
}

.project-card {
  display: flex;
  flex-direction: column;
  height: 565px;
  /* Default: Vertical for Desktop & Small Mobile */
  gap: 20px;
  padding: 0px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 242, 254, 0.15);
  /* Internal padding restored */
  border-radius: 24px;
  align-items: flex-start;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover {
  border-color: var(--primary);
  background: rgba(0, 242, 254, 0.07);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.1);
  /* padding: 5px;
  transform: translateY(-12px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.1); */
}

/* Hover Effect: The image "wakes up" */
.project-card:hover .card-preview img {
  opacity: 1;
  transform: scale(1.08);
  filter: saturate(1.1);
}

.project-card:hover .card-preview {
  border-radius: 20px 20px 10px 10px;
}

.project-card a.btn-small {
  margin-top: auto;
  /* Pushes button to bottom */
  display: inline-block;
  padding: 12px 25px;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  text-decoration: none;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-radius: 50px;
  transition: all 0.3s;
  margin-top: 25px;
}

.project-card a.btn-small:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 20px var(--primary);
}

.project-card h3 {
  font-size: 1.4rem;
  /* Slightly larger to balance the tall image */
  margin: 0px 0;
  letter-spacing: 0.5px;
}

.project-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 10px;
  flex-grow: 1;
  /* Pushes the button down */
}

.card-preview {
  display: flex;
  height: 60%;
  width: 100%;
  position: relative;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 1);
  border-radius: 10px;
  padding: 0px;
  margin-bottom: 10px;
  overflow: hidden;
  border: 0px solid rgba(0, 242, 254, 0.1);
  /* Inset shadow makes the "glimpse" feel like a deep monitor */
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0);
}

.card-content {
  display: flex;
  width: 100%;
  height: 40%;
  padding: 10px 20px 15px 20px;
  flex-grow: 1;
  flex-direction: column;
  justify-content: space-between;
  /* Alignment tweak for the new image height */
}

.card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  /* border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.1); */
  /* Keeps the 'header' of your screenshots visible */
  opacity: 0.85;
  transition: 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  filter: saturate(0.8);
}

.preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: linear-gradient(to bottom, transparent, rgba(15, 18, 24, 0.8)); */
}

.status-badge {
  font-size: 0.65rem;
  color: #00ff88;
  letter-spacing: 1px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff88;
  animation: neon-pulse 2s infinite ease-in-out;
}

.project-tag {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 10;
  background: var(--primary);
  color: #000;
  padding: 5px 15px;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  border-radius: 4px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.tech-specs {
  list-style: none;
  padding: 0;
  margin: 20px 0;
  display: none;
  /* Hidden by default */
}

.tech-specs li {
  font-size: 0.75rem;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 8px;
  padding-left: 15px;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tech-specs li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--primary);
}

.btn-small:hover {
  box-shadow: 0 0 15px var(--primary), 0 0 30px var(--primary-glow);
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}



/* Terminal */
.terminal-window {
  background: #000;
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 254, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 242, 254, 0.1);
  overflow: hidden;
  font-family: 'Courier New', Courier, monospace;
  max-width: 800px;
  margin: 0 auto;
}

.terminal-header {
  background: #1a1a1a;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #333;
}

.terminal-title {
  font-size: 0.75rem;
  color: #888;
  flex-grow: 1;
  text-align: center;
  font-family: sans-serif;
}

.terminal-body {
  padding: 30px;
  color: #00ff88;
  font-size: 0.95rem;
  text-align: left;
}

.t-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
}

.red {
  background: #ff5f56;
}

.yellow {
  background: #ffbd2e;
}

.green {
  background: #27c93f;
}

.line {
  display: flex;
  align-items: flex-start;
  /* Ensures multi-line text aligns to the prompt top */
  gap: 15px;
  margin-bottom: 12px;
  font-family: 'Roboto Mono', 'Courier New', monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
}

/* The Prompt Cursor (>) */
.line::before {
  content: ">";
  color: var(--text);
  font-weight: bold;
  flex-shrink: 0;
  /* Prevents the cursor from squishing on small screens */
  text-shadow: 0 0 5px var(--primary-glow);
}

/* The Prompt Cursor and Label Styling */
.line label {
  color: var(--primary);
  /* Your Cyan */
  font-weight: normal;
  font-family: 'Roboto Mono', monospace;
  white-space: nowrap;
  /* Prevents the label from breaking into 2 lines */
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.line input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 0.95rem;
  caret-color: var(--text);
  /* Glowing cursor */
}

.line textarea {
  flex-grow: 1;
  overflow: hidden;
  /* Hides scrollbars for that "clean" look */
  resize: none;
  line-height: 1.5;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.95rem;
  width: 100%;
  resize: none;
  /* Disables the manual drag handle */
  padding: 0;
  margin: 0;
  caret-color: var(--text);
  /* The cyan "Neural" cursor */
}

.line input,
.line textarea {
  background: rgba(255, 255, 255, 0.03);
  /* Very subtle "recessed" base */
  border: 1px solid rgba(0, 242, 254, 0.05);
  /* Stealth border */
  border-radius: 4px;
  padding: 4px 10px;
  /* Internal padding so text doesn't hit the edges */
  color: #ffffff;
  font-family: inherit;
  transition: all 0.3s ease;
}

/* Focus state to keep the terminal "Hot" */
.line textarea:focus {
  color: var(--text);
  text-shadow: 0 0 5px rgba(0, 242, 254, 0.3);
}

.line.output {
  color: #ffffff;
  /* White for system responses */
  opacity: 0.9;
}

.line.error {
  color: #ff4d4d;
  /* Red for failed protocols */
}

.line.comment {
  color: rgba(255, 255, 255, 0.4);
  /* Muted for // comments */
  font-style: italic;
}

/* --- The "Active Node" Focus --- */
.line input:focus,
.line textarea:focus {
  background: rgba(0, 242, 254, 0.05);
  /* Cyan tint on focus */
  border: 1px solid rgba(0, 242, 254, 0.3);
  /* Glowing border */
  box-shadow: inset 0 0 10px rgba(0, 242, 254, 0.1);
  outline: none;
}

/* Optional: A subtle hover state to "invite" the click */
.line input:hover,
.line textarea:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 242, 254, 0.2);
}

.terminal-submit {
  margin-top: 25px;
  background: transparent;
  border: 1px solid #00ff88;
  color: #00ff88;
  padding: 8px 25px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

.terminal-submit:hover {
  background: #00ff88;
  color: #000;
  box-shadow: 0 0 15px #00ff88;
}

.modal-overlay {
  display: none;
  /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.modal-box {
  width: 90%;
  max-width: 500px;
  background: #0f1218;
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 0 40px rgba(0, 242, 254, 0.2);
}

.modal-header {
  font-family: 'Roboto Mono', monospace;
  color: var(--primary);
  font-size: 0.8rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #00ff00;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff00;
}



/* Core Specializations */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 50px;
}

.card {
  background: var(--card-bg);
  padding: 40px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: 0.3s;
}

.card:hover {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
}

.card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.card p {
  margin-top: 10px;
}



@media (max-width: 1023px) {
  .line {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 20px;
  }

  .line::before {
    display: none;
    /* Removes the floating '>' on mobile to save space */
  }

  .line label {
    font-size: 0.8rem;
    opacity: 0.8;
  }

  .line input,
  .line textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 1rem;
  }

}

@media (min-width: 600px) and (max-width: 1023px) {
  .project-grid {
    grid-template-columns: 1fr;
    /* Single column grid, but the card expands */
    gap: 40px;
  }

  .project-card {
    flex-direction: row;
    height: 400px;
    /* FLIP: Image left, Content right */
    align-items: center;
    gap: 20px;
  }

  .project-card:hover .card-preview {
    border-radius: 20px 10px 10px 20px;
  }

  .card-preview {
    flex: 1;
    flex-direction: column;
    /* Takes up half the space */
    height: 100%;
    /* Much taller and wider on tablet */
    margin-bottom: 0;
    /* Remove bottom margin since it's now on the left */
  }

  .card-content {
    flex: 1;
    flex-direction: column;
    height: 100%;
    padding: 30px;
    /* Takes up the other half */
  }

  .project-card h3 {
    font-size: 1.6rem;
  }

  .project-card p {
    font-size: 0.95rem;
  }

  .tech-specs {
    display: block;
    /* REVEAL: Only when we have the horizontal space */
    columns: 2;
    /* Optional: splits the list into two small columns */
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 50px 5%;
  }
}

@media (max-width: 599px) {
  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    flex-direction: column;
    height: 500px;
  }

  .card-preview {
    height: 50%;
  }

  .card {
    padding: 35px;
    min-height: 280px;
  }

  .preview-overlay {
    display: none;
  }

  .tech-specs {
    display: none;
  }
}