/* --- CSS Variables (Theme Configuration) --- */
:root {
  --bg-main: #0d1117;
  --bg-card: #161b22;
  --border-color: #30363d;
  --text-main: #c9d1d9;
  --text-muted: #8b949e;
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-yellow: #d29922;
}

/* --- Global Resets & Base Styles --- */
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* --- Portfolio Header --- */
.portfolio-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeIn 1s ease-in-out;
  /* Smooth entry */
}

.brand-logo {
  width: 80px;
  height: auto;
  margin-bottom: 15px;
  border-radius: 12px;
  /* Softens the sharp corners slightly */
  box-shadow: 0 4px 20px rgba(88, 166, 255, 0.15);
  /* Subtle blue tech glow */
}

.portfolio-header h1 {
  margin: 0;
  font-size: 2.2em;
  color: var(--text-main);
  letter-spacing: 1px;
}

.portfolio-header .subtitle {
  margin: 8px 0 0 0;
  color: var(--accent-blue);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.95em;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Optional: Keyframe for smooth header load */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Terminal Component --- */
.terminal {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 30px;
  max-width: 700px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  font-family: "Courier New", Courier, monospace;
  margin-bottom: 40px;
}

.terminal p {
  margin: 10px 0;
}

.header {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.9em;
}

.text-blue {
  color: var(--accent-blue);
}

.success {
  color: var(--accent-green) !important;
  margin-top: 20px;
}

.warning {
  color: var(--accent-yellow);
  margin-top: 10px;
}

.typing {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid; /* Defaults to currentColor */
  animation:
    typing 2s steps(40, end),
    blink-caret 0.75s step-end infinite;
}

/* --- Architecture Grid System --- */
.architecture-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  max-width: 1400px;
  /* Expands nicely on large screens */
  width: 100%;
  justify-content: center;
  align-items: flex-start;
}

.diagram-box {
  flex: 1 1 400px;
  /* Flex-grow, Flex-shrink, Base-width */
  background-color: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.diagram-box img {
  max-width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.diagram-box img:hover {
  transform: scale(1.02);
}

.diagram-title {
  color: var(--text-muted);
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

/* --- Certification Badge --- */
.cert-box {
  flex-basis: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.cert-badge {
  width: 150px;
  height: 150px;
  filter: grayscale(100%);
  opacity: 0.5;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

.cert-status {
  font-family: "Courier New", Courier, monospace;
  color: var(--accent-yellow);
  font-size: 0.9em;
  background: rgba(210, 153, 34, 0.1);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(210, 153, 34, 0.4);
}

/* --- Certification Date Animation --- */
.cert-date {
  margin-top: 15px;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9em;
  display: inline-block; /* Forces the box to hug the text tightly */
}

.cert-date.typing {
  /* Uses the new typing-date keyframe and 22 steps */
  animation:
    typing-date 2s steps(22, end),
    blink-caret 0.75s step-end infinite;
  animation-delay: 1.5s;
  animation-fill-mode: both;
}

/* Custom keyframe just for the date text */
@keyframes typing-date {
  from {
    width: 0;
  }
  to {
    width: 22ch;
  } /* 'ch' stands for characters! */
}

/* --- Modal (Lightbox) Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(13, 17, 23, 0.95);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}

.modal-content {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-color);
  object-fit: contain;
}

/* --- Animations --- */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink-caret {
  from,
  to {
    border-color: transparent;
  }
  50% {
    border-color: currentColor;
  } /* Inherits the text color */
}

/* =========================================
   MEDIA QUERIES (Responsive Breakpoints)
   ========================================= */

/* Tablet & Smaller Laptops (Max Width: 1024px) */
@media (max-width: 1024px) {
  .architecture-container {
    gap: 30px;
  }

  .diagram-box {
    flex: 1 1 100%;
    /* Forces diagrams to stack vertically on tablets */
  }
}

/* Mobile Devices (Max Width: 768px) */
@media (max-width: 768px) {
  body {
    padding: 20px 15px;
  }

  .terminal {
    padding: 20px;
    font-size: 0.85em;
    /* Prevents text overflow on small screens */
    margin-bottom: 30px;
  }

  .architecture-container {
    gap: 20px;
  }

  .diagram-box {
    padding: 10px;
  }
}
