/* Portfolio (/portfolio/): A4 sheets, the same on screen and in the PDF. Uses tokens and fonts from site.css. */

.pf { padding: 24px 12px 48px; display: grid; gap: 24px; justify-content: center; }
.pf-bar { max-width: 210mm; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 0 12px; }
.pf-bar a { font-size: 14px; }
.pf-bar .cv-pdf { display: inline-flex; padding: 7px 14px; border-radius: 999px; background: var(--ink); color: var(--surface); text-decoration: none; font-weight: 600; }

.sheet {
  width: 210mm; height: 297mm; overflow: hidden; position: relative;
  padding: 14mm 15mm 12mm; display: flex; flex-direction: column; gap: 5mm;
  background: #fff; color: #152030; font-size: 9.6pt; line-height: 1.45;
  box-shadow: 0 12px 34px rgba(21,32,48,0.14); border-radius: 4px;
  --ink: #152030; --muted: #556275; --line: #dde3ea; --accent: #2c63d1; --surface: #f4f6f9;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.sheet h2 { font-size: 17pt; line-height: 1.15; color: var(--ink); }
.sheet h3 { font-size: 10.5pt; font-weight: 600; }
.sheet p { color: var(--ink); }
.sheet .muted { color: var(--muted); }
.sheet a { color: var(--accent); text-decoration: none; }

.s-head { display: grid; gap: 1.6mm; }
.s-kicker { font-family: var(--font-mono); font-size: 7.6pt; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.s-lead { font-size: 10.6pt; color: var(--muted); max-width: 165mm; }
.s-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 6mm; padding-top: 3mm; border-top: 1px solid var(--line); font-size: 7.6pt; color: var(--muted); }

/* Cover */
.cover { padding: 0; gap: 0; }
.cover-top { background: var(--night); color: var(--night-ink); padding: 15mm 15mm 11mm; display: grid; gap: 3.5mm; }
.cover-top .s-kicker { color: var(--morning); }
.cover-top h1 { font-size: 27pt; line-height: 1.1; }
.cover-top h1 span { color: var(--morning); }
.cover-top p { color: var(--night-muted); font-size: 10.8pt; max-width: 160mm; }
.cover-contacts { display: flex; flex-wrap: wrap; gap: 2mm 7mm; font-size: 9.6pt; }
.cover-contacts a { color: var(--night-ink); }
.cover-body { padding: 9mm 15mm 12mm; display: flex; flex-direction: column; gap: 5mm; flex: 1; min-height: 0; }
.toc-list { list-style: none; padding: 0; display: grid; gap: 4mm; }
.toc-list li { display: grid; grid-template-columns: 11mm 1fr auto; gap: 4mm; align-items: start; padding: 4mm 5mm; border: 1px solid var(--line); border-radius: 3mm; }
.toc-list .n { font-family: var(--font-display); font-size: 15pt; color: var(--accent); line-height: 1; }
.toc-list h3 { font-size: 11.5pt; }
.toc-list p { color: var(--muted); margin-top: 1mm; }
.toc-list .pg { font-family: var(--font-mono); font-size: 8pt; color: var(--muted); }
.cover-note { color: var(--muted); }

/* Numbers */
.pf-metrics { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3mm; }
.pf-metrics li { background: var(--surface); border-radius: 2.5mm; padding: 3.5mm 4mm; display: grid; gap: 0.8mm; }
.pf-metrics b { font-family: var(--font-display); font-size: 15pt; line-height: 1.1; font-weight: 600; }
.pf-metrics span { color: var(--muted); font-size: 8.2pt; line-height: 1.3; }

/* Two columns, lists, cards */
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 7mm; }
.cols.wide-left { grid-template-columns: 1.15fr 0.85fr; }
.cols.shot-left { grid-template-columns: 92mm 1fr; align-items: start; }
.box { display: grid; gap: 2mm; align-content: start; }
.dots { list-style: none; padding: 0; display: grid; gap: 1.6mm; }
.dots li { padding-left: 4.5mm; position: relative; }
.dots li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 2.4mm; height: 0.5mm; background: var(--accent); }
.dots.bad li::before { width: 1.8mm; height: 1.8mm; top: 0.42em; border-radius: 50%; border: 0.45mm solid var(--bad); background: none; }
.dots b { font-weight: 600; }

.cards4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3mm; }
.card4 { border: 1px solid var(--line); border-radius: 2.5mm; padding: 3.5mm; display: grid; gap: 1.2mm; align-content: start; }
.card4 .code { font-family: var(--font-mono); font-size: 7.4pt; color: var(--morning); }
.card4 p { color: var(--muted); font-size: 8.4pt; line-height: 1.35; }

/* Pictures */
.pic { margin: 0; display: grid; gap: 1.6mm; min-height: 0; align-content: start; }
.pic img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 2mm; }
.pic.crop { overflow: hidden; }
.pic.crop .frame { overflow: hidden; border: 1px solid var(--line); border-radius: 2mm; }
.pic.crop img { border: 0; border-radius: 0; }
.pic.h150 .frame { height: 150mm; }
.pic figcaption { color: var(--muted); font-size: 7.8pt; }
.pic.toast img { width: 78mm; border: 0; box-shadow: 0 2mm 6mm rgba(0,0,0,0.25); }

.tech { display: grid; grid-template-columns: 1fr 1fr; gap: 0 7mm; }
.tech div { display: grid; grid-template-columns: 24mm 1fr; gap: 3mm; padding: 1.8mm 0; border-bottom: 1px solid var(--line); }
.tech dt { font-family: var(--font-mono); font-size: 7.2pt; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-top: 0.6mm; }
.tech dd { margin: 0; }

.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3mm; }

/* Trade bot */
.term { background: var(--night); color: var(--night-ink); font-family: var(--font-mono); font-size: 8.4pt; line-height: 1.55; padding: 4mm 5mm; border-radius: 2.5mm; white-space: pre; }
.results { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.results th, .results td { padding: 1.8mm 2.5mm; text-align: left; border-bottom: 1px solid var(--line); }
.results th { font-family: var(--font-mono); font-size: 7.2pt; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.results .num { text-align: right; }
.results .neg { color: var(--bad); }
.results .pos { color: var(--good); }
.verdict { padding: 3.5mm 4.5mm; border-left: 1mm solid var(--morning); background: var(--surface); border-radius: 0 2mm 2mm 0; }

@media screen and (max-width: 860px) {
  .pf { justify-content: stretch; padding-inline: 0; }
  .sheet { width: auto; height: auto; overflow: visible; border-radius: 0; padding: 20px 16px; }
  .cover { padding: 0; }
  .cover-top, .cover-body { padding: 24px 16px; }
  .cols, .cols.wide-left, .cols.shot-left, .tech { grid-template-columns: 1fr; }
  .pf-metrics, .cards4, .flow { grid-template-columns: 1fr 1fr; }
  .pic.h150 .frame { height: auto; max-height: 520px; }
  .term { overflow-x: auto; }
}

@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .pf { display: block; padding: 0; }
  .pf-bar, .skip { display: none !important; }
  .sheet { box-shadow: none; border-radius: 0; margin: 0; break-after: page; }
  .sheet:last-child { break-after: auto; }
}
