
/* Portfolio pages */
.portfolio-header {
  background: linear-gradient(135deg, #0e1a2f 0%, #14233d 54%, #244c8f 100%);
  color: #fff;
  padding: 1rem 1.4rem 3rem;
}
.portfolio-hero {
  max-width: 1120px;
  margin: 2.2rem auto 0;
}
.breadcrumb {
  display: flex;
  gap: .5rem;
  align-items: center;
  color: rgba(255,255,255,.7);
  font-size: .88rem;
  margin-bottom: 1rem;
}
.breadcrumb a { color: rgba(255,255,255,.9); font-weight: 800; }
.portfolio-hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.18;
  letter-spacing: -0.06em;
}
.portfolio-hero p {
  max-width: 760px;
  margin: 1rem 0 0;
  color: rgba(255,255,255,.76);
  font-size: 1rem;
}
.portfolio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.4rem;
}
.portfolio-main { max-width: 1120px; margin: 0 auto; padding: 3rem 1.4rem; }
.portfolio-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.portfolio-card {
  display: grid;
  grid-template-columns: minmax(0,1fr) 220px;
  gap: 1.4rem;
  align-items: start;
  padding: 1.5rem;
}
.portfolio-card h2 { margin: 0; letter-spacing: -0.045em; }
.portfolio-card p { color: #34445d; margin: .55rem 0 0; }
.project-period {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: .9rem;
  font-weight: 900;
  white-space: nowrap;
  justify-self: end;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: .8rem;
  margin-top: 1.4rem;
}
.meta-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  padding: .9rem;
}
.meta-card dt { color: rgba(255,255,255,.58); font-size: .78rem; font-weight: 900; }
.meta-card dd { margin: .3rem 0 0; color: #fff; font-weight: 800; line-height: 1.45; }
.detail-section { margin-top: 2.3rem; }
.detail-section:first-child { margin-top: 0; }
.detail-section h2 {
  margin: 0 0 1rem;
  font-size: 1.55rem;
  letter-spacing: -0.045em;
}
.detail-section h3 { margin: 1.1rem 0 .55rem; letter-spacing: -0.035em; }
.detail-card { padding: 1.45rem; }
.summary-box {
  background: #f5f9ff;
  border: 1px solid #cfddf1;
  border-radius: 22px;
  padding: 1.35rem;
}
.summary-box p { margin: 0; color: #243850; }
.summary-box p + p { margin-top: .75rem; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: #fff; }
.portfolio-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.portfolio-table th, .portfolio-table td { padding: .85rem .95rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.portfolio-table th { background: #f8fbff; color: #1e3558; font-weight: 900; }
.portfolio-table tr:last-child td { border-bottom: 0; }
.decision-list { display: grid; gap: 1rem; }
.decision-card { padding: 1.25rem; }
.decision-card h3 { margin-top: 0; }
.decision-row { display: grid; grid-template-columns: 80px 1fr; gap: .8rem; padding-top: .7rem; margin-top: .7rem; border-top: 1px solid var(--line); }
.decision-row:first-of-type { border-top: 0; padding-top: 0; margin-top: .3rem; }
.decision-label { color: var(--primary); font-weight: 900; }
.architecture-figure { margin: 0; }
.architecture-figure img {
  width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
}
.architecture-figure figcaption { margin-top: .55rem; color: var(--muted); font-size: .9rem; }
.code-block {
  overflow-x: auto;
  background: #121826;
  color: #e5edf8;
  border-radius: 16px;
  padding: 1rem;
  font-size: .88rem;
  line-height: 1.6;
}
.inline-code {
  background: #f1f4f9;
  color: #d9485f;
  border-radius: 6px;
  padding: .08rem .32rem;
  font-weight: 800;
}
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.back-top { margin-top: 2rem; display: flex; justify-content: center; }
@media (max-width: 820px) {
  .portfolio-card { grid-template-columns: 1fr; }
  .project-period { justify-self: start; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .portfolio-header { padding: .9rem 1rem 2.2rem; }
  .portfolio-main { padding: 2.2rem 1rem; }
  .meta-grid { grid-template-columns: 1fr; }
  .decision-row { grid-template-columns: 1fr; gap: .2rem; }
}

.safe-header {
  background: linear-gradient(135deg, #091b21 0%, #12302d 50%, #1f6f58 100%);
}
.highlight-card {
  background: linear-gradient(180deg, #f7fbff 0%, #f0fff8 100%);
  border-color: #cce8db;
}

.parking-header {
  background: linear-gradient(135deg, #172033 0%, #26315c 48%, #6b4fd6 100%);
}
.parking-card {
  background: linear-gradient(180deg, #fbfbff 0%, #f5f1ff 100%);
  border-color: #ded6ff;
}


/* HTML print export */
.button { cursor: pointer; font-family: inherit; }
@page { size: A4; margin: 14mm; }
@media print {
  html { scroll-behavior: auto; }
  body {
    background: #fff !important;
    color: #111827 !important;
    font-size: 10pt;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  a { color: #111827 !important; text-decoration: none !important; }
  .portfolio-header,
  .safe-header,
  .parking-header {
    background: #fff !important;
    color: #111827 !important;
    padding: 0 0 8mm !important;
    border-bottom: 1px solid #d8dee8;
  }
  .breadcrumb,
  .portfolio-actions,
  .back-top,
  .footer,
  .print-button { display: none !important; }
  .portfolio-hero { max-width: none; margin: 0; }
  .portfolio-hero h1 {
    color: #111827 !important;
    font-size: 22pt !important;
    line-height: 1.24 !important;
    letter-spacing: -0.035em;
  }
  .portfolio-hero p { color: #374151 !important; font-size: 10pt; }
  .portfolio-main { max-width: none; margin: 0; padding: 8mm 0 0; }
  .portfolio-card { grid-template-columns: minmax(0,1fr) 48mm; gap: 6mm; padding: 5mm; }
  .project-period { justify-self: end; border: 1px solid #cbd5e1; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4mm; }
  .meta-card {
    background: #fff !important;
    border: 1px solid #d8dee8 !important;
    border-radius: 10px !important;
    padding: 4mm;
  }
  .meta-card dt, .meta-card dd { color: #111827 !important; }
  .meta-card dt { color: #4b5563 !important; }
  .detail-section { margin-top: 8mm; break-inside: auto; }
  .detail-section h2 { font-size: 15pt; margin-bottom: 4mm; }
  .detail-section h3 { font-size: 11.5pt; }
  .card,
  .summary-box,
  .detail-card,
  .decision-card,
  .table-wrap,
  .portfolio-card {
    box-shadow: none !important;
    border: 1px solid #d8dee8 !important;
    border-radius: 10px !important;
    background: #fff !important;
  }
  .summary-box, .detail-card, .decision-card { padding: 5mm; }
  .decision-card, .summary-box, .table-wrap, .architecture-figure, .portfolio-card { break-inside: avoid; page-break-inside: avoid; }
  .decision-row { grid-template-columns: 22mm 1fr; gap: 4mm; }
  .architecture-figure img { border-radius: 8px; max-height: 122mm; object-fit: contain; }
  .portfolio-table { min-width: 0; font-size: 9.2pt; }
  .portfolio-table th, .portfolio-table td { padding: 3mm; }
  .two-col { grid-template-columns: 1fr; gap: 4mm; }
  .chips span, .inline-code { background: #eef4ff !important; color: #163f83 !important; }
  .code-block { white-space: pre-wrap; overflow: visible; background: #f4f7fb !important; color: #111827 !important; border: 1px solid #d8dee8; }
}


/* Additional portfolio groups */
.kafka-header { background: linear-gradient(135deg, #1b1b2f 0%, #263159 50%, #f08a24 100%); }
.elk-header { background: linear-gradient(135deg, #14213d 0%, #2b4162 48%, #7f52ff 100%); }
.es-header { background: linear-gradient(135deg, #13231f 0%, #1f4d43 50%, #00a884 100%); }
.kafka-card { background: linear-gradient(180deg, #fffaf3 0%, #fff3df 100%); border-color: #f4d3a4; }
.elk-card { background: linear-gradient(180deg, #fbf9ff 0%, #f2eeff 100%); border-color: #d8ceff; }
.es-card { background: linear-gradient(180deg, #f8fffd 0%, #ecfff9 100%); border-color: #bfeadf; }
.image-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 820px) { .image-pair { grid-template-columns: 1fr; } }
@media print { .kafka-header, .elk-header, .es-header { background: #fff !important; color: #111827 !important; } }
