.projetos {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  max-width: 1200px;
  margin: 100px auto;
}

.projetos h1 {
  color: #f0f4ff;
  font-size: clamp(1.5rem, 2.2vw, 2.1rem);
  margin-bottom: 20px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.projeto-cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.card,
.projeto-card {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(246, 249, 255, 0.98) 100%
  );
  border: 1px solid rgba(108, 127, 172, 0.24);
  border-radius: 16px;
  padding: 18px;
  min-height: 290px;
  box-shadow: 0 8px 24px rgba(39, 54, 94, 0.18);
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 10px;
  cursor: pointer;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.card:hover,
.projeto-card:hover {
  transform: translateY(-6px);
  border-color: rgba(74, 91, 140, 0.55);
  box-shadow: 0 14px 30px rgba(32, 46, 83, 0.26);
}

.card:focus-visible,
.list-item:focus-visible,
.projeto-card:focus-visible,
.projeto-lista-item:focus-visible {
  outline: 3px solid #2f5ba8;
  outline-offset: 2px;
}

.card-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  background-color: #e2e9f7;
}

.card h2,
.projeto-card h2 {
  font-size: 1.25rem;
  color: #223459;
  line-height: 1.25;
}

.card p,
.projeto-card p {
  font-size: 0.97rem;
  color: #4a5875;
  line-height: 1.5;
}

.repo-date {
  color: #38517d;
  font-size: 0.88rem;
  font-weight: 600;
}

.repo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.repo-actions a,
.repo-reload-button {
  border: 0;
  border-radius: 10px;
  background: #1c305d;
  color: #f7f9ff;
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  padding: 10px 12px;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.repo-actions a:nth-child(2) {
  background: #0f9f6e;
}

.repo-actions a:hover,
.repo-reload-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 16px rgba(22, 36, 69, 0.2);
}

.repo-actions a:focus-visible,
.repo-reload-button:focus-visible {
  outline: 3px solid #2f5ba8;
  outline-offset: 2px;
}

.repo-reload-button {
  margin: 0 0 20px;
}

.repo-reload-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.projeto-lista {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 900px;
  margin: 20px auto;
}

.list-item,
.projeto-lista-item {
  list-style: none;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(108, 127, 172, 0.24);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 6px 18px rgba(39, 54, 94, 0.14);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.list-item:hover,
.projeto-lista-item:hover {
  transform: translateY(-3px);
  border-color: rgba(74, 91, 140, 0.45);
  box-shadow: 0 10px 20px rgba(33, 45, 82, 0.2);
}

.list-item h2,
.projeto-lista-item h3 {
  font-size: 1.05rem;
  color: #223459;
  margin-bottom: 4px;
}

.list-item p,
.projeto-lista-item p {
  font-size: 0.92rem;
  color: #4a5875;
}

@media (max-width: 768px) {
  .projetos {
    margin: 88px auto 36px;
    padding: 16px;
  }

  .projeto-cards {
    grid-template-columns: 1fr;
  }

  .card,
  .projeto-card,
  .list-item,
  .projeto-lista-item {
    border-radius: 12px;
  }
}

.repo-modal-open {
  overflow: hidden;
}

.repo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 14, 31, 0.56);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 2200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.repo-modal-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.repo-modal {
  width: min(900px, 100%);
  max-height: min(82vh, 760px);
  background: linear-gradient(170deg, #ffffff, #f7f9ff);
  border-radius: 18px;
  border: 1px solid rgba(111, 131, 180, 0.35);
  box-shadow: 0 24px 52px rgba(9, 18, 39, 0.36);
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
}

.repo-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.repo-modal-header h2 {
  color: #1f2f53;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
}

.repo-modal-subtitle {
  color: #4c5b7e;
  font-size: 0.95rem;
  font-weight: 600;
}

.repo-modal-readme {
  overflow: auto;
  background: #eef3ff;
  border: 1px solid #d5ddf0;
  border-radius: 12px;
  padding: 18px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #233152;
}

.repo-modal-readme h1,
.repo-modal-readme h2,
.repo-modal-readme h3,
.repo-modal-readme h4 {
  color: #1f2f53;
  line-height: 1.3;
  margin: 0 0 0.7em;
}

.repo-modal-readme p,
.repo-modal-readme ul,
.repo-modal-readme ol,
.repo-modal-readme blockquote,
.repo-modal-readme table,
.repo-modal-readme pre {
  margin: 0 0 1em;
}

.repo-modal-readme ul,
.repo-modal-readme ol {
  padding-left: 1.4em;
}

.repo-modal-readme a {
  color: #1e4fab;
  font-weight: 600;
  text-decoration: underline;
}

.repo-modal-readme code {
  background: rgba(46, 68, 116, 0.12);
  border-radius: 6px;
  padding: 0.15em 0.35em;
  font-family: "Cascadia Code", "Consolas", monospace;
}

.repo-modal-readme pre {
  background: #1f2b49;
  color: #f7f9ff;
  border-radius: 10px;
  padding: 12px;
  overflow: auto;
}

.repo-modal-readme pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.repo-modal-readme blockquote {
  border-left: 4px solid #89a4da;
  padding-left: 10px;
  color: #415684;
}

.repo-modal-readme table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 8px;
}

.repo-modal-readme th,
.repo-modal-readme td {
  border: 1px solid #c8d4ef;
  padding: 8px;
  text-align: left;
}

.repo-modal-readme img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.repo-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.repo-modal-btn,
.repo-modal-close {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.repo-modal-close,
.repo-modal-btn-light {
  background: #dde6fb;
  color: #243963;
}

.repo-modal-btn-dark {
  background: #1c305d;
  color: #f7f9ff;
}

.repo-modal-btn-primary {
  background: #0f9f6e;
  color: #f4fff9;
}

.repo-modal-btn:hover,
.repo-modal-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 16px rgba(22, 36, 69, 0.2);
}

.repo-modal-btn:focus-visible,
.repo-modal-close:focus-visible {
  outline: 3px solid #2f5ba8;
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .repo-modal-overlay {
    padding: 12px;
  }

  .repo-modal {
    max-height: 88vh;
    padding: 16px;
    gap: 10px;
  }

  .repo-modal-actions {
    justify-content: stretch;
  }

  .repo-modal-btn,
  .repo-modal-close {
    width: 100%;
    text-align: center;
  }
}
