/* ============================================================
   PROJECTEN.CSS — Projects page
   Page Header · Grid · Modal Overlay · Detail Card
   ============================================================ */

/* ── PAGE HEADER ─────────────────────────────────────────── */
#page-header {
  position: relative;
  min-height: 40vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding-bottom: 3.5rem;
}

.ph-bg {
  position: absolute;
  inset: 0;
  background: var(--sage);
}

.ph-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--navy-deep);
  clip-path: polygon(55% 0, 100% 0, 100% 100%, 40% 100%);
}

.dc {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.dc1 {
  width: 340px; height: 340px;
  top: -100px; left: -100px;
  border: 60px solid var(--sage);
  opacity: 0.25;
  animation: growIn 1s cubic-bezier(0.34,1.56,0.64,1) 0.1s both;
}

.dc2 {
  width: 160px; height: 160px;
  bottom: -40px; right: 18%;
  border: 35px solid rgba(255,255,255,0.12);
  animation: growIn 1s cubic-bezier(0.34,1.56,0.64,1) 0.3s both;
}

.dc3 {
  display: none;
}

.ph-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  padding: 7rem var(--pad-x) 0;
  animation: slideUpSm 0.8s cubic-bezier(0.25,0.8,0.25,1) 0.2s both;
}

.ph-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.88);
  margin-bottom: 0.4rem;
}

.ph-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: 0.9;
  text-transform: uppercase;
  color: var(--white);
}

.ph-divider {
  width: 60px; height: 4px;
  background: var(--sage-light);
  margin-top: 1.5rem;
}

/* ── MAIN ────────────────────────────────────────────────── */
.main {
  padding: 5rem var(--pad-x);
}

.grid-intro {
  margin-bottom: 3rem;
}

.grid-intro p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--navy-deep);
  opacity: 0.85;
  max-width: 540px;
}

/* ── PROJECT GRID ────────────────────────────────────────── */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* ── PROJECT CARD ────────────────────────────────────────── */
.p-card {
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.25,0.8,0.25,1),
              box-shadow 0.25s cubic-bezier(0.25,0.8,0.25,1);
  animation: slideUpSm 0.7s cubic-bezier(0.25,0.8,0.25,1) both;
}

.p-card:nth-child(1) { animation-delay: 0.05s; }
.p-card:nth-child(2) { animation-delay: 0.12s; }
.p-card:nth-child(3) { animation-delay: 0.19s; }
.p-card:nth-child(4) { animation-delay: 0.26s; }
.p-card:nth-child(5) { animation-delay: 0.33s; }
.p-card:nth-child(6) { animation-delay: 0.40s; }
.p-card:nth-child(7) { animation-delay: 0.47s; }
.p-card:nth-child(8) { animation-delay: 0.54s; }
.p-card:nth-child(9) { animation-delay: 0.61s; }

.p-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 52px rgba(43,77,106,0.14);
}

.p-card:focus-visible {
  outline: 3px solid var(--sage-light);
  outline-offset: 2px;
}

.card-accent {
  height: 5px;
  flex-shrink: 0;
}

.accent-sage   { background: var(--sage); }
.accent-teal   { background: var(--teal-dark); }
.accent-navy   { background: var(--navy); }
.accent-navyd  { background: var(--navy-deep); }
.accent-aws    { background: #c47c2b; }

.card-body {
  padding: 1.8rem 1.8rem 1.6rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
  display: block;
}

.tag-sage  { color: var(--sage); }
.tag-teal  { color: var(--teal-dark); }
.tag-navy  { color: var(--navy); }
.tag-navyd { color: var(--navy-deep); }
.tag-aws   { color: #9a5f16; }

.card-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--navy-deep);
  margin-bottom: 0.8rem;
}

.card-brief {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--navy-deep);
  opacity: 0.8;
  flex: 1;
  margin-bottom: 1.2rem;
}

.card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}

.pill {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  background: var(--navy-deep);
  color: var(--white);
  border-radius: 2px;
}

.card-cta {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s;
}

.p-card:hover .card-cta {
  gap: 0.75rem;
}

.card-cta svg {
  width: 14px; height: 14px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.p-card:hover .card-cta svg {
  transform: translateX(3px);
}

/* ── MODAL OVERLAY ───────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(30, 45, 52, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--pad-x);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── MODAL CARD ──────────────────────────────────────────── */
#modal-card {
  position: relative;
  background: var(--white);
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  transform: translateY(40px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1),
              opacity 0.3s ease;
  opacity: 0;
}

#modal-overlay.active #modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Scrollbar styling */
#modal-card::-webkit-scrollbar { width: 5px; }
#modal-card::-webkit-scrollbar-track { background: var(--off-white); }
#modal-card::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 3px; }

/* Close button */
#modal-close {
  position: sticky;
  top: 0;
  left: 100%;
  z-index: 10;
  width: 42px; height: 42px;
  background: var(--navy-deep);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  margin-bottom: -42px;
  transition: background 0.2s;
}

#modal-close:hover {
  background: var(--sage);
}

/* ── MODAL INNER LAYOUT ──────────────────────────────────── */
.modal-accent-bar {
  height: 6px;
  flex-shrink: 0;
}

.modal-inner {
  padding: 2.8rem 2.8rem 3rem;
}

.modal-eyebrow {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 4vw, 3rem);
  text-transform: uppercase;
  line-height: 0.95;
  color: var(--navy-deep);
  margin-bottom: 0.6rem;
}

.modal-meta {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  align-items: center;
}

.meta-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  color: var(--white);
}

.badge-sage   { background: var(--sage); }
.badge-teal   { background: var(--teal-dark); }
.badge-navy   { background: var(--navy); }
.badge-navyd  { background: var(--navy-deep); }
.badge-aws    { background: #c47c2b; }
.badge-team   { background: rgba(90,115,105,0.15); color: var(--sage); }

.modal-divider {
  height: 1px;
  background: rgba(90,115,105,0.18);
  margin: 0 0 2rem;
}

.modal-desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--navy-deep);
  opacity: 0.82;
  margin-bottom: 2rem;
}

/* Section headers inside modal */
.modal-s-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sage-text);
  margin-bottom: 0.9rem;
  display: block;
}

/* Breathing room when a label follows the tag row */
.modal-tags + .modal-s-label {
  margin-top: 2rem;
}

/* Highlights list */
.modal-highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 2rem;
}

.modal-highlights li {
  font-size: 0.92rem;
  color: var(--navy-deep);
  opacity: 0.8;
  padding-left: 1.2rem;
  position: relative;
  line-height: 1.55;
}

.modal-highlights li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--sage-light);
  font-size: 0.65rem;
  top: 0.2em;
}

.modal-highlights li strong {
  font-weight: 600;
  opacity: 1;
}

/* Vulnerability table */
.vuln-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.87rem;
}

.vuln-table th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--navy-deep);
  padding: 0.7rem 1rem;
  text-align: left;
}

.vuln-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(90,115,105,0.12);
  color: var(--navy-deep);
  opacity: 0.85;
  vertical-align: middle;
}

.vuln-table tr:last-child td { border-bottom: none; }
.vuln-table tr:nth-child(even) td { background: var(--off-white); }

.sev-high   { color: #b94040; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.05em; }
.sev-medium { color: #b97340; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.05em; }
.sev-low    { color: #7a9640; font-weight: 700; font-family: var(--font-display); letter-spacing: 0.05em; }
.sev-none   { color: rgba(55,79,89,0.35); font-family: var(--font-display); }

.found-yes { color: var(--sage); font-weight: 700; }
.found-no  { color: rgba(55,79,89,0.35); }

/* Stack table */
.stack-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.87rem;
}

.stack-table th {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--teal-dark);
  padding: 0.7rem 1rem;
  text-align: left;
}

.stack-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(90,115,105,0.12);
  color: var(--navy-deep);
  opacity: 0.82;
  vertical-align: top;
  line-height: 1.5;
}

.stack-table tr:last-child td { border-bottom: none; }
.stack-table tr:nth-child(even) td { background: var(--off-white); }

.stack-table td:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 1;
  white-space: nowrap;
}

/* Tags row at bottom of modal */
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.modal-tag {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.8rem;
  background: var(--navy-deep);
  color: var(--white);
  border-radius: 2px;
}

/* Downloadable documents in the modal */
.modal-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.modal-doc {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  color: var(--white);
  background: var(--sage);
  border: 1px solid var(--sage);
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}

.modal-doc svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.modal-doc:hover,
.modal-doc:focus-visible {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
}

/* Source-code links at the bottom of the modal */
.modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.modal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  color: var(--navy-deep);
  background: var(--off-white);
  border: 1px solid rgba(55, 79, 89, 0.15);
  border-radius: 2px;
  text-decoration: none;
  word-break: break-all;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.modal-link svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  color: var(--sage-text);
}

.modal-link:hover,
.modal-link:focus-visible {
  background: var(--navy-deep);
  border-color: var(--navy-deep);
  color: var(--white);
}

.modal-link:hover svg,
.modal-link:focus-visible svg { color: var(--white); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  #page-header { min-height: 30vh; }

  .ph-content { padding: 6rem var(--pad-x-md) 0; }

  .main { padding: 4rem var(--pad-x-md); }

  .proj-grid { grid-template-columns: repeat(2, 1fr); }

  .dc1 { width: 200px; height: 200px; border-width: 40px; top: -60px; left: -60px; }
  .dc2 { display: none; }

  #modal-overlay { padding: 1rem; }

  .modal-inner { padding: 2rem 2rem 2.5rem; }
}

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

  .ph-title { font-size: clamp(2.8rem, 12vw, 4rem); }

  .modal-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }

  .modal-inner { padding: 1.5rem 1.5rem 2rem; }

  .vuln-table, .stack-table { font-size: 0.8rem; }
  .vuln-table th, .stack-table th,
  .vuln-table td, .stack-table td { padding: 0.5rem 0.65rem; }
}
